@xyo-network/xl1-protocol 1.25.26 → 1.25.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/dist/neutral/BlockNumber/BlockNumber.d.ts +7 -0
  2. package/dist/neutral/BlockNumber/BlockNumber.d.ts.map +1 -1
  3. package/dist/neutral/BlockNumber/EthBlockNumber.d.ts +7 -0
  4. package/dist/neutral/BlockNumber/EthBlockNumber.d.ts.map +1 -1
  5. package/dist/neutral/BlockNumber/Numberish.d.ts +2 -0
  6. package/dist/neutral/BlockNumber/Numberish.d.ts.map +1 -1
  7. package/dist/neutral/BlockNumber/XL1BlockNumber.d.ts +7 -0
  8. package/dist/neutral/BlockNumber/XL1BlockNumber.d.ts.map +1 -1
  9. package/dist/neutral/Initializable.d.ts +1 -0
  10. package/dist/neutral/Initializable.d.ts.map +1 -1
  11. package/dist/neutral/OpenTelemetryProviders.d.ts +1 -0
  12. package/dist/neutral/OpenTelemetryProviders.d.ts.map +1 -1
  13. package/dist/neutral/RecordKeyType.d.ts +2 -0
  14. package/dist/neutral/RecordKeyType.d.ts.map +1 -1
  15. package/dist/neutral/Step/StepHash.d.ts +2 -0
  16. package/dist/neutral/Step/StepHash.d.ts.map +1 -1
  17. package/dist/neutral/Step/StepIdentity.d.ts +4 -0
  18. package/dist/neutral/Step/StepIdentity.d.ts.map +1 -1
  19. package/dist/neutral/Step/StepSizes.d.ts +5 -0
  20. package/dist/neutral/Step/StepSizes.d.ts.map +1 -1
  21. package/dist/neutral/TransferPayload.d.ts +7 -0
  22. package/dist/neutral/TransferPayload.d.ts.map +1 -1
  23. package/dist/neutral/amount/ShiftedBigIntConfig.d.ts +1 -0
  24. package/dist/neutral/amount/ShiftedBigIntConfig.d.ts.map +1 -1
  25. package/dist/neutral/amount/XL1AmountInstance.d.ts +16 -0
  26. package/dist/neutral/amount/XL1AmountInstance.d.ts.map +1 -0
  27. package/dist/neutral/amount/index.d.ts +2 -4
  28. package/dist/neutral/amount/index.d.ts.map +1 -1
  29. package/dist/neutral/block/AllowedBlockPayload.d.ts +7 -0
  30. package/dist/neutral/block/AllowedBlockPayload.d.ts.map +1 -1
  31. package/dist/neutral/block/BlockBoundWitness.d.ts +15 -0
  32. package/dist/neutral/block/BlockBoundWitness.d.ts.map +1 -1
  33. package/dist/neutral/block/HydratedBlock.d.ts +37 -0
  34. package/dist/neutral/block/HydratedBlock.d.ts.map +1 -1
  35. package/dist/neutral/block/signed/SignedBlockBoundWitness.d.ts +5 -0
  36. package/dist/neutral/block/signed/SignedBlockBoundWitness.d.ts.map +1 -1
  37. package/dist/neutral/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts +7 -0
  38. package/dist/neutral/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts.map +1 -1
  39. package/dist/neutral/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts +7 -0
  40. package/dist/neutral/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts.map +1 -1
  41. package/dist/neutral/block/unsigned/UnsignedBlockBoundWitness.d.ts +5 -0
  42. package/dist/neutral/block/unsigned/UnsignedBlockBoundWitness.d.ts.map +1 -1
  43. package/dist/neutral/chain/Chain.d.ts +1 -0
  44. package/dist/neutral/chain/Chain.d.ts.map +1 -1
  45. package/dist/neutral/chain/ChainAnalyzer.d.ts +1 -0
  46. package/dist/neutral/chain/ChainAnalyzer.d.ts.map +1 -1
  47. package/dist/neutral/chain/ChainId.d.ts +1 -0
  48. package/dist/neutral/chain/ChainId.d.ts.map +1 -1
  49. package/dist/neutral/fields/Addressable.d.ts +1 -0
  50. package/dist/neutral/fields/Addressable.d.ts.map +1 -1
  51. package/dist/neutral/fields/BlockDuration.d.ts +2 -0
  52. package/dist/neutral/fields/BlockDuration.d.ts.map +1 -1
  53. package/dist/neutral/fields/BlockNumber.d.ts +5 -0
  54. package/dist/neutral/fields/BlockNumber.d.ts.map +1 -1
  55. package/dist/neutral/index.mjs +152 -319
  56. package/dist/neutral/index.mjs.map +1 -1
  57. package/dist/neutral/map/AsyncMap.d.ts +6 -0
  58. package/dist/neutral/map/AsyncMap.d.ts.map +1 -1
  59. package/dist/neutral/map/MapType.d.ts +7 -0
  60. package/dist/neutral/map/MapType.d.ts.map +1 -1
  61. package/dist/neutral/map/SyncMap.d.ts +6 -0
  62. package/dist/neutral/map/SyncMap.d.ts.map +1 -1
  63. package/dist/neutral/model/AccountBalance.d.ts +12 -0
  64. package/dist/neutral/model/AccountBalance.d.ts.map +1 -1
  65. package/dist/neutral/model/ArrayBuffer.d.ts +2 -0
  66. package/dist/neutral/model/ArrayBuffer.d.ts.map +1 -1
  67. package/dist/neutral/model/BlockRange/BlockRange.d.ts +10 -0
  68. package/dist/neutral/model/BlockRange/BlockRange.d.ts.map +1 -1
  69. package/dist/neutral/model/BlockRange/EthBlockRange.d.ts +10 -0
  70. package/dist/neutral/model/BlockRange/EthBlockRange.d.ts.map +1 -1
  71. package/dist/neutral/model/BlockRange/Numberish.d.ts +1 -0
  72. package/dist/neutral/model/BlockRange/Numberish.d.ts.map +1 -1
  73. package/dist/neutral/model/BlockRange/Range.d.ts +5 -0
  74. package/dist/neutral/model/BlockRange/Range.d.ts.map +1 -1
  75. package/dist/neutral/model/BlockRange/XL1BlockRange.d.ts +10 -0
  76. package/dist/neutral/model/BlockRange/XL1BlockRange.d.ts.map +1 -1
  77. package/dist/neutral/model/BlockRate.d.ts +27 -0
  78. package/dist/neutral/model/BlockRate.d.ts.map +1 -1
  79. package/dist/neutral/model/ChainQualification.d.ts +15 -0
  80. package/dist/neutral/model/ChainQualification.d.ts.map +1 -1
  81. package/dist/neutral/model/Context/BaseContext.d.ts +1 -0
  82. package/dist/neutral/model/Context/BaseContext.d.ts.map +1 -1
  83. package/dist/neutral/model/Context/BaseContext.zod.d.ts +7 -0
  84. package/dist/neutral/model/Context/BaseContext.zod.d.ts.map +1 -1
  85. package/dist/neutral/model/Context/BlockContext.d.ts +3 -0
  86. package/dist/neutral/model/Context/BlockContext.d.ts.map +1 -1
  87. package/dist/neutral/model/Context/BlockContext.zod.d.ts +3 -0
  88. package/dist/neutral/model/Context/BlockContext.zod.d.ts.map +1 -1
  89. package/dist/neutral/model/Context/CachingContext.d.ts +1 -0
  90. package/dist/neutral/model/Context/CachingContext.d.ts.map +1 -1
  91. package/dist/neutral/model/Context/CachingContext.zod.d.ts +1 -0
  92. package/dist/neutral/model/Context/CachingContext.zod.d.ts.map +1 -1
  93. package/dist/neutral/model/Context/ChainContext.d.ts +3 -0
  94. package/dist/neutral/model/Context/ChainContext.d.ts.map +1 -1
  95. package/dist/neutral/model/Context/ChainContext.zod.d.ts +3 -0
  96. package/dist/neutral/model/Context/ChainContext.zod.d.ts.map +1 -1
  97. package/dist/neutral/model/Context/HeadContext.d.ts +1 -0
  98. package/dist/neutral/model/Context/HeadContext.d.ts.map +1 -1
  99. package/dist/neutral/model/Context/HeadContext.zod.d.ts +2 -0
  100. package/dist/neutral/model/Context/HeadContext.zod.d.ts.map +1 -1
  101. package/dist/neutral/model/GatewayName.d.ts +1 -0
  102. package/dist/neutral/model/GatewayName.d.ts.map +1 -1
  103. package/dist/neutral/model/HydratedTransaction.d.ts +45 -0
  104. package/dist/neutral/model/HydratedTransaction.d.ts.map +1 -1
  105. package/dist/neutral/model/OpCodes.d.ts +1 -0
  106. package/dist/neutral/model/OpCodes.d.ts.map +1 -1
  107. package/dist/neutral/model/PayloadMap.d.ts +3 -0
  108. package/dist/neutral/model/PayloadMap.d.ts.map +1 -1
  109. package/dist/neutral/model/Permission.d.ts +6 -0
  110. package/dist/neutral/model/Permission.d.ts.map +1 -1
  111. package/dist/neutral/model/Position.d.ts +1 -0
  112. package/dist/neutral/model/Position.d.ts.map +1 -1
  113. package/dist/neutral/model/PositionId.d.ts +1 -0
  114. package/dist/neutral/model/PositionId.d.ts.map +1 -1
  115. package/dist/neutral/model/RangeMultipliers.d.ts +4 -0
  116. package/dist/neutral/model/RangeMultipliers.d.ts.map +1 -1
  117. package/dist/neutral/model/RewardShare.d.ts +1 -0
  118. package/dist/neutral/model/RewardShare.d.ts.map +1 -1
  119. package/dist/neutral/model/RewardsRangeOptions.d.ts +1 -0
  120. package/dist/neutral/model/RewardsRangeOptions.d.ts.map +1 -1
  121. package/dist/neutral/model/Sequence.d.ts +6 -0
  122. package/dist/neutral/model/Sequence.d.ts.map +1 -1
  123. package/dist/neutral/model/Stake.d.ts +3 -0
  124. package/dist/neutral/model/Stake.d.ts.map +1 -1
  125. package/dist/neutral/model/StakeShare.d.ts +1 -0
  126. package/dist/neutral/model/StakeShare.d.ts.map +1 -1
  127. package/dist/neutral/model/TimeDomain.d.ts +1 -0
  128. package/dist/neutral/model/TimeDomain.d.ts.map +1 -1
  129. package/dist/neutral/model/TransferPair.d.ts +1 -0
  130. package/dist/neutral/model/TransferPair.d.ts.map +1 -1
  131. package/dist/neutral/model/addresses.d.ts +5 -0
  132. package/dist/neutral/model/addresses.d.ts.map +1 -1
  133. package/dist/neutral/model/defaultRewardRatio.d.ts +1 -0
  134. package/dist/neutral/model/defaultRewardRatio.d.ts.map +1 -1
  135. package/dist/neutral/model/defaultTransactionFees.d.ts +1 -0
  136. package/dist/neutral/model/defaultTransactionFees.d.ts.map +1 -1
  137. package/dist/neutral/model/minTransactionFees.d.ts +1 -0
  138. package/dist/neutral/model/minTransactionFees.d.ts.map +1 -1
  139. package/dist/neutral/model/rewards.d.ts +7 -0
  140. package/dist/neutral/model/rewards.d.ts.map +1 -1
  141. package/dist/neutral/model/version.d.ts +5 -0
  142. package/dist/neutral/model/version.d.ts.map +1 -1
  143. package/dist/neutral/network/NetworkId.d.ts +2 -0
  144. package/dist/neutral/network/NetworkId.d.ts.map +1 -1
  145. package/dist/neutral/network/Status.d.ts +7 -0
  146. package/dist/neutral/network/Status.d.ts.map +1 -1
  147. package/dist/neutral/payload/StepIdentityPayload.d.ts +5 -0
  148. package/dist/neutral/payload/StepIdentityPayload.d.ts.map +1 -1
  149. package/dist/neutral/payload/elevatable/Bridge/BridgeDestinationObservation.d.ts +5 -0
  150. package/dist/neutral/payload/elevatable/Bridge/BridgeDestinationObservation.d.ts.map +1 -1
  151. package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts +6 -0
  152. package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts.map +1 -1
  153. package/dist/neutral/payload/elevatable/Bridge/BridgeSourceObservation.d.ts +5 -0
  154. package/dist/neutral/payload/elevatable/Bridge/BridgeSourceObservation.d.ts.map +1 -1
  155. package/dist/neutral/payload/elevatable/ChainStakeIntent.d.ts +8 -0
  156. package/dist/neutral/payload/elevatable/ChainStakeIntent.d.ts.map +1 -1
  157. package/dist/neutral/payload/elevatable/Executable.d.ts +7 -0
  158. package/dist/neutral/payload/elevatable/Executable.d.ts.map +1 -1
  159. package/dist/neutral/payload/elevatable/Hash.d.ts +7 -0
  160. package/dist/neutral/payload/elevatable/Hash.d.ts.map +1 -1
  161. package/dist/neutral/payload/elevatable/StepComplete.d.ts +5 -0
  162. package/dist/neutral/payload/elevatable/StepComplete.d.ts.map +1 -1
  163. package/dist/neutral/payload/elevatable/Time.d.ts +13 -0
  164. package/dist/neutral/payload/elevatable/Time.d.ts.map +1 -1
  165. package/dist/neutral/permissions/InvokerPermission.d.ts +2 -0
  166. package/dist/neutral/permissions/InvokerPermission.d.ts.map +1 -1
  167. package/dist/neutral/permissions/XyoPermissions.d.ts +1 -0
  168. package/dist/neutral/permissions/XyoPermissions.d.ts.map +1 -1
  169. package/dist/neutral/provider/Provider.d.ts +1 -0
  170. package/dist/neutral/provider/Provider.d.ts.map +1 -1
  171. package/dist/neutral/provider/ProviderMoniker.d.ts +4 -0
  172. package/dist/neutral/provider/ProviderMoniker.d.ts.map +1 -1
  173. package/dist/neutral/providers/DataLake/Provider.d.ts +2 -0
  174. package/dist/neutral/providers/DataLake/Provider.d.ts.map +1 -1
  175. package/dist/neutral/providers/DataLake/Runner.d.ts +4 -0
  176. package/dist/neutral/providers/DataLake/Runner.d.ts.map +1 -1
  177. package/dist/neutral/providers/DataLake/Viewer.d.ts +4 -0
  178. package/dist/neutral/providers/DataLake/Viewer.d.ts.map +1 -1
  179. package/dist/neutral/providers/TransactionHelper.d.ts +1 -0
  180. package/dist/neutral/providers/TransactionHelper.d.ts.map +1 -1
  181. package/dist/neutral/providers/XyoClient.d.ts +1 -0
  182. package/dist/neutral/providers/XyoClient.d.ts.map +1 -1
  183. package/dist/neutral/providers/XyoConnection.d.ts +3 -0
  184. package/dist/neutral/providers/XyoConnection.d.ts.map +1 -1
  185. package/dist/neutral/providers/XyoGateway.d.ts +5 -0
  186. package/dist/neutral/providers/XyoGateway.d.ts.map +1 -1
  187. package/dist/neutral/providers/XyoGatewayRunner.d.ts +6 -0
  188. package/dist/neutral/providers/XyoGatewayRunner.d.ts.map +1 -1
  189. package/dist/neutral/providers/XyoNetwork.d.ts +1 -0
  190. package/dist/neutral/providers/XyoNetwork.d.ts.map +1 -1
  191. package/dist/neutral/providers/XyoRunner.d.ts +4 -0
  192. package/dist/neutral/providers/XyoRunner.d.ts.map +1 -1
  193. package/dist/neutral/providers/signer/XyoSigner.d.ts +5 -0
  194. package/dist/neutral/providers/signer/XyoSigner.d.ts.map +1 -1
  195. package/dist/neutral/repository/Repository.d.ts +7 -0
  196. package/dist/neutral/repository/Repository.d.ts.map +1 -1
  197. package/dist/neutral/repository/TransactionReadRepository.d.ts +1 -0
  198. package/dist/neutral/repository/TransactionReadRepository.d.ts.map +1 -1
  199. package/dist/neutral/repository/TransactionRepository.d.ts +3 -0
  200. package/dist/neutral/repository/TransactionRepository.d.ts.map +1 -1
  201. package/dist/neutral/repository/TransactionRepositoryIterator.d.ts +1 -0
  202. package/dist/neutral/repository/TransactionRepositoryIterator.d.ts.map +1 -1
  203. package/dist/neutral/repository/TransactionWriteRepository.d.ts +1 -0
  204. package/dist/neutral/repository/TransactionWriteRepository.d.ts.map +1 -1
  205. package/dist/neutral/runners/Block.d.ts +4 -0
  206. package/dist/neutral/runners/Block.d.ts.map +1 -1
  207. package/dist/neutral/runners/Finalization.d.ts +4 -0
  208. package/dist/neutral/runners/Finalization.d.ts.map +1 -1
  209. package/dist/neutral/runners/Mempool.d.ts +6 -0
  210. package/dist/neutral/runners/Mempool.d.ts.map +1 -1
  211. package/dist/neutral/transaction/TransactionBoundWitness.d.ts +53 -0
  212. package/dist/neutral/transaction/TransactionBoundWitness.d.ts.map +1 -1
  213. package/dist/neutral/transaction/TransactionFees.d.ts +18 -1
  214. package/dist/neutral/transaction/TransactionFees.d.ts.map +1 -1
  215. package/dist/neutral/transaction/TransactionGasCosts.d.ts +1 -0
  216. package/dist/neutral/transaction/TransactionGasCosts.d.ts.map +1 -1
  217. package/dist/neutral/validation/block/BlockValidationFunction.d.ts +1 -0
  218. package/dist/neutral/validation/block/BlockValidationFunction.d.ts.map +1 -1
  219. package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts +2 -0
  220. package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
  221. package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts +1 -0
  222. package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
  223. package/dist/neutral/validation/block/error.d.ts +6 -0
  224. package/dist/neutral/validation/block/error.d.ts.map +1 -1
  225. package/dist/neutral/validation/boundwitness/BoundWitnessValidationFunction.d.ts +1 -0
  226. package/dist/neutral/validation/boundwitness/BoundWitnessValidationFunction.d.ts.map +1 -1
  227. package/dist/neutral/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts +2 -0
  228. package/dist/neutral/validation/boundwitness/HydratedBoundWitnessValidationFunction.d.ts.map +1 -1
  229. package/dist/neutral/validation/boundwitness/error.d.ts +4 -0
  230. package/dist/neutral/validation/boundwitness/error.d.ts.map +1 -1
  231. package/dist/neutral/validation/error.d.ts +2 -0
  232. package/dist/neutral/validation/error.d.ts.map +1 -1
  233. package/dist/neutral/validation/payload/InBlockPayloadValidationFunction.d.ts +2 -0
  234. package/dist/neutral/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
  235. package/dist/neutral/validation/payload/error.d.ts +2 -0
  236. package/dist/neutral/validation/payload/error.d.ts.map +1 -1
  237. package/dist/neutral/validation/transaction/HydratedTransactionStateValidationFunction.d.ts +1 -0
  238. package/dist/neutral/validation/transaction/HydratedTransactionStateValidationFunction.d.ts.map +1 -1
  239. package/dist/neutral/validation/transaction/HydratedTransactionValidationFunction.d.ts +1 -0
  240. package/dist/neutral/validation/transaction/HydratedTransactionValidationFunction.d.ts.map +1 -1
  241. package/dist/neutral/validation/transaction/error.d.ts +2 -0
  242. package/dist/neutral/validation/transaction/error.d.ts.map +1 -1
  243. package/dist/neutral/viewers/Block.d.ts +4 -0
  244. package/dist/neutral/viewers/Block.d.ts.map +1 -1
  245. package/dist/neutral/viewers/BlockInvalidation.d.ts +10 -0
  246. package/dist/neutral/viewers/BlockInvalidation.d.ts.map +1 -1
  247. package/dist/neutral/viewers/BlockReward.d.ts +4 -0
  248. package/dist/neutral/viewers/BlockReward.d.ts.map +1 -1
  249. package/dist/neutral/viewers/BlockValidation.d.ts +10 -0
  250. package/dist/neutral/viewers/BlockValidation.d.ts.map +1 -1
  251. package/dist/neutral/viewers/ChainContract.d.ts +4 -0
  252. package/dist/neutral/viewers/ChainContract.d.ts.map +1 -1
  253. package/dist/neutral/viewers/ChainStakeViewer.d.ts +3 -0
  254. package/dist/neutral/viewers/ChainStakeViewer.d.ts.map +1 -1
  255. package/dist/neutral/viewers/Finalization.d.ts +4 -0
  256. package/dist/neutral/viewers/Finalization.d.ts.map +1 -1
  257. package/dist/neutral/viewers/Fork.d.ts +2 -0
  258. package/dist/neutral/viewers/Fork.d.ts.map +1 -1
  259. package/dist/neutral/viewers/Mempool.d.ts +8 -0
  260. package/dist/neutral/viewers/Mempool.d.ts.map +1 -1
  261. package/dist/neutral/viewers/NetworkStake/NetworkStakeViewer.d.ts +4 -0
  262. package/dist/neutral/viewers/NetworkStake/NetworkStakeViewer.d.ts.map +1 -1
  263. package/dist/neutral/viewers/NetworkStake/Rewards/ByPositionViewer.d.ts +4 -0
  264. package/dist/neutral/viewers/NetworkStake/Rewards/ByPositionViewer.d.ts.map +1 -1
  265. package/dist/neutral/viewers/NetworkStake/Rewards/ByStakerViewer.d.ts +4 -0
  266. package/dist/neutral/viewers/NetworkStake/Rewards/ByStakerViewer.d.ts.map +1 -1
  267. package/dist/neutral/viewers/NetworkStake/Rewards/ByStepViewer.d.ts +4 -0
  268. package/dist/neutral/viewers/NetworkStake/Rewards/ByStepViewer.d.ts.map +1 -1
  269. package/dist/neutral/viewers/NetworkStake/Rewards/Options.d.ts +4 -0
  270. package/dist/neutral/viewers/NetworkStake/Rewards/Options.d.ts.map +1 -1
  271. package/dist/neutral/viewers/NetworkStake/Rewards/TotalViewer.d.ts +4 -0
  272. package/dist/neutral/viewers/NetworkStake/Rewards/TotalViewer.d.ts.map +1 -1
  273. package/dist/neutral/viewers/NetworkStake/Rewards/Viewer.d.ts +4 -0
  274. package/dist/neutral/viewers/NetworkStake/Rewards/Viewer.d.ts.map +1 -1
  275. package/dist/neutral/viewers/NetworkStake/Rewards/templates/ByIndexMethodsTemplate.d.ts +1 -0
  276. package/dist/neutral/viewers/NetworkStake/Rewards/templates/ByIndexMethodsTemplate.d.ts.map +1 -1
  277. package/dist/neutral/viewers/NetworkStake/Rewards/templates/MethodsTemplate.d.ts +1 -0
  278. package/dist/neutral/viewers/NetworkStake/Rewards/templates/MethodsTemplate.d.ts.map +1 -1
  279. package/dist/neutral/viewers/NetworkStakeStepReward.d.ts +7 -0
  280. package/dist/neutral/viewers/NetworkStakeStepReward.d.ts.map +1 -1
  281. package/dist/neutral/viewers/Stake.d.ts +8 -0
  282. package/dist/neutral/viewers/Stake.d.ts.map +1 -1
  283. package/dist/neutral/viewers/StakeEvents.d.ts +11 -0
  284. package/dist/neutral/viewers/StakeEvents.d.ts.map +1 -1
  285. package/dist/neutral/viewers/StakeIntent.d.ts +4 -0
  286. package/dist/neutral/viewers/StakeIntent.d.ts.map +1 -1
  287. package/dist/neutral/viewers/StakeTotals.d.ts +4 -0
  288. package/dist/neutral/viewers/StakeTotals.d.ts.map +1 -1
  289. package/dist/neutral/viewers/StepStake.d.ts +3 -0
  290. package/dist/neutral/viewers/StepStake.d.ts.map +1 -1
  291. package/dist/neutral/viewers/StepViewer.d.ts +7 -0
  292. package/dist/neutral/viewers/StepViewer.d.ts.map +1 -1
  293. package/dist/neutral/viewers/TimeSync.d.ts +4 -0
  294. package/dist/neutral/viewers/TimeSync.d.ts.map +1 -1
  295. package/dist/neutral/viewers/Transaction.d.ts +4 -0
  296. package/dist/neutral/viewers/Transaction.d.ts.map +1 -1
  297. package/dist/neutral/viewers/TransactionInvalidation.d.ts +10 -0
  298. package/dist/neutral/viewers/TransactionInvalidation.d.ts.map +1 -1
  299. package/dist/neutral/viewers/TransactionValidation.d.ts +10 -0
  300. package/dist/neutral/viewers/TransactionValidation.d.ts.map +1 -1
  301. package/dist/neutral/viewers/TransferBalance.d.ts +6 -0
  302. package/dist/neutral/viewers/TransferBalance.d.ts.map +1 -1
  303. package/dist/neutral/viewers/WindowedBlock.d.ts +4 -0
  304. package/dist/neutral/viewers/WindowedBlock.d.ts.map +1 -1
  305. package/dist/neutral/viewers/XyoViewer.d.ts +6 -0
  306. package/dist/neutral/viewers/XyoViewer.d.ts.map +1 -1
  307. package/dist/neutral/xl1/AttoXL1.d.ts +6 -0
  308. package/dist/neutral/xl1/AttoXL1.d.ts.map +1 -1
  309. package/dist/neutral/xl1/FemtoXL1.d.ts +6 -0
  310. package/dist/neutral/xl1/FemtoXL1.d.ts.map +1 -1
  311. package/dist/neutral/xl1/MicroXL1.d.ts +6 -0
  312. package/dist/neutral/xl1/MicroXL1.d.ts.map +1 -1
  313. package/dist/neutral/xl1/MilliXL1.d.ts +6 -0
  314. package/dist/neutral/xl1/MilliXL1.d.ts.map +1 -1
  315. package/dist/neutral/xl1/NanoXL1.d.ts +6 -0
  316. package/dist/neutral/xl1/NanoXL1.d.ts.map +1 -1
  317. package/dist/neutral/xl1/PicoXL1.d.ts +6 -0
  318. package/dist/neutral/xl1/PicoXL1.d.ts.map +1 -1
  319. package/dist/neutral/xl1/XL1.d.ts +6 -0
  320. package/dist/neutral/xl1/XL1.d.ts.map +1 -1
  321. package/dist/neutral/xl1/XL1Units.d.ts +1 -0
  322. package/dist/neutral/xl1/XL1Units.d.ts.map +1 -1
  323. package/dist/neutral/xl1/isXL1Factory.d.ts +5 -0
  324. package/dist/neutral/xl1/isXL1Factory.d.ts.map +1 -1
  325. package/dist/neutral/xl1/xl1MaxValue.d.ts +1 -0
  326. package/dist/neutral/xl1/xl1MaxValue.d.ts.map +1 -1
  327. package/package.json +6 -6
  328. package/src/BlockNumber/BlockNumber.ts +7 -0
  329. package/src/BlockNumber/EthBlockNumber.ts +7 -0
  330. package/src/BlockNumber/Numberish.ts +2 -0
  331. package/src/BlockNumber/XL1BlockNumber.ts +7 -0
  332. package/src/Initializable.ts +2 -1
  333. package/src/OpenTelemetryProviders.ts +1 -0
  334. package/src/RecordKeyType.ts +4 -1
  335. package/src/Step/StepHash.ts +2 -1
  336. package/src/Step/StepIdentity.ts +4 -1
  337. package/src/Step/StepSizes.ts +5 -0
  338. package/src/TransferPayload.ts +7 -0
  339. package/src/amount/ShiftedBigIntConfig.ts +1 -0
  340. package/src/amount/XL1AmountInstance.ts +19 -0
  341. package/src/amount/index.ts +2 -4
  342. package/src/block/AllowedBlockPayload.ts +7 -0
  343. package/src/block/BlockBoundWitness.ts +17 -2
  344. package/src/block/HydratedBlock.ts +37 -0
  345. package/src/block/signed/SignedBlockBoundWitness.ts +5 -0
  346. package/src/block/signed/SignedBlockBoundWitnessWithHashMeta.ts +7 -0
  347. package/src/block/signed/SignedBlockBoundWitnessWithStorageMeta.ts +7 -0
  348. package/src/block/unsigned/UnsignedBlockBoundWitness.ts +5 -0
  349. package/src/chain/Chain.ts +1 -0
  350. package/src/chain/ChainAnalyzer.ts +1 -0
  351. package/src/chain/ChainId.ts +1 -0
  352. package/src/fields/Addressable.ts +1 -0
  353. package/src/fields/BlockDuration.ts +2 -0
  354. package/src/fields/BlockNumber.ts +5 -0
  355. package/src/map/AsyncMap.ts +6 -0
  356. package/src/map/MapType.ts +7 -0
  357. package/src/map/SyncMap.ts +6 -0
  358. package/src/model/AccountBalance.ts +12 -0
  359. package/src/model/ArrayBuffer.ts +2 -0
  360. package/src/model/BlockRange/BlockRange.ts +11 -0
  361. package/src/model/BlockRange/EthBlockRange.ts +11 -0
  362. package/src/model/BlockRange/Numberish.ts +1 -0
  363. package/src/model/BlockRange/Range.ts +5 -0
  364. package/src/model/BlockRange/XL1BlockRange.ts +11 -0
  365. package/src/model/BlockRate.ts +27 -0
  366. package/src/model/ChainQualification.ts +15 -0
  367. package/src/model/Context/BaseContext.ts +1 -0
  368. package/src/model/Context/BaseContext.zod.ts +7 -0
  369. package/src/model/Context/BlockContext.ts +3 -0
  370. package/src/model/Context/BlockContext.zod.ts +3 -0
  371. package/src/model/Context/CachingContext.ts +1 -0
  372. package/src/model/Context/CachingContext.zod.ts +1 -0
  373. package/src/model/Context/ChainContext.ts +3 -0
  374. package/src/model/Context/ChainContext.zod.ts +3 -0
  375. package/src/model/Context/HeadContext.ts +1 -0
  376. package/src/model/Context/HeadContext.zod.ts +2 -0
  377. package/src/model/GatewayName.ts +1 -0
  378. package/src/model/HydratedTransaction.ts +45 -0
  379. package/src/model/OpCodes.ts +1 -0
  380. package/src/model/PayloadMap.ts +3 -0
  381. package/src/model/Permission.ts +6 -0
  382. package/src/model/Position.ts +1 -0
  383. package/src/model/PositionId.ts +1 -0
  384. package/src/model/RangeMultipliers.ts +4 -0
  385. package/src/model/RewardShare.ts +1 -0
  386. package/src/model/RewardsRangeOptions.ts +1 -0
  387. package/src/model/Sequence.ts +6 -0
  388. package/src/model/Stake.ts +3 -0
  389. package/src/model/StakeShare.ts +1 -0
  390. package/src/model/TimeDomain.ts +1 -0
  391. package/src/model/TransferPair.ts +1 -0
  392. package/src/model/addresses.ts +5 -0
  393. package/src/model/defaultRewardRatio.ts +1 -0
  394. package/src/model/defaultTransactionFees.ts +1 -0
  395. package/src/model/minTransactionFees.ts +1 -0
  396. package/src/model/rewards.ts +7 -0
  397. package/src/model/version.ts +5 -0
  398. package/src/network/NetworkId.ts +2 -0
  399. package/src/network/Status.ts +7 -0
  400. package/src/payload/StepIdentityPayload.ts +5 -0
  401. package/src/payload/elevatable/Bridge/BridgeDestinationObservation.ts +5 -0
  402. package/src/payload/elevatable/Bridge/BridgeIntent.ts +6 -0
  403. package/src/payload/elevatable/Bridge/BridgeSourceObservation.ts +5 -0
  404. package/src/payload/elevatable/ChainStakeIntent.ts +8 -0
  405. package/src/payload/elevatable/Executable.ts +7 -0
  406. package/src/payload/elevatable/Hash.ts +7 -0
  407. package/src/payload/elevatable/StepComplete.ts +5 -0
  408. package/src/payload/elevatable/Time.ts +13 -0
  409. package/src/permissions/InvokerPermission.ts +2 -0
  410. package/src/permissions/XyoPermissions.ts +1 -0
  411. package/src/provider/Provider.ts +1 -0
  412. package/src/provider/ProviderMoniker.ts +4 -0
  413. package/src/providers/DataLake/Provider.ts +2 -0
  414. package/src/providers/DataLake/Runner.ts +4 -0
  415. package/src/providers/DataLake/Viewer.ts +4 -0
  416. package/src/providers/TransactionHelper.ts +1 -0
  417. package/src/providers/XyoClient.ts +1 -0
  418. package/src/providers/XyoConnection.ts +3 -0
  419. package/src/providers/XyoGateway.ts +5 -0
  420. package/src/providers/XyoGatewayRunner.ts +6 -0
  421. package/src/providers/XyoNetwork.ts +1 -0
  422. package/src/providers/XyoRunner.ts +4 -0
  423. package/src/providers/signer/XyoSigner.ts +5 -0
  424. package/src/repository/Repository.ts +7 -0
  425. package/src/repository/TransactionReadRepository.ts +1 -0
  426. package/src/repository/TransactionRepository.ts +3 -0
  427. package/src/repository/TransactionRepositoryIterator.ts +1 -0
  428. package/src/repository/TransactionWriteRepository.ts +1 -0
  429. package/src/runners/Block.ts +4 -0
  430. package/src/runners/Finalization.ts +4 -0
  431. package/src/runners/Mempool.ts +6 -0
  432. package/src/transaction/TransactionBoundWitness.ts +53 -0
  433. package/src/transaction/TransactionFees.ts +20 -2
  434. package/src/transaction/TransactionGasCosts.ts +1 -0
  435. package/src/validation/block/BlockValidationFunction.ts +1 -0
  436. package/src/validation/block/HydratedBlockStateValidationFunction.ts +2 -0
  437. package/src/validation/block/HydratedBlockValidationFunction.ts +1 -0
  438. package/src/validation/block/error.ts +6 -0
  439. package/src/validation/boundwitness/BoundWitnessValidationFunction.ts +1 -0
  440. package/src/validation/boundwitness/HydratedBoundWitnessValidationFunction.ts +2 -0
  441. package/src/validation/boundwitness/error.ts +4 -0
  442. package/src/validation/error.ts +2 -0
  443. package/src/validation/payload/InBlockPayloadValidationFunction.ts +2 -0
  444. package/src/validation/payload/error.ts +2 -0
  445. package/src/validation/transaction/HydratedTransactionStateValidationFunction.ts +1 -0
  446. package/src/validation/transaction/HydratedTransactionValidationFunction.ts +1 -0
  447. package/src/validation/transaction/error.ts +2 -0
  448. package/src/viewers/Block.ts +4 -0
  449. package/src/viewers/BlockInvalidation.ts +10 -0
  450. package/src/viewers/BlockReward.ts +4 -0
  451. package/src/viewers/BlockValidation.ts +10 -0
  452. package/src/viewers/ChainContract.ts +4 -0
  453. package/src/viewers/ChainStakeViewer.ts +3 -0
  454. package/src/viewers/Finalization.ts +4 -0
  455. package/src/viewers/Fork.ts +2 -0
  456. package/src/viewers/Mempool.ts +8 -0
  457. package/src/viewers/NetworkStake/NetworkStakeViewer.ts +4 -0
  458. package/src/viewers/NetworkStake/Rewards/ByPositionViewer.ts +4 -0
  459. package/src/viewers/NetworkStake/Rewards/ByStakerViewer.ts +4 -0
  460. package/src/viewers/NetworkStake/Rewards/ByStepViewer.ts +4 -0
  461. package/src/viewers/NetworkStake/Rewards/Options.ts +4 -0
  462. package/src/viewers/NetworkStake/Rewards/TotalViewer.ts +4 -0
  463. package/src/viewers/NetworkStake/Rewards/Viewer.ts +4 -0
  464. package/src/viewers/NetworkStake/Rewards/templates/ByIndexMethodsTemplate.ts +1 -0
  465. package/src/viewers/NetworkStake/Rewards/templates/MethodsTemplate.ts +1 -0
  466. package/src/viewers/NetworkStakeStepReward.ts +7 -0
  467. package/src/viewers/Stake.ts +8 -0
  468. package/src/viewers/StakeEvents.ts +11 -0
  469. package/src/viewers/StakeIntent.ts +4 -0
  470. package/src/viewers/StakeTotals.ts +4 -0
  471. package/src/viewers/StepStake.ts +3 -0
  472. package/src/viewers/StepViewer.ts +7 -0
  473. package/src/viewers/TimeSync.ts +4 -0
  474. package/src/viewers/Transaction.ts +4 -0
  475. package/src/viewers/TransactionInvalidation.ts +10 -0
  476. package/src/viewers/TransactionValidation.ts +10 -0
  477. package/src/viewers/TransferBalance.ts +6 -0
  478. package/src/viewers/WindowedBlock.ts +4 -0
  479. package/src/viewers/XyoViewer.ts +6 -0
  480. package/src/xl1/AttoXL1.ts +6 -0
  481. package/src/xl1/FemtoXL1.ts +6 -0
  482. package/src/xl1/MicroXL1.ts +6 -0
  483. package/src/xl1/MilliXL1.ts +6 -0
  484. package/src/xl1/NanoXL1.ts +6 -0
  485. package/src/xl1/PicoXL1.ts +6 -0
  486. package/src/xl1/XL1.ts +6 -0
  487. package/src/xl1/XL1Units.ts +1 -0
  488. package/src/xl1/isXL1Factory.ts +5 -0
  489. package/src/xl1/xl1MaxValue.ts +1 -0
  490. package/dist/neutral/amount/ShiftedBigInt.d.ts +0 -16
  491. package/dist/neutral/amount/ShiftedBigInt.d.ts.map +0 -1
  492. package/dist/neutral/amount/XL1Amount.d.ts +0 -37
  493. package/dist/neutral/amount/XL1Amount.d.ts.map +0 -1
  494. package/dist/neutral/amount/splitOnDecimal.d.ts +0 -2
  495. package/dist/neutral/amount/splitOnDecimal.d.ts.map +0 -1
  496. package/dist/neutral/amount/splitOnDecimalToString.d.ts +0 -2
  497. package/dist/neutral/amount/splitOnDecimalToString.d.ts.map +0 -1
  498. package/src/amount/ShiftedBigInt.ts +0 -71
  499. package/src/amount/XL1Amount.ts +0 -124
  500. package/src/amount/splitOnDecimal.ts +0 -5
  501. package/src/amount/splitOnDecimalToString.ts +0 -39
@@ -6,13 +6,17 @@ import type { BlockViewerMethods } from './Block.ts'
6
6
 
7
7
  type ExtendableBlockViewerMethods = Omit<BlockViewerMethods, 'rate' | 'stepSizeRate' | 'timeDurationRate'>
8
8
 
9
+ /** WindowedBlockViewerMethods interface. */
9
10
  export interface WindowedBlockViewerMethods extends ExtendableBlockViewerMethods {
10
11
  blocksByTransactionHashes(hashes: Hash[]): Promisable<HydratedBlockWithHashMeta[]>
11
12
  }
12
13
 
14
+ /** Moniker identifier for the WindowedBlockViewer provider. */
13
15
  export const WindowedBlockViewerMoniker = 'WindowedBlockViewer' as const
16
+ /** Type literal for the WindowedBlockViewer provider moniker. */
14
17
  export type WindowedBlockViewerMoniker = typeof WindowedBlockViewerMoniker
15
18
 
19
+ /** Viewer interface for reading WindowedBlock data. */
16
20
  export interface WindowedBlockViewer<TMoniker extends ProviderMoniker = WindowedBlockViewerMoniker> extends WindowedBlockViewerMethods, Provider<TMoniker> {
17
21
  blockByTransactionHash(hash: Hash): Promisable<HydratedBlockWithHashMeta | null>
18
22
  }
@@ -16,6 +16,7 @@ import type { StepViewer } from './StepViewer.ts'
16
16
  import type { TimeSyncViewer } from './TimeSync.ts'
17
17
  import type { TransactionViewer, TransactionViewerMethods } from './Transaction.ts'
18
18
 
19
+ /** XyoViewerMethods interface. */
19
20
  export interface XyoViewerMethods extends
20
21
  NetworkStakeStepRewardViewerMethods, BlockViewerMethods,
21
22
  Omit<TransactionViewerMethods, 'byHash'>, Omit<
@@ -28,13 +29,17 @@ export interface XyoViewerMethods extends
28
29
  accountBalanceHistory(address: Address, config?: ChainQualifiedConfig): Promisable<AccountBalanceHistoryItem[]>
29
30
  }
30
31
 
32
+ /** XyoViewerMethodsV2 interface. */
31
33
  export interface XyoViewerMethodsV2 {
32
34
 
33
35
  }
34
36
 
37
+ /** Moniker identifier for the XyoViewer provider. */
35
38
  export const XyoViewerMoniker = 'XyoViewer' as const
39
+ /** Type literal for the XyoViewer provider moniker. */
36
40
  export type XyoViewerMoniker = typeof XyoViewerMoniker
37
41
 
42
+ /** Viewer interface for reading Xyo data. */
38
43
  export interface XyoViewer extends Omit<BlockViewer, 'moniker'>, XyoViewerMethods,
39
44
  Omit<
40
45
  StakeViewerMethods, 'moniker' | 'minWithdrawalBlocks' | 'rewardsContract' | 'stakingTokenAddress' | 'active'
@@ -53,6 +58,7 @@ export interface XyoViewer extends Omit<BlockViewer, 'moniker'>, XyoViewerMethod
53
58
  transaction: TransactionViewer
54
59
  }
55
60
 
61
+ /** XyoViewerV2 interface. */
56
62
  export interface XyoViewerV2 extends XyoViewerMethodsV2, Provider<XyoViewerMoniker> {
57
63
  account: {
58
64
  balance: AccountBalanceViewer
@@ -4,10 +4,16 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** Maximum value for the AttoXL1 branded type. */
7
8
  export const AttoXL1MaxValue = xl1MaxValue(XL1Places.atto)
9
+ /** AttoXL1 type. */
8
10
  export type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' }
11
+ /** Type guard that checks if a value is a valid AttoXL1. */
9
12
  export const isAttoXL1 = isXL1Factory<AttoXL1>(XL1Places.atto)
13
+ /** Converts a value to AttoXL1, throwing if invalid. */
10
14
  export const asAttoXL1 = asXL1Factory<AttoXL1>(XL1Places.atto)
15
+ /** Converts a bigint value to AttoXL1 without validation. */
11
16
  export const toAttoXL1 = toXL1Factory<AttoXL1>(XL1Places.atto)
12
17
 
18
+ /** Shorthand alias for asAttoXL1. */
13
19
  export const AttoXL1 = asAttoXL1
@@ -4,11 +4,17 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** Maximum value for the FemtoXL1 branded type. */
7
8
  export const FemtoXL1MaxValue = xl1MaxValue(XL1Places.femto)
9
+ /** FemtoXL1 type. */
8
10
  export type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' }
11
+ /** Type guard that checks if a value is a valid FemtoXL1. */
9
12
  export const isFemtoXL1 = isXL1Factory<FemtoXL1>(XL1Places.femto)
13
+ /** Converts a value to FemtoXL1, throwing if invalid. */
10
14
  export const asFemtoXL1 = asXL1Factory<FemtoXL1>(XL1Places.femto)
11
15
 
16
+ /** Converts a bigint value to FemtoXL1 without validation. */
12
17
  export const toFemtoXL1 = toXL1Factory<FemtoXL1>(XL1Places.femto)
13
18
 
19
+ /** Shorthand alias for asFemtoXL1. */
14
20
  export const FemtoXL1 = asFemtoXL1
@@ -4,11 +4,17 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** Maximum value for the MicroXL1 branded type. */
7
8
  export const MicroXL1MaxValue = xl1MaxValue(XL1Places.micro)
9
+ /** MicroXL1 type. */
8
10
  export type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' }
11
+ /** Type guard that checks if a value is a valid MicroXL1. */
9
12
  export const isMicroXL1 = isXL1Factory<MicroXL1>(XL1Places.micro)
13
+ /** Converts a value to MicroXL1, throwing if invalid. */
10
14
  export const asMicroXL1 = asXL1Factory<MicroXL1>(XL1Places.micro)
11
15
 
16
+ /** Converts a bigint value to MicroXL1 without validation. */
12
17
  export const toMicroXL1 = toXL1Factory<MicroXL1>(XL1Places.micro)
13
18
 
19
+ /** Shorthand alias for asMicroXL1. */
14
20
  export const MicroXL1 = asMicroXL1
@@ -4,11 +4,17 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** Maximum value for the MilliXL1 branded type. */
7
8
  export const MilliXL1MaxValue = xl1MaxValue(XL1Places.milli)
9
+ /** MilliXL1 type. */
8
10
  export type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' }
11
+ /** Type guard that checks if a value is a valid MilliXL1. */
9
12
  export const isMilliXL1 = isXL1Factory<MilliXL1>(XL1Places.milli)
13
+ /** Converts a value to MilliXL1, throwing if invalid. */
10
14
  export const asMilliXL1 = asXL1Factory<MilliXL1>(XL1Places.milli)
11
15
 
16
+ /** Converts a bigint value to MilliXL1 without validation. */
12
17
  export const toMilliXL1 = toXL1Factory<MilliXL1>(XL1Places.milli)
13
18
 
19
+ /** Shorthand alias for asMilliXL1. */
14
20
  export const MilliXL1 = asMilliXL1
@@ -4,11 +4,17 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** Maximum value for the NanoXL1 branded type. */
7
8
  export const NanoXL1MaxValue = xl1MaxValue(XL1Places.nano)
9
+ /** NanoXL1 type. */
8
10
  export type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' }
11
+ /** Type guard that checks if a value is a valid NanoXL1. */
9
12
  export const isNanoXL1 = isXL1Factory<NanoXL1>(XL1Places.nano)
13
+ /** Converts a value to NanoXL1, throwing if invalid. */
10
14
  export const asNanoXL1 = asXL1Factory<NanoXL1>(XL1Places.nano)
11
15
 
16
+ /** Converts a bigint value to NanoXL1 without validation. */
12
17
  export const toNanoXL1 = toXL1Factory<NanoXL1>(XL1Places.nano)
13
18
 
19
+ /** Shorthand alias for asNanoXL1. */
14
20
  export const NanoXL1 = asNanoXL1
@@ -4,11 +4,17 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** PicoXL1MaxValue constant. */
7
8
  export const PicoXL1MaxValue = xl1MaxValue(XL1Places.pico)
9
+ /** PicoXL1 type. */
8
10
  export type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' }
11
+ /** Type guard that checks if a value is a valid PicoXL1. */
9
12
  export const isPicoXL1 = isXL1Factory<PicoXL1>(XL1Places.pico)
13
+ /** Converts a value to PicoXL1, throwing if invalid. */
10
14
  export const asPicoXL1 = asXL1Factory<PicoXL1>(XL1Places.pico)
11
15
 
16
+ /** toPicoXL1 constant. */
12
17
  export const toPicoXL1 = toXL1Factory<PicoXL1>(XL1Places.pico)
13
18
 
19
+ /** PicoXL1 constant. */
14
20
  export const PicoXL1 = asPicoXL1
package/src/xl1/XL1.ts CHANGED
@@ -4,11 +4,17 @@ import {
4
4
  import { xl1MaxValue } from './xl1MaxValue.ts'
5
5
  import { XL1Places } from './XL1Units.ts'
6
6
 
7
+ /** XL1MaxValue constant. */
7
8
  export const XL1MaxValue = xl1MaxValue(XL1Places.xl1)
9
+ /** XL1 type. */
8
10
  export type XL1 = bigint & { readonly _tag: 'XL1' }
11
+ /** Type guard that checks if a value is a valid XL1. */
9
12
  export const isXL1 = isXL1Factory<XL1>(XL1Places.xl1)
13
+ /** Converts a value to XL1, throwing if invalid. */
10
14
  export const asXL1 = asXL1Factory<XL1>(XL1Places.xl1)
11
15
 
16
+ /** toXL1 constant. */
12
17
  export const toXL1 = toXL1Factory<XL1>(XL1Places.xl1)
13
18
 
19
+ /** XL1 constant. */
14
20
  export const XL1 = asXL1
@@ -1,5 +1,6 @@
1
1
  type XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'
2
2
 
3
+ /** Decimal place definitions for each XL1 currency unit (atto=18, femto=15, etc.). */
3
4
  export const XL1Places: Record<XL1Units, bigint> = {
4
5
  xl1: 18n,
5
6
  milli: 15n,
@@ -2,11 +2,13 @@ import { z } from 'zod'
2
2
 
3
3
  import { xl1MaxValue } from './xl1MaxValue.ts'
4
4
 
5
+ /** Type guard that checks if a value is a valid XL1Factory. */
5
6
  export const isXL1Factory = <T extends bigint>(places: bigint) => (val: unknown): val is T => {
6
7
  if (typeof val !== 'bigint') return false
7
8
  return val >= 0n && val <= xl1MaxValue(places)
8
9
  }
9
10
 
11
+ /** Creates a Zod schema factory for XL1 branded bigint types. */
10
12
  export const XL1ZodFactory = <T extends bigint>(places: bigint, name: string) => {
11
13
  const is = isXL1Factory<T>(places)
12
14
  const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`
@@ -19,6 +21,7 @@ export const XL1ZodFactory = <T extends bigint>(places: bigint, name: string) =>
19
21
  )
20
22
  }
21
23
 
24
+ /** Creates a Zod transform factory that converts values between XL1 unit types. */
22
25
  export const XL1TransformZodFactory = <T extends bigint>(places: bigint, name: string) => {
23
26
  const is = isXL1Factory<T>(places)
24
27
  const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`
@@ -31,6 +34,7 @@ export const XL1TransformZodFactory = <T extends bigint>(places: bigint, name: s
31
34
  )
32
35
  }
33
36
 
37
+ /** Converts a value to XL1Factory, throwing if invalid. */
34
38
  export const asXL1Factory = <T extends bigint>(places: bigint) => {
35
39
  const zod = XL1ZodFactory<T>(places, 'local')
36
40
  return (val: unknown): T => {
@@ -42,6 +46,7 @@ export const asXL1Factory = <T extends bigint>(places: bigint) => {
42
46
  }
43
47
  }
44
48
 
49
+ /** Creates a factory function that converts bigint values to a specific XL1 branded type. */
45
50
  export const toXL1Factory = <T extends bigint>(places: bigint) => {
46
51
  const zod = XL1TransformZodFactory<T>(places, 'local')
47
52
  return (val: unknown): T | undefined => {
@@ -1 +1,2 @@
1
+ /** Computes the maximum value for an XL1 unit given its decimal places. */
1
2
  export const xl1MaxValue = (places: bigint) => 10n ** (32n - places) - 1n
@@ -1,16 +0,0 @@
1
- import type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts';
2
- export declare class ShiftedBigInt {
3
- static readonly defaultConfig: ShiftedBigIntConfig;
4
- config: ShiftedBigIntConfig;
5
- value: bigint;
6
- constructor(value: bigint | ShiftedBigInt, config?: Partial<ShiftedBigIntConfig>);
7
- get locale(): Intl.LocalesArgument;
8
- get maxCharacters(): number;
9
- get maxDecimal(): number;
10
- get minDecimals(): number;
11
- get places(): number;
12
- toFullString(): string;
13
- toShortString(): string;
14
- toString(): string;
15
- }
16
- //# sourceMappingURL=ShiftedBigInt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShiftedBigInt.d.ts","sourceRoot":"","sources":["../../../src/amount/ShiftedBigInt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAGnE,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAMjD;IAED,MAAM,EAAE,mBAAmB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;gBAGX,KAAK,EAAE,MAAM,GAAG,aAAa,EAC7B,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAQ3C,IAAI,MAAM,IAAI,IAAI,CAAC,eAAe,CAEjC;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,MAAM;IAWtB,aAAa,IAAI,MAAM;IAWvB,QAAQ,IAAI,MAAM;CAGnB"}
@@ -1,37 +0,0 @@
1
- import { AttoXL1, FemtoXL1, MicroXL1, MilliXL1, NanoXL1, PicoXL1, XL1 } from '../xl1/index.ts';
2
- import type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts';
3
- export interface XL1AmountInstance {
4
- value: AttoXL1;
5
- to(places: bigint | number): bigint;
6
- milli: MilliXL1;
7
- micro: MicroXL1;
8
- nano: NanoXL1;
9
- pico: PicoXL1;
10
- femto: FemtoXL1;
11
- atto: AttoXL1;
12
- xl1: XL1;
13
- toString(places: number, config: Partial<ShiftedBigIntConfig>): string;
14
- }
15
- export declare class XL1Amount implements XL1AmountInstance {
16
- value: AttoXL1;
17
- private locale;
18
- constructor(value: bigint, locale?: Intl.LocalesArgument);
19
- static from(value: bigint, places?: bigint): XL1Amount;
20
- static fromMilli(value: MilliXL1): XL1Amount;
21
- static fromMicro(value: MicroXL1): XL1Amount;
22
- static fromNano(value: NanoXL1): XL1Amount;
23
- static fromPico(value: PicoXL1): XL1Amount;
24
- static fromFemto(value: FemtoXL1): XL1Amount;
25
- static fromAtto(value: AttoXL1): XL1Amount;
26
- static fromXL1(value: XL1): XL1Amount;
27
- to(places?: number | bigint): bigint;
28
- get milli(): MilliXL1;
29
- get micro(): MicroXL1;
30
- get nano(): NanoXL1;
31
- get pico(): PicoXL1;
32
- get femto(): FemtoXL1;
33
- get atto(): AttoXL1;
34
- get xl1(): XL1;
35
- toString(places?: number, config?: Partial<ShiftedBigIntConfig>): string;
36
- }
37
- //# sourceMappingURL=XL1Amount.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XL1Amount.d.ts","sourceRoot":"","sources":["../../../src/amount/XL1Amount.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAE7D,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAKnE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAA;IAEd,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IAEnC,KAAK,EAAE,QAAQ,CAAA;IAEf,KAAK,EAAE,QAAQ,CAAA;IAEf,IAAI,EAAE,OAAO,CAAA;IAEb,IAAI,EAAE,OAAO,CAAA;IAEb,KAAK,EAAE,QAAQ,CAAA;IAEf,IAAI,EAAE,OAAO,CAAA;IAEb,GAAG,EAAE,GAAG,CAAA;IAER,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAA;CACvE;AAED,qBAAa,SAAU,YAAW,iBAAiB;IACjD,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,CAAC,MAAM,CAAsB;gBAExB,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,IAAI,CAAC,eAAyB;IAKjE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAuB;IAK1D,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ;IAIhC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ;IAIhC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO;IAI9B,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO;IAI9B,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ;IAIhC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO;IAI9B,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;IAIzB,EAAE,CAAC,MAAM,GAAE,MAAM,GAAG,MAAuB;IAI3C,IAAI,KAAK,aAER;IAED,IAAI,KAAK,aAER;IAED,IAAI,IAAI,YAEP;IAED,IAAI,IAAI,YAEP;IAED,IAAI,KAAK,aAER;IAED,IAAI,IAAI,YAEP;IAED,IAAI,GAAG,QAEN;IAED,QAAQ,CAAC,MAAM,GAAE,MAA+B,EAAE,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAAG,MAAM;CAcrG"}
@@ -1,2 +0,0 @@
1
- export declare const splitOnDecimal: (value: bigint, places?: number) => [bigint, bigint];
2
- //# sourceMappingURL=splitOnDecimal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitOnDecimal.d.ts","sourceRoot":"","sources":["../../../src/amount/splitOnDecimal.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,eAAW,KAAG,CAAC,MAAM,EAAE,MAAM,CAI1E,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const splitOnDecimalToString: (value: bigint, places?: number, maxDecimal?: number, maxCharacters?: number, minDecimals?: number, locale?: Intl.LocalesArgument) => string;
2
- //# sourceMappingURL=splitOnDecimalToString.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitOnDecimalToString.d.ts","sourceRoot":"","sources":["../../../src/amount/splitOnDecimalToString.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,GACjC,OAAO,MAAM,EACb,eAAW,EACX,mBAAmB,EACnB,sBAAiB,EACjB,oBAAe,EACf,SAAQ,IAAI,CAAC,eAAyB,KACrC,MA6BF,CAAA"}
@@ -1,71 +0,0 @@
1
- import type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts'
2
- import { splitOnDecimalToString } from './splitOnDecimalToString.ts'
3
-
4
- export class ShiftedBigInt {
5
- static readonly defaultConfig: ShiftedBigIntConfig = {
6
- places: 18,
7
- maxDecimal: 18,
8
- maxCharacters: 9,
9
- minDecimals: 1,
10
- locale: 'en-US',
11
- }
12
-
13
- config: ShiftedBigIntConfig
14
- value: bigint
15
-
16
- constructor(
17
- value: bigint | ShiftedBigInt,
18
- config: Partial<ShiftedBigIntConfig> = {},
19
- ) {
20
- this.value = typeof value === 'bigint' ? value : value.value
21
- this.config = {
22
- ...ShiftedBigInt.defaultConfig, ...(typeof value === 'bigint' ? {} : value.config), ...config,
23
- }
24
- }
25
-
26
- get locale(): Intl.LocalesArgument {
27
- return this.config.locale ?? 'en-US'
28
- }
29
-
30
- get maxCharacters(): number {
31
- return this.config.maxCharacters ?? 9
32
- }
33
-
34
- get maxDecimal(): number {
35
- return this.config.maxDecimal ?? this.places
36
- }
37
-
38
- get minDecimals(): number {
39
- return this.config.minDecimals ?? 1
40
- }
41
-
42
- get places(): number {
43
- return this.config.places ?? 18
44
- }
45
-
46
- toFullString(): string {
47
- return splitOnDecimalToString(
48
- this.value,
49
- this.places,
50
- this.places,
51
- Infinity,
52
- this.places,
53
- this.locale,
54
- )
55
- }
56
-
57
- toShortString(): string {
58
- return splitOnDecimalToString(
59
- this.value,
60
- this.places,
61
- this.maxDecimal,
62
- this.maxCharacters,
63
- this.minDecimals,
64
- this.locale,
65
- )
66
- }
67
-
68
- toString(): string {
69
- return this.toFullString()
70
- }
71
- }
@@ -1,124 +0,0 @@
1
- /* eslint-disable @typescript-eslint/member-ordering */
2
- import { assertEx } from '@xylabs/sdk-js'
3
-
4
- import {
5
- AttoXL1, FemtoXL1, MicroXL1, MilliXL1, NanoXL1, PicoXL1, XL1,
6
- XL1Places,
7
- } from '../xl1/index.ts'
8
- import { ShiftedBigInt } from './ShiftedBigInt.ts'
9
- import type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts'
10
-
11
- const MAX_XL1_AMOUNT = 2n ** 256n - 1n
12
- const allowedPlaces = Object.values(XL1Places)
13
-
14
- export interface XL1AmountInstance {
15
- value: AttoXL1
16
-
17
- to(places: bigint | number): bigint
18
-
19
- milli: MilliXL1
20
-
21
- micro: MicroXL1
22
-
23
- nano: NanoXL1
24
-
25
- pico: PicoXL1
26
-
27
- femto: FemtoXL1
28
-
29
- atto: AttoXL1
30
-
31
- xl1: XL1
32
-
33
- toString(places: number, config: Partial<ShiftedBigIntConfig>): string
34
- }
35
-
36
- export class XL1Amount implements XL1AmountInstance {
37
- value: AttoXL1
38
- private locale: Intl.LocalesArgument
39
-
40
- constructor(value: bigint, locale: Intl.LocalesArgument = 'en-US') {
41
- this.locale = locale
42
- this.value = AttoXL1(value > MAX_XL1_AMOUNT ? MAX_XL1_AMOUNT : value < 0n ? 0n : value)
43
- }
44
-
45
- static from(value: bigint, places: bigint = XL1Places.atto) {
46
- assertEx(allowedPlaces.includes(places), () => `Invalid conversion places (${places} not in ${allowedPlaces})`)
47
- return new XL1Amount(value * 10n ** BigInt(places))
48
- }
49
-
50
- static fromMilli(value: MilliXL1) {
51
- return this.from(value, XL1Places.milli)
52
- }
53
-
54
- static fromMicro(value: MicroXL1) {
55
- return this.from(value, XL1Places.micro)
56
- }
57
-
58
- static fromNano(value: NanoXL1) {
59
- return this.from(value, XL1Places.nano)
60
- }
61
-
62
- static fromPico(value: PicoXL1) {
63
- return this.from(value, XL1Places.pico)
64
- }
65
-
66
- static fromFemto(value: FemtoXL1) {
67
- return this.from(value, XL1Places.femto)
68
- }
69
-
70
- static fromAtto(value: AttoXL1) {
71
- return this.from(value, XL1Places.atto)
72
- }
73
-
74
- static fromXL1(value: XL1) {
75
- return this.from(value, XL1Places.xl1)
76
- }
77
-
78
- to(places: number | bigint = XL1Places.atto) {
79
- return this.value / 10n ** BigInt(places)
80
- }
81
-
82
- get milli() {
83
- return MilliXL1(this.to(XL1Places.milli))
84
- }
85
-
86
- get micro() {
87
- return MicroXL1(this.to(XL1Places.micro))
88
- }
89
-
90
- get nano() {
91
- return NanoXL1(this.to(XL1Places.nano))
92
- }
93
-
94
- get pico() {
95
- return PicoXL1(this.to(XL1Places.pico))
96
- }
97
-
98
- get femto() {
99
- return FemtoXL1(this.to(XL1Places.femto))
100
- }
101
-
102
- get atto() {
103
- return AttoXL1(this.to(XL1Places.atto))
104
- }
105
-
106
- get xl1() {
107
- return XL1(this.to(XL1Places.xl1))
108
- }
109
-
110
- toString(places: number = Number(XL1Places.atto), config: Partial<ShiftedBigIntConfig> = {}): string {
111
- assertEx(allowedPlaces.includes(BigInt(places)), () => `Invalid conversion places (${places} not in ${allowedPlaces})`)
112
- return new ShiftedBigInt(
113
- this.value,
114
- {
115
- places,
116
- locale: this.locale,
117
- maxDecimal: places,
118
- minDecimals: 0,
119
- maxCharacters: places,
120
- ...config,
121
- },
122
- ).toShortString()
123
- }
124
- }
@@ -1,5 +0,0 @@
1
- export const splitOnDecimal = (value: bigint, places = 18): [bigint, bigint] => {
2
- const whole = value / BigInt(10 ** places)
3
- const decimal = value % BigInt(10 ** places)
4
- return [whole, decimal]
5
- }
@@ -1,39 +0,0 @@
1
- import { splitOnDecimal } from './splitOnDecimal.ts'
2
-
3
- export const splitOnDecimalToString = (
4
- value: bigint,
5
- places = 18,
6
- maxDecimal = places,
7
- maxCharacters = 9,
8
- minDecimals = 1,
9
- locale: Intl.LocalesArgument = 'en-US',
10
- ): string => {
11
- const [whole, decimal] = splitOnDecimal(value, places)
12
- const remainderLength = decimal.toString().length
13
- const precedingZerosInDecimal = places - remainderLength
14
- if (whole === 0n && precedingZerosInDecimal >= maxDecimal && decimal !== 0n) return '< 0.'.padEnd(maxDecimal + 5, '0') + '1'
15
-
16
- const wholeCharacters = whole.toString(10).length
17
- const calcMaxDecimalCharacters = maxCharacters === -1 ? places : wholeCharacters > maxCharacters ? 0 : maxCharacters - wholeCharacters
18
- const maxDecimalCharacters = Math.min(maxDecimal, calcMaxDecimalCharacters)
19
-
20
- // Format whole number with thousand separators according to locale
21
- const formattedWhole = new Intl.NumberFormat(locale, {
22
- maximumFractionDigits: 0,
23
- useGrouping: true,
24
- }).format(whole)
25
-
26
- // Get decimal separator for the locale
27
- const decimalSeparator = new Intl.NumberFormat(locale)
28
- .formatToParts(1.1)
29
- .find(part => part.type === 'decimal')?.value ?? '.'
30
-
31
- // Pad decimal part to correct number of places
32
- let paddedDecimal = decimal.toString().padStart(places, '0').slice(0, maxDecimalCharacters)
33
- // remove unneeded trailing zeros (honoring minDecimals)
34
- while (paddedDecimal.length > minDecimals && paddedDecimal.endsWith('0')) {
35
- paddedDecimal = paddedDecimal.slice(0, -1)
36
- }
37
-
38
- return `${formattedWhole}${paddedDecimal.length > 0 ? decimalSeparator : ''}${paddedDecimal}`
39
- }