@useragent-kit/sdk 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +61 -3
  3. package/dist/adapters.d.ts +94 -0
  4. package/dist/adapters.d.ts.map +1 -0
  5. package/dist/adapters.js +188 -0
  6. package/dist/adapters.js.map +1 -0
  7. package/dist/api-protocol.d.ts +9 -0
  8. package/dist/api-protocol.d.ts.map +1 -0
  9. package/dist/api-protocol.js +9 -0
  10. package/dist/api-protocol.js.map +1 -0
  11. package/dist/bridge/contract.d.ts +66 -0
  12. package/dist/bridge/contract.d.ts.map +1 -0
  13. package/dist/bridge/contract.js +160 -0
  14. package/dist/bridge/contract.js.map +1 -0
  15. package/dist/bridge/index.d.ts +53 -0
  16. package/dist/bridge/index.d.ts.map +1 -0
  17. package/dist/bridge/index.js +302 -0
  18. package/dist/bridge/index.js.map +1 -0
  19. package/dist/bridge/types.d.ts +93 -0
  20. package/dist/bridge/types.d.ts.map +1 -0
  21. package/dist/bridge/types.js +9 -0
  22. package/dist/bridge/types.js.map +1 -0
  23. package/dist/chain.d.ts +198 -0
  24. package/dist/chain.d.ts.map +1 -0
  25. package/dist/chain.js +424 -0
  26. package/dist/chain.js.map +1 -0
  27. package/dist/errors.d.ts +22 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +41 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/events.d.ts +252 -0
  32. package/dist/events.d.ts.map +1 -0
  33. package/dist/events.js +54 -0
  34. package/dist/events.js.map +1 -0
  35. package/dist/experimental/file-transfer.d.ts +97 -0
  36. package/dist/experimental/file-transfer.d.ts.map +1 -0
  37. package/dist/experimental/file-transfer.js +1377 -0
  38. package/dist/experimental/file-transfer.js.map +1 -0
  39. package/dist/experimental/index.d.ts +7 -0
  40. package/dist/experimental/index.d.ts.map +1 -0
  41. package/dist/experimental/index.js +4 -0
  42. package/dist/experimental/index.js.map +1 -0
  43. package/dist/experimental/logger.d.ts +5 -0
  44. package/dist/experimental/logger.d.ts.map +1 -0
  45. package/dist/experimental/logger.js +74 -0
  46. package/dist/experimental/logger.js.map +1 -0
  47. package/dist/experimental/transport.d.ts +34 -0
  48. package/dist/experimental/transport.d.ts.map +1 -0
  49. package/dist/experimental/transport.js +43 -0
  50. package/dist/experimental/transport.js.map +1 -0
  51. package/dist/guest/claw.d.ts +10 -0
  52. package/dist/guest/claw.d.ts.map +1 -0
  53. package/dist/guest/claw.js +21 -0
  54. package/dist/guest/claw.js.map +1 -0
  55. package/dist/guest/crdt.d.ts +19 -0
  56. package/dist/guest/crdt.d.ts.map +1 -0
  57. package/dist/guest/crdt.js +64 -0
  58. package/dist/guest/crdt.js.map +1 -0
  59. package/dist/guest/data.d.ts +27 -0
  60. package/dist/guest/data.d.ts.map +1 -0
  61. package/dist/guest/data.js +61 -0
  62. package/dist/guest/data.js.map +1 -0
  63. package/dist/guest/files.d.ts +15 -0
  64. package/dist/guest/files.d.ts.map +1 -0
  65. package/dist/guest/files.js +24 -0
  66. package/dist/guest/files.js.map +1 -0
  67. package/dist/guest/index.d.ts +43 -0
  68. package/dist/guest/index.d.ts.map +1 -0
  69. package/dist/guest/index.js +44 -0
  70. package/dist/guest/index.js.map +1 -0
  71. package/dist/guest/media.d.ts +44 -0
  72. package/dist/guest/media.d.ts.map +1 -0
  73. package/dist/guest/media.js +97 -0
  74. package/dist/guest/media.js.map +1 -0
  75. package/dist/guest/mesh.d.ts +79 -0
  76. package/dist/guest/mesh.d.ts.map +1 -0
  77. package/dist/guest/mesh.js +153 -0
  78. package/dist/guest/mesh.js.map +1 -0
  79. package/dist/guest/navigate.d.ts +17 -0
  80. package/dist/guest/navigate.d.ts.map +1 -0
  81. package/dist/guest/navigate.js +169 -0
  82. package/dist/guest/navigate.js.map +1 -0
  83. package/dist/guest/statements.d.ts +18 -0
  84. package/dist/guest/statements.d.ts.map +1 -0
  85. package/dist/guest/statements.js +26 -0
  86. package/dist/guest/statements.js.map +1 -0
  87. package/dist/guest/telemetry.d.ts +88 -0
  88. package/dist/guest/telemetry.d.ts.map +1 -0
  89. package/dist/guest/telemetry.js +184 -0
  90. package/dist/guest/telemetry.js.map +1 -0
  91. package/dist/guest/types.d.ts +255 -0
  92. package/dist/guest/types.d.ts.map +1 -0
  93. package/dist/guest/types.js +9 -0
  94. package/dist/guest/types.js.map +1 -0
  95. package/dist/host-runtime-contract.d.ts +19 -0
  96. package/dist/host-runtime-contract.d.ts.map +1 -0
  97. package/dist/host-runtime-contract.js +80 -0
  98. package/dist/host-runtime-contract.js.map +1 -0
  99. package/dist/host-runtime-frame.d.ts +128 -0
  100. package/dist/host-runtime-frame.d.ts.map +1 -0
  101. package/dist/host-runtime-frame.js +881 -0
  102. package/dist/host-runtime-frame.js.map +1 -0
  103. package/dist/host-runtime-registry.d.ts +16 -0
  104. package/dist/host-runtime-registry.d.ts.map +1 -0
  105. package/dist/host-runtime-registry.js +53 -0
  106. package/dist/host-runtime-registry.js.map +1 -0
  107. package/dist/host-runtime.d.ts +106 -0
  108. package/dist/host-runtime.d.ts.map +1 -0
  109. package/dist/host-runtime.js +290 -0
  110. package/dist/host-runtime.js.map +1 -0
  111. package/dist/identity-adapter.d.ts +42 -0
  112. package/dist/identity-adapter.d.ts.map +1 -0
  113. package/dist/identity-adapter.js +43 -0
  114. package/dist/identity-adapter.js.map +1 -0
  115. package/dist/identity.d.ts +86 -0
  116. package/dist/identity.d.ts.map +1 -0
  117. package/dist/identity.js +223 -0
  118. package/dist/identity.js.map +1 -0
  119. package/dist/index.d.ts +91 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +356 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/internal/api-protocol/api/protocol.d.ts +1402 -0
  124. package/dist/internal/api-protocol/api/protocol.d.ts.map +1 -0
  125. package/dist/internal/api-protocol/api/protocol.js +311 -0
  126. package/dist/internal/api-protocol/api/protocol.js.map +1 -0
  127. package/dist/internal/api-protocol/api/types.d.ts +24 -0
  128. package/dist/internal/api-protocol/api/types.d.ts.map +1 -0
  129. package/dist/internal/api-protocol/api/types.js +9 -0
  130. package/dist/internal/api-protocol/api/types.js.map +1 -0
  131. package/dist/internal/api-protocol/host-facade/connectionManager.d.ts +44 -0
  132. package/dist/internal/api-protocol/host-facade/connectionManager.d.ts.map +1 -0
  133. package/dist/internal/api-protocol/host-facade/connectionManager.js +349 -0
  134. package/dist/internal/api-protocol/host-facade/connectionManager.js.map +1 -0
  135. package/dist/internal/api-protocol/host-facade/protocolHandler.d.ts +24 -0
  136. package/dist/internal/api-protocol/host-facade/protocolHandler.d.ts.map +1 -0
  137. package/dist/internal/api-protocol/host-facade/protocolHandler.js +505 -0
  138. package/dist/internal/api-protocol/host-facade/protocolHandler.js.map +1 -0
  139. package/dist/internal/api-protocol/host-facade/types.d.ts +82 -0
  140. package/dist/internal/api-protocol/host-facade/types.d.ts.map +1 -0
  141. package/dist/internal/api-protocol/host-facade/types.js +14 -0
  142. package/dist/internal/api-protocol/host-facade/types.js.map +1 -0
  143. package/dist/internal/api-protocol/index.d.ts +39 -0
  144. package/dist/internal/api-protocol/index.d.ts.map +1 -0
  145. package/dist/internal/api-protocol/index.js +41 -0
  146. package/dist/internal/api-protocol/index.js.map +1 -0
  147. package/dist/internal/api-protocol/product-facade/hostApi.d.ts +392 -0
  148. package/dist/internal/api-protocol/product-facade/hostApi.d.ts.map +1 -0
  149. package/dist/internal/api-protocol/product-facade/hostApi.js +241 -0
  150. package/dist/internal/api-protocol/product-facade/hostApi.js.map +1 -0
  151. package/dist/internal/api-protocol/shared/codec/adapter.d.ts +41 -0
  152. package/dist/internal/api-protocol/shared/codec/adapter.d.ts.map +1 -0
  153. package/dist/internal/api-protocol/shared/codec/adapter.js +10 -0
  154. package/dist/internal/api-protocol/shared/codec/adapter.js.map +1 -0
  155. package/dist/internal/api-protocol/shared/codec/negotiation.d.ts +80 -0
  156. package/dist/internal/api-protocol/shared/codec/negotiation.d.ts.map +1 -0
  157. package/dist/internal/api-protocol/shared/codec/negotiation.js +129 -0
  158. package/dist/internal/api-protocol/shared/codec/negotiation.js.map +1 -0
  159. package/dist/internal/api-protocol/shared/codec/scale/adapter.d.ts +18 -0
  160. package/dist/internal/api-protocol/shared/codec/scale/adapter.d.ts.map +1 -0
  161. package/dist/internal/api-protocol/shared/codec/scale/adapter.js +23 -0
  162. package/dist/internal/api-protocol/shared/codec/scale/adapter.js.map +1 -0
  163. package/dist/internal/api-protocol/shared/codec/scale/primitives.d.ts +35 -0
  164. package/dist/internal/api-protocol/shared/codec/scale/primitives.d.ts.map +1 -0
  165. package/dist/internal/api-protocol/shared/codec/scale/primitives.js +96 -0
  166. package/dist/internal/api-protocol/shared/codec/scale/primitives.js.map +1 -0
  167. package/dist/internal/api-protocol/shared/codec/scale/v1/accounts.d.ts +65 -0
  168. package/dist/internal/api-protocol/shared/codec/scale/v1/accounts.d.ts.map +1 -0
  169. package/dist/internal/api-protocol/shared/codec/scale/v1/accounts.js +43 -0
  170. package/dist/internal/api-protocol/shared/codec/scale/v1/accounts.js.map +1 -0
  171. package/dist/internal/api-protocol/shared/codec/scale/v1/chainInteraction.d.ts +162 -0
  172. package/dist/internal/api-protocol/shared/codec/scale/v1/chainInteraction.d.ts.map +1 -0
  173. package/dist/internal/api-protocol/shared/codec/scale/v1/chainInteraction.js +81 -0
  174. package/dist/internal/api-protocol/shared/codec/scale/v1/chainInteraction.js.map +1 -0
  175. package/dist/internal/api-protocol/shared/codec/scale/v1/chat.d.ts +307 -0
  176. package/dist/internal/api-protocol/shared/codec/scale/v1/chat.d.ts.map +1 -0
  177. package/dist/internal/api-protocol/shared/codec/scale/v1/chat.js +105 -0
  178. package/dist/internal/api-protocol/shared/codec/scale/v1/chat.js.map +1 -0
  179. package/dist/internal/api-protocol/shared/codec/scale/v1/commonCodecs.d.ts +5 -0
  180. package/dist/internal/api-protocol/shared/codec/scale/v1/commonCodecs.d.ts.map +1 -0
  181. package/dist/internal/api-protocol/shared/codec/scale/v1/commonCodecs.js +6 -0
  182. package/dist/internal/api-protocol/shared/codec/scale/v1/commonCodecs.js.map +1 -0
  183. package/dist/internal/api-protocol/shared/codec/scale/v1/createTransaction.d.ts +71 -0
  184. package/dist/internal/api-protocol/shared/codec/scale/v1/createTransaction.d.ts.map +1 -0
  185. package/dist/internal/api-protocol/shared/codec/scale/v1/createTransaction.js +34 -0
  186. package/dist/internal/api-protocol/shared/codec/scale/v1/createTransaction.js.map +1 -0
  187. package/dist/internal/api-protocol/shared/codec/scale/v1/customRenderer.d.ts +106 -0
  188. package/dist/internal/api-protocol/shared/codec/scale/v1/customRenderer.d.ts.map +1 -0
  189. package/dist/internal/api-protocol/shared/codec/scale/v1/customRenderer.js +84 -0
  190. package/dist/internal/api-protocol/shared/codec/scale/v1/customRenderer.js.map +1 -0
  191. package/dist/internal/api-protocol/shared/codec/scale/v1/devicePermission.d.ts +4 -0
  192. package/dist/internal/api-protocol/shared/codec/scale/v1/devicePermission.d.ts.map +1 -0
  193. package/dist/internal/api-protocol/shared/codec/scale/v1/devicePermission.js +4 -0
  194. package/dist/internal/api-protocol/shared/codec/scale/v1/devicePermission.js.map +1 -0
  195. package/dist/internal/api-protocol/shared/codec/scale/v1/feature.d.ts +7 -0
  196. package/dist/internal/api-protocol/shared/codec/scale/v1/feature.d.ts.map +1 -0
  197. package/dist/internal/api-protocol/shared/codec/scale/v1/feature.js +7 -0
  198. package/dist/internal/api-protocol/shared/codec/scale/v1/feature.js.map +1 -0
  199. package/dist/internal/api-protocol/shared/codec/scale/v1/handshake.d.ts +13 -0
  200. package/dist/internal/api-protocol/shared/codec/scale/v1/handshake.d.ts.map +1 -0
  201. package/dist/internal/api-protocol/shared/codec/scale/v1/handshake.js +10 -0
  202. package/dist/internal/api-protocol/shared/codec/scale/v1/handshake.js.map +1 -0
  203. package/dist/internal/api-protocol/shared/codec/scale/v1/localStorage.d.ts +15 -0
  204. package/dist/internal/api-protocol/shared/codec/scale/v1/localStorage.d.ts.map +1 -0
  205. package/dist/internal/api-protocol/shared/codec/scale/v1/localStorage.js +12 -0
  206. package/dist/internal/api-protocol/shared/codec/scale/v1/localStorage.js.map +1 -0
  207. package/dist/internal/api-protocol/shared/codec/scale/v1/navigation.d.ts +10 -0
  208. package/dist/internal/api-protocol/shared/codec/scale/v1/navigation.d.ts.map +1 -0
  209. package/dist/internal/api-protocol/shared/codec/scale/v1/navigation.js +10 -0
  210. package/dist/internal/api-protocol/shared/codec/scale/v1/navigation.js.map +1 -0
  211. package/dist/internal/api-protocol/shared/codec/scale/v1/notification.d.ts +7 -0
  212. package/dist/internal/api-protocol/shared/codec/scale/v1/notification.d.ts.map +1 -0
  213. package/dist/internal/api-protocol/shared/codec/scale/v1/notification.js +7 -0
  214. package/dist/internal/api-protocol/shared/codec/scale/v1/notification.js.map +1 -0
  215. package/dist/internal/api-protocol/shared/codec/scale/v1/payment.d.ts +74 -0
  216. package/dist/internal/api-protocol/shared/codec/scale/v1/payment.d.ts.map +1 -0
  217. package/dist/internal/api-protocol/shared/codec/scale/v1/payment.js +38 -0
  218. package/dist/internal/api-protocol/shared/codec/scale/v1/payment.js.map +1 -0
  219. package/dist/internal/api-protocol/shared/codec/scale/v1/preimage.d.ts +12 -0
  220. package/dist/internal/api-protocol/shared/codec/scale/v1/preimage.d.ts.map +1 -0
  221. package/dist/internal/api-protocol/shared/codec/scale/v1/preimage.js +11 -0
  222. package/dist/internal/api-protocol/shared/codec/scale/v1/preimage.js.map +1 -0
  223. package/dist/internal/api-protocol/shared/codec/scale/v1/remotePermission.d.ts +10 -0
  224. package/dist/internal/api-protocol/shared/codec/scale/v1/remotePermission.d.ts.map +1 -0
  225. package/dist/internal/api-protocol/shared/codec/scale/v1/remotePermission.js +8 -0
  226. package/dist/internal/api-protocol/shared/codec/scale/v1/remotePermission.js.map +1 -0
  227. package/dist/internal/api-protocol/shared/codec/scale/v1/sign.d.ts +61 -0
  228. package/dist/internal/api-protocol/shared/codec/scale/v1/sign.d.ts.map +1 -0
  229. package/dist/internal/api-protocol/shared/codec/scale/v1/sign.js +42 -0
  230. package/dist/internal/api-protocol/shared/codec/scale/v1/sign.js.map +1 -0
  231. package/dist/internal/api-protocol/shared/codec/scale/v1/statementStore.d.ts +137 -0
  232. package/dist/internal/api-protocol/shared/codec/scale/v1/statementStore.d.ts.map +1 -0
  233. package/dist/internal/api-protocol/shared/codec/scale/v1/statementStore.js +55 -0
  234. package/dist/internal/api-protocol/shared/codec/scale/v1/statementStore.js.map +1 -0
  235. package/dist/internal/api-protocol/shared/codec/structured/index.d.ts +10 -0
  236. package/dist/internal/api-protocol/shared/codec/structured/index.d.ts.map +1 -0
  237. package/dist/internal/api-protocol/shared/codec/structured/index.js +19 -0
  238. package/dist/internal/api-protocol/shared/codec/structured/index.js.map +1 -0
  239. package/dist/internal/api-protocol/shared/transport/messagePortProvider.d.ts +18 -0
  240. package/dist/internal/api-protocol/shared/transport/messagePortProvider.d.ts.map +1 -0
  241. package/dist/internal/api-protocol/shared/transport/messagePortProvider.js +98 -0
  242. package/dist/internal/api-protocol/shared/transport/messagePortProvider.js.map +1 -0
  243. package/dist/internal/api-protocol/shared/transport/provider.d.ts +42 -0
  244. package/dist/internal/api-protocol/shared/transport/provider.d.ts.map +1 -0
  245. package/dist/internal/api-protocol/shared/transport/provider.js +13 -0
  246. package/dist/internal/api-protocol/shared/transport/provider.js.map +1 -0
  247. package/dist/internal/api-protocol/shared/transport/transport.d.ts +72 -0
  248. package/dist/internal/api-protocol/shared/transport/transport.d.ts.map +1 -0
  249. package/dist/internal/api-protocol/shared/transport/transport.js +420 -0
  250. package/dist/internal/api-protocol/shared/transport/transport.js.map +1 -0
  251. package/dist/internal/api-protocol/shared/transport/windowProvider.d.ts +13 -0
  252. package/dist/internal/api-protocol/shared/transport/windowProvider.d.ts.map +1 -0
  253. package/dist/internal/api-protocol/shared/transport/windowProvider.js +85 -0
  254. package/dist/internal/api-protocol/shared/transport/windowProvider.js.map +1 -0
  255. package/dist/internal/api-protocol/shared/util/helpers.d.ts +27 -0
  256. package/dist/internal/api-protocol/shared/util/helpers.d.ts.map +1 -0
  257. package/dist/internal/api-protocol/shared/util/helpers.js +43 -0
  258. package/dist/internal/api-protocol/shared/util/helpers.js.map +1 -0
  259. package/dist/internal/api-protocol/shared/util/idFactory.d.ts +9 -0
  260. package/dist/internal/api-protocol/shared/util/idFactory.d.ts.map +1 -0
  261. package/dist/internal/api-protocol/shared/util/idFactory.js +12 -0
  262. package/dist/internal/api-protocol/shared/util/idFactory.js.map +1 -0
  263. package/dist/internal/api-protocol/shared/util/logger.d.ts +15 -0
  264. package/dist/internal/api-protocol/shared/util/logger.d.ts.map +1 -0
  265. package/dist/internal/api-protocol/shared/util/logger.js +20 -0
  266. package/dist/internal/api-protocol/shared/util/logger.js.map +1 -0
  267. package/dist/mesh-attachment.d.ts +19 -0
  268. package/dist/mesh-attachment.d.ts.map +1 -0
  269. package/dist/mesh-attachment.js +43 -0
  270. package/dist/mesh-attachment.js.map +1 -0
  271. package/dist/mesh-chat.d.ts +48 -0
  272. package/dist/mesh-chat.d.ts.map +1 -0
  273. package/dist/mesh-chat.js +84 -0
  274. package/dist/mesh-chat.js.map +1 -0
  275. package/dist/mesh-delivery-diagnostics.d.ts +12 -0
  276. package/dist/mesh-delivery-diagnostics.d.ts.map +1 -0
  277. package/dist/mesh-delivery-diagnostics.js +45 -0
  278. package/dist/mesh-delivery-diagnostics.js.map +1 -0
  279. package/dist/mesh-notification.d.ts +29 -0
  280. package/dist/mesh-notification.d.ts.map +1 -0
  281. package/dist/mesh-notification.js +52 -0
  282. package/dist/mesh-notification.js.map +1 -0
  283. package/dist/mesh-pairing.d.ts +40 -0
  284. package/dist/mesh-pairing.d.ts.map +1 -0
  285. package/dist/mesh-pairing.js +78 -0
  286. package/dist/mesh-pairing.js.map +1 -0
  287. package/dist/product-host-runtime.d.ts +59 -0
  288. package/dist/product-host-runtime.d.ts.map +1 -0
  289. package/dist/product-host-runtime.js +150 -0
  290. package/dist/product-host-runtime.js.map +1 -0
  291. package/dist/product-protocol.d.ts +49 -0
  292. package/dist/product-protocol.d.ts.map +1 -0
  293. package/dist/product-protocol.js +389 -0
  294. package/dist/product-protocol.js.map +1 -0
  295. package/dist/product-view-hosted.d.ts +63 -0
  296. package/dist/product-view-hosted.d.ts.map +1 -0
  297. package/dist/product-view-hosted.js +272 -0
  298. package/dist/product-view-hosted.js.map +1 -0
  299. package/dist/product-view-service-worker.d.ts +6 -0
  300. package/dist/product-view-service-worker.d.ts.map +1 -0
  301. package/dist/product-view-service-worker.js +57 -0
  302. package/dist/product-view-service-worker.js.map +1 -0
  303. package/dist/product-view.d.ts +459 -0
  304. package/dist/product-view.d.ts.map +1 -0
  305. package/dist/product-view.js +2671 -0
  306. package/dist/product-view.js.map +1 -0
  307. package/dist/protocol.d.ts +39 -0
  308. package/dist/protocol.d.ts.map +1 -0
  309. package/dist/protocol.js +25 -0
  310. package/dist/protocol.js.map +1 -0
  311. package/dist/remote-runtime-provider.d.ts +9 -0
  312. package/dist/remote-runtime-provider.d.ts.map +1 -0
  313. package/dist/remote-runtime-provider.js +1002 -0
  314. package/dist/remote-runtime-provider.js.map +1 -0
  315. package/dist/runtime-chain-service.d.ts +109 -0
  316. package/dist/runtime-chain-service.d.ts.map +1 -0
  317. package/dist/runtime-chain-service.js +846 -0
  318. package/dist/runtime-chain-service.js.map +1 -0
  319. package/dist/runtime-chain.d.ts +8 -0
  320. package/dist/runtime-chain.d.ts.map +1 -0
  321. package/dist/runtime-chain.js +4 -0
  322. package/dist/runtime-chain.js.map +1 -0
  323. package/dist/runtime-storage-access.d.ts +39 -0
  324. package/dist/runtime-storage-access.d.ts.map +1 -0
  325. package/dist/runtime-storage-access.js +209 -0
  326. package/dist/runtime-storage-access.js.map +1 -0
  327. package/dist/scoped-frame.d.ts +55 -0
  328. package/dist/scoped-frame.d.ts.map +1 -0
  329. package/dist/scoped-frame.js +234 -0
  330. package/dist/scoped-frame.js.map +1 -0
  331. package/dist/sdk-interfaces.d.ts +159 -0
  332. package/dist/sdk-interfaces.d.ts.map +1 -0
  333. package/dist/sdk-interfaces.js +2 -0
  334. package/dist/sdk-interfaces.js.map +1 -0
  335. package/dist/statement-store.d.ts +166 -0
  336. package/dist/statement-store.d.ts.map +1 -0
  337. package/dist/statement-store.js +627 -0
  338. package/dist/statement-store.js.map +1 -0
  339. package/dist/telemetry.d.ts +218 -0
  340. package/dist/telemetry.d.ts.map +1 -0
  341. package/dist/telemetry.js +162 -0
  342. package/dist/telemetry.js.map +1 -0
  343. package/dist/types.d.ts +255 -0
  344. package/dist/types.d.ts.map +1 -0
  345. package/dist/types.js +77 -0
  346. package/dist/types.js.map +1 -0
  347. package/dist/wallet-session.d.ts +89 -0
  348. package/dist/wallet-session.d.ts.map +1 -0
  349. package/dist/wallet-session.js +135 -0
  350. package/dist/wallet-session.js.map +1 -0
  351. package/package.json +86 -5
  352. package/index.js +0 -1
@@ -0,0 +1,1402 @@
1
+ /**
2
+ * API protocol definition.
3
+ *
4
+ * This is the core of the entire project: the definition of what methods
5
+ * exist in the host-product API and what their argument/return types are.
6
+ *
7
+ * `hostApiProtocol` is the registry of all protocol methods with their
8
+ * versioned SCALE codec pairs. Types are defined as SCALE codecs (not just
9
+ * TypeScript types) so the wire format is the single source of truth.
10
+ * TypeScript types are derived from the codecs via `CodecType<>`.
11
+ *
12
+ * `MessagePayload` and `Message` define the top-level wire envelope.
13
+ *
14
+ * The derived mapped types (`RequestMethod`, `RequestCodecType<M>`,
15
+ * `RequestParams<M,V>`, `ResponseOk<M,V>`, etc.) are used by both
16
+ * facades and the transport layer for end-to-end type safety.
17
+ */
18
+ import type { Codec, CodecType } from "scale-ts";
19
+ /**
20
+ * All protocol methods with their versioned codec pairs.
21
+ *
22
+ * Request methods have `_request` and `_response` keys.
23
+ * Subscription methods have `_start` and `_receive` keys
24
+ * (`_stop` and `_interrupt` are inferred as `_void`).
25
+ *
26
+ * Each key is a versioned enum: `Enum({ v1: codec })`.
27
+ * When adding a v2, extend the enum: `Enum({ v1: codec1, v2: codec2 })`.
28
+ */
29
+ export declare const hostApiProtocol: {
30
+ readonly host_handshake: {
31
+ readonly _request: Codec<{
32
+ tag: "v1";
33
+ value: number;
34
+ }>;
35
+ readonly _response: Codec<{
36
+ tag: "v1";
37
+ value: import("scale-ts").ResultPayload<undefined, {
38
+ tag: "Unknown";
39
+ value: {
40
+ reason: string;
41
+ };
42
+ } | {
43
+ tag: "Timeout";
44
+ value: undefined;
45
+ } | {
46
+ tag: "UnsupportedProtocolVersion";
47
+ value: undefined;
48
+ }>;
49
+ }>;
50
+ };
51
+ readonly host_feature_supported: {
52
+ readonly _request: Codec<{
53
+ tag: "v1";
54
+ value: {
55
+ tag: "Chain";
56
+ value: `0x${string}`;
57
+ };
58
+ }>;
59
+ readonly _response: Codec<{
60
+ tag: "v1";
61
+ value: import("scale-ts").ResultPayload<boolean, {
62
+ reason: string;
63
+ }>;
64
+ }>;
65
+ };
66
+ readonly host_push_notification: {
67
+ readonly _request: Codec<{
68
+ tag: "v1";
69
+ value: {
70
+ text: string;
71
+ deeplink: string | undefined;
72
+ };
73
+ }>;
74
+ readonly _response: Codec<{
75
+ tag: "v1";
76
+ value: import("scale-ts").ResultPayload<undefined, {
77
+ reason: string;
78
+ }>;
79
+ }>;
80
+ };
81
+ readonly host_navigate_to: {
82
+ readonly _request: Codec<{
83
+ tag: "v1";
84
+ value: string;
85
+ }>;
86
+ readonly _response: Codec<{
87
+ tag: "v1";
88
+ value: import("scale-ts").ResultPayload<undefined, {
89
+ tag: "Unknown";
90
+ value: {
91
+ reason: string;
92
+ };
93
+ } | {
94
+ tag: "PermissionDenied";
95
+ value: undefined;
96
+ }>;
97
+ }>;
98
+ };
99
+ readonly host_device_permission: {
100
+ readonly _request: Codec<{
101
+ tag: "v1";
102
+ value: "Camera" | "Microphone" | "Bluetooth" | "Location";
103
+ }>;
104
+ readonly _response: Codec<{
105
+ tag: "v1";
106
+ value: import("scale-ts").ResultPayload<boolean, {
107
+ reason: string;
108
+ }>;
109
+ }>;
110
+ };
111
+ readonly remote_permission: {
112
+ readonly _request: Codec<{
113
+ tag: "v1";
114
+ value: {
115
+ tag: "ExternalRequest";
116
+ value: string;
117
+ } | {
118
+ tag: "TransactionSubmit";
119
+ value: undefined;
120
+ };
121
+ }>;
122
+ readonly _response: Codec<{
123
+ tag: "v1";
124
+ value: import("scale-ts").ResultPayload<boolean, {
125
+ reason: string;
126
+ }>;
127
+ }>;
128
+ };
129
+ readonly host_local_storage_read: {
130
+ readonly _request: Codec<{
131
+ tag: "v1";
132
+ value: string;
133
+ }>;
134
+ readonly _response: Codec<{
135
+ tag: "v1";
136
+ value: import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike> | undefined, {
137
+ tag: "Unknown";
138
+ value: {
139
+ reason: string;
140
+ };
141
+ } | {
142
+ tag: "Full";
143
+ value: undefined;
144
+ }>;
145
+ }>;
146
+ };
147
+ readonly host_local_storage_write: {
148
+ readonly _request: Codec<{
149
+ tag: "v1";
150
+ value: [string, Uint8Array<ArrayBufferLike>];
151
+ }>;
152
+ readonly _response: Codec<{
153
+ tag: "v1";
154
+ value: import("scale-ts").ResultPayload<undefined, {
155
+ tag: "Unknown";
156
+ value: {
157
+ reason: string;
158
+ };
159
+ } | {
160
+ tag: "Full";
161
+ value: undefined;
162
+ }>;
163
+ }>;
164
+ };
165
+ readonly host_local_storage_clear: {
166
+ readonly _request: Codec<{
167
+ tag: "v1";
168
+ value: string;
169
+ }>;
170
+ readonly _response: Codec<{
171
+ tag: "v1";
172
+ value: import("scale-ts").ResultPayload<undefined, {
173
+ tag: "Unknown";
174
+ value: {
175
+ reason: string;
176
+ };
177
+ } | {
178
+ tag: "Full";
179
+ value: undefined;
180
+ }>;
181
+ }>;
182
+ };
183
+ readonly host_account_connection_status_subscribe: {
184
+ readonly _start: Codec<{
185
+ tag: "v1";
186
+ value: undefined;
187
+ }>;
188
+ readonly _receive: Codec<{
189
+ tag: "v1";
190
+ value: "disconnected" | "connected";
191
+ }>;
192
+ };
193
+ readonly host_account_get: {
194
+ readonly _request: Codec<{
195
+ tag: "v1";
196
+ value: [string, number];
197
+ }>;
198
+ readonly _response: Codec<{
199
+ tag: "v1";
200
+ value: import("scale-ts").ResultPayload<{
201
+ publicKey: Uint8Array<ArrayBufferLike>;
202
+ name: string | undefined;
203
+ }, {
204
+ tag: "NotConnected";
205
+ value: undefined;
206
+ } | {
207
+ tag: "Rejected";
208
+ value: undefined;
209
+ } | {
210
+ tag: "DomainNotValid";
211
+ value: undefined;
212
+ } | {
213
+ tag: "Unknown";
214
+ value: {
215
+ reason: string;
216
+ };
217
+ }>;
218
+ }>;
219
+ };
220
+ readonly host_account_get_alias: {
221
+ readonly _request: Codec<{
222
+ tag: "v1";
223
+ value: [string, number];
224
+ }>;
225
+ readonly _response: Codec<{
226
+ tag: "v1";
227
+ value: import("scale-ts").ResultPayload<{
228
+ context: Uint8Array<ArrayBufferLike>;
229
+ alias: Uint8Array<ArrayBufferLike>;
230
+ }, {
231
+ tag: "NotConnected";
232
+ value: undefined;
233
+ } | {
234
+ tag: "Rejected";
235
+ value: undefined;
236
+ } | {
237
+ tag: "DomainNotValid";
238
+ value: undefined;
239
+ } | {
240
+ tag: "Unknown";
241
+ value: {
242
+ reason: string;
243
+ };
244
+ }>;
245
+ }>;
246
+ };
247
+ readonly host_account_create_proof: {
248
+ readonly _request: Codec<{
249
+ tag: "v1";
250
+ value: [[string, number], {
251
+ genesisHash: `0x${string}`;
252
+ ringRootHash: `0x${string}`;
253
+ hints: {
254
+ palletInstance: number | undefined;
255
+ } | undefined;
256
+ }, Uint8Array<ArrayBufferLike>];
257
+ }>;
258
+ readonly _response: Codec<{
259
+ tag: "v1";
260
+ value: import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, {
261
+ tag: "Rejected";
262
+ value: undefined;
263
+ } | {
264
+ tag: "Unknown";
265
+ value: {
266
+ reason: string;
267
+ };
268
+ } | {
269
+ tag: "RingNotFound";
270
+ value: undefined;
271
+ }>;
272
+ }>;
273
+ };
274
+ readonly host_get_non_product_accounts: {
275
+ readonly _request: Codec<{
276
+ tag: "v1";
277
+ value: undefined;
278
+ }>;
279
+ readonly _response: Codec<{
280
+ tag: "v1";
281
+ value: import("scale-ts").ResultPayload<{
282
+ publicKey: Uint8Array<ArrayBufferLike>;
283
+ name: string | undefined;
284
+ }[], {
285
+ tag: "NotConnected";
286
+ value: undefined;
287
+ } | {
288
+ tag: "Rejected";
289
+ value: undefined;
290
+ } | {
291
+ tag: "DomainNotValid";
292
+ value: undefined;
293
+ } | {
294
+ tag: "Unknown";
295
+ value: {
296
+ reason: string;
297
+ };
298
+ }>;
299
+ }>;
300
+ };
301
+ readonly host_create_transaction: {
302
+ readonly _request: Codec<{
303
+ tag: "v1";
304
+ value: [[string, number], {
305
+ tag: "v1";
306
+ value: {
307
+ signer: string | undefined;
308
+ callData: `0x${string}`;
309
+ extensions: {
310
+ id: string;
311
+ extra: `0x${string}`;
312
+ additionalSigned: `0x${string}`;
313
+ }[];
314
+ txExtVersion: number;
315
+ context: {
316
+ metadata: `0x${string}`;
317
+ tokenSymbol: string;
318
+ tokenDecimals: number;
319
+ bestBlockHeight: number;
320
+ };
321
+ };
322
+ }];
323
+ }>;
324
+ readonly _response: Codec<{
325
+ tag: "v1";
326
+ value: import("scale-ts").ResultPayload<`0x${string}`, {
327
+ tag: "Rejected";
328
+ value: undefined;
329
+ } | {
330
+ tag: "Unknown";
331
+ value: {
332
+ reason: string;
333
+ };
334
+ } | {
335
+ tag: "FailedToDecode";
336
+ value: undefined;
337
+ } | {
338
+ tag: "PermissionDenied";
339
+ value: undefined;
340
+ } | {
341
+ tag: "NotSupported";
342
+ value: string;
343
+ }>;
344
+ }>;
345
+ };
346
+ readonly host_create_transaction_with_non_product_account: {
347
+ readonly _request: Codec<{
348
+ tag: "v1";
349
+ value: {
350
+ tag: "v1";
351
+ value: {
352
+ signer: string | undefined;
353
+ callData: `0x${string}`;
354
+ extensions: {
355
+ id: string;
356
+ extra: `0x${string}`;
357
+ additionalSigned: `0x${string}`;
358
+ }[];
359
+ txExtVersion: number;
360
+ context: {
361
+ metadata: `0x${string}`;
362
+ tokenSymbol: string;
363
+ tokenDecimals: number;
364
+ bestBlockHeight: number;
365
+ };
366
+ };
367
+ };
368
+ }>;
369
+ readonly _response: Codec<{
370
+ tag: "v1";
371
+ value: import("scale-ts").ResultPayload<`0x${string}`, {
372
+ tag: "Rejected";
373
+ value: undefined;
374
+ } | {
375
+ tag: "Unknown";
376
+ value: {
377
+ reason: string;
378
+ };
379
+ } | {
380
+ tag: "FailedToDecode";
381
+ value: undefined;
382
+ } | {
383
+ tag: "PermissionDenied";
384
+ value: undefined;
385
+ } | {
386
+ tag: "NotSupported";
387
+ value: string;
388
+ }>;
389
+ }>;
390
+ };
391
+ readonly host_payment_balance_subscribe: {
392
+ readonly _start: Codec<{
393
+ tag: "v1";
394
+ value: undefined;
395
+ }>;
396
+ readonly _receive: Codec<{
397
+ tag: "v1";
398
+ value: {
399
+ available: {
400
+ currency: string;
401
+ minorUnits: string;
402
+ };
403
+ pending: {
404
+ currency: string;
405
+ minorUnits: string;
406
+ };
407
+ };
408
+ }>;
409
+ };
410
+ readonly host_payment_top_up: {
411
+ readonly _request: Codec<{
412
+ tag: "v1";
413
+ value: {
414
+ amount: {
415
+ currency: string;
416
+ minorUnits: string;
417
+ };
418
+ source: {
419
+ tag: "ProductAccount";
420
+ value: {
421
+ account: [string, number];
422
+ };
423
+ } | {
424
+ tag: "OneTimePrivateKey";
425
+ value: {
426
+ privateKey: Uint8Array<ArrayBufferLike>;
427
+ };
428
+ };
429
+ };
430
+ }>;
431
+ readonly _response: Codec<{
432
+ tag: "v1";
433
+ value: import("scale-ts").ResultPayload<undefined, {
434
+ reason: string;
435
+ }>;
436
+ }>;
437
+ };
438
+ readonly host_payment_request: {
439
+ readonly _request: Codec<{
440
+ tag: "v1";
441
+ value: {
442
+ amount: {
443
+ currency: string;
444
+ minorUnits: string;
445
+ };
446
+ recipient: string;
447
+ memo: string | undefined;
448
+ };
449
+ }>;
450
+ readonly _response: Codec<{
451
+ tag: "v1";
452
+ value: import("scale-ts").ResultPayload<{
453
+ id: string;
454
+ }, {
455
+ reason: string;
456
+ }>;
457
+ }>;
458
+ };
459
+ readonly host_payment_status_subscribe: {
460
+ readonly _start: Codec<{
461
+ tag: "v1";
462
+ value: string;
463
+ }>;
464
+ readonly _receive: Codec<{
465
+ tag: "v1";
466
+ value: {
467
+ tag: "Processing";
468
+ value: undefined;
469
+ } | {
470
+ tag: "Completed";
471
+ value: undefined;
472
+ } | {
473
+ tag: "Failed";
474
+ value: {
475
+ reason: string;
476
+ };
477
+ };
478
+ }>;
479
+ };
480
+ readonly host_sign_raw: {
481
+ readonly _request: Codec<{
482
+ tag: "v1";
483
+ value: {
484
+ address: string;
485
+ data: {
486
+ tag: "Bytes";
487
+ value: Uint8Array<ArrayBufferLike>;
488
+ } | {
489
+ tag: "Payload";
490
+ value: string;
491
+ };
492
+ };
493
+ }>;
494
+ readonly _response: Codec<{
495
+ tag: "v1";
496
+ value: import("scale-ts").ResultPayload<{
497
+ signature: `0x${string}`;
498
+ signedTransaction: `0x${string}` | undefined;
499
+ }, {
500
+ tag: "Rejected";
501
+ value: undefined;
502
+ } | {
503
+ tag: "Unknown";
504
+ value: {
505
+ reason: string;
506
+ };
507
+ } | {
508
+ tag: "FailedToDecode";
509
+ value: undefined;
510
+ } | {
511
+ tag: "PermissionDenied";
512
+ value: undefined;
513
+ }>;
514
+ }>;
515
+ };
516
+ readonly host_sign_payload: {
517
+ readonly _request: Codec<{
518
+ tag: "v1";
519
+ value: {
520
+ address: string;
521
+ blockHash: `0x${string}`;
522
+ blockNumber: `0x${string}`;
523
+ era: `0x${string}`;
524
+ genesisHash: `0x${string}`;
525
+ method: `0x${string}`;
526
+ nonce: `0x${string}`;
527
+ specVersion: `0x${string}`;
528
+ tip: `0x${string}`;
529
+ transactionVersion: `0x${string}`;
530
+ signedExtensions: string[];
531
+ version: number;
532
+ assetId: `0x${string}` | undefined;
533
+ metadataHash: `0x${string}` | undefined;
534
+ mode: number | undefined;
535
+ withSignedTransaction: boolean | undefined;
536
+ };
537
+ }>;
538
+ readonly _response: Codec<{
539
+ tag: "v1";
540
+ value: import("scale-ts").ResultPayload<{
541
+ signature: `0x${string}`;
542
+ signedTransaction: `0x${string}` | undefined;
543
+ }, {
544
+ tag: "Rejected";
545
+ value: undefined;
546
+ } | {
547
+ tag: "Unknown";
548
+ value: {
549
+ reason: string;
550
+ };
551
+ } | {
552
+ tag: "FailedToDecode";
553
+ value: undefined;
554
+ } | {
555
+ tag: "PermissionDenied";
556
+ value: undefined;
557
+ }>;
558
+ }>;
559
+ };
560
+ readonly host_chat_create_room: {
561
+ readonly _request: Codec<{
562
+ tag: "v1";
563
+ value: {
564
+ roomId: string;
565
+ name: string;
566
+ icon: string;
567
+ };
568
+ }>;
569
+ readonly _response: Codec<{
570
+ tag: "v1";
571
+ value: import("scale-ts").ResultPayload<{
572
+ status: "New" | "Exists";
573
+ }, {
574
+ tag: "Unknown";
575
+ value: {
576
+ reason: string;
577
+ };
578
+ } | {
579
+ tag: "PermissionDenied";
580
+ value: undefined;
581
+ }>;
582
+ }>;
583
+ };
584
+ readonly host_chat_register_bot: {
585
+ readonly _request: Codec<{
586
+ tag: "v1";
587
+ value: {
588
+ botId: string;
589
+ name: string;
590
+ icon: string;
591
+ };
592
+ }>;
593
+ readonly _response: Codec<{
594
+ tag: "v1";
595
+ value: import("scale-ts").ResultPayload<{
596
+ status: "New" | "Exists";
597
+ }, {
598
+ tag: "Unknown";
599
+ value: {
600
+ reason: string;
601
+ };
602
+ } | {
603
+ tag: "PermissionDenied";
604
+ value: undefined;
605
+ }>;
606
+ }>;
607
+ };
608
+ readonly host_chat_list_subscribe: {
609
+ readonly _start: Codec<{
610
+ tag: "v1";
611
+ value: undefined;
612
+ }>;
613
+ readonly _receive: Codec<{
614
+ tag: "v1";
615
+ value: {
616
+ roomId: string;
617
+ participatingAs: "RoomHost" | "Bot";
618
+ }[];
619
+ }>;
620
+ };
621
+ readonly host_chat_post_message: {
622
+ readonly _request: Codec<{
623
+ tag: "v1";
624
+ value: {
625
+ roomId: string;
626
+ payload: {
627
+ tag: "Text";
628
+ value: string;
629
+ } | {
630
+ tag: "RichText";
631
+ value: {
632
+ text: string | undefined;
633
+ media: {
634
+ url: string;
635
+ }[];
636
+ };
637
+ } | {
638
+ tag: "Actions";
639
+ value: {
640
+ text: string | undefined;
641
+ actions: {
642
+ actionId: string;
643
+ title: string;
644
+ }[];
645
+ layout: "Column" | "Grid";
646
+ };
647
+ } | {
648
+ tag: "File";
649
+ value: {
650
+ url: string;
651
+ fileName: string;
652
+ mimeType: string;
653
+ sizeBytes: bigint;
654
+ text: string | undefined;
655
+ };
656
+ } | {
657
+ tag: "Reaction";
658
+ value: {
659
+ messageId: string;
660
+ emoji: string;
661
+ };
662
+ } | {
663
+ tag: "ReactionRemoved";
664
+ value: {
665
+ messageId: string;
666
+ emoji: string;
667
+ };
668
+ } | {
669
+ tag: "Custom";
670
+ value: {
671
+ messageType: string;
672
+ payload: Uint8Array<ArrayBufferLike>;
673
+ };
674
+ };
675
+ };
676
+ }>;
677
+ readonly _response: Codec<{
678
+ tag: "v1";
679
+ value: import("scale-ts").ResultPayload<{
680
+ messageId: string;
681
+ }, {
682
+ tag: "Unknown";
683
+ value: {
684
+ reason: string;
685
+ };
686
+ } | {
687
+ tag: "MessageTooLarge";
688
+ value: undefined;
689
+ }>;
690
+ }>;
691
+ };
692
+ readonly host_chat_action_subscribe: {
693
+ readonly _start: Codec<{
694
+ tag: "v1";
695
+ value: undefined;
696
+ }>;
697
+ readonly _receive: Codec<{
698
+ tag: "v1";
699
+ value: {
700
+ roomId: string;
701
+ peer: string;
702
+ payload: {
703
+ tag: "MessagePosted";
704
+ value: {
705
+ tag: "Text";
706
+ value: string;
707
+ } | {
708
+ tag: "RichText";
709
+ value: {
710
+ text: string | undefined;
711
+ media: {
712
+ url: string;
713
+ }[];
714
+ };
715
+ } | {
716
+ tag: "Actions";
717
+ value: {
718
+ text: string | undefined;
719
+ actions: {
720
+ actionId: string;
721
+ title: string;
722
+ }[];
723
+ layout: "Column" | "Grid";
724
+ };
725
+ } | {
726
+ tag: "File";
727
+ value: {
728
+ url: string;
729
+ fileName: string;
730
+ mimeType: string;
731
+ sizeBytes: bigint;
732
+ text: string | undefined;
733
+ };
734
+ } | {
735
+ tag: "Reaction";
736
+ value: {
737
+ messageId: string;
738
+ emoji: string;
739
+ };
740
+ } | {
741
+ tag: "ReactionRemoved";
742
+ value: {
743
+ messageId: string;
744
+ emoji: string;
745
+ };
746
+ } | {
747
+ tag: "Custom";
748
+ value: {
749
+ messageType: string;
750
+ payload: Uint8Array<ArrayBufferLike>;
751
+ };
752
+ };
753
+ } | {
754
+ tag: "ActionTriggered";
755
+ value: {
756
+ messageId: string;
757
+ actionId: string;
758
+ payload: Uint8Array<ArrayBufferLike> | undefined;
759
+ };
760
+ } | {
761
+ tag: "Command";
762
+ value: {
763
+ command: string;
764
+ payload: string;
765
+ };
766
+ };
767
+ };
768
+ }>;
769
+ };
770
+ readonly product_chat_custom_message_render_subscribe: {
771
+ readonly _start: Codec<{
772
+ tag: "v1";
773
+ value: {
774
+ messageId: string;
775
+ messageType: string;
776
+ payload: Uint8Array<ArrayBufferLike>;
777
+ };
778
+ }>;
779
+ readonly _receive: Codec<{
780
+ tag: "v1";
781
+ value: import("./types.js").CustomRendererNode;
782
+ }>;
783
+ };
784
+ readonly remote_statement_store_subscribe: {
785
+ readonly _start: Codec<{
786
+ tag: "v1";
787
+ value: Uint8Array<ArrayBufferLike>[];
788
+ }>;
789
+ readonly _receive: Codec<{
790
+ tag: "v1";
791
+ value: {
792
+ proof: {
793
+ tag: "Sr25519";
794
+ value: {
795
+ signature: Uint8Array<ArrayBufferLike>;
796
+ signer: Uint8Array<ArrayBufferLike>;
797
+ };
798
+ } | {
799
+ tag: "Ed25519";
800
+ value: {
801
+ signature: Uint8Array<ArrayBufferLike>;
802
+ signer: Uint8Array<ArrayBufferLike>;
803
+ };
804
+ } | {
805
+ tag: "Ecdsa";
806
+ value: {
807
+ signature: Uint8Array<ArrayBufferLike>;
808
+ signer: Uint8Array<ArrayBufferLike>;
809
+ };
810
+ } | {
811
+ tag: "OnChain";
812
+ value: {
813
+ who: Uint8Array<ArrayBufferLike>;
814
+ blockHash: Uint8Array<ArrayBufferLike>;
815
+ event: bigint;
816
+ };
817
+ };
818
+ decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
819
+ expiry: bigint | undefined;
820
+ channel: Uint8Array<ArrayBufferLike> | undefined;
821
+ topics: Uint8Array<ArrayBufferLike>[];
822
+ data: Uint8Array<ArrayBufferLike> | undefined;
823
+ }[];
824
+ }>;
825
+ };
826
+ readonly remote_statement_store_create_proof: {
827
+ readonly _request: Codec<{
828
+ tag: "v1";
829
+ value: [[string, number], {
830
+ proof: {
831
+ tag: "Sr25519";
832
+ value: {
833
+ signature: Uint8Array<ArrayBufferLike>;
834
+ signer: Uint8Array<ArrayBufferLike>;
835
+ };
836
+ } | {
837
+ tag: "Ed25519";
838
+ value: {
839
+ signature: Uint8Array<ArrayBufferLike>;
840
+ signer: Uint8Array<ArrayBufferLike>;
841
+ };
842
+ } | {
843
+ tag: "Ecdsa";
844
+ value: {
845
+ signature: Uint8Array<ArrayBufferLike>;
846
+ signer: Uint8Array<ArrayBufferLike>;
847
+ };
848
+ } | {
849
+ tag: "OnChain";
850
+ value: {
851
+ who: Uint8Array<ArrayBufferLike>;
852
+ blockHash: Uint8Array<ArrayBufferLike>;
853
+ event: bigint;
854
+ };
855
+ } | undefined;
856
+ decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
857
+ expiry: bigint | undefined;
858
+ channel: Uint8Array<ArrayBufferLike> | undefined;
859
+ topics: Uint8Array<ArrayBufferLike>[];
860
+ data: Uint8Array<ArrayBufferLike> | undefined;
861
+ }];
862
+ }>;
863
+ readonly _response: Codec<{
864
+ tag: "v1";
865
+ value: import("scale-ts").ResultPayload<{
866
+ tag: "Sr25519";
867
+ value: {
868
+ signature: Uint8Array<ArrayBufferLike>;
869
+ signer: Uint8Array<ArrayBufferLike>;
870
+ };
871
+ } | {
872
+ tag: "Ed25519";
873
+ value: {
874
+ signature: Uint8Array<ArrayBufferLike>;
875
+ signer: Uint8Array<ArrayBufferLike>;
876
+ };
877
+ } | {
878
+ tag: "Ecdsa";
879
+ value: {
880
+ signature: Uint8Array<ArrayBufferLike>;
881
+ signer: Uint8Array<ArrayBufferLike>;
882
+ };
883
+ } | {
884
+ tag: "OnChain";
885
+ value: {
886
+ who: Uint8Array<ArrayBufferLike>;
887
+ blockHash: Uint8Array<ArrayBufferLike>;
888
+ event: bigint;
889
+ };
890
+ }, {
891
+ tag: "Unknown";
892
+ value: {
893
+ reason: string;
894
+ };
895
+ } | {
896
+ tag: "UnableToSign";
897
+ value: undefined;
898
+ } | {
899
+ tag: "UnknownAccount";
900
+ value: undefined;
901
+ }>;
902
+ }>;
903
+ };
904
+ readonly remote_statement_store_submit: {
905
+ readonly _request: Codec<{
906
+ tag: "v1";
907
+ value: {
908
+ proof: {
909
+ tag: "Sr25519";
910
+ value: {
911
+ signature: Uint8Array<ArrayBufferLike>;
912
+ signer: Uint8Array<ArrayBufferLike>;
913
+ };
914
+ } | {
915
+ tag: "Ed25519";
916
+ value: {
917
+ signature: Uint8Array<ArrayBufferLike>;
918
+ signer: Uint8Array<ArrayBufferLike>;
919
+ };
920
+ } | {
921
+ tag: "Ecdsa";
922
+ value: {
923
+ signature: Uint8Array<ArrayBufferLike>;
924
+ signer: Uint8Array<ArrayBufferLike>;
925
+ };
926
+ } | {
927
+ tag: "OnChain";
928
+ value: {
929
+ who: Uint8Array<ArrayBufferLike>;
930
+ blockHash: Uint8Array<ArrayBufferLike>;
931
+ event: bigint;
932
+ };
933
+ };
934
+ decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
935
+ expiry: bigint | undefined;
936
+ channel: Uint8Array<ArrayBufferLike> | undefined;
937
+ topics: Uint8Array<ArrayBufferLike>[];
938
+ data: Uint8Array<ArrayBufferLike> | undefined;
939
+ };
940
+ }>;
941
+ readonly _response: Codec<{
942
+ tag: "v1";
943
+ value: import("scale-ts").ResultPayload<undefined, {
944
+ reason: string;
945
+ }>;
946
+ }>;
947
+ };
948
+ readonly remote_preimage_lookup_subscribe: {
949
+ readonly _start: Codec<{
950
+ tag: "v1";
951
+ value: `0x${string}`;
952
+ }>;
953
+ readonly _receive: Codec<{
954
+ tag: "v1";
955
+ value: Uint8Array<ArrayBufferLike> | undefined;
956
+ }>;
957
+ };
958
+ readonly remote_preimage_submit: {
959
+ readonly _request: Codec<{
960
+ tag: "v1";
961
+ value: Uint8Array<ArrayBufferLike>;
962
+ }>;
963
+ readonly _response: Codec<{
964
+ tag: "v1";
965
+ value: import("scale-ts").ResultPayload<`0x${string}`, {
966
+ tag: "Unknown";
967
+ value: {
968
+ reason: string;
969
+ };
970
+ }>;
971
+ }>;
972
+ };
973
+ readonly host_jsonrpc_message_send: {
974
+ readonly _request: Codec<{
975
+ tag: "v1";
976
+ value: [`0x${string}`, string];
977
+ }>;
978
+ readonly _response: Codec<{
979
+ tag: "v1";
980
+ value: import("scale-ts").ResultPayload<undefined, {
981
+ reason: string;
982
+ }>;
983
+ }>;
984
+ };
985
+ readonly host_jsonrpc_message_subscribe: {
986
+ readonly _start: Codec<{
987
+ tag: "v1";
988
+ value: `0x${string}`;
989
+ }>;
990
+ readonly _receive: Codec<{
991
+ tag: "v1";
992
+ value: string;
993
+ }>;
994
+ };
995
+ readonly remote_chain_head_follow: {
996
+ readonly _start: Codec<{
997
+ tag: "v1";
998
+ value: {
999
+ genesisHash: `0x${string}`;
1000
+ withRuntime: boolean;
1001
+ };
1002
+ }>;
1003
+ readonly _receive: Codec<{
1004
+ tag: "v1";
1005
+ value: {
1006
+ tag: "Initialized";
1007
+ value: {
1008
+ finalizedBlockHashes: `0x${string}`[];
1009
+ finalizedBlockRuntime: {
1010
+ tag: "Valid";
1011
+ value: {
1012
+ specName: string;
1013
+ implName: string;
1014
+ specVersion: number;
1015
+ implVersion: number;
1016
+ transactionVersion: number | undefined;
1017
+ apis: [string, number][];
1018
+ };
1019
+ } | {
1020
+ tag: "Invalid";
1021
+ value: {
1022
+ error: string;
1023
+ };
1024
+ } | undefined;
1025
+ };
1026
+ } | {
1027
+ tag: "NewBlock";
1028
+ value: {
1029
+ blockHash: `0x${string}`;
1030
+ parentBlockHash: `0x${string}`;
1031
+ newRuntime: {
1032
+ tag: "Valid";
1033
+ value: {
1034
+ specName: string;
1035
+ implName: string;
1036
+ specVersion: number;
1037
+ implVersion: number;
1038
+ transactionVersion: number | undefined;
1039
+ apis: [string, number][];
1040
+ };
1041
+ } | {
1042
+ tag: "Invalid";
1043
+ value: {
1044
+ error: string;
1045
+ };
1046
+ } | undefined;
1047
+ };
1048
+ } | {
1049
+ tag: "BestBlockChanged";
1050
+ value: {
1051
+ bestBlockHash: `0x${string}`;
1052
+ };
1053
+ } | {
1054
+ tag: "Finalized";
1055
+ value: {
1056
+ finalizedBlockHashes: `0x${string}`[];
1057
+ prunedBlockHashes: `0x${string}`[];
1058
+ };
1059
+ } | {
1060
+ tag: "OperationBodyDone";
1061
+ value: {
1062
+ operationId: string;
1063
+ value: `0x${string}`[];
1064
+ };
1065
+ } | {
1066
+ tag: "OperationCallDone";
1067
+ value: {
1068
+ operationId: string;
1069
+ output: `0x${string}`;
1070
+ };
1071
+ } | {
1072
+ tag: "OperationStorageItems";
1073
+ value: {
1074
+ operationId: string;
1075
+ items: {
1076
+ key: `0x${string}`;
1077
+ value: `0x${string}` | undefined;
1078
+ hash: `0x${string}` | undefined;
1079
+ closestDescendantMerkleValue: `0x${string}` | undefined;
1080
+ }[];
1081
+ };
1082
+ } | {
1083
+ tag: "OperationStorageDone";
1084
+ value: {
1085
+ operationId: string;
1086
+ };
1087
+ } | {
1088
+ tag: "OperationWaitingForContinue";
1089
+ value: {
1090
+ operationId: string;
1091
+ };
1092
+ } | {
1093
+ tag: "OperationInaccessible";
1094
+ value: {
1095
+ operationId: string;
1096
+ };
1097
+ } | {
1098
+ tag: "OperationError";
1099
+ value: {
1100
+ operationId: string;
1101
+ error: string;
1102
+ };
1103
+ } | {
1104
+ tag: "Stop";
1105
+ value: undefined;
1106
+ };
1107
+ }>;
1108
+ };
1109
+ readonly remote_chain_head_header: {
1110
+ readonly _request: Codec<{
1111
+ tag: "v1";
1112
+ value: {
1113
+ genesisHash: `0x${string}`;
1114
+ followSubscriptionId: string;
1115
+ hash: `0x${string}`;
1116
+ };
1117
+ }>;
1118
+ readonly _response: Codec<{
1119
+ tag: "v1";
1120
+ value: import("scale-ts").ResultPayload<`0x${string}` | undefined, {
1121
+ reason: string;
1122
+ }>;
1123
+ }>;
1124
+ };
1125
+ readonly remote_chain_head_body: {
1126
+ readonly _request: Codec<{
1127
+ tag: "v1";
1128
+ value: {
1129
+ genesisHash: `0x${string}`;
1130
+ followSubscriptionId: string;
1131
+ hash: `0x${string}`;
1132
+ };
1133
+ }>;
1134
+ readonly _response: Codec<{
1135
+ tag: "v1";
1136
+ value: import("scale-ts").ResultPayload<{
1137
+ tag: "Started";
1138
+ value: {
1139
+ operationId: string;
1140
+ };
1141
+ } | {
1142
+ tag: "LimitReached";
1143
+ value: undefined;
1144
+ }, {
1145
+ reason: string;
1146
+ }>;
1147
+ }>;
1148
+ };
1149
+ readonly remote_chain_head_storage: {
1150
+ readonly _request: Codec<{
1151
+ tag: "v1";
1152
+ value: {
1153
+ genesisHash: `0x${string}`;
1154
+ followSubscriptionId: string;
1155
+ hash: `0x${string}`;
1156
+ items: {
1157
+ key: `0x${string}`;
1158
+ type: "Value" | "Hash" | "ClosestDescendantMerkleValue" | "DescendantsValues" | "DescendantsHashes";
1159
+ }[];
1160
+ childTrie: `0x${string}` | undefined;
1161
+ };
1162
+ }>;
1163
+ readonly _response: Codec<{
1164
+ tag: "v1";
1165
+ value: import("scale-ts").ResultPayload<{
1166
+ tag: "Started";
1167
+ value: {
1168
+ operationId: string;
1169
+ };
1170
+ } | {
1171
+ tag: "LimitReached";
1172
+ value: undefined;
1173
+ }, {
1174
+ reason: string;
1175
+ }>;
1176
+ }>;
1177
+ };
1178
+ readonly remote_chain_head_call: {
1179
+ readonly _request: Codec<{
1180
+ tag: "v1";
1181
+ value: {
1182
+ genesisHash: `0x${string}`;
1183
+ followSubscriptionId: string;
1184
+ hash: `0x${string}`;
1185
+ function: string;
1186
+ callParameters: `0x${string}`;
1187
+ };
1188
+ }>;
1189
+ readonly _response: Codec<{
1190
+ tag: "v1";
1191
+ value: import("scale-ts").ResultPayload<{
1192
+ tag: "Started";
1193
+ value: {
1194
+ operationId: string;
1195
+ };
1196
+ } | {
1197
+ tag: "LimitReached";
1198
+ value: undefined;
1199
+ }, {
1200
+ reason: string;
1201
+ }>;
1202
+ }>;
1203
+ };
1204
+ readonly remote_chain_head_unpin: {
1205
+ readonly _request: Codec<{
1206
+ tag: "v1";
1207
+ value: {
1208
+ genesisHash: `0x${string}`;
1209
+ followSubscriptionId: string;
1210
+ hashes: `0x${string}`[];
1211
+ };
1212
+ }>;
1213
+ readonly _response: Codec<{
1214
+ tag: "v1";
1215
+ value: import("scale-ts").ResultPayload<undefined, {
1216
+ reason: string;
1217
+ }>;
1218
+ }>;
1219
+ };
1220
+ readonly remote_chain_head_continue: {
1221
+ readonly _request: Codec<{
1222
+ tag: "v1";
1223
+ value: {
1224
+ genesisHash: `0x${string}`;
1225
+ followSubscriptionId: string;
1226
+ operationId: string;
1227
+ };
1228
+ }>;
1229
+ readonly _response: Codec<{
1230
+ tag: "v1";
1231
+ value: import("scale-ts").ResultPayload<undefined, {
1232
+ reason: string;
1233
+ }>;
1234
+ }>;
1235
+ };
1236
+ readonly remote_chain_head_stop_operation: {
1237
+ readonly _request: Codec<{
1238
+ tag: "v1";
1239
+ value: {
1240
+ genesisHash: `0x${string}`;
1241
+ followSubscriptionId: string;
1242
+ operationId: string;
1243
+ };
1244
+ }>;
1245
+ readonly _response: Codec<{
1246
+ tag: "v1";
1247
+ value: import("scale-ts").ResultPayload<undefined, {
1248
+ reason: string;
1249
+ }>;
1250
+ }>;
1251
+ };
1252
+ readonly remote_chain_spec_genesis_hash: {
1253
+ readonly _request: Codec<{
1254
+ tag: "v1";
1255
+ value: `0x${string}`;
1256
+ }>;
1257
+ readonly _response: Codec<{
1258
+ tag: "v1";
1259
+ value: import("scale-ts").ResultPayload<`0x${string}`, {
1260
+ reason: string;
1261
+ }>;
1262
+ }>;
1263
+ };
1264
+ readonly remote_chain_spec_chain_name: {
1265
+ readonly _request: Codec<{
1266
+ tag: "v1";
1267
+ value: `0x${string}`;
1268
+ }>;
1269
+ readonly _response: Codec<{
1270
+ tag: "v1";
1271
+ value: import("scale-ts").ResultPayload<string, {
1272
+ reason: string;
1273
+ }>;
1274
+ }>;
1275
+ };
1276
+ readonly remote_chain_spec_properties: {
1277
+ readonly _request: Codec<{
1278
+ tag: "v1";
1279
+ value: `0x${string}`;
1280
+ }>;
1281
+ readonly _response: Codec<{
1282
+ tag: "v1";
1283
+ value: import("scale-ts").ResultPayload<string, {
1284
+ reason: string;
1285
+ }>;
1286
+ }>;
1287
+ };
1288
+ readonly remote_chain_transaction_broadcast: {
1289
+ readonly _request: Codec<{
1290
+ tag: "v1";
1291
+ value: {
1292
+ genesisHash: `0x${string}`;
1293
+ transaction: `0x${string}`;
1294
+ };
1295
+ }>;
1296
+ readonly _response: Codec<{
1297
+ tag: "v1";
1298
+ value: import("scale-ts").ResultPayload<string | undefined, {
1299
+ reason: string;
1300
+ }>;
1301
+ }>;
1302
+ };
1303
+ readonly remote_chain_transaction_stop: {
1304
+ readonly _request: Codec<{
1305
+ tag: "v1";
1306
+ value: {
1307
+ genesisHash: `0x${string}`;
1308
+ operationId: string;
1309
+ };
1310
+ }>;
1311
+ readonly _response: Codec<{
1312
+ tag: "v1";
1313
+ value: import("scale-ts").ResultPayload<undefined, {
1314
+ reason: string;
1315
+ }>;
1316
+ }>;
1317
+ };
1318
+ readonly host_codec_upgrade: {
1319
+ readonly _request: Codec<{
1320
+ tag: "v1";
1321
+ value: {
1322
+ supportedFormats: string[];
1323
+ };
1324
+ }>;
1325
+ readonly _response: Codec<{
1326
+ tag: "v1";
1327
+ value: {
1328
+ selectedFormat: string;
1329
+ };
1330
+ }>;
1331
+ };
1332
+ };
1333
+ type Protocol = typeof hostApiProtocol;
1334
+ /** Union of all request method names (entries with `_request` / `_response`). */
1335
+ export type RequestMethod = {
1336
+ [K in keyof Protocol]: "_request" extends keyof Protocol[K] ? K : never;
1337
+ }[keyof Protocol];
1338
+ /** Union of all subscription method names (entries with `_start` / `_receive`). */
1339
+ export type SubscriptionMethod = {
1340
+ [K in keyof Protocol]: "_start" extends keyof Protocol[K] ? K : never;
1341
+ }[keyof Protocol];
1342
+ /** Action string suffixes for request methods. */
1343
+ type RequestSuffix = "request" | "response";
1344
+ /** Action string suffixes for subscription methods. */
1345
+ type SubscriptionSuffix = "start" | "receive" | "stop" | "interrupt";
1346
+ /** Union of all valid action strings on the wire. */
1347
+ export type ActionString = `${RequestMethod}_${RequestSuffix}` | `${SubscriptionMethod}_${SubscriptionSuffix}`;
1348
+ /** Full decoded type of a request method's _request codec (versioned envelope). */
1349
+ export type RequestCodecType<M extends RequestMethod> = CodecType<Protocol[M]["_request"]>;
1350
+ /** Full decoded type of a request method's _response codec (versioned envelope). */
1351
+ export type ResponseCodecType<M extends RequestMethod> = CodecType<Protocol[M]["_response"]>;
1352
+ /** Full decoded type of a subscription method's _start codec (versioned envelope). */
1353
+ export type StartCodecType<M extends SubscriptionMethod> = CodecType<Protocol[M]["_start"]>;
1354
+ /** Full decoded type of a subscription method's _receive codec (versioned envelope). */
1355
+ export type ReceiveCodecType<M extends SubscriptionMethod> = CodecType<Protocol[M]["_receive"]>;
1356
+ /** Available version tags for a request method's _request codec. */
1357
+ export type RequestVersions<M extends RequestMethod> = RequestCodecType<M>["tag"];
1358
+ /** Available version tags for a request method's _response codec. */
1359
+ export type ResponseVersions<M extends RequestMethod> = ResponseCodecType<M>["tag"];
1360
+ /** Available version tags for a subscription method's _start codec. */
1361
+ export type StartVersions<M extends SubscriptionMethod> = StartCodecType<M>["tag"];
1362
+ /** Available version tags for a subscription method's _receive codec. */
1363
+ export type ReceiveVersions<M extends SubscriptionMethod> = ReceiveCodecType<M>["tag"];
1364
+ /** Extract the inner value type for a specific version tag from a versioned enum type. */
1365
+ type VersionValue<T, V extends string> = Extract<T, {
1366
+ tag: V;
1367
+ }> extends {
1368
+ value: infer U;
1369
+ } ? U : never;
1370
+ /** Request params type for method M at version V. */
1371
+ export type RequestParams<M extends RequestMethod, V extends string> = VersionValue<RequestCodecType<M>, V>;
1372
+ /** The full Result type for method M's response at version V. */
1373
+ type ResponseResultType<M extends RequestMethod, V extends string> = VersionValue<ResponseCodecType<M>, V>;
1374
+ /** Ok type from a request method's response Result at version V. */
1375
+ export type ResponseOk<M extends RequestMethod, V extends string> = Extract<ResponseResultType<M, V>, {
1376
+ success: true;
1377
+ }> extends {
1378
+ value: infer U;
1379
+ } ? U : never;
1380
+ /** Err type from a request method's response Result at version V. */
1381
+ export type ResponseErr<M extends RequestMethod, V extends string> = Extract<ResponseResultType<M, V>, {
1382
+ success: false;
1383
+ }> extends {
1384
+ value: infer U;
1385
+ } ? U : never;
1386
+ /** Subscription start params type for method M at version V. */
1387
+ export type SubscriptionParams<M extends SubscriptionMethod, V extends string> = VersionValue<StartCodecType<M>, V>;
1388
+ /** Subscription receive payload type for method M at version V. */
1389
+ export type SubscriptionPayload<M extends SubscriptionMethod, V extends string> = VersionValue<ReceiveCodecType<M>, V>;
1390
+ export declare const MessagePayload: Codec<{
1391
+ tag: string;
1392
+ value: unknown;
1393
+ }>;
1394
+ export declare const Message: Codec<{
1395
+ requestId: string;
1396
+ payload: {
1397
+ tag: string;
1398
+ value: unknown;
1399
+ };
1400
+ }>;
1401
+ export {};
1402
+ //# sourceMappingURL=protocol.d.ts.map