@paimaexample/wallets 0.3.117

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 (700) hide show
  1. package/README.md +1 -0
  2. package/esm/chain-types/src/hash.d.ts +28 -0
  3. package/esm/chain-types/src/hash.d.ts.map +1 -0
  4. package/esm/chain-types/src/hash.js +29 -0
  5. package/esm/chain-types/src/mod.d.ts +3 -0
  6. package/esm/chain-types/src/mod.d.ts.map +1 -0
  7. package/esm/chain-types/src/mod.js +2 -0
  8. package/esm/chain-types/src/types.d.ts +70 -0
  9. package/esm/chain-types/src/types.d.ts.map +1 -0
  10. package/esm/chain-types/src/types.js +1 -0
  11. package/esm/concise/src/batcher.d.ts +40 -0
  12. package/esm/concise/src/batcher.d.ts.map +1 -0
  13. package/esm/concise/src/batcher.js +117 -0
  14. package/esm/concise/src/delegate.d.ts +18 -0
  15. package/esm/concise/src/delegate.d.ts.map +1 -0
  16. package/esm/concise/src/delegate.js +118 -0
  17. package/esm/concise/src/mod.d.ts +5 -0
  18. package/esm/concise/src/mod.d.ts.map +1 -0
  19. package/esm/concise/src/mod.js +3 -0
  20. package/esm/concise/src/v2/builtins/batcher.d.ts +27 -0
  21. package/esm/concise/src/v2/builtins/batcher.d.ts.map +1 -0
  22. package/esm/concise/src/v2/builtins/batcher.js +51 -0
  23. package/esm/concise/src/v2/builtins/grammar.d.ts +25 -0
  24. package/esm/concise/src/v2/builtins/grammar.d.ts.map +1 -0
  25. package/esm/concise/src/v2/builtins/grammar.js +40 -0
  26. package/esm/concise/src/v2/builtins/index.d.ts +3 -0
  27. package/esm/concise/src/v2/builtins/index.d.ts.map +1 -0
  28. package/esm/concise/src/v2/builtins/index.js +3 -0
  29. package/esm/concise/src/v2/grammar.d.ts +8 -0
  30. package/esm/concise/src/v2/grammar.d.ts.map +1 -0
  31. package/esm/concise/src/v2/grammar.js +19 -0
  32. package/esm/concise/src/v2/inputs.d.ts +7 -0
  33. package/esm/concise/src/v2/inputs.d.ts.map +1 -0
  34. package/esm/concise/src/v2/inputs.js +37 -0
  35. package/esm/concise/src/v2/mod.d.ts +5 -0
  36. package/esm/concise/src/v2/mod.d.ts.map +1 -0
  37. package/esm/concise/src/v2/mod.js +4 -0
  38. package/esm/concise/src/v2/types.d.ts +23 -0
  39. package/esm/concise/src/v2/types.d.ts.map +1 -0
  40. package/esm/concise/src/v2/types.js +1 -0
  41. package/esm/config/src/config/builder.d.ts +33 -0
  42. package/esm/config/src/config/builder.d.ts.map +1 -0
  43. package/esm/config/src/config/builder.js +82 -0
  44. package/esm/config/src/config/configCheck.d.ts +32 -0
  45. package/esm/config/src/config/configCheck.d.ts.map +1 -0
  46. package/esm/config/src/config/configCheck.js +67 -0
  47. package/esm/config/src/config/context.d.ts +23 -0
  48. package/esm/config/src/config/context.d.ts.map +1 -0
  49. package/esm/config/src/config/context.js +25 -0
  50. package/esm/config/src/config/mod.d.ts +7 -0
  51. package/esm/config/src/config/mod.d.ts.map +1 -0
  52. package/esm/config/src/config/mod.js +4 -0
  53. package/esm/config/src/config/parts/deployedAddresses.d.ts +17 -0
  54. package/esm/config/src/config/parts/deployedAddresses.d.ts.map +1 -0
  55. package/esm/config/src/config/parts/deployedAddresses.js +24 -0
  56. package/esm/config/src/config/parts/network.d.ts +19 -0
  57. package/esm/config/src/config/parts/network.d.ts.map +1 -0
  58. package/esm/config/src/config/parts/network.js +29 -0
  59. package/esm/config/src/config/parts/primitive.d.ts +31 -0
  60. package/esm/config/src/config/parts/primitive.d.ts.map +1 -0
  61. package/esm/config/src/config/parts/primitive.js +28 -0
  62. package/esm/config/src/config/parts/securityNamespace.d.ts +14 -0
  63. package/esm/config/src/config/parts/securityNamespace.d.ts.map +1 -0
  64. package/esm/config/src/config/parts/securityNamespace.js +26 -0
  65. package/esm/config/src/config/parts/syncProtocols.d.ts +43 -0
  66. package/esm/config/src/config/parts/syncProtocols.d.ts.map +1 -0
  67. package/esm/config/src/config/parts/syncProtocols.js +66 -0
  68. package/esm/config/src/config/utils.d.ts +40 -0
  69. package/esm/config/src/config/utils.d.ts.map +1 -0
  70. package/esm/config/src/config/utils.js +55 -0
  71. package/esm/config/src/mod.d.ts +3 -0
  72. package/esm/config/src/mod.d.ts.map +1 -0
  73. package/esm/config/src/mod.js +2 -0
  74. package/esm/config/src/schema/common.d.ts +26 -0
  75. package/esm/config/src/schema/common.d.ts.map +1 -0
  76. package/esm/config/src/schema/common.js +51 -0
  77. package/esm/config/src/schema/mod.d.ts +7 -0
  78. package/esm/config/src/schema/mod.d.ts.map +1 -0
  79. package/esm/config/src/schema/mod.js +6 -0
  80. package/esm/config/src/schema/namespace.d.ts +39 -0
  81. package/esm/config/src/schema/namespace.d.ts.map +1 -0
  82. package/esm/config/src/schema/namespace.js +34 -0
  83. package/esm/config/src/schema/network/algorand.d.ts +12 -0
  84. package/esm/config/src/schema/network/algorand.d.ts.map +1 -0
  85. package/esm/config/src/schema/network/algorand.js +23 -0
  86. package/esm/config/src/schema/network/all.d.ts +175 -0
  87. package/esm/config/src/schema/network/all.d.ts.map +1 -0
  88. package/esm/config/src/schema/network/all.js +24 -0
  89. package/esm/config/src/schema/network/bitcoin.d.ts +19 -0
  90. package/esm/config/src/schema/network/bitcoin.d.ts.map +1 -0
  91. package/esm/config/src/schema/network/bitcoin.js +21 -0
  92. package/esm/config/src/schema/network/cardano.d.ts +12 -0
  93. package/esm/config/src/schema/network/cardano.d.ts.map +1 -0
  94. package/esm/config/src/schema/network/cardano.js +27 -0
  95. package/esm/config/src/schema/network/evm.d.ts +68 -0
  96. package/esm/config/src/schema/network/evm.d.ts.map +1 -0
  97. package/esm/config/src/schema/network/evm.js +70 -0
  98. package/esm/config/src/schema/network/mina.d.ts +14 -0
  99. package/esm/config/src/schema/network/mina.d.ts.map +1 -0
  100. package/esm/config/src/schema/network/mina.js +25 -0
  101. package/esm/config/src/schema/network/mod.d.ts +9 -0
  102. package/esm/config/src/schema/network/mod.d.ts.map +1 -0
  103. package/esm/config/src/schema/network/mod.js +8 -0
  104. package/esm/config/src/schema/network/ntp.d.ts +32 -0
  105. package/esm/config/src/schema/network/ntp.d.ts.map +1 -0
  106. package/esm/config/src/schema/network/ntp.js +39 -0
  107. package/esm/config/src/schema/network/substrate/avail.d.ts +14 -0
  108. package/esm/config/src/schema/network/substrate/avail.d.ts.map +1 -0
  109. package/esm/config/src/schema/network/substrate/avail.js +26 -0
  110. package/esm/config/src/schema/network/substrate/common.d.ts +18 -0
  111. package/esm/config/src/schema/network/substrate/common.d.ts.map +1 -0
  112. package/esm/config/src/schema/network/substrate/common.js +32 -0
  113. package/esm/config/src/schema/network/substrate/midnight.d.ts +20 -0
  114. package/esm/config/src/schema/network/substrate/midnight.d.ts.map +1 -0
  115. package/esm/config/src/schema/network/substrate/midnight.js +32 -0
  116. package/esm/config/src/schema/network/substrate/mod.d.ts +4 -0
  117. package/esm/config/src/schema/network/substrate/mod.d.ts.map +1 -0
  118. package/esm/config/src/schema/network/substrate/mod.js +3 -0
  119. package/esm/config/src/schema/network/types.d.ts +13 -0
  120. package/esm/config/src/schema/network/types.d.ts.map +1 -0
  121. package/esm/config/src/schema/network/types.js +13 -0
  122. package/esm/config/src/schema/network/utils.d.ts +5 -0
  123. package/esm/config/src/schema/network/utils.d.ts.map +1 -0
  124. package/esm/config/src/schema/network/utils.js +73 -0
  125. package/esm/config/src/schema/primitive/mod.d.ts +2 -0
  126. package/esm/config/src/schema/primitive/mod.d.ts.map +1 -0
  127. package/esm/config/src/schema/primitive/mod.js +1 -0
  128. package/esm/config/src/schema/primitive/types.d.ts +58 -0
  129. package/esm/config/src/schema/primitive/types.d.ts.map +1 -0
  130. package/esm/config/src/schema/primitive/types.js +1 -0
  131. package/esm/config/src/schema/sync-protocols/all.d.ts +583 -0
  132. package/esm/config/src/schema/sync-protocols/all.d.ts.map +1 -0
  133. package/esm/config/src/schema/sync-protocols/all.js +55 -0
  134. package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts +76 -0
  135. package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts.map +1 -0
  136. package/esm/config/src/schema/sync-protocols/avail/rpc.js +56 -0
  137. package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +76 -0
  138. package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +1 -0
  139. package/esm/config/src/schema/sync-protocols/bitcoin/rpc.js +47 -0
  140. package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts +80 -0
  141. package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts.map +1 -0
  142. package/esm/config/src/schema/sync-protocols/cardano/carp.js +62 -0
  143. package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts +2 -0
  144. package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts.map +1 -0
  145. package/esm/config/src/schema/sync-protocols/cardano/mod.js +1 -0
  146. package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +56 -0
  147. package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +1 -0
  148. package/esm/config/src/schema/sync-protocols/cardano/utxorpc.js +56 -0
  149. package/esm/config/src/schema/sync-protocols/common.d.ts +60 -0
  150. package/esm/config/src/schema/sync-protocols/common.d.ts.map +1 -0
  151. package/esm/config/src/schema/sync-protocols/common.js +54 -0
  152. package/esm/config/src/schema/sync-protocols/decorators/all.d.ts +17 -0
  153. package/esm/config/src/schema/sync-protocols/decorators/all.d.ts.map +1 -0
  154. package/esm/config/src/schema/sync-protocols/decorators/all.js +8 -0
  155. package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts +8 -0
  156. package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +1 -0
  157. package/esm/config/src/schema/sync-protocols/decorators/emulated.js +12 -0
  158. package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts +4 -0
  159. package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts.map +1 -0
  160. package/esm/config/src/schema/sync-protocols/decorators/mod.js +3 -0
  161. package/esm/config/src/schema/sync-protocols/decorators/types.d.ts +4 -0
  162. package/esm/config/src/schema/sync-protocols/decorators/types.d.ts.map +1 -0
  163. package/esm/config/src/schema/sync-protocols/decorators/types.js +4 -0
  164. package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts +68 -0
  165. package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts.map +1 -0
  166. package/esm/config/src/schema/sync-protocols/evm/rpc.js +44 -0
  167. package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts +66 -0
  168. package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +1 -0
  169. package/esm/config/src/schema/sync-protocols/midnight/graphql.js +50 -0
  170. package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts +73 -0
  171. package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts.map +1 -0
  172. package/esm/config/src/schema/sync-protocols/mina/graphql.js +59 -0
  173. package/esm/config/src/schema/sync-protocols/mod.d.ts +10 -0
  174. package/esm/config/src/schema/sync-protocols/mod.d.ts.map +1 -0
  175. package/esm/config/src/schema/sync-protocols/mod.js +9 -0
  176. package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts +45 -0
  177. package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +1 -0
  178. package/esm/config/src/schema/sync-protocols/ntp/rpc.js +33 -0
  179. package/esm/config/src/schema/sync-protocols/types.d.ts +125 -0
  180. package/esm/config/src/schema/sync-protocols/types.d.ts.map +1 -0
  181. package/esm/config/src/schema/sync-protocols/types.js +22 -0
  182. package/esm/config/src/schema/utils.d.ts +53 -0
  183. package/esm/config/src/schema/utils.d.ts.map +1 -0
  184. package/esm/config/src/schema/utils.js +58 -0
  185. package/esm/events/src/app-events.d.ts +65 -0
  186. package/esm/events/src/app-events.d.ts.map +1 -0
  187. package/esm/events/src/app-events.js +51 -0
  188. package/esm/events/src/asyncapi.d.ts +1173 -0
  189. package/esm/events/src/asyncapi.d.ts.map +1 -0
  190. package/esm/events/src/asyncapi.js +7 -0
  191. package/esm/events/src/builtin-event-utils.d.ts +5 -0
  192. package/esm/events/src/builtin-event-utils.d.ts.map +1 -0
  193. package/esm/events/src/builtin-event-utils.js +58 -0
  194. package/esm/events/src/builtin-events.d.ts +106 -0
  195. package/esm/events/src/builtin-events.d.ts.map +1 -0
  196. package/esm/events/src/builtin-events.js +198 -0
  197. package/esm/events/src/event-connect.d.ts +15 -0
  198. package/esm/events/src/event-connect.d.ts.map +1 -0
  199. package/esm/events/src/event-connect.js +75 -0
  200. package/esm/events/src/event-manager.d.ts +54 -0
  201. package/esm/events/src/event-manager.d.ts.map +1 -0
  202. package/esm/events/src/event-manager.js +129 -0
  203. package/esm/events/src/evm.d.ts +6 -0
  204. package/esm/events/src/evm.d.ts.map +1 -0
  205. package/esm/events/src/evm.js +55 -0
  206. package/esm/events/src/mod.d.ts +10 -0
  207. package/esm/events/src/mod.d.ts.map +1 -0
  208. package/esm/events/src/mod.js +9 -0
  209. package/esm/events/src/types.d.ts +255 -0
  210. package/esm/events/src/types.d.ts.map +1 -0
  211. package/esm/events/src/types.js +103 -0
  212. package/esm/events/src/utils.d.ts +16 -0
  213. package/esm/events/src/utils.d.ts.map +1 -0
  214. package/esm/events/src/utils.js +93 -0
  215. package/esm/package.json +3 -0
  216. package/esm/utils/src/binary-search.d.ts +7 -0
  217. package/esm/utils/src/binary-search.d.ts.map +1 -0
  218. package/esm/utils/src/binary-search.js +38 -0
  219. package/esm/utils/src/captcha.d.ts +9 -0
  220. package/esm/utils/src/captcha.d.ts.map +1 -0
  221. package/esm/utils/src/captcha.js +19 -0
  222. package/esm/utils/src/concurrency/condVar.d.ts +25 -0
  223. package/esm/utils/src/concurrency/condVar.d.ts.map +1 -0
  224. package/esm/utils/src/concurrency/condVar.js +39 -0
  225. package/esm/utils/src/concurrency/latch.d.ts +25 -0
  226. package/esm/utils/src/concurrency/latch.d.ts.map +1 -0
  227. package/esm/utils/src/concurrency/latch.js +51 -0
  228. package/esm/utils/src/concurrency/mod.d.ts +5 -0
  229. package/esm/utils/src/concurrency/mod.d.ts.map +1 -0
  230. package/esm/utils/src/concurrency/mod.js +4 -0
  231. package/esm/utils/src/concurrency/retry.d.ts +14 -0
  232. package/esm/utils/src/concurrency/retry.d.ts.map +1 -0
  233. package/esm/utils/src/concurrency/retry.js +26 -0
  234. package/esm/utils/src/concurrency/utils.d.ts +27 -0
  235. package/esm/utils/src/concurrency/utils.d.ts.map +1 -0
  236. package/esm/utils/src/concurrency/utils.js +27 -0
  237. package/esm/utils/src/constants.d.ts +4 -0
  238. package/esm/utils/src/constants.d.ts.map +1 -0
  239. package/esm/utils/src/constants.js +7 -0
  240. package/esm/utils/src/decorators/bound.d.ts +10 -0
  241. package/esm/utils/src/decorators/bound.d.ts.map +1 -0
  242. package/esm/utils/src/decorators/bound.js +17 -0
  243. package/esm/utils/src/decorators/mod.d.ts +2 -0
  244. package/esm/utils/src/decorators/mod.d.ts.map +1 -0
  245. package/esm/utils/src/decorators/mod.js +1 -0
  246. package/esm/utils/src/mod.d.ts +8 -0
  247. package/esm/utils/src/mod.d.ts.map +1 -0
  248. package/esm/utils/src/mod.js +7 -0
  249. package/esm/utils/src/types/json-query.d.ts +30 -0
  250. package/esm/utils/src/types/json-query.d.ts.map +1 -0
  251. package/esm/utils/src/types/json-query.js +1 -0
  252. package/esm/utils/src/types/misc.d.ts +109 -0
  253. package/esm/utils/src/types/misc.d.ts.map +1 -0
  254. package/esm/utils/src/types/misc.js +2 -0
  255. package/esm/utils/src/types/mod.d.ts +7 -0
  256. package/esm/utils/src/types/mod.d.ts.map +1 -0
  257. package/esm/utils/src/types/mod.js +3 -0
  258. package/esm/utils/src/types/nominal.d.ts +87 -0
  259. package/esm/utils/src/types/nominal.d.ts.map +1 -0
  260. package/esm/utils/src/types/nominal.js +1 -0
  261. package/esm/utils/src/types/typebox-helpers.d.ts +183 -0
  262. package/esm/utils/src/types/typebox-helpers.d.ts.map +1 -0
  263. package/esm/utils/src/types/typebox-helpers.js +235 -0
  264. package/esm/utils/src/types/utils.d.ts +37 -0
  265. package/esm/utils/src/types/utils.d.ts.map +1 -0
  266. package/esm/utils/src/types/utils.js +46 -0
  267. package/esm/utils/src/types/validators/algorand.d.ts +31 -0
  268. package/esm/utils/src/types/validators/algorand.d.ts.map +1 -0
  269. package/esm/utils/src/types/validators/algorand.js +90 -0
  270. package/esm/utils/src/types/validators/cardano.d.ts +26 -0
  271. package/esm/utils/src/types/validators/cardano.d.ts.map +1 -0
  272. package/esm/utils/src/types/validators/cardano.js +113 -0
  273. package/esm/utils/src/types/validators/mina.d.ts +15 -0
  274. package/esm/utils/src/types/validators/mina.d.ts.map +1 -0
  275. package/esm/utils/src/types/validators/mina.js +43 -0
  276. package/esm/utils/src/types/validators/minicbor.d.ts +98 -0
  277. package/esm/utils/src/types/validators/minicbor.d.ts.map +1 -0
  278. package/esm/utils/src/types/validators/minicbor.js +332 -0
  279. package/esm/utils/src/types/validators/mod.d.ts +3 -0
  280. package/esm/utils/src/types/validators/mod.d.ts.map +1 -0
  281. package/esm/utils/src/types/validators/mod.js +2 -0
  282. package/esm/utils/src/types/validators/utils.d.ts +6 -0
  283. package/esm/utils/src/types/validators/utils.d.ts.map +1 -0
  284. package/esm/utils/src/types/validators/utils.js +24 -0
  285. package/esm/utils/src/viem.d.ts +6 -0
  286. package/esm/utils/src/viem.d.ts.map +1 -0
  287. package/esm/utils/src/viem.js +15 -0
  288. package/esm/wallets/src/IProvider.d.ts +48 -0
  289. package/esm/wallets/src/IProvider.d.ts.map +1 -0
  290. package/esm/wallets/src/IProvider.js +7 -0
  291. package/esm/wallets/src/avail/avail.d.ts +28 -0
  292. package/esm/wallets/src/avail/avail.d.ts.map +1 -0
  293. package/esm/wallets/src/avail/avail.js +65 -0
  294. package/esm/wallets/src/avail/wrapper.d.ts +6 -0
  295. package/esm/wallets/src/avail/wrapper.d.ts.map +1 -0
  296. package/esm/wallets/src/avail/wrapper.js +31 -0
  297. package/esm/wallets/src/cardano/cardano.d.ts +30 -0
  298. package/esm/wallets/src/cardano/cardano.d.ts.map +1 -0
  299. package/esm/wallets/src/cardano/cardano.js +158 -0
  300. package/esm/wallets/src/cardano/wrapper.d.ts +7 -0
  301. package/esm/wallets/src/cardano/wrapper.d.ts.map +1 -0
  302. package/esm/wallets/src/cardano/wrapper.js +22 -0
  303. package/esm/wallets/src/evm/ethers.d.ts +28 -0
  304. package/esm/wallets/src/evm/ethers.d.ts.map +1 -0
  305. package/esm/wallets/src/evm/ethers.js +79 -0
  306. package/esm/wallets/src/evm/injected.d.ts +74 -0
  307. package/esm/wallets/src/evm/injected.d.ts.map +1 -0
  308. package/esm/wallets/src/evm/injected.js +322 -0
  309. package/esm/wallets/src/evm/types.d.ts +3 -0
  310. package/esm/wallets/src/evm/types.d.ts.map +1 -0
  311. package/esm/wallets/src/evm/types.js +1 -0
  312. package/esm/wallets/src/evm/wrapper-ethers.d.ts +6 -0
  313. package/esm/wallets/src/evm/wrapper-ethers.d.ts.map +1 -0
  314. package/esm/wallets/src/evm/wrapper-ethers.js +38 -0
  315. package/esm/wallets/src/evm/wrapper-injected.d.ts +7 -0
  316. package/esm/wallets/src/evm/wrapper-injected.d.ts.map +1 -0
  317. package/esm/wallets/src/evm/wrapper-injected.js +80 -0
  318. package/esm/wallets/src/midnight/midnight.d.ts +26 -0
  319. package/esm/wallets/src/midnight/midnight.d.ts.map +1 -0
  320. package/esm/wallets/src/midnight/midnight.js +112 -0
  321. package/esm/wallets/src/midnight/wrapper.d.ts +7 -0
  322. package/esm/wallets/src/midnight/wrapper.d.ts.map +1 -0
  323. package/esm/wallets/src/midnight/wrapper.js +22 -0
  324. package/esm/wallets/src/mina/mina.d.ts +28 -0
  325. package/esm/wallets/src/mina/mina.d.ts.map +1 -0
  326. package/esm/wallets/src/mina/mina.js +133 -0
  327. package/esm/wallets/src/mina/wrapper.d.ts +6 -0
  328. package/esm/wallets/src/mina/wrapper.d.ts.map +1 -0
  329. package/esm/wallets/src/mina/wrapper.js +12 -0
  330. package/esm/wallets/src/mod.d.ts +8 -0
  331. package/esm/wallets/src/mod.d.ts.map +1 -0
  332. package/esm/wallets/src/mod.js +5 -0
  333. package/esm/wallets/src/paima.d.ts +104 -0
  334. package/esm/wallets/src/paima.d.ts.map +1 -0
  335. package/esm/wallets/src/paima.js +244 -0
  336. package/esm/wallets/src/types.d.ts +49 -0
  337. package/esm/wallets/src/types.d.ts.map +1 -0
  338. package/esm/wallets/src/types.js +1 -0
  339. package/esm/wallets/src/utils.d.ts +41 -0
  340. package/esm/wallets/src/utils.d.ts.map +1 -0
  341. package/esm/wallets/src/utils.js +75 -0
  342. package/esm/wallets/src/wallet-modes.d.ts +49 -0
  343. package/esm/wallets/src/wallet-modes.d.ts.map +1 -0
  344. package/esm/wallets/src/wallet-modes.js +26 -0
  345. package/esm/wallets/src/wallets.d.ts +5 -0
  346. package/esm/wallets/src/wallets.d.ts.map +1 -0
  347. package/esm/wallets/src/wallets.js +55 -0
  348. package/esm/wallets/src/windows.d.ts +5 -0
  349. package/esm/wallets/src/windows.d.ts.map +1 -0
  350. package/esm/wallets/src/windows.js +9 -0
  351. package/package.json +51 -0
  352. package/script/chain-types/src/hash.d.ts +28 -0
  353. package/script/chain-types/src/hash.d.ts.map +1 -0
  354. package/script/chain-types/src/hash.js +36 -0
  355. package/script/chain-types/src/mod.d.ts +3 -0
  356. package/script/chain-types/src/mod.d.ts.map +1 -0
  357. package/script/chain-types/src/mod.js +18 -0
  358. package/script/chain-types/src/types.d.ts +70 -0
  359. package/script/chain-types/src/types.d.ts.map +1 -0
  360. package/script/chain-types/src/types.js +2 -0
  361. package/script/concise/src/batcher.d.ts +40 -0
  362. package/script/concise/src/batcher.d.ts.map +1 -0
  363. package/script/concise/src/batcher.js +122 -0
  364. package/script/concise/src/delegate.d.ts +18 -0
  365. package/script/concise/src/delegate.d.ts.map +1 -0
  366. package/script/concise/src/delegate.js +123 -0
  367. package/script/concise/src/mod.d.ts +5 -0
  368. package/script/concise/src/mod.d.ts.map +1 -0
  369. package/script/concise/src/mod.js +19 -0
  370. package/script/concise/src/v2/builtins/batcher.d.ts +27 -0
  371. package/script/concise/src/v2/builtins/batcher.d.ts.map +1 -0
  372. package/script/concise/src/v2/builtins/batcher.js +54 -0
  373. package/script/concise/src/v2/builtins/grammar.d.ts +25 -0
  374. package/script/concise/src/v2/builtins/grammar.d.ts.map +1 -0
  375. package/script/concise/src/v2/builtins/grammar.js +43 -0
  376. package/script/concise/src/v2/builtins/index.d.ts +3 -0
  377. package/script/concise/src/v2/builtins/index.d.ts.map +1 -0
  378. package/script/concise/src/v2/builtins/index.js +19 -0
  379. package/script/concise/src/v2/grammar.d.ts +8 -0
  380. package/script/concise/src/v2/grammar.d.ts.map +1 -0
  381. package/script/concise/src/v2/grammar.js +24 -0
  382. package/script/concise/src/v2/inputs.d.ts +7 -0
  383. package/script/concise/src/v2/inputs.d.ts.map +1 -0
  384. package/script/concise/src/v2/inputs.js +43 -0
  385. package/script/concise/src/v2/mod.d.ts +5 -0
  386. package/script/concise/src/v2/mod.d.ts.map +1 -0
  387. package/script/concise/src/v2/mod.js +20 -0
  388. package/script/concise/src/v2/types.d.ts +23 -0
  389. package/script/concise/src/v2/types.d.ts.map +1 -0
  390. package/script/concise/src/v2/types.js +2 -0
  391. package/script/config/src/config/builder.d.ts +33 -0
  392. package/script/config/src/config/builder.d.ts.map +1 -0
  393. package/script/config/src/config/builder.js +86 -0
  394. package/script/config/src/config/configCheck.d.ts +32 -0
  395. package/script/config/src/config/configCheck.d.ts.map +1 -0
  396. package/script/config/src/config/configCheck.js +70 -0
  397. package/script/config/src/config/context.d.ts +23 -0
  398. package/script/config/src/config/context.d.ts.map +1 -0
  399. package/script/config/src/config/context.js +31 -0
  400. package/script/config/src/config/mod.d.ts +7 -0
  401. package/script/config/src/config/mod.d.ts.map +1 -0
  402. package/script/config/src/config/mod.js +22 -0
  403. package/script/config/src/config/parts/deployedAddresses.d.ts +17 -0
  404. package/script/config/src/config/parts/deployedAddresses.d.ts.map +1 -0
  405. package/script/config/src/config/parts/deployedAddresses.js +28 -0
  406. package/script/config/src/config/parts/network.d.ts +19 -0
  407. package/script/config/src/config/parts/network.d.ts.map +1 -0
  408. package/script/config/src/config/parts/network.js +33 -0
  409. package/script/config/src/config/parts/primitive.d.ts +31 -0
  410. package/script/config/src/config/parts/primitive.d.ts.map +1 -0
  411. package/script/config/src/config/parts/primitive.js +32 -0
  412. package/script/config/src/config/parts/securityNamespace.d.ts +14 -0
  413. package/script/config/src/config/parts/securityNamespace.d.ts.map +1 -0
  414. package/script/config/src/config/parts/securityNamespace.js +30 -0
  415. package/script/config/src/config/parts/syncProtocols.d.ts +43 -0
  416. package/script/config/src/config/parts/syncProtocols.d.ts.map +1 -0
  417. package/script/config/src/config/parts/syncProtocols.js +70 -0
  418. package/script/config/src/config/utils.d.ts +40 -0
  419. package/script/config/src/config/utils.d.ts.map +1 -0
  420. package/script/config/src/config/utils.js +62 -0
  421. package/script/config/src/mod.d.ts +3 -0
  422. package/script/config/src/mod.d.ts.map +1 -0
  423. package/script/config/src/mod.js +18 -0
  424. package/script/config/src/schema/common.d.ts +26 -0
  425. package/script/config/src/schema/common.d.ts.map +1 -0
  426. package/script/config/src/schema/common.js +54 -0
  427. package/script/config/src/schema/mod.d.ts +7 -0
  428. package/script/config/src/schema/mod.d.ts.map +1 -0
  429. package/script/config/src/schema/mod.js +22 -0
  430. package/script/config/src/schema/namespace.d.ts +39 -0
  431. package/script/config/src/schema/namespace.d.ts.map +1 -0
  432. package/script/config/src/schema/namespace.js +38 -0
  433. package/script/config/src/schema/network/algorand.d.ts +12 -0
  434. package/script/config/src/schema/network/algorand.d.ts.map +1 -0
  435. package/script/config/src/schema/network/algorand.js +26 -0
  436. package/script/config/src/schema/network/all.d.ts +175 -0
  437. package/script/config/src/schema/network/all.d.ts.map +1 -0
  438. package/script/config/src/schema/network/all.js +28 -0
  439. package/script/config/src/schema/network/bitcoin.d.ts +19 -0
  440. package/script/config/src/schema/network/bitcoin.d.ts.map +1 -0
  441. package/script/config/src/schema/network/bitcoin.js +24 -0
  442. package/script/config/src/schema/network/cardano.d.ts +12 -0
  443. package/script/config/src/schema/network/cardano.d.ts.map +1 -0
  444. package/script/config/src/schema/network/cardano.js +30 -0
  445. package/script/config/src/schema/network/evm.d.ts +68 -0
  446. package/script/config/src/schema/network/evm.d.ts.map +1 -0
  447. package/script/config/src/schema/network/evm.js +75 -0
  448. package/script/config/src/schema/network/mina.d.ts +14 -0
  449. package/script/config/src/schema/network/mina.d.ts.map +1 -0
  450. package/script/config/src/schema/network/mina.js +28 -0
  451. package/script/config/src/schema/network/mod.d.ts +9 -0
  452. package/script/config/src/schema/network/mod.d.ts.map +1 -0
  453. package/script/config/src/schema/network/mod.js +24 -0
  454. package/script/config/src/schema/network/ntp.d.ts +32 -0
  455. package/script/config/src/schema/network/ntp.d.ts.map +1 -0
  456. package/script/config/src/schema/network/ntp.js +42 -0
  457. package/script/config/src/schema/network/substrate/avail.d.ts +14 -0
  458. package/script/config/src/schema/network/substrate/avail.d.ts.map +1 -0
  459. package/script/config/src/schema/network/substrate/avail.js +29 -0
  460. package/script/config/src/schema/network/substrate/common.d.ts +18 -0
  461. package/script/config/src/schema/network/substrate/common.d.ts.map +1 -0
  462. package/script/config/src/schema/network/substrate/common.js +35 -0
  463. package/script/config/src/schema/network/substrate/midnight.d.ts +20 -0
  464. package/script/config/src/schema/network/substrate/midnight.d.ts.map +1 -0
  465. package/script/config/src/schema/network/substrate/midnight.js +35 -0
  466. package/script/config/src/schema/network/substrate/mod.d.ts +4 -0
  467. package/script/config/src/schema/network/substrate/mod.d.ts.map +1 -0
  468. package/script/config/src/schema/network/substrate/mod.js +19 -0
  469. package/script/config/src/schema/network/types.d.ts +13 -0
  470. package/script/config/src/schema/network/types.d.ts.map +1 -0
  471. package/script/config/src/schema/network/types.js +16 -0
  472. package/script/config/src/schema/network/utils.d.ts +5 -0
  473. package/script/config/src/schema/network/utils.d.ts.map +1 -0
  474. package/script/config/src/schema/network/utils.js +76 -0
  475. package/script/config/src/schema/primitive/mod.d.ts +2 -0
  476. package/script/config/src/schema/primitive/mod.d.ts.map +1 -0
  477. package/script/config/src/schema/primitive/mod.js +17 -0
  478. package/script/config/src/schema/primitive/types.d.ts +58 -0
  479. package/script/config/src/schema/primitive/types.d.ts.map +1 -0
  480. package/script/config/src/schema/primitive/types.js +2 -0
  481. package/script/config/src/schema/sync-protocols/all.d.ts +583 -0
  482. package/script/config/src/schema/sync-protocols/all.d.ts.map +1 -0
  483. package/script/config/src/schema/sync-protocols/all.js +62 -0
  484. package/script/config/src/schema/sync-protocols/avail/rpc.d.ts +76 -0
  485. package/script/config/src/schema/sync-protocols/avail/rpc.d.ts.map +1 -0
  486. package/script/config/src/schema/sync-protocols/avail/rpc.js +59 -0
  487. package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +76 -0
  488. package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +1 -0
  489. package/script/config/src/schema/sync-protocols/bitcoin/rpc.js +50 -0
  490. package/script/config/src/schema/sync-protocols/cardano/carp.d.ts +80 -0
  491. package/script/config/src/schema/sync-protocols/cardano/carp.d.ts.map +1 -0
  492. package/script/config/src/schema/sync-protocols/cardano/carp.js +65 -0
  493. package/script/config/src/schema/sync-protocols/cardano/mod.d.ts +2 -0
  494. package/script/config/src/schema/sync-protocols/cardano/mod.d.ts.map +1 -0
  495. package/script/config/src/schema/sync-protocols/cardano/mod.js +17 -0
  496. package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +56 -0
  497. package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +1 -0
  498. package/script/config/src/schema/sync-protocols/cardano/utxorpc.js +59 -0
  499. package/script/config/src/schema/sync-protocols/common.d.ts +60 -0
  500. package/script/config/src/schema/sync-protocols/common.d.ts.map +1 -0
  501. package/script/config/src/schema/sync-protocols/common.js +61 -0
  502. package/script/config/src/schema/sync-protocols/decorators/all.d.ts +17 -0
  503. package/script/config/src/schema/sync-protocols/decorators/all.d.ts.map +1 -0
  504. package/script/config/src/schema/sync-protocols/decorators/all.js +12 -0
  505. package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts +8 -0
  506. package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +1 -0
  507. package/script/config/src/schema/sync-protocols/decorators/emulated.js +15 -0
  508. package/script/config/src/schema/sync-protocols/decorators/mod.d.ts +4 -0
  509. package/script/config/src/schema/sync-protocols/decorators/mod.d.ts.map +1 -0
  510. package/script/config/src/schema/sync-protocols/decorators/mod.js +19 -0
  511. package/script/config/src/schema/sync-protocols/decorators/types.d.ts +4 -0
  512. package/script/config/src/schema/sync-protocols/decorators/types.d.ts.map +1 -0
  513. package/script/config/src/schema/sync-protocols/decorators/types.js +7 -0
  514. package/script/config/src/schema/sync-protocols/evm/rpc.d.ts +68 -0
  515. package/script/config/src/schema/sync-protocols/evm/rpc.d.ts.map +1 -0
  516. package/script/config/src/schema/sync-protocols/evm/rpc.js +47 -0
  517. package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts +66 -0
  518. package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +1 -0
  519. package/script/config/src/schema/sync-protocols/midnight/graphql.js +53 -0
  520. package/script/config/src/schema/sync-protocols/mina/graphql.d.ts +73 -0
  521. package/script/config/src/schema/sync-protocols/mina/graphql.d.ts.map +1 -0
  522. package/script/config/src/schema/sync-protocols/mina/graphql.js +62 -0
  523. package/script/config/src/schema/sync-protocols/mod.d.ts +10 -0
  524. package/script/config/src/schema/sync-protocols/mod.d.ts.map +1 -0
  525. package/script/config/src/schema/sync-protocols/mod.js +25 -0
  526. package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts +45 -0
  527. package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +1 -0
  528. package/script/config/src/schema/sync-protocols/ntp/rpc.js +36 -0
  529. package/script/config/src/schema/sync-protocols/types.d.ts +125 -0
  530. package/script/config/src/schema/sync-protocols/types.d.ts.map +1 -0
  531. package/script/config/src/schema/sync-protocols/types.js +25 -0
  532. package/script/config/src/schema/utils.d.ts +53 -0
  533. package/script/config/src/schema/utils.d.ts.map +1 -0
  534. package/script/config/src/schema/utils.js +62 -0
  535. package/script/events/src/app-events.d.ts +65 -0
  536. package/script/events/src/app-events.d.ts.map +1 -0
  537. package/script/events/src/app-events.js +62 -0
  538. package/script/events/src/asyncapi.d.ts +1173 -0
  539. package/script/events/src/asyncapi.d.ts.map +1 -0
  540. package/script/events/src/asyncapi.js +8 -0
  541. package/script/events/src/builtin-event-utils.d.ts +5 -0
  542. package/script/events/src/builtin-event-utils.d.ts.map +1 -0
  543. package/script/events/src/builtin-event-utils.js +63 -0
  544. package/script/events/src/builtin-events.d.ts +106 -0
  545. package/script/events/src/builtin-events.d.ts.map +1 -0
  546. package/script/events/src/builtin-events.js +204 -0
  547. package/script/events/src/event-connect.d.ts +15 -0
  548. package/script/events/src/event-connect.d.ts.map +1 -0
  549. package/script/events/src/event-connect.js +82 -0
  550. package/script/events/src/event-manager.d.ts +54 -0
  551. package/script/events/src/event-manager.d.ts.map +1 -0
  552. package/script/events/src/event-manager.js +133 -0
  553. package/script/events/src/evm.d.ts +6 -0
  554. package/script/events/src/evm.d.ts.map +1 -0
  555. package/script/events/src/evm.js +59 -0
  556. package/script/events/src/mod.d.ts +10 -0
  557. package/script/events/src/mod.d.ts.map +1 -0
  558. package/script/events/src/mod.js +25 -0
  559. package/script/events/src/types.d.ts +255 -0
  560. package/script/events/src/types.d.ts.map +1 -0
  561. package/script/events/src/types.js +111 -0
  562. package/script/events/src/utils.d.ts +16 -0
  563. package/script/events/src/utils.d.ts.map +1 -0
  564. package/script/events/src/utils.js +98 -0
  565. package/script/package.json +3 -0
  566. package/script/utils/src/binary-search.d.ts +7 -0
  567. package/script/utils/src/binary-search.d.ts.map +1 -0
  568. package/script/utils/src/binary-search.js +41 -0
  569. package/script/utils/src/captcha.d.ts +9 -0
  570. package/script/utils/src/captcha.d.ts.map +1 -0
  571. package/script/utils/src/captcha.js +22 -0
  572. package/script/utils/src/concurrency/condVar.d.ts +25 -0
  573. package/script/utils/src/concurrency/condVar.d.ts.map +1 -0
  574. package/script/utils/src/concurrency/condVar.js +42 -0
  575. package/script/utils/src/concurrency/latch.d.ts +25 -0
  576. package/script/utils/src/concurrency/latch.d.ts.map +1 -0
  577. package/script/utils/src/concurrency/latch.js +54 -0
  578. package/script/utils/src/concurrency/mod.d.ts +5 -0
  579. package/script/utils/src/concurrency/mod.d.ts.map +1 -0
  580. package/script/utils/src/concurrency/mod.js +20 -0
  581. package/script/utils/src/concurrency/retry.d.ts +14 -0
  582. package/script/utils/src/concurrency/retry.d.ts.map +1 -0
  583. package/script/utils/src/concurrency/retry.js +30 -0
  584. package/script/utils/src/concurrency/utils.d.ts +27 -0
  585. package/script/utils/src/concurrency/utils.d.ts.map +1 -0
  586. package/script/utils/src/concurrency/utils.js +30 -0
  587. package/script/utils/src/constants.d.ts +4 -0
  588. package/script/utils/src/constants.d.ts.map +1 -0
  589. package/script/utils/src/constants.js +12 -0
  590. package/script/utils/src/decorators/bound.d.ts +10 -0
  591. package/script/utils/src/decorators/bound.d.ts.map +1 -0
  592. package/script/utils/src/decorators/bound.js +20 -0
  593. package/script/utils/src/decorators/mod.d.ts +2 -0
  594. package/script/utils/src/decorators/mod.d.ts.map +1 -0
  595. package/script/utils/src/decorators/mod.js +17 -0
  596. package/script/utils/src/mod.d.ts +8 -0
  597. package/script/utils/src/mod.d.ts.map +1 -0
  598. package/script/utils/src/mod.js +23 -0
  599. package/script/utils/src/types/json-query.d.ts +30 -0
  600. package/script/utils/src/types/json-query.d.ts.map +1 -0
  601. package/script/utils/src/types/json-query.js +2 -0
  602. package/script/utils/src/types/misc.d.ts +109 -0
  603. package/script/utils/src/types/misc.d.ts.map +1 -0
  604. package/script/utils/src/types/misc.js +3 -0
  605. package/script/utils/src/types/mod.d.ts +7 -0
  606. package/script/utils/src/types/mod.d.ts.map +1 -0
  607. package/script/utils/src/types/mod.js +19 -0
  608. package/script/utils/src/types/nominal.d.ts +87 -0
  609. package/script/utils/src/types/nominal.d.ts.map +1 -0
  610. package/script/utils/src/types/nominal.js +2 -0
  611. package/script/utils/src/types/typebox-helpers.d.ts +183 -0
  612. package/script/utils/src/types/typebox-helpers.d.ts.map +1 -0
  613. package/script/utils/src/types/typebox-helpers.js +277 -0
  614. package/script/utils/src/types/utils.d.ts +37 -0
  615. package/script/utils/src/types/utils.d.ts.map +1 -0
  616. package/script/utils/src/types/utils.js +52 -0
  617. package/script/utils/src/types/validators/algorand.d.ts +31 -0
  618. package/script/utils/src/types/validators/algorand.d.ts.map +1 -0
  619. package/script/utils/src/types/validators/algorand.js +98 -0
  620. package/script/utils/src/types/validators/cardano.d.ts +26 -0
  621. package/script/utils/src/types/validators/cardano.d.ts.map +1 -0
  622. package/script/utils/src/types/validators/cardano.js +121 -0
  623. package/script/utils/src/types/validators/mina.d.ts +15 -0
  624. package/script/utils/src/types/validators/mina.d.ts.map +1 -0
  625. package/script/utils/src/types/validators/mina.js +51 -0
  626. package/script/utils/src/types/validators/minicbor.d.ts +98 -0
  627. package/script/utils/src/types/validators/minicbor.d.ts.map +1 -0
  628. package/script/utils/src/types/validators/minicbor.js +337 -0
  629. package/script/utils/src/types/validators/mod.d.ts +3 -0
  630. package/script/utils/src/types/validators/mod.d.ts.map +1 -0
  631. package/script/utils/src/types/validators/mod.js +18 -0
  632. package/script/utils/src/types/validators/utils.d.ts +6 -0
  633. package/script/utils/src/types/validators/utils.d.ts.map +1 -0
  634. package/script/utils/src/types/validators/utils.js +31 -0
  635. package/script/utils/src/viem.d.ts +6 -0
  636. package/script/utils/src/viem.d.ts.map +1 -0
  637. package/script/utils/src/viem.js +19 -0
  638. package/script/wallets/src/IProvider.d.ts +48 -0
  639. package/script/wallets/src/IProvider.d.ts.map +1 -0
  640. package/script/wallets/src/IProvider.js +10 -0
  641. package/script/wallets/src/avail/avail.d.ts +28 -0
  642. package/script/wallets/src/avail/avail.d.ts.map +1 -0
  643. package/script/wallets/src/avail/avail.js +70 -0
  644. package/script/wallets/src/avail/wrapper.d.ts +6 -0
  645. package/script/wallets/src/avail/wrapper.d.ts.map +1 -0
  646. package/script/wallets/src/avail/wrapper.js +34 -0
  647. package/script/wallets/src/cardano/cardano.d.ts +30 -0
  648. package/script/wallets/src/cardano/cardano.d.ts.map +1 -0
  649. package/script/wallets/src/cardano/cardano.js +163 -0
  650. package/script/wallets/src/cardano/wrapper.d.ts +7 -0
  651. package/script/wallets/src/cardano/wrapper.d.ts.map +1 -0
  652. package/script/wallets/src/cardano/wrapper.js +26 -0
  653. package/script/wallets/src/evm/ethers.d.ts +28 -0
  654. package/script/wallets/src/evm/ethers.d.ts.map +1 -0
  655. package/script/wallets/src/evm/ethers.js +84 -0
  656. package/script/wallets/src/evm/injected.d.ts +74 -0
  657. package/script/wallets/src/evm/injected.d.ts.map +1 -0
  658. package/script/wallets/src/evm/injected.js +360 -0
  659. package/script/wallets/src/evm/types.d.ts +3 -0
  660. package/script/wallets/src/evm/types.d.ts.map +1 -0
  661. package/script/wallets/src/evm/types.js +4 -0
  662. package/script/wallets/src/evm/wrapper-ethers.d.ts +6 -0
  663. package/script/wallets/src/evm/wrapper-ethers.d.ts.map +1 -0
  664. package/script/wallets/src/evm/wrapper-ethers.js +41 -0
  665. package/script/wallets/src/evm/wrapper-injected.d.ts +7 -0
  666. package/script/wallets/src/evm/wrapper-injected.d.ts.map +1 -0
  667. package/script/wallets/src/evm/wrapper-injected.js +84 -0
  668. package/script/wallets/src/midnight/midnight.d.ts +26 -0
  669. package/script/wallets/src/midnight/midnight.d.ts.map +1 -0
  670. package/script/wallets/src/midnight/midnight.js +117 -0
  671. package/script/wallets/src/midnight/wrapper.d.ts +7 -0
  672. package/script/wallets/src/midnight/wrapper.d.ts.map +1 -0
  673. package/script/wallets/src/midnight/wrapper.js +26 -0
  674. package/script/wallets/src/mina/mina.d.ts +28 -0
  675. package/script/wallets/src/mina/mina.d.ts.map +1 -0
  676. package/script/wallets/src/mina/mina.js +138 -0
  677. package/script/wallets/src/mina/wrapper.d.ts +6 -0
  678. package/script/wallets/src/mina/wrapper.d.ts.map +1 -0
  679. package/script/wallets/src/mina/wrapper.js +15 -0
  680. package/script/wallets/src/mod.d.ts +8 -0
  681. package/script/wallets/src/mod.d.ts.map +1 -0
  682. package/script/wallets/src/mod.js +26 -0
  683. package/script/wallets/src/paima.d.ts +104 -0
  684. package/script/wallets/src/paima.d.ts.map +1 -0
  685. package/script/wallets/src/paima.js +253 -0
  686. package/script/wallets/src/types.d.ts +49 -0
  687. package/script/wallets/src/types.d.ts.map +1 -0
  688. package/script/wallets/src/types.js +2 -0
  689. package/script/wallets/src/utils.d.ts +41 -0
  690. package/script/wallets/src/utils.d.ts.map +1 -0
  691. package/script/wallets/src/utils.js +81 -0
  692. package/script/wallets/src/wallet-modes.d.ts +49 -0
  693. package/script/wallets/src/wallet-modes.d.ts.map +1 -0
  694. package/script/wallets/src/wallet-modes.js +29 -0
  695. package/script/wallets/src/wallets.d.ts +5 -0
  696. package/script/wallets/src/wallets.d.ts.map +1 -0
  697. package/script/wallets/src/wallets.js +58 -0
  698. package/script/wallets/src/windows.d.ts +5 -0
  699. package/script/wallets/src/windows.d.ts.map +1 -0
  700. package/script/wallets/src/windows.js +12 -0
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaimaEventManager = void 0;
4
+ /* eslint-disable no-console */
5
+ const utils_js_1 = require("./utils.js");
6
+ const event_connect_js_1 = require("./event-connect.js");
7
+ const types_js_1 = require("./types.js");
8
+ /*
9
+ * This class subscribes to specific topics, and stores the callbacks for event processing.
10
+ */
11
+ class PaimaEventManager {
12
+ callbacksForTopic = {
13
+ [types_js_1.PaimaEventBrokerNames.PaimaEngine]: {},
14
+ [types_js_1.PaimaEventBrokerNames.Batcher]: {},
15
+ };
16
+ symbolToSubscription = {};
17
+ static Instance = new PaimaEventManager();
18
+ constructor() {
19
+ // TODO: replace once TS5 decorators are better supported
20
+ this.subscribe.bind(this);
21
+ this.subscribeExplicit.bind(this);
22
+ this.unsubscribe.bind(this);
23
+ this.sendMessage.bind(this);
24
+ this.sendMessageExplicit.bind(this);
25
+ }
26
+ /**
27
+ * Subscribe to events for a topic filtered by a set of indexed variables
28
+ * @param broker
29
+ * @param filter a filter to generate the MQTT topic syntax to monitor for new events
30
+ * @param callback a callback to call when a message matching this topic is encountered
31
+ * @returns a unique symbol to use to unsubscribe the specific callback
32
+ */
33
+ async subscribe(args, callback) {
34
+ return await this.subscribeExplicit({
35
+ topic: args.topic,
36
+ filter: args.filter,
37
+ }, ({ val, resolvedPath }) => callback({ ...val, ...resolvedPath }));
38
+ }
39
+ /**
40
+ * Subscribe to events for a topic filtered by a set of indexed variables
41
+ *
42
+ * This is an explicit version of the `subscribe` function
43
+ * by explicit, it means MQTT topic vars and content are treated differently
44
+ * this is worse devx, but supports cases where topic & content have vars with overlapping names
45
+ * @param broker
46
+ * @param filter a filter to generate the MQTT topic syntax to monitor for new events
47
+ * @param callback a callback to call when a message matching this topic is encountered
48
+ * @returns a unique symbol to use to unsubscribe the specific callback
49
+ */
50
+ async subscribeExplicit(args, callback) {
51
+ const client = await new event_connect_js_1.PaimaEventConnect().getClient(args.topic.broker);
52
+ const topic = (0, utils_js_1.fillPath)(args.topic.path, args.filter);
53
+ const clientSubscribe = async () => {
54
+ try {
55
+ await client.subscribeAsync(topic, { qos: 2 });
56
+ }
57
+ catch (err) {
58
+ console.log(`MQTT[${args.topic.broker}] ERROR`, err);
59
+ }
60
+ };
61
+ if (client.connected)
62
+ await clientSubscribe();
63
+ else
64
+ await new Promise(resolve => {
65
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
66
+ client.on('connect', async () => {
67
+ await clientSubscribe();
68
+ resolve();
69
+ });
70
+ });
71
+ // keep track of a unique symbol for the subscription that can be used to unsubscribe later
72
+ const symbol = Symbol(topic);
73
+ this.symbolToSubscription[symbol] = {
74
+ broker: args.topic.broker,
75
+ topic,
76
+ };
77
+ const callbacksForTopic = this.callbacksForTopic[args.topic.broker][topic] ?? {};
78
+ callbacksForTopic[symbol] = {
79
+ // in practice, casting to any shouldn't be problem
80
+ // since callbacks are only called for specific topics where we know the type matches
81
+ callback: callback, // eslint-disable-line @typescript-eslint/no-explicit-any
82
+ event: args.topic,
83
+ };
84
+ this.callbacksForTopic[args.topic.broker][topic] = callbacksForTopic;
85
+ return symbol;
86
+ }
87
+ async unsubscribe(event) {
88
+ const { topic, broker } = this.symbolToSubscription[event];
89
+ if (topic == null) {
90
+ console.error('Subscription not found', event.description);
91
+ return;
92
+ }
93
+ delete this.symbolToSubscription[event];
94
+ const callbacks = this.callbacksForTopic[broker][topic];
95
+ delete callbacks[event];
96
+ const numCallbacks = Object.keys(callbacks).length - 1; // objs are small, so this is fast enough in practice
97
+ // if there are no references left to this topic, we can unsubscribe from it
98
+ if (numCallbacks === 0) {
99
+ const client = await new event_connect_js_1.PaimaEventConnect().getClient(broker);
100
+ delete this.callbacksForTopic[broker][topic];
101
+ const clientUnsubscribe = async () => {
102
+ try {
103
+ await client.unsubscribeAsync(topic);
104
+ }
105
+ catch (err) {
106
+ console.log(`MQTT[${broker}] ERROR`, err);
107
+ }
108
+ };
109
+ if (client.connected)
110
+ await clientUnsubscribe();
111
+ else
112
+ await new Promise(resolve => {
113
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
114
+ client.on('connect', async () => {
115
+ await clientUnsubscribe();
116
+ resolve();
117
+ });
118
+ });
119
+ }
120
+ }
121
+ async sendMessage(topic, event) {
122
+ const filterKeys = new Set((0, utils_js_1.keysForPath)(topic.path));
123
+ const filter = Object.fromEntries(Object.entries(event).filter(([key, _]) => filterKeys.has(key))); // typescript can't know this filter actually matches the static type
124
+ const message = Object.fromEntries(Object.entries(event).filter(([key, _]) => !filterKeys.has(key))); // typescript can't know this filter actually matches the static type
125
+ return await this.sendMessageExplicit({ topic, filter }, message);
126
+ }
127
+ async sendMessageExplicit(args, message) {
128
+ const client = await new event_connect_js_1.PaimaEventConnect().getClient(args.topic.broker);
129
+ const topicPath = (0, utils_js_1.fillPath)(args.topic.path, args.filter);
130
+ await client.publishAsync(topicPath, JSON.stringify(message), { qos: 2 });
131
+ }
132
+ }
133
+ exports.PaimaEventManager = PaimaEventManager;
@@ -0,0 +1,6 @@
1
+ import type { TSchema } from '@sinclair/typebox';
2
+ import type { LogEvent, LogEventFields } from './types.js';
3
+ import type { AbiParameter } from 'abitype';
4
+ export declare function fieldToAbi<Type extends TSchema>(type: Type): AbiParameter | undefined;
5
+ export declare function toEvmAbi<const T extends LogEvent<LogEventFields<TSchema>[]>>(log: T): undefined | AbiParameter[];
6
+ //# sourceMappingURL=evm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../src/events/src/evm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,OAAO,EAAU,MAAM,mBAAmB,CAAC;AAE1E,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,UAAU,CAAC,IAAI,SAAS,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,YAAY,GAAG,SAAS,CA2CrF;AACD,wBAAgB,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,EAC1E,GAAG,EAAE,CAAC,GACL,SAAS,GAAG,YAAY,EAAE,CAW5B"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fieldToAbi = fieldToAbi;
4
+ exports.toEvmAbi = toEvmAbi;
5
+ const typebox_1 = require("@sinclair/typebox");
6
+ function fieldToAbi(type) {
7
+ const isString = typebox_1.Type.Extends(type, typebox_1.Type.String(), typebox_1.Type.Literal(true), typebox_1.Type.Literal(false)).const;
8
+ if (isString) {
9
+ return { type: 'string' };
10
+ }
11
+ const isNumber = typebox_1.Type.Extends(type, typebox_1.Type.Number(), typebox_1.Type.Literal(true), typebox_1.Type.Literal(false)).const;
12
+ if (isNumber) {
13
+ const minimum = type.minimum;
14
+ const maximum = type.maximum;
15
+ const isSigned = minimum != null && minimum < 0;
16
+ const bits = maximum == null ? null : Math.log2(isSigned ? maximum + 1 : maximum);
17
+ const suffix = bits == null || !Number.isInteger(bits) ? '' : isSigned ? bits + 1 : bits;
18
+ return { type: `${isSigned ? 'int' : 'uint'}${suffix}` };
19
+ }
20
+ const isBoolean = typebox_1.Type.Extends(type, typebox_1.Type.Boolean(), typebox_1.Type.Literal(true), typebox_1.Type.Literal(false)).const;
21
+ if (isBoolean) {
22
+ return { type: 'bool' };
23
+ }
24
+ if (type[typebox_1.Kind] === 'Tuple') {
25
+ const components = [];
26
+ for (const subtype of type.items?.map(t => fieldToAbi(t)) ?? []) {
27
+ if (subtype == null)
28
+ return undefined;
29
+ components.push(subtype);
30
+ }
31
+ return {
32
+ type: 'tuple',
33
+ components,
34
+ };
35
+ }
36
+ if (type[typebox_1.Kind] === 'Array') {
37
+ const innerType = fieldToAbi(type.items);
38
+ if (innerType == null)
39
+ return undefined;
40
+ return { type: `${innerType.type}[]` };
41
+ }
42
+ // TODO: address
43
+ // TODO: bytes
44
+ // TODO: support refining to numbers larger than max JS Number size (ex: uint256)
45
+ return undefined;
46
+ }
47
+ function toEvmAbi(log) {
48
+ const params = [];
49
+ for (const field of log.fields) {
50
+ const parsedField = fieldToAbi(field.type);
51
+ if (parsedField == null)
52
+ return undefined;
53
+ params.push({
54
+ ...parsedField,
55
+ name: field.name,
56
+ });
57
+ }
58
+ return params;
59
+ }
@@ -0,0 +1,10 @@
1
+ export * from './app-events.js';
2
+ export * from './event-manager.js';
3
+ export * from './builtin-events.js';
4
+ export * from './builtin-event-utils.js';
5
+ export * from './utils.js';
6
+ export * from './event-connect.js';
7
+ export * from './builtin-event-utils.js';
8
+ export * from './types.js';
9
+ export * from './evm.js';
10
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/events/src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./app-events.js"), exports);
18
+ __exportStar(require("./event-manager.js"), exports);
19
+ __exportStar(require("./builtin-events.js"), exports);
20
+ __exportStar(require("./builtin-event-utils.js"), exports);
21
+ __exportStar(require("./utils.js"), exports);
22
+ __exportStar(require("./event-connect.js"), exports);
23
+ __exportStar(require("./builtin-event-utils.js"), exports);
24
+ __exportStar(require("./types.js"), exports);
25
+ __exportStar(require("./evm.js"), exports);
@@ -0,0 +1,255 @@
1
+ import type { TString, TInteger, TExtends, Kind, TTuple, TLiteral, TObject, Static, TSchema } from '@sinclair/typebox';
2
+ export declare enum PaimaEventBrokerNames {
3
+ PaimaEngine = "effectstream-engine",
4
+ Batcher = "batcher"
5
+ }
6
+ /**
7
+ * Name inspired from https://docs.aws.amazon.com/whitepapers/latest/designing-mqtt-topics-aws-iot-core/mqtt-design-best-practices.html#:~:text=Since%20MQTT%20topics%20are%20case,when%20creating%20each%20topic%20level
8
+ */
9
+ export declare enum TopicPrefix {
10
+ Batcher = "batcher",
11
+ Node = "node",
12
+ App = "app"
13
+ }
14
+ export declare function topicToBroker(topic: TopicPrefix): PaimaEventBrokerNames;
15
+ /**
16
+ * ============================
17
+ * Define paths for MQTT topics
18
+ * ============================
19
+ */
20
+ export type SimplePath = string;
21
+ export type ArgPath = {
22
+ name: string;
23
+ type: TSchema;
24
+ };
25
+ export type EventPath = (SimplePath | ArgPath)[];
26
+ /**
27
+ * ===================================================
28
+ * Define the dev-friendly event log definition format
29
+ * ===================================================
30
+ */
31
+ type EnsureExtendsString<A extends TSchema> = TExtends<A, TString, TLiteral<true>, TLiteral<false>> extends TLiteral<true> ? A : never;
32
+ type EnsureExtendsNumber<A extends TSchema> = TExtends<A, TInteger, TLiteral<true>, TLiteral<false>> extends TLiteral<true> ? A : never;
33
+ type ValidMqttParameter<A extends TSchema> = EnsureExtendsString<A> | EnsureExtendsNumber<A>;
34
+ export type LogEventFields<Schema extends TSchema> = {
35
+ indexed: boolean;
36
+ /** keeps track if this indexed field is the string version of a complex data type (ex: if it's an object type) */
37
+ hashed?: boolean;
38
+ name: string;
39
+ type: Schema;
40
+ };
41
+ export type LogEvent<Fields extends LogEventFields<any>[]> = {
42
+ name: string;
43
+ fields: Fields;
44
+ };
45
+ /**
46
+ * ==============================================
47
+ * Define the MQTT topic path + event type format
48
+ * ==============================================
49
+ */
50
+ export type EventPathAndDef = {
51
+ path: EventPath;
52
+ broker: PaimaEventBrokerNames;
53
+ type: TObject;
54
+ };
55
+ /**
56
+ * ============================================================
57
+ * Transform paths into TS objects that can be partially filled
58
+ * ============================================================
59
+ */
60
+ type FilterSimple<T> = T extends SimplePath ? never : T;
61
+ type RemoveAllSimple<T extends EventPath> = T extends (infer U)[] ? FilterSimple<U>[] : never;
62
+ type KeypairToObj<T extends {
63
+ name: string;
64
+ type: any;
65
+ }[]> = {
66
+ [K in T[number] as K['name']]: Static<K['type']>;
67
+ };
68
+ export type ResolvedPath<Path extends EventPath> = KeypairToObj<RemoveAllSimple<Path>>;
69
+ export type Undefined<T extends Record<string, any>> = {
70
+ [P in keyof T]: T[P] | undefined;
71
+ };
72
+ export type UserFilledPath<Path extends EventPath> = Partial<Undefined<ResolvedPath<Path>>>;
73
+ /**
74
+ * ======================================================================
75
+ * Transform dev-friendly event type to typebox Schema for easy exporting
76
+ * ======================================================================
77
+ */
78
+ type ToTObject<T extends Record<string, LogEventFields<any>>> = {
79
+ -readonly [P in keyof T]: TObject<{
80
+ indexed: TLiteral<T[P]['indexed']>;
81
+ name: TLiteral<T[P]['name']>;
82
+ type: T[P]['type'];
83
+ hashed: TLiteral<DefaultToFalse<T[P]['hashed']>>;
84
+ }>;
85
+ };
86
+ /**
87
+ * Typebox doesn't provide the right interface for convert into a Tuple
88
+ * So we provide our own wrapper here, then convert it to a proper Tuple later
89
+ */
90
+ export type CustomTuple<T> = T extends TSchema[] ? TSchema & {
91
+ [Kind]: 'Tuple';
92
+ static: {
93
+ [K in keyof T]: T[K] extends TSchema ? Static<T[K], TSchema['params']> : T[K];
94
+ };
95
+ type: 'array';
96
+ items?: T;
97
+ additionalItems?: false;
98
+ minItems: number;
99
+ maxItems: number;
100
+ } : never;
101
+ type AsTuple<T extends TSchema> = T extends TTuple<infer U> ? TTuple<U> : never;
102
+ export declare function toSchema<T extends LogEvent<any>>(event: T): TObject<{
103
+ name: TLiteral<T['name']>;
104
+ fields: AsTuple<CustomTuple<ToTObject<T['fields']>>>;
105
+ }>;
106
+ /**
107
+ * =======================================================
108
+ * Transform dev-friendly event type to MQTT-friendly type
109
+ * =======================================================
110
+ */
111
+ type FilterIndexed<T> = T extends {
112
+ indexed: true;
113
+ } ? T : never;
114
+ type RemoveAllUnindexed<T extends LogEventFields<TSchema>[]> = {
115
+ [P in keyof T]: FilterIndexed<T[P]>;
116
+ };
117
+ type TransformEventInput<T> = T extends {
118
+ readonly hashed?: infer Hashed;
119
+ readonly name: infer N;
120
+ readonly type: infer U;
121
+ } ? {
122
+ hashed?: Hashed;
123
+ name: N;
124
+ type: U;
125
+ } : never;
126
+ export type TransformAllEventInput<T extends LogEventFields<TSchema>[]> = {
127
+ [P in keyof T]: TransformEventInput<T[P]>;
128
+ };
129
+ export type ExcludeFromTuple<T extends readonly any[], E> = T extends [infer F, ...infer R] ? [F] extends [E] ? ExcludeFromTuple<R, E> : [F, ...ExcludeFromTuple<R, E>] : [];
130
+ type RemoveHashSuffix<T extends string> = T extends `${infer Prefix}Hash` ? Prefix : T;
131
+ type AddStringPath<T extends any[]> = T extends [
132
+ {
133
+ hashed?: infer Hashed;
134
+ name: infer Name extends string;
135
+ type: infer Type;
136
+ },
137
+ ...infer Rest
138
+ ] ? [
139
+ Hashed extends true ? RemoveHashSuffix<Name> : Name,
140
+ {
141
+ name: Name;
142
+ type: Type;
143
+ },
144
+ ...AddStringPath<Rest>
145
+ ] : [];
146
+ type FilterNonIndexed<T> = T extends {
147
+ indexed: false;
148
+ } ? T : never;
149
+ export type RemoveAllIndexed<T extends LogEventFields<TSchema>[]> = {
150
+ [P in keyof T]: FilterNonIndexed<T[P]>;
151
+ };
152
+ export type OutputKeypairToObj<T> = T extends {
153
+ name: string;
154
+ type: any;
155
+ }[] ? {
156
+ [K in T[number] as K['name']]: K['type'];
157
+ } : never;
158
+ export type BrokerName<T extends TopicPrefix> = T extends TopicPrefix.Batcher ? PaimaEventBrokerNames.Batcher : PaimaEventBrokerNames.PaimaEngine;
159
+ type IndexedFields<T extends LogEventFields<TSchema>[]> = ExcludeFromTuple<TransformAllEventInput<RemoveAllUnindexed<T>>, never>;
160
+ export declare function toPath<T extends LogEvent<LogEventFields<TSchema>[]>, Prefix extends TopicPrefix>(prefix: Prefix, event: T, signatureHash?: string): {
161
+ path: AddStringPath<IndexedFields<T['fields']>>;
162
+ broker: BrokerName<Prefix>;
163
+ type: TObject<OutputKeypairToObj<ExcludeFromTuple<TransformAllEventInput<RemoveAllIndexed<T['fields']>>, never>>>;
164
+ };
165
+ /**
166
+ * ================================================================
167
+ * Wrap interface to make it more dev-friendly and less error-prone
168
+ * ================================================================
169
+ */
170
+ export type MaybeIndexedLogEventFields<Schema extends TSchema> = {
171
+ indexed?: boolean;
172
+ hashed?: boolean;
173
+ name: string;
174
+ type: Schema;
175
+ };
176
+ export type MaybeIndexedLogEvent<Fields extends MaybeIndexedLogEventFields<any>[]> = {
177
+ name: string;
178
+ fields: Fields;
179
+ };
180
+ type DefaultToFalse<T> = T extends true ? true : false;
181
+ type ToDefinitelyIndexedObject<T extends MaybeIndexedLogEventFields<any>[]> = {
182
+ -readonly [P in keyof T]: {
183
+ indexed: DefaultToFalse<T[P]['indexed']>;
184
+ hashed: DefaultToFalse<T[P]['hashed']>;
185
+ name: T[P]['name'];
186
+ type: T[P]['type'];
187
+ };
188
+ };
189
+ export type ToLog<T extends MaybeIndexedLogEvent<MaybeIndexedLogEventFields<TSchema>[]>> = {
190
+ name: T['name'];
191
+ fields: ToDefinitelyIndexedObject<T['fields']>;
192
+ };
193
+ type Ensure<T extends MaybeIndexedLogEvent<MaybeIndexedLogEventFields<TSchema>[]>, U> = MaybeIndexedLogEvent<MaybeIndexedLogEventFields<TSchema>[]> extends U ? T : never;
194
+ export declare function genEvent<const T extends MaybeIndexedLogEvent<MaybeIndexedLogEventFields<TSchema>[]>>(event: DisallowComplexEventFields<T> & Ensure<T, MaybeIndexedLogEvent<any>>): ToLog<T>;
195
+ /**
196
+ * ======================================================================
197
+ * Replace indexed objects with hashes so they can be used as MQTT topics
198
+ * ======================================================================
199
+ */
200
+ type AddHashFields<T extends any[]> = T extends [
201
+ {
202
+ indexed: infer Indexed;
203
+ name: infer Name extends string;
204
+ type: infer Type extends TSchema;
205
+ },
206
+ ...infer Rest
207
+ ] ? Indexed extends true ? ValidMqttParameter<Type> extends never ? [
208
+ {
209
+ hashed: true;
210
+ indexed: true;
211
+ name: `${Name}Hash`;
212
+ type: TString;
213
+ },
214
+ {
215
+ indexed: false;
216
+ name: Name;
217
+ type: Type;
218
+ },
219
+ ...AddHashFields<Rest>
220
+ ] : [{
221
+ indexed: Indexed;
222
+ name: Name;
223
+ type: Type;
224
+ }, ...AddHashFields<Rest>] : [{
225
+ indexed: Indexed;
226
+ name: Name;
227
+ type: Type;
228
+ }, ...AddHashFields<Rest>] : [];
229
+ export type EventAddHashFields<T extends {
230
+ name: string;
231
+ fields: MaybeIndexedLogEventFields<TSchema>[];
232
+ }> = {
233
+ name: T['name'];
234
+ fields: AddHashFields<T['fields']>;
235
+ };
236
+ export declare function addHashes<T extends LogEvent<LogEventFields<TSchema>[]>>(event: T): EventAddHashFields<T>;
237
+ /**
238
+ * ===================================================
239
+ * Disable complex fields until we support these later
240
+ * ===================================================
241
+ */
242
+ type DisallowComplexFields<T extends MaybeIndexedLogEventFields<TSchema>[]> = {
243
+ [P in keyof T]: T[P]['indexed'] extends false ? T[P] : ValidMqttParameter<T[P]['type']> extends never ? {
244
+ indexed: T[P]['indexed'];
245
+ name: T[P]['name'];
246
+ type: never;
247
+ } : T[P];
248
+ };
249
+ type DisallowComplexEventFields<T extends {
250
+ fields: MaybeIndexedLogEventFields<TSchema>[];
251
+ }> = {
252
+ fields: DisallowComplexFields<T['fields']>;
253
+ };
254
+ export {};
255
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/events/src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACR,MAAM,mBAAmB,CAAC;AAG3B,oBAAY,qBAAqB;IAC/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AC,CAkCvB;AAED;;;;GAIG;AAGH,KAAK,qBAAqB,CAAC,CAAC,SAAS,0BAA0B,CAAC,OAAO,CAAC,EAAE,IAAI;KAC3E,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,KAAK,GACzC,CAAC,CAAC,CAAC,CAAC,GACJ,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,KAAK,GAC5C;QACE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACzB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,EAAE,KAAK,CAAC;KACb,GACD,CAAC,CAAC,CAAC,CAAC;CACX,CAAC;AAEF,KAAK,0BAA0B,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAAE,CAAA;CAAE,IAAI;IAC7F,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TopicPrefix = exports.PaimaEventBrokerNames = void 0;
4
+ exports.topicToBroker = topicToBroker;
5
+ exports.toSchema = toSchema;
6
+ exports.toPath = toPath;
7
+ exports.genEvent = genEvent;
8
+ exports.addHashes = addHashes;
9
+ const typebox_1 = require("@sinclair/typebox");
10
+ const assert_never_1 = require("assert-never");
11
+ var PaimaEventBrokerNames;
12
+ (function (PaimaEventBrokerNames) {
13
+ PaimaEventBrokerNames["PaimaEngine"] = "effectstream-engine";
14
+ PaimaEventBrokerNames["Batcher"] = "batcher";
15
+ })(PaimaEventBrokerNames || (exports.PaimaEventBrokerNames = PaimaEventBrokerNames = {}));
16
+ /**
17
+ * Name inspired from https://docs.aws.amazon.com/whitepapers/latest/designing-mqtt-topics-aws-iot-core/mqtt-design-best-practices.html#:~:text=Since%20MQTT%20topics%20are%20case,when%20creating%20each%20topic%20level
18
+ */
19
+ var TopicPrefix;
20
+ (function (TopicPrefix) {
21
+ TopicPrefix["Batcher"] = "batcher";
22
+ TopicPrefix["Node"] = "node";
23
+ TopicPrefix["App"] = "app";
24
+ })(TopicPrefix || (exports.TopicPrefix = TopicPrefix = {}));
25
+ function topicToBroker(topic) {
26
+ switch (topic) {
27
+ case TopicPrefix.Batcher:
28
+ return PaimaEventBrokerNames.Batcher;
29
+ case TopicPrefix.Node:
30
+ return PaimaEventBrokerNames.PaimaEngine;
31
+ case TopicPrefix.App:
32
+ return PaimaEventBrokerNames.PaimaEngine;
33
+ default:
34
+ (0, assert_never_1.assertNever)(topic);
35
+ }
36
+ }
37
+ function toSchema(event) {
38
+ return typebox_1.Type.Object({
39
+ name: typebox_1.Type.Literal(event.name),
40
+ fields: typebox_1.Type.Tuple(event.fields.map((input) => typebox_1.Type.Object({
41
+ indexed: typebox_1.Type.Literal(input.indexed),
42
+ name: typebox_1.Type.Literal(input.name),
43
+ type: input.type,
44
+ hashed: typebox_1.Type.Literal(input.hashed ?? false),
45
+ })) // map(..) converts it to an array, but we need to consider it a tuple
46
+ ),
47
+ }); // typescript can't really know this dynamic object matches our static type
48
+ }
49
+ function toPath(prefix, event, signatureHash) {
50
+ return {
51
+ path: [
52
+ prefix,
53
+ ...[signatureHash].filter(x => x),
54
+ ...event.fields
55
+ .filter(input => input.indexed)
56
+ .flatMap(input => [
57
+ input.hashed === true
58
+ ? input.name.substring(0, input.name.length - 'Hash'.length)
59
+ : input.name,
60
+ {
61
+ name: input.name,
62
+ type: input.type,
63
+ },
64
+ ]),
65
+ ],
66
+ broker: topicToBroker(prefix),
67
+ type: typebox_1.Type.Object(event.fields
68
+ .filter(input => !input.indexed)
69
+ .reduce((acc, curr) => {
70
+ acc[curr.name] = curr.type;
71
+ return acc;
72
+ }, {})),
73
+ }; // typescript can't really know this dynamic object matches our static type
74
+ }
75
+ function genEvent(event) {
76
+ for (const { name } of event.fields) {
77
+ const invalidCharacters = ['$', '/', '+', '#'];
78
+ for (const invalid of invalidCharacters) {
79
+ if (name.includes(invalid)) {
80
+ throw new Error(`Event ${event.name} has field ${name} with invalid character ${invalid}.`);
81
+ }
82
+ }
83
+ }
84
+ return event;
85
+ }
86
+ function addHashes(event) {
87
+ return {
88
+ name: event.name,
89
+ fields: event.fields.flatMap(field => {
90
+ if (field.indexed === false)
91
+ return field;
92
+ const isString = typebox_1.Type.Extends(field.type, typebox_1.Type.String(), typebox_1.Type.Literal(true), typebox_1.Type.Literal(false)).const;
93
+ const isNumber = typebox_1.Type.Extends(field.type, typebox_1.Type.Number(), typebox_1.Type.Literal(true), typebox_1.Type.Literal(false)).const;
94
+ if (isString || isNumber) {
95
+ return field;
96
+ }
97
+ return [
98
+ {
99
+ indexed: true,
100
+ type: typebox_1.Type.String(),
101
+ name: `${field.name}Hash`,
102
+ hashed: true,
103
+ },
104
+ {
105
+ ...field,
106
+ indexed: false,
107
+ },
108
+ ];
109
+ }),
110
+ };
111
+ }
@@ -0,0 +1,16 @@
1
+ import type { EventPath, UserFilledPath } from './types.js';
2
+ /**
3
+ * Creates an MQTT path filling in specified variables in the path
4
+ * @param path the base MQTT path to use
5
+ * @param args the args to fill the path.
6
+ * - `undefined` (explicitly or omitted) variables will be treated as `+`
7
+ * - if all trailing variables are `undefined`, it will be replaced by `#`
8
+ */
9
+ export declare function fillPath<Path extends EventPath>(path: Path, args: UserFilledPath<Path>): string;
10
+ /**
11
+ * Convert our internal definition of an event path to an mqtt-pattern compatible path
12
+ * This is useful to later deconstruct topics for pattern matching
13
+ */
14
+ export declare function toPattern(path: EventPath): string;
15
+ export declare function keysForPath(path: EventPath): string[];
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,SAAS,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,MAAM,CAsE/F;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAajD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,CAErD"}