@xyo-network/xl1-protocol 1.6.1 → 1.7.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/neutral/index.d.ts +829 -0
  2. package/dist/neutral/index.mjs +6 -0
  3. package/dist/neutral/index.mjs.map +1 -1
  4. package/package.json +19 -25
  5. package/src/services/AccountBalanceService.ts +2 -12
  6. package/src/services/ChainBlocksService/ChainBlocksService.ts +7 -0
  7. package/src/services/ChainBlocksService/index.ts +1 -0
  8. package/src/services/ChainHead/ChainHeadService.ts +11 -0
  9. package/src/services/ChainHead/ChainHeadServiceEventData.ts +8 -0
  10. package/src/services/ChainHead/index.ts +2 -0
  11. package/src/services/ChainInformationService.ts +12 -0
  12. package/src/services/ChainStakeService.ts +9 -0
  13. package/src/services/ChainStakeViewService.ts +10 -0
  14. package/src/services/{Election.ts → ProducerElectionInterface.ts} +1 -1
  15. package/src/services/Service.ts +18 -1
  16. package/src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts +12 -1
  17. package/src/services/StakeIntentService/StakeIntentService.ts +1 -0
  18. package/src/services/index.ts +5 -5
  19. package/src/validation/block/HydratedBlockStateValidationFunction.ts +3 -7
  20. package/dist/types/Initializable.d.ts +0 -3
  21. package/dist/types/Initializable.d.ts.map +0 -1
  22. package/dist/types/OpenTelemetryProviders.d.ts +0 -6
  23. package/dist/types/OpenTelemetryProviders.d.ts.map +0 -1
  24. package/dist/types/block/AllowedBlockPayload.d.ts +0 -11
  25. package/dist/types/block/AllowedBlockPayload.d.ts.map +0 -1
  26. package/dist/types/block/BlockBoundWitness.d.ts +0 -32
  27. package/dist/types/block/BlockBoundWitness.d.ts.map +0 -1
  28. package/dist/types/block/HydratedBlock.d.ts +0 -7
  29. package/dist/types/block/HydratedBlock.d.ts.map +0 -1
  30. package/dist/types/block/index.d.ts +0 -4
  31. package/dist/types/block/index.d.ts.map +0 -1
  32. package/dist/types/chain/ChainAnalyzer.d.ts +0 -9
  33. package/dist/types/chain/ChainAnalyzer.d.ts.map +0 -1
  34. package/dist/types/chain/index.d.ts +0 -2
  35. package/dist/types/chain/index.d.ts.map +0 -1
  36. package/dist/types/constants/StepSizes.d.ts +0 -5
  37. package/dist/types/constants/StepSizes.d.ts.map +0 -1
  38. package/dist/types/constants/TransactionGasCosts.d.ts +0 -37
  39. package/dist/types/constants/TransactionGasCosts.d.ts.map +0 -1
  40. package/dist/types/constants/defaultTransactionFees.d.ts +0 -3
  41. package/dist/types/constants/defaultTransactionFees.d.ts.map +0 -1
  42. package/dist/types/constants/index.d.ts +0 -6
  43. package/dist/types/constants/index.d.ts.map +0 -1
  44. package/dist/types/constants/minTransactionFees.d.ts +0 -3
  45. package/dist/types/constants/minTransactionFees.d.ts.map +0 -1
  46. package/dist/types/constants/version.d.ts +0 -6
  47. package/dist/types/constants/version.d.ts.map +0 -1
  48. package/dist/types/fields/Addressable.d.ts +0 -5
  49. package/dist/types/fields/Addressable.d.ts.map +0 -1
  50. package/dist/types/fields/BlockDuration.d.ts +0 -23
  51. package/dist/types/fields/BlockDuration.d.ts.map +0 -1
  52. package/dist/types/fields/BlockNumber.d.ts +0 -25
  53. package/dist/types/fields/BlockNumber.d.ts.map +0 -1
  54. package/dist/types/fields/ChainReference.d.ts +0 -11
  55. package/dist/types/fields/ChainReference.d.ts.map +0 -1
  56. package/dist/types/fields/index.d.ts +0 -5
  57. package/dist/types/fields/index.d.ts.map +0 -1
  58. package/dist/types/index.d.ts +0 -15
  59. package/dist/types/index.d.ts.map +0 -1
  60. package/dist/types/isHydratedBoundWitness.d.ts +0 -3
  61. package/dist/types/isHydratedBoundWitness.d.ts.map +0 -1
  62. package/dist/types/network/NetworkId.d.ts +0 -3
  63. package/dist/types/network/NetworkId.d.ts.map +0 -1
  64. package/dist/types/network/Status.d.ts +0 -17
  65. package/dist/types/network/Status.d.ts.map +0 -1
  66. package/dist/types/network/index.d.ts +0 -3
  67. package/dist/types/network/index.d.ts.map +0 -1
  68. package/dist/types/payload/elevatable/ChainStakeIntent.d.ts +0 -13
  69. package/dist/types/payload/elevatable/ChainStakeIntent.d.ts.map +0 -1
  70. package/dist/types/payload/elevatable/Executable.d.ts +0 -14
  71. package/dist/types/payload/elevatable/Executable.d.ts.map +0 -1
  72. package/dist/types/payload/elevatable/Hash.d.ts +0 -12
  73. package/dist/types/payload/elevatable/Hash.d.ts.map +0 -1
  74. package/dist/types/payload/elevatable/TransferPayload.d.ts +0 -13
  75. package/dist/types/payload/elevatable/TransferPayload.d.ts.map +0 -1
  76. package/dist/types/payload/elevatable/index.d.ts +0 -5
  77. package/dist/types/payload/elevatable/index.d.ts.map +0 -1
  78. package/dist/types/payload/index.d.ts +0 -2
  79. package/dist/types/payload/index.d.ts.map +0 -1
  80. package/dist/types/provider/index.d.ts +0 -2
  81. package/dist/types/provider/index.d.ts.map +0 -1
  82. package/dist/types/provider/v1/XyoDataLake.d.ts +0 -18
  83. package/dist/types/provider/v1/XyoDataLake.d.ts.map +0 -1
  84. package/dist/types/provider/v1/XyoHost.d.ts +0 -65
  85. package/dist/types/provider/v1/XyoHost.d.ts.map +0 -1
  86. package/dist/types/provider/v1/XyoNetwork.d.ts +0 -6
  87. package/dist/types/provider/v1/XyoNetwork.d.ts.map +0 -1
  88. package/dist/types/provider/v1/XyoProvider.d.ts +0 -24
  89. package/dist/types/provider/v1/XyoProvider.d.ts.map +0 -1
  90. package/dist/types/provider/v1/XyoRunner.d.ts +0 -7
  91. package/dist/types/provider/v1/XyoRunner.d.ts.map +0 -1
  92. package/dist/types/provider/v1/XyoSigner.d.ts +0 -11
  93. package/dist/types/provider/v1/XyoSigner.d.ts.map +0 -1
  94. package/dist/types/provider/v1/XyoViewer.d.ts +0 -20
  95. package/dist/types/provider/v1/XyoViewer.d.ts.map +0 -1
  96. package/dist/types/provider/v1/XyoWallet.d.ts +0 -14
  97. package/dist/types/provider/v1/XyoWallet.d.ts.map +0 -1
  98. package/dist/types/provider/v1/index.d.ts +0 -9
  99. package/dist/types/provider/v1/index.d.ts.map +0 -1
  100. package/dist/types/provider/v2/Chain/Block.d.ts +0 -9
  101. package/dist/types/provider/v2/Chain/Block.d.ts.map +0 -1
  102. package/dist/types/provider/v2/Chain/Chain.d.ts +0 -20
  103. package/dist/types/provider/v2/Chain/Chain.d.ts.map +0 -1
  104. package/dist/types/provider/v2/Chain/ChainAccount.d.ts +0 -16
  105. package/dist/types/provider/v2/Chain/ChainAccount.d.ts.map +0 -1
  106. package/dist/types/provider/v2/Chain/index.d.ts +0 -4
  107. package/dist/types/provider/v2/Chain/index.d.ts.map +0 -1
  108. package/dist/types/provider/v2/ChainDefinition/ChainContractProvider.d.ts +0 -9
  109. package/dist/types/provider/v2/ChainDefinition/ChainContractProvider.d.ts.map +0 -1
  110. package/dist/types/provider/v2/ChainDefinition/ChainContractViewer.d.ts +0 -12
  111. package/dist/types/provider/v2/ChainDefinition/ChainContractViewer.d.ts.map +0 -1
  112. package/dist/types/provider/v2/ChainDefinition/ChainDefinitionProvider.d.ts +0 -12
  113. package/dist/types/provider/v2/ChainDefinition/ChainDefinitionProvider.d.ts.map +0 -1
  114. package/dist/types/provider/v2/ChainDefinition/Stake/StakeContractProvider.d.ts +0 -7
  115. package/dist/types/provider/v2/ChainDefinition/Stake/StakeContractProvider.d.ts.map +0 -1
  116. package/dist/types/provider/v2/ChainDefinition/Stake/StakeContractViewer.d.ts +0 -11
  117. package/dist/types/provider/v2/ChainDefinition/Stake/StakeContractViewer.d.ts.map +0 -1
  118. package/dist/types/provider/v2/ChainDefinition/Stake/index.d.ts +0 -3
  119. package/dist/types/provider/v2/ChainDefinition/Stake/index.d.ts.map +0 -1
  120. package/dist/types/provider/v2/ChainDefinition/index.d.ts +0 -4
  121. package/dist/types/provider/v2/ChainDefinition/index.d.ts.map +0 -1
  122. package/dist/types/provider/v2/ChainsProvider.d.ts +0 -7
  123. package/dist/types/provider/v2/ChainsProvider.d.ts.map +0 -1
  124. package/dist/types/provider/v2/ListProvider.d.ts +0 -10
  125. package/dist/types/provider/v2/ListProvider.d.ts.map +0 -1
  126. package/dist/types/provider/v2/QueueProvider.d.ts +0 -8
  127. package/dist/types/provider/v2/QueueProvider.d.ts.map +0 -1
  128. package/dist/types/provider/v2/Runner.d.ts +0 -9
  129. package/dist/types/provider/v2/Runner.d.ts.map +0 -1
  130. package/dist/types/provider/v2/Signer.d.ts +0 -8
  131. package/dist/types/provider/v2/Signer.d.ts.map +0 -1
  132. package/dist/types/provider/v2/WalletProvider.d.ts +0 -9
  133. package/dist/types/provider/v2/WalletProvider.d.ts.map +0 -1
  134. package/dist/types/provider/v2/WalletsProvider.d.ts +0 -5
  135. package/dist/types/provider/v2/WalletsProvider.d.ts.map +0 -1
  136. package/dist/types/provider/v2/Xyo.d.ts +0 -15
  137. package/dist/types/provider/v2/Xyo.d.ts.map +0 -1
  138. package/dist/types/provider/v2/index.d.ts +0 -10
  139. package/dist/types/provider/v2/index.d.ts.map +0 -1
  140. package/dist/types/provider/v2/lake/DataLakeProvider.d.ts +0 -7
  141. package/dist/types/provider/v2/lake/DataLakeProvider.d.ts.map +0 -1
  142. package/dist/types/provider/v2/lake/DataLakeViewer.d.ts +0 -6
  143. package/dist/types/provider/v2/lake/DataLakeViewer.d.ts.map +0 -1
  144. package/dist/types/provider/v2/lake/DataLakesProvider.d.ts +0 -8
  145. package/dist/types/provider/v2/lake/DataLakesProvider.d.ts.map +0 -1
  146. package/dist/types/provider/v2/lake/PayloadLakeProvider.d.ts +0 -8
  147. package/dist/types/provider/v2/lake/PayloadLakeProvider.d.ts.map +0 -1
  148. package/dist/types/provider/v2/lake/PayloadLakeViewer.d.ts +0 -7
  149. package/dist/types/provider/v2/lake/PayloadLakeViewer.d.ts.map +0 -1
  150. package/dist/types/provider/v2/lake/index.d.ts +0 -6
  151. package/dist/types/provider/v2/lake/index.d.ts.map +0 -1
  152. package/dist/types/provider/v2/viewer/PendingTransactionsViewer.d.ts +0 -8
  153. package/dist/types/provider/v2/viewer/PendingTransactionsViewer.d.ts.map +0 -1
  154. package/dist/types/provider/v2/viewer/index.d.ts +0 -2
  155. package/dist/types/provider/v2/viewer/index.d.ts.map +0 -1
  156. package/dist/types/repository/Repository.d.ts +0 -22
  157. package/dist/types/repository/Repository.d.ts.map +0 -1
  158. package/dist/types/repository/TransactionReadRepository.d.ts +0 -5
  159. package/dist/types/repository/TransactionReadRepository.d.ts.map +0 -1
  160. package/dist/types/repository/TransactionRepository.d.ts +0 -10
  161. package/dist/types/repository/TransactionRepository.d.ts.map +0 -1
  162. package/dist/types/repository/TransactionRepositoryIterator.d.ts +0 -5
  163. package/dist/types/repository/TransactionRepositoryIterator.d.ts.map +0 -1
  164. package/dist/types/repository/TransactionWriteRepository.d.ts +0 -5
  165. package/dist/types/repository/TransactionWriteRepository.d.ts.map +0 -1
  166. package/dist/types/repository/index.d.ts +0 -6
  167. package/dist/types/repository/index.d.ts.map +0 -1
  168. package/dist/types/services/AccountBalanceService.d.ts +0 -15
  169. package/dist/types/services/AccountBalanceService.d.ts.map +0 -1
  170. package/dist/types/services/BlockProducerService.d.ts +0 -8
  171. package/dist/types/services/BlockProducerService.d.ts.map +0 -1
  172. package/dist/types/services/BlockRewardService.d.ts +0 -6
  173. package/dist/types/services/BlockRewardService.d.ts.map +0 -1
  174. package/dist/types/services/Chain/BaseChainService.d.ts +0 -6
  175. package/dist/types/services/Chain/BaseChainService.d.ts.map +0 -1
  176. package/dist/types/services/Chain/ChainHeadService.d.ts +0 -6
  177. package/dist/types/services/Chain/ChainHeadService.d.ts.map +0 -1
  178. package/dist/types/services/Chain/ChainService.d.ts +0 -5
  179. package/dist/types/services/Chain/ChainService.d.ts.map +0 -1
  180. package/dist/types/services/Chain/index.d.ts +0 -5
  181. package/dist/types/services/Chain/index.d.ts.map +0 -1
  182. package/dist/types/services/Chain/interfaces/ChainContractViewer.d.ts +0 -11
  183. package/dist/types/services/Chain/interfaces/ChainContractViewer.d.ts.map +0 -1
  184. package/dist/types/services/Chain/interfaces/ChainStakeViewer.d.ts +0 -10
  185. package/dist/types/services/Chain/interfaces/ChainStakeViewer.d.ts.map +0 -1
  186. package/dist/types/services/Chain/interfaces/ChainStaker.d.ts +0 -6
  187. package/dist/types/services/Chain/interfaces/ChainStaker.d.ts.map +0 -1
  188. package/dist/types/services/Chain/interfaces/index.d.ts +0 -4
  189. package/dist/types/services/Chain/interfaces/index.d.ts.map +0 -1
  190. package/dist/types/services/ChainIterator/ChainIteratorService.d.ts +0 -41
  191. package/dist/types/services/ChainIterator/ChainIteratorService.d.ts.map +0 -1
  192. package/dist/types/services/ChainIterator/ChainIteratorServiceEventData.d.ts +0 -14
  193. package/dist/types/services/ChainIterator/ChainIteratorServiceEventData.d.ts.map +0 -1
  194. package/dist/types/services/ChainIterator/index.d.ts +0 -3
  195. package/dist/types/services/ChainIterator/index.d.ts.map +0 -1
  196. package/dist/types/services/ChainServiceCollection.d.ts +0 -67
  197. package/dist/types/services/ChainServiceCollection.d.ts.map +0 -1
  198. package/dist/types/services/ChainServiceCollectionV2.d.ts +0 -67
  199. package/dist/types/services/ChainServiceCollectionV2.d.ts.map +0 -1
  200. package/dist/types/services/Election.d.ts +0 -11
  201. package/dist/types/services/Election.d.ts.map +0 -1
  202. package/dist/types/services/Params.d.ts +0 -9
  203. package/dist/types/services/Params.d.ts.map +0 -1
  204. package/dist/types/services/PendingTransactionsService.d.ts +0 -7
  205. package/dist/types/services/PendingTransactionsService.d.ts.map +0 -1
  206. package/dist/types/services/Service.d.ts +0 -3
  207. package/dist/types/services/Service.d.ts.map +0 -1
  208. package/dist/types/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts +0 -32
  209. package/dist/types/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts.map +0 -1
  210. package/dist/types/services/StakeIntentService/StakeIntentService.d.ts +0 -31
  211. package/dist/types/services/StakeIntentService/StakeIntentService.d.ts.map +0 -1
  212. package/dist/types/services/StakeIntentService/index.d.ts +0 -3
  213. package/dist/types/services/StakeIntentService/index.d.ts.map +0 -1
  214. package/dist/types/services/index.d.ts +0 -12
  215. package/dist/types/services/index.d.ts.map +0 -1
  216. package/dist/types/transaction/HydratedTransaction.d.ts +0 -7
  217. package/dist/types/transaction/HydratedTransaction.d.ts.map +0 -1
  218. package/dist/types/transaction/TransactionBoundWitness.d.ts +0 -21
  219. package/dist/types/transaction/TransactionBoundWitness.d.ts.map +0 -1
  220. package/dist/types/transaction/TransactionFeesFields.d.ts +0 -15
  221. package/dist/types/transaction/TransactionFeesFields.d.ts.map +0 -1
  222. package/dist/types/transaction/index.d.ts +0 -4
  223. package/dist/types/transaction/index.d.ts.map +0 -1
  224. package/dist/types/validation/block/BlockValidationFunction.d.ts +0 -6
  225. package/dist/types/validation/block/BlockValidationFunction.d.ts.map +0 -1
  226. package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts +0 -19
  227. package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts.map +0 -1
  228. package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts +0 -12
  229. package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts.map +0 -1
  230. package/dist/types/validation/block/error.d.ts +0 -15
  231. package/dist/types/validation/block/error.d.ts.map +0 -1
  232. package/dist/types/validation/block/index.d.ts +0 -5
  233. package/dist/types/validation/block/index.d.ts.map +0 -1
  234. package/dist/types/validation/boundwitness/BoundWitnessValidationFunction.d.ts +0 -5
  235. package/dist/types/validation/boundwitness/BoundWitnessValidationFunction.d.ts.map +0 -1
  236. package/dist/types/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts +0 -7
  237. package/dist/types/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts.map +0 -1
  238. package/dist/types/validation/boundwitness/error.d.ts +0 -10
  239. package/dist/types/validation/boundwitness/error.d.ts.map +0 -1
  240. package/dist/types/validation/boundwitness/index.d.ts +0 -4
  241. package/dist/types/validation/boundwitness/index.d.ts.map +0 -1
  242. package/dist/types/validation/error.d.ts +0 -9
  243. package/dist/types/validation/error.d.ts.map +0 -1
  244. package/dist/types/validation/index.d.ts +0 -6
  245. package/dist/types/validation/index.d.ts.map +0 -1
  246. package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts +0 -6
  247. package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts.map +0 -1
  248. package/dist/types/validation/payload/error.d.ts +0 -10
  249. package/dist/types/validation/payload/error.d.ts.map +0 -1
  250. package/dist/types/validation/payload/index.d.ts +0 -3
  251. package/dist/types/validation/payload/index.d.ts.map +0 -1
  252. package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts +0 -14
  253. package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts.map +0 -1
  254. package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts +0 -12
  255. package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts.map +0 -1
  256. package/dist/types/validation/transaction/error.d.ts +0 -6
  257. package/dist/types/validation/transaction/error.d.ts.map +0 -1
  258. package/dist/types/validation/transaction/index.d.ts +0 -4
  259. package/dist/types/validation/transaction/index.d.ts.map +0 -1
  260. package/dist/types/xl1/XL1.d.ts +0 -42
  261. package/dist/types/xl1/XL1.d.ts.map +0 -1
  262. package/dist/types/xl1/index.d.ts +0 -2
  263. package/dist/types/xl1/index.d.ts.map +0 -1
  264. package/src/services/Chain/BaseChainService.ts +0 -7
  265. package/src/services/Chain/ChainHeadService.ts +0 -7
  266. package/src/services/Chain/ChainService.ts +0 -6
  267. package/src/services/Chain/index.ts +0 -4
  268. package/src/services/Chain/interfaces/ChainContractViewer.ts +0 -11
  269. package/src/services/Chain/interfaces/ChainStakeViewer.ts +0 -10
  270. package/src/services/Chain/interfaces/ChainStaker.ts +0 -5
  271. package/src/services/Chain/interfaces/index.ts +0 -3
  272. package/src/services/ChainIterator/ChainIteratorService.ts +0 -43
  273. package/src/services/ChainIterator/ChainIteratorServiceEventData.ts +0 -14
  274. package/src/services/ChainIterator/index.ts +0 -2
  275. package/src/services/ChainServiceCollection.ts +0 -71
  276. package/src/services/ChainServiceCollectionV2.ts +0 -71
@@ -0,0 +1,829 @@
1
+ import type { Address } from '@xylabs/hex';
2
+ import { AsTypeFunction } from '.store/@xylabs-object-model-npm-4.13.2-4ad0974a5d/package';
3
+ import { BoundWitness } from '@xyo-network/boundwitness-model';
4
+ import type { EmptyObject } from '@xylabs/object';
5
+ import type { EventData } from '@xylabs/events';
6
+ import type { EventEmitter } from '@xylabs/events';
7
+ import { Hash } from '@xylabs/hex';
8
+ import type { Hex } from '@xylabs/hex';
9
+ import type { HydratedBoundWitness } from '@xyo-network/archivist-model';
10
+ import type { HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model';
11
+ import type { JsonObject } from '@xylabs/object';
12
+ import type { JsonValue } from '@xylabs/object';
13
+ import type { MeterProvider } from '@opentelemetry/api';
14
+ import type { NextOptions } from '@xyo-network/archivist-model';
15
+ import { Payload } from '@xyo-network/payload-model';
16
+ import type { Promisable } from '@xylabs/promise';
17
+ import type { ReadArchivist } from '@xyo-network/archivist-model';
18
+ import type { Schema } from '@xyo-network/payload-model';
19
+ import type { SchemaPayload } from '@xyo-network/schema-payload-plugin';
20
+ import type { Signed } from '@xyo-network/boundwitness-model';
21
+ import type { TracerProvider } from '@opentelemetry/api';
22
+ import type { WithHashStorageMeta } from '@xyo-network/payload-model';
23
+ import type { WithSources } from '@xyo-network/payload-model';
24
+ import { WithStorageMeta } from '@xyo-network/payload-model';
25
+
26
+ /** @public */
27
+ export declare interface AccountBalanceService extends Service {
28
+ balances(head: Hash, addresses: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>;
29
+ }
30
+
31
+ export declare interface Addressable {
32
+ address: Address;
33
+ }
34
+
35
+ export declare type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload;
36
+
37
+ export declare type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number];
38
+
39
+ export declare const AllowedBlockPayloadSchemas: Schema[];
40
+
41
+ export declare const asBlockBoundWitness: AsTypeFunction<BlockBoundWitness>;
42
+
43
+ export declare const asBlockBoundWitnessWithHashStorageMeta: AsTypeFunction<WithHashStorageMeta<BlockBoundWitness>>;
44
+
45
+ export declare const asBlockBoundWitnessWithStorageMeta: AsTypeFunction<WithStorageMeta<BlockBoundWitness>>;
46
+
47
+ export declare const asBlockNumber: AsTypeFunction<BlockNumber>;
48
+
49
+ export declare const asBlockNumberWithSources: AsTypeFunction<WithSources<BlockNumber>>;
50
+
51
+ /** @public */
52
+ export declare const asChainIndexingServiceState: AsTypeFunction<ChainIndexingServiceState<JsonValue>>;
53
+
54
+ /** @public */
55
+ export declare const asChainIndexingServiceStateWithStorageMeta: AsTypeFunction<WithStorageMeta<ChainIndexingServiceState<JsonValue>>>;
56
+
57
+ export declare const asChainStakeIntent: AsTypeFunction<ChainStakeIntent>;
58
+
59
+ export declare const asExecutable: <T extends EmptyObject>(value: T | undefined) => Executable<T> | undefined;
60
+
61
+ export declare const asHashPayload: AsTypeFunction<HashPayload>;
62
+
63
+ export declare const asHashPayloadWithStorageMeta: AsTypeFunction<HashPayload>;
64
+
65
+ export declare const asHydratedBlock: AsTypeFunction<HydratedBlock<BlockBoundWitness, Payload>>;
66
+
67
+ export declare const asHydratedTransaction: AsTypeFunction<HydratedTransaction<TransactionBoundWitness, Payload>>;
68
+
69
+ export declare const asSignedBlockBoundWitness: AsTypeFunction<Signed<BlockBoundWitness>>;
70
+
71
+ export declare const asSignedBlockBoundWitnessWithHashStorageMeta: AsTypeFunction<Signed<WithHashStorageMeta<BlockBoundWitness>>>;
72
+
73
+ export declare const asSignedBlockBoundWitnessWithStorageMeta: AsTypeFunction<Signed<WithStorageMeta<BlockBoundWitness>>>;
74
+
75
+ export declare const asTransactionBoundWitness: AsTypeFunction<TransactionBoundWitness>;
76
+
77
+ export declare const asTransactionBoundWitnessWithHashStorageMeta: AsTypeFunction<WithHashStorageMeta<TransactionBoundWitness>>;
78
+
79
+ export declare const asTransactionBoundWitnessWithStorageMeta: AsTypeFunction<WithStorageMeta<TransactionBoundWitness>>;
80
+
81
+ export declare const asTransfer: AsTypeFunction<Transfer>;
82
+
83
+ export declare const asValidStep: AsTypeFunction<number>;
84
+
85
+ export declare type AttoXL1 = bigint & {
86
+ readonly _tag: 'AttoXL1';
87
+ };
88
+
89
+ export declare const AttoXL1: TypingFunc<AttoXL1>;
90
+
91
+ /**
92
+ * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or
93
+ * by which AttoXL1 is divided to convert it to respective unit is multiplied.
94
+ */
95
+ export declare const AttoXL1ConvertFactor: Record<XL1Units, bigint>;
96
+
97
+ export declare type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>;
98
+
99
+ export declare interface BlockBoundWitnessFields {
100
+ /** Block number */
101
+ block: number;
102
+ /** Chain id - this should be "0" for the genesis block */
103
+ chain: Hex;
104
+ /** Previous block hash if not block 0 */
105
+ previous: Hash | null;
106
+ /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */
107
+ protocol: number;
108
+ /** Step hashes */
109
+ step_hashes: Hex[];
110
+ }
111
+
112
+ export declare interface BlockBoundWitnessMeta {
113
+ $epoch: number;
114
+ }
115
+
116
+ /**
117
+ * A duration referenced to block numbers
118
+ */
119
+ export declare interface BlockDuration extends BlockStart, BlockEnd {
120
+ }
121
+
122
+ export declare interface BlockEnd {
123
+ /**
124
+ * The block at which the duration ends
125
+ */
126
+ exp: number;
127
+ }
128
+
129
+ /**
130
+ * The number of a block
131
+ */
132
+ export declare type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>;
133
+
134
+ export declare interface BlockNumberFields {
135
+ /**
136
+ * The block number
137
+ */
138
+ block: Hex;
139
+ }
140
+
141
+ export declare const BlockNumberSchema: "network.xyo.chain.block.number";
142
+
143
+ export declare type BlockNumberSchema = typeof BlockNumberSchema;
144
+
145
+ export declare interface BlockProducerService extends Addressable, NextBlockProducer, Service {
146
+ }
147
+
148
+ export declare interface BlockRewardService extends Service {
149
+ getRewardForBlock(block: bigint): Promisable<bigint>;
150
+ }
151
+
152
+ export declare interface BlockStart {
153
+ /**
154
+ * The block at which the duration starts
155
+ */
156
+ nbf: number;
157
+ }
158
+
159
+ export declare class BlockValidationError extends ValidationError<BlockBoundWitness> {
160
+ }
161
+
162
+ export declare type BlockValidatorFunction = (block: BlockBoundWitness, chainId?: Address) => Promisable<BlockValidationError[]>;
163
+
164
+ export declare class BoundWitnessValidationError extends ValidationError<BoundWitness> {
165
+ }
166
+
167
+ export declare type BoundWitnessValidationFunction<T extends BoundWitness = BoundWitness> = (bw: T) => Promisable<BoundWitnessValidationError[]>;
168
+
169
+ /**
170
+ * Modeled after EIP-2255
171
+ * See - https://eips.ethereum.org/EIPS/eip-2255#specification
172
+ */
173
+ export declare interface Caveats {
174
+ /** Type of caveat */
175
+ type: CaveatTypes;
176
+ /** Value for the caveat (i.e. chain id, subset of accounts, expiration, max request per minute, etc.) */
177
+ value: JsonValue;
178
+ }
179
+
180
+ export declare type CaveatTypes = 'chain' | 'expiration' | 'filteredResponse' | 'rateLimit';
181
+
182
+ export declare interface ChainAnalyzer<T extends Payload = Payload> {
183
+ onBlock(block: HydratedBlock): Promisable<boolean>;
184
+ result(): T;
185
+ shouldContinue(): boolean;
186
+ }
187
+
188
+ export declare interface ChainConnection {
189
+ /** Chain Identifier - can be a hex (eth contract address) or a string */
190
+ chainId?: string | Hex;
191
+ /** Name of the chain */
192
+ name: string;
193
+ /** Url for accessing the network */
194
+ url: string;
195
+ }
196
+
197
+ export declare interface ChainHeadService extends Service {
198
+ head(): Promise<Hash>;
199
+ }
200
+
201
+ export declare interface ChainHeadServiceEventArgs {
202
+ hash: Hash;
203
+ }
204
+
205
+ export declare interface ChainHeadServiceEventData extends EventData {
206
+ headUpdated: ChainHeadServiceEventArgs;
207
+ }
208
+
209
+ /**
210
+ * @public
211
+ * The result of a ChainIndexingServiceState
212
+ */
213
+ export declare type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>;
214
+
215
+ /** @public */
216
+ export declare interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {
217
+ /**
218
+ * The hash of the last block that this service has indexing
219
+ */
220
+ endBlockHash: Hash;
221
+ /**
222
+ * The hash of the block that the service started indexing. If undefined, the service is
223
+ * assumed to have started indexing from the genesis block
224
+ */
225
+ startBlockHash?: Hash;
226
+ /**
227
+ * The indexed state for the range
228
+ */
229
+ state: T;
230
+ }
231
+
232
+ /** @public */
233
+ export declare const ChainIndexingServiceStateSchema: "network.xyo.chain.indexing.service.state";
234
+
235
+ /** @public */
236
+ export declare type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema;
237
+
238
+ export declare interface ChainInformationService {
239
+ active(): Promisable<bigint>;
240
+ forkedAtBlockNumber(): Promisable<bigint>;
241
+ forkedAtHash(): Promisable<bigint>;
242
+ forkedChainId(): Promisable<Address>;
243
+ minWithdrawalBlocks(): Promisable<bigint>;
244
+ rewardsContract(): Promisable<string>;
245
+ stakingTokenAddress(): Promisable<string>;
246
+ }
247
+
248
+ /**
249
+ * Required info for a chain reference
250
+ */
251
+ export declare interface ChainReference {
252
+ /**
253
+ * The contract address referenced by the chain
254
+ */
255
+ chain: Address;
256
+ }
257
+
258
+ export declare type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>;
259
+
260
+ export declare interface ChainStakeIntentFields extends BlockDuration, FromFields {
261
+ intent: Intent;
262
+ }
263
+
264
+ export declare const ChainStakeIntentSchema: "network.xyo.chain.stake.intent";
265
+
266
+ export declare type ChainStakeIntentSchema = typeof ChainStakeIntentSchema;
267
+
268
+ export declare interface ChainStakeService extends ChainStakeViewService {
269
+ addStake(staked: string, amount: bigint): Promisable<boolean>;
270
+ removeStake(slot: bigint): Promisable<boolean>;
271
+ withdrawStake(slot: bigint): Promisable<boolean>;
272
+ }
273
+
274
+ export declare interface ChainStakeViewService {
275
+ activeByAddressStaked(address: string): Promisable<bigint>;
276
+ activeByStaker(address: string): Promisable<bigint>;
277
+ pending(): Promisable<bigint>;
278
+ pendingByStaker(staker: string): Promisable<bigint>;
279
+ withdrawn(): Promisable<bigint>;
280
+ withdrawnByStaker(staker: string): Promisable<bigint>;
281
+ }
282
+
283
+ export declare type DefaultNetworkIds = 'mainnet' | 'sequence' | 'local';
284
+
285
+ export declare const defaultTransactionFees: TransactionFeesBigInt;
286
+
287
+ export declare interface EventingChainHeadService extends ChainHeadService, EventEmitter<ChainHeadServiceEventData> {
288
+ }
289
+
290
+ export declare type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields;
291
+
292
+ export declare interface ExecutableFields {
293
+ script: string[];
294
+ }
295
+
296
+ export declare type FemtoXL1 = bigint & {
297
+ readonly _tag: 'FemtoXL1';
298
+ };
299
+
300
+ export declare const FemtoXL1: TypingFunc<FemtoXL1>;
301
+
302
+ export declare interface FromFields {
303
+ from: Address;
304
+ }
305
+
306
+ export declare const hasFrom: (value: unknown) => value is FromFields;
307
+
308
+ export declare interface HashFields {
309
+ hash: Hash;
310
+ }
311
+
312
+ export declare type HashPayload = Payload<HashFields, HashSchema>;
313
+
314
+ export declare const HashSchema: "network.xyo.hash";
315
+
316
+ export declare type HashSchema = typeof HashSchema;
317
+
318
+ export declare type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness, P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]];
319
+
320
+ export declare class HydratedBlockStateValidationError extends ValidationError<HydratedBlock> {
321
+ chainId: Address;
322
+ constructor(hash: Hash, chainId: Address, value: HydratedBlock, message?: string, cause?: unknown);
323
+ }
324
+
325
+ /**
326
+ * @public
327
+ * A function that validates a hydrated block against chain state.
328
+ * @param hydratedBlock The hydrated block to validate.
329
+ * @param chainId The chain ID to use for validation.
330
+ * @param archivist The archivist to use for validation.
331
+ * @returns An array of errors if the block is invalid, or an empty array if it is valid.
332
+ */
333
+ export declare type HydratedBlockStateValidationFunction = (hydratedBlock: HydratedBlock, chainId: Address, services: {
334
+ accountBalance: AccountBalanceService;
335
+ }) => Promisable<HydratedBlockStateValidationError[]>;
336
+
337
+ export declare class HydratedBlockValidationError extends ValidationError<HydratedBlock> {
338
+ }
339
+
340
+ /**
341
+ * A function that validates a hydrated block.
342
+ * @param hydratedBlock The hydrated block to validate.
343
+ * @param chainId The chain ID to use for validation.
344
+ * @returns An array of errors if the block is invalid, or an empty array if it is valid.
345
+ */
346
+ export declare type HydratedBlockValidationFunction = (hydratedBlock: HydratedBlock, chainId?: Address) => Promisable<HydratedBlockValidationError[]>;
347
+
348
+ export declare class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {
349
+ }
350
+
351
+ export declare type HydratedBoundWitnessValidationFunction<T extends BoundWitness = BoundWitness> = (bw: HydratedBoundWitnessWithHashStorageMeta<T>) => Promisable<HydratedBoundWitnessValidationError[]>;
352
+
353
+ export declare type HydratedBoundWitnessWithHashStorageMeta<T extends BoundWitness = BoundWitness, P extends Payload = Payload> = [WithHashStorageMeta<T>, WithHashStorageMeta<P>[]];
354
+
355
+ export declare type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness, P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]];
356
+
357
+ /**
358
+ * A function that validates a hydrated transaction against chain state.
359
+ * @param hydratedTransaction The hydrated transaction to validate.
360
+ * @param chainId The chain ID to use for validation.
361
+ * @param archivist The archivist to use for validation.
362
+ * @returns An array of errors if the transaction is invalid, or an empty array if it is valid.
363
+ */
364
+ export declare type HydratedTransactionStateValidationFunction<T extends TransactionBoundWitness = TransactionBoundWitness> = (hydratedTransaction: HydratedBoundWitnessWithStorageMeta<T>, chainId: Address, archivist: ReadArchivist) => Promisable<HydratedTransactionValidationError[]>;
365
+
366
+ export declare class HydratedTransactionValidationError extends ValidationError<HydratedTransaction> {
367
+ }
368
+
369
+ /**
370
+ * A function that validates a hydrated transaction.
371
+ * @param bw The hydrated transaction to validate.
372
+ * @param chainId The chain ID to use for validation.
373
+ * @returns An array of errors if the transaction is invalid, or an empty array if it is valid.
374
+ */
375
+ export declare type HydratedTransactionValidationFunction<T extends TransactionBoundWitness = TransactionBoundWitness> = (hydratedTransaction: HydratedTransaction<T>, chainId?: Address) => Promisable<HydratedTransactionValidationError[]>;
376
+
377
+ export declare class InBlockPayloadValidationError extends ValidationError<Payload> {
378
+ block: HydratedBlock;
379
+ constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown);
380
+ }
381
+
382
+ export declare type InBlockPayloadValidationFunction = (payload: WithHashStorageMeta<Payload>, block: HydratedBlock) => Promisable<InBlockPayloadValidationError[]>;
383
+
384
+ export declare type Initializable<T, R> = (params: T) => Promisable<R>;
385
+
386
+ export declare type Intent = 'producer';
387
+
388
+ export declare interface InvokerPermission extends Permission {
389
+ /** Time at which the permission was granted */
390
+ date?: number;
391
+ }
392
+
393
+ export declare const isAllowedBlockPayload: (value: unknown) => value is AllowedBlockPayload;
394
+
395
+ export declare const isAllowedBlockPayloadSchema: (value: unknown) => value is AllowedBlockPayloadSchema;
396
+
397
+ export declare const isAllowedBlockPayloadWithHashStorageMeta: (value: unknown) => value is WithStorageMeta<AllowedBlockPayload>;
398
+
399
+ export declare const isBlockBoundWitness: (value: unknown) => value is BlockBoundWitness;
400
+
401
+ export declare const isBlockBoundWitnessWithHashStorageMeta: (value: unknown) => value is WithHashStorageMeta<BlockBoundWitness>;
402
+
403
+ export declare const isBlockBoundWitnessWithStorageMeta: (value: unknown) => value is WithStorageMeta<BlockBoundWitness>;
404
+
405
+ /**
406
+ * Identity function for determining if an object is a BlockNumber
407
+ */
408
+ export declare const isBlockNumber: (x?: unknown | null) => x is BlockNumber;
409
+
410
+ /**
411
+ * Identity function for determining if an object is a BlockNumber with sources
412
+ */
413
+ export declare const isBlockNumberWithSources: (x?: unknown | null) => x is WithSources<BlockNumber>;
414
+
415
+ export declare const isBlockValidationError: (error: unknown) => error is BlockValidationError;
416
+
417
+ export declare const isBoundWitnessValidationError: (error: unknown) => error is BoundWitnessValidationError;
418
+
419
+ /**
420
+ * @public
421
+ * Identity functions for determining if an object is an ChainIndexingServiceState
422
+ */
423
+ export declare const isChainIndexingServiceState: <T extends JsonValue = JsonValue>(payload?: unknown) => payload is ChainIndexingServiceState<T>;
424
+
425
+ /** @public */
426
+ export declare const isChainIndexingServiceStateWithStorageMeta: <T extends JsonValue = JsonValue>(value: unknown) => value is WithStorageMeta<ChainIndexingServiceState<T>>;
427
+
428
+ export declare const isChainStakeIntent: (x?: unknown | null) => x is ChainStakeIntent;
429
+
430
+ export declare const isExecutable: <T extends EmptyObject>(value: T | undefined) => value is Executable<T>;
431
+
432
+ export declare const isHashPayload: (x?: unknown | null) => x is HashPayload;
433
+
434
+ export declare const isHydratedBlock: (value: unknown) => value is HydratedBlock;
435
+
436
+ export declare const isHydratedBlockStateValidationError: (error: unknown) => error is HydratedBlockStateValidationError;
437
+
438
+ export declare const isHydratedBlockValidationError: (error: unknown) => error is HydratedBlockValidationError;
439
+
440
+ export declare const isHydratedBoundWitnessValidationError: (error: unknown) => error is HydratedBoundWitnessValidationError;
441
+
442
+ export declare const isHydratedTransaction: (value: unknown) => value is HydratedTransaction;
443
+
444
+ export declare const isHydratedTransactionValidationError: (error: unknown) => error is HydratedTransactionValidationError;
445
+
446
+ export declare const isInBlockPayloadValidationError: (error: unknown) => error is InBlockPayloadValidationError;
447
+
448
+ export declare const isNetworkStatus: (x?: unknown | null) => x is NetworkStatus;
449
+
450
+ /** @public */
451
+ export declare const isService: (value: unknown) => value is Service;
452
+
453
+ export declare const isSigned: <T extends BoundWitness = BoundWitness>(value: unknown) => value is Signed<T>;
454
+
455
+ export declare const isSignedBlockBoundWitness: (value: unknown) => value is Signed<BlockBoundWitness>;
456
+
457
+ export declare const isSignedBlockBoundWitnessWithHashStorageMeta: (value: unknown) => value is Signed<WithHashStorageMeta<BlockBoundWitness>>;
458
+
459
+ export declare const isSignedBlockBoundWitnessWithStorageMeta: (value: unknown) => value is Signed<WithStorageMeta<BlockBoundWitness>>;
460
+
461
+ export declare const isSignedTransactionBoundWitness: (value: unknown) => value is Signed<TransactionBoundWitness>;
462
+
463
+ export declare const isSignedTransactionBoundWitnessWithHashStorageMeta: (value: unknown) => value is WithHashStorageMeta<Signed<TransactionBoundWitness>>;
464
+
465
+ export declare const isSignedTransactionBoundWitnessWithStorageMeta: (value: unknown) => value is WithStorageMeta<Signed<TransactionBoundWitness>>;
466
+
467
+ export declare const isTransactionBoundWitness: (value: unknown) => value is TransactionBoundWitness;
468
+
469
+ export declare const isTransactionBoundWitnessWithHashStorageMeta: (value: unknown) => value is WithHashStorageMeta<TransactionBoundWitness>;
470
+
471
+ export declare const isTransactionBoundWitnessWithStorageMeta: (value: unknown) => value is WithStorageMeta<TransactionBoundWitness>;
472
+
473
+ export declare const isTransfer: (x?: unknown | null) => x is Transfer;
474
+
475
+ export declare const isValidationError: <TValue = Payload>(error: unknown) => error is ValidationError<TValue>;
476
+
477
+ export declare function isValidStep(step: unknown): step is number;
478
+
479
+ export declare interface IterableRepository<TId, TData> {
480
+ next(id: TId): Promisable<TData>;
481
+ }
482
+
483
+ export declare interface IterableTransactionRepository extends TransactionRepository, TransactionRepositoryIterator {
484
+ }
485
+
486
+ export declare type MicroXL1 = bigint & {
487
+ readonly _tag: 'MicroXL1';
488
+ };
489
+
490
+ export declare const MicroXL1: TypingFunc<MicroXL1>;
491
+
492
+ export declare type MilliXL1 = bigint & {
493
+ readonly _tag: 'MilliXL1';
494
+ };
495
+
496
+ export declare const MilliXL1: TypingFunc<MilliXL1>;
497
+
498
+ export declare const minTransactionFees: TransactionFeesBigInt;
499
+
500
+ export declare type NanoXL1 = bigint & {
501
+ readonly _tag: 'NanoXL1';
502
+ };
503
+
504
+ export declare const NanoXL1: TypingFunc<NanoXL1>;
505
+
506
+ export declare type NetworkId<T extends string | void = void> = T extends void ? DefaultNetworkIds : T | DefaultNetworkIds;
507
+
508
+ export declare type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>;
509
+
510
+ export declare interface NetworkStatusFields {
511
+ description: string;
512
+ state: NetworkStatusState;
513
+ updates?: NetworkStatusUpdate[];
514
+ }
515
+
516
+ export declare const NetworkStatusSchema: "network.xyo.chain.status";
517
+
518
+ export declare type NetworkStatusSchema = typeof NetworkStatusSchema;
519
+
520
+ export declare type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown';
521
+
522
+ export declare type NetworkStatusUpdate = {
523
+ end: number;
524
+ start: number;
525
+ update: string;
526
+ };
527
+
528
+ export declare type NextBlockProducer = IterableRepository<BlockBoundWitness, HydratedBlock | undefined>;
529
+
530
+ export declare interface OpenTelemetryProviders {
531
+ meterProvider?: MeterProvider;
532
+ traceProvider?: TracerProvider;
533
+ }
534
+
535
+ /**
536
+ * A optional duration referenced to block numbers
537
+ */
538
+ export declare interface OptionalBlockDuration extends Partial<BlockStart>, Partial<BlockEnd> {
539
+ }
540
+
541
+ export declare type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>;
542
+
543
+ export declare interface PayloadIterableRepository<TId = Hash, TData extends Payload = Payload> extends IterableRepository<NextOptions<TId>, WithStorageMeta<TData>[]> {
544
+ }
545
+
546
+ export declare interface PayloadReadRepository<TId = Hash, TData extends Payload = Payload> extends ReadRepository<TId[], WithStorageMeta<TData>[]> {
547
+ }
548
+
549
+ export declare interface PayloadRepository<TId = Hash, TData extends Payload = Payload> extends PayloadReadRepository<TId, TData>, PayloadWriteRepository<TData>, PayloadIterableRepository<TId, TData> {
550
+ }
551
+
552
+ export declare interface PayloadWriteRepository<TData extends Payload = Payload> extends WriteRepository<TData[], WithStorageMeta<TData>[]> {
553
+ }
554
+
555
+ export declare interface PendingTransactionsService extends Service {
556
+ getPendingTransactions(head: Hash, limit: number, timeout?: number): Promise<HydratedTransaction[]>;
557
+ }
558
+
559
+ /**
560
+ * Modeled after EIP-2255
561
+ * See - https://eips.ethereum.org/EIPS/eip-2255#specification
562
+ */
563
+ export declare interface Permission {
564
+ /** Permission identifier (i.e. RPC method, action, etc.) */
565
+ capability: string;
566
+ /** Caveats for the permission, if applicable (i.e. allowed accounts, signing, etc.) */
567
+ caveats?: Caveats[];
568
+ /** Invoker for the given permission (URI, domain, webpage, address, etc.) */
569
+ invoker: string;
570
+ }
571
+
572
+ /**
573
+ * Modeled after EIP-2255
574
+ * See - https://eips.ethereum.org/EIPS/eip-2255#specification
575
+ */
576
+ export declare interface PermissionRequest {
577
+ [capability: string]: {
578
+ [caveatName: string]: JsonValue;
579
+ };
580
+ }
581
+
582
+ export declare type PicoXL1 = bigint & {
583
+ readonly _tag: 'PicoXL1';
584
+ };
585
+
586
+ export declare const PicoXL1: TypingFunc<PicoXL1>;
587
+
588
+ export declare interface ProducerElectionService extends Service {
589
+ /**
590
+ * Given the current block, get the leader for the next block
591
+ * @param current The previous block
592
+ */
593
+ getCreatorCommitteeForNextBlock(current: BlockBoundWitness): Promise<Address[]>;
594
+ }
595
+
596
+ export declare interface ReadonlyIterableTransactionRepository extends TransactionReadRepository, TransactionRepositoryIterator {
597
+ }
598
+
599
+ export declare interface ReadRepository<TId, TData> {
600
+ get(id: TId): Promisable<TData>;
601
+ }
602
+
603
+ /**
604
+ * Modeled after EIP-2255
605
+ * See - https://eips.ethereum.org/EIPS/eip-2255#specification
606
+ */
607
+ export declare interface RequestedPermission {
608
+ /** Permission identifier (i.e. RPC method, action, etc.) */
609
+ capability: string;
610
+ /** Optional timestamp for when the permission was granted */
611
+ date?: number;
612
+ }
613
+
614
+ /** @public */
615
+ export declare interface Service {
616
+ /** @description Service Function Interface */
617
+ sfi(): Promisable<JsonObject>;
618
+ }
619
+
620
+ /** @public */
621
+ export declare interface StakeIntentService extends Service {
622
+ /**
623
+ * Gets the declared ranges for an address based on historical on-chain data
624
+ * @param address The address to get the declared ranges for
625
+ * @param intent The declared intent to filter for
626
+ */
627
+ getDeclaredCandidateRanges(address: Address, intent: Intent): Promise<Readonly<Readonly<[number, number]>[]>>;
628
+ /**
629
+ * Gets the declared candidates for a block based on historical on-chain data
630
+ * @param block The block number to get the declared candidates for
631
+ * @param intent The declared intent to filter for
632
+ */
633
+ getDeclaredCandidatesForBlock(block: number, intent: Intent): Promise<Address[]>;
634
+ /**
635
+ * Gets the required minimum stake for a given intent
636
+ * @param intent The declared intent to filter for
637
+ * @returns The required minimum stake for the intent
638
+ */
639
+ getRequiredMinimumStakeForIntent(intent: Intent): bigint;
640
+ /**
641
+ * Checks if the address is staked for a block for a given intent
642
+ * @param block The block number to check
643
+ * @param intent The declared intent to filter for
644
+ * @param address The address to check
645
+ */
646
+ isStakedForBlock(block: number, intent: Intent, address: Address): Promise<boolean>;
647
+ }
648
+
649
+ export declare function stepSize(step: number): number;
650
+
651
+ export declare const StepSizes: readonly [7, 31, 211, 2311, 30031, 510511, 9699691, 223092871, 6469693231];
652
+
653
+ export declare type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>;
654
+
655
+ export declare interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {
656
+ chain: Address;
657
+ }
658
+
659
+ export declare interface TransactionFeesBigInt {
660
+ base: AttoXL1;
661
+ gasLimit: AttoXL1;
662
+ gasPrice: AttoXL1;
663
+ priority: AttoXL1;
664
+ }
665
+
666
+ export declare interface TransactionFeesFields {
667
+ fees: TransactionFeesHex;
668
+ }
669
+
670
+ export declare type TransactionFeesHex = {
671
+ [K in keyof TransactionFeesBigInt]: Hex;
672
+ };
673
+
674
+ export declare const TransactionGasCosts: {
675
+ /**
676
+ * The cost of storing each character that is added to the chain
677
+ * This includes the transaction JSON and all the elevated payloads' JSON
678
+ */
679
+ readonly characterStorage: 10n;
680
+ /** The cost of static validating every payload that will be included in the chain */
681
+ readonly payloadValidation: 1000n;
682
+ /** The cost of validating each signature that will be included in the chain */
683
+ readonly signatureValidation: 1000n;
684
+ /** The cost of validating each hash that will be included in the chain */
685
+ readonly hashValidation: 100n;
686
+ /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */
687
+ readonly balanceValidation: 100n;
688
+ };
689
+
690
+ export declare interface TransactionReadRepository extends ReadRepository<TransactionBoundWitness, HydratedTransaction | undefined> {
691
+ }
692
+
693
+ export declare interface TransactionRepository extends TransactionReadRepository, TransactionWriteRepository {
694
+ }
695
+
696
+ export declare interface TransactionRepositoryIterator extends IterableRepository<TransactionBoundWitness, HydratedTransaction | undefined> {
697
+ }
698
+
699
+ export declare interface TransactionWriteRepository extends WriteRepository<HydratedTransaction, boolean> {
700
+ }
701
+
702
+ export declare type Transfer = Payload<TransferFields, TransferSchema>;
703
+
704
+ export declare interface TransferFields extends FromFields {
705
+ epoch: number;
706
+ transfers: Partial<Record<Address, Hex>>;
707
+ }
708
+
709
+ export declare const TransferSchema: "network.xyo.transfer";
710
+
711
+ export declare type TransferSchema = typeof TransferSchema;
712
+
713
+ export declare type TypingFunc<T extends bigint> = (value: bigint) => T;
714
+
715
+ export declare class ValidationError<TValue = Payload> extends Error {
716
+ hash: Hash;
717
+ value: TValue;
718
+ constructor(hash: Hash, value: TValue, message?: string, cause?: unknown);
719
+ }
720
+
721
+ export declare interface WriteRepository<TData, TResp> {
722
+ insert(data: TData): Promisable<TResp>;
723
+ }
724
+
725
+ export declare type XL1 = bigint & {
726
+ readonly _tag: 'XL1';
727
+ };
728
+
729
+ export declare const XL1: TypingFunc<XL1>;
730
+
731
+ export declare const XL1_PROTOCOL_VERSION: number;
732
+
733
+ export declare const XL1_PROTOCOL_VERSION_MAJOR: 1;
734
+
735
+ export declare const XL1_PROTOCOL_VERSION_MINOR: 2;
736
+
737
+ export declare const XL1_PROTOCOL_VERSION_PATCH: 0;
738
+
739
+ export declare const XL1_PROTOCOL_VERSION_STRING: "1.2.0";
740
+
741
+ /** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */
742
+ export declare const XL1ConvertDict: Record<XL1Units, number>;
743
+
744
+ /** @deprecated use AttoXL1ConvertFactor instead */
745
+ export declare function xl1ConvertFactor(unit: XL1Units): bigint;
746
+
747
+ export declare const XL1Places: Record<XL1Units, bigint>;
748
+
749
+ declare type XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto';
750
+
751
+ export declare interface XyoDataLakeProvider extends XyoDataLakeViewer, XyoPayloadLakeProvider {
752
+ add(items: ArrayBuffer[]): Promisable<Hash[]>;
753
+ }
754
+
755
+ export declare interface XyoDataLakeViewer extends XyoPayloadLakeViewer {
756
+ fetch(hashes: Hash[], maxDepth?: number): Promisable<(ArrayBuffer | Payload)[]>;
757
+ get(hashes: Hash[]): Promisable<(ArrayBuffer | Payload)[]>;
758
+ trace(hashes: Hash[]): Promisable<[(ArrayBuffer | Payload), Payload[]][]>;
759
+ }
760
+
761
+ export declare interface XyoHost {
762
+ addChain(chainConnectionInfo: ChainConnection): Promisable<boolean>;
763
+ chains(): Promisable<ChainConnection[]>;
764
+ getPermissions(): Promisable<InvokerPermission[]>;
765
+ requestPermissions(permissions: Permission[]): Promisable<boolean>;
766
+ revokePermissions(permissions: Permission[]): Promisable<boolean>;
767
+ }
768
+
769
+ export declare interface XyoNetwork {
770
+ status(): Promisable<NetworkStatus>;
771
+ }
772
+
773
+ export declare interface XyoPayloadLakeProvider extends XyoPayloadLakeViewer {
774
+ addPayloads(payloads: Payload[]): Promisable<Hash[]>;
775
+ }
776
+
777
+ export declare interface XyoPayloadLakeViewer {
778
+ getPayloads(hashes: Hash[]): Promisable<Payload[]>;
779
+ }
780
+
781
+ export declare interface XyoProvider {
782
+ host?: XyoHost;
783
+ network?: XyoNetwork;
784
+ runner?: XyoRunner;
785
+ send?: (elevatedPayloads: AllowedBlockPayload[], additionalPayloads: Payload[], chain?: Address, nbf?: number, exp?: number, from?: Address, fees?: TransactionFeesBigInt) => Promise<Signed<TransactionBoundWitness>>;
786
+ signer?: XyoSigner;
787
+ storage?: XyoDataLakeProvider;
788
+ viewer?: XyoViewer;
789
+ /** @deprecated - use host instead */
790
+ wallet?: XyoWallet;
791
+ }
792
+
793
+ export declare interface XyoRunner {
794
+ broadcastTransaction(transaction: HydratedTransaction): Promisable<Hash>;
795
+ }
796
+
797
+ export declare interface XyoSigner {
798
+ address(): Promisable<Address>;
799
+ createSignedTransaction(chain: Address, elevatedPayloads: AllowedBlockPayload[], additionalPayloads: Payload[], nbf: number, exp: number, fees: TransactionFeesBigInt, from?: Address): Promisable<Signed<TransactionBoundWitness>>;
800
+ }
801
+
802
+ export declare interface XyoViewer {
803
+ accountBalance: (address: Address) => Promisable<bigint>;
804
+ accountHistory: (address: Address) => Promisable<[TransactionBoundWitness[], Transfer[]]>;
805
+ blockByHash(hash: Hash): Promisable<HydratedBlock | null>;
806
+ blockByNumber(blockNumber: number): Promisable<HydratedBlock | null>;
807
+ blocksByHash(hash: Hash, limit?: number): Promisable<HydratedBlock[]>;
808
+ chainId(): Promisable<Address>;
809
+ currentBlock(): Promisable<HydratedBlock>;
810
+ currentBlockHash(): Promisable<Hash>;
811
+ currentBlockNumber(): Promisable<number>;
812
+ transactionByBlockHashAndIndex(blockHash: Hash, transactionIndex: number): Promisable<HydratedTransaction | null>;
813
+ transactionByBlockNumberAndIndex(blockNumber: number, transactionIndex: number): Promisable<HydratedTransaction | null>;
814
+ transactionByHash(transactionHash: Hash): Promisable<HydratedTransaction | null>;
815
+ }
816
+
817
+ /** @deprecated - use XyoHost instead */
818
+ export declare interface XyoWallet {
819
+ accounts(): Promisable<Address[]>;
820
+ addChain(chain: Address, name?: string): Promisable<object>;
821
+ chain(): Promisable<Address>;
822
+ chains(): Promisable<object>;
823
+ permissions(): Promisable<Record<string, object>>;
824
+ requestPermissions(permissions: object): Promisable<object>;
825
+ revokePermissions(permissions: object): Promisable<object>;
826
+ switchChain(chain: Address): Promisable<void>;
827
+ }
828
+
829
+ export { }