@arkiv-network/sdk 0.0.36-dev.6 → 0.1.1-dev.0

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 (491) hide show
  1. package/README.md +96 -16
  2. package/dist/accounts/index.cjs +9 -0
  3. package/dist/accounts/index.d.cts +1 -0
  4. package/dist/accounts/index.d.ts +1 -0
  5. package/dist/chains/index.cjs +64 -0
  6. package/dist/chains/index.d.cts +136 -0
  7. package/dist/chains/index.d.cts.map +1 -0
  8. package/dist/chains/index.d.ts +136 -0
  9. package/dist/chains/index.d.ts.map +1 -0
  10. package/dist/chains/index.js +63 -0
  11. package/dist/chains/index.js.map +1 -0
  12. package/dist/consts-BV9DVKgE.cjs +18 -0
  13. package/dist/consts-CHtLBwGd.js +7 -0
  14. package/dist/consts-CHtLBwGd.js.map +1 -0
  15. package/dist/entity-CMRcjXBK.d.ts +41 -0
  16. package/dist/entity-CMRcjXBK.d.ts.map +1 -0
  17. package/dist/entity-Dgf1SSpi.d.cts +41 -0
  18. package/dist/entity-Dgf1SSpi.d.cts.map +1 -0
  19. package/dist/index.cjs +438 -0
  20. package/dist/index.d.cts +498 -0
  21. package/dist/index.d.cts.map +1 -0
  22. package/dist/index.d.ts +498 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +415 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/query/index.cjs +172 -0
  27. package/dist/query/index.d.cts +19 -0
  28. package/dist/query/index.d.cts.map +1 -0
  29. package/dist/query/index.d.ts +19 -0
  30. package/dist/query/index.d.ts.map +1 -0
  31. package/dist/query/index.js +159 -0
  32. package/dist/query/index.js.map +1 -0
  33. package/dist/queryBuilder-BueP5de6.js +341 -0
  34. package/dist/queryBuilder-BueP5de6.js.map +1 -0
  35. package/dist/queryBuilder-D38MYG7o.d.ts +320 -0
  36. package/dist/queryBuilder-D38MYG7o.d.ts.map +1 -0
  37. package/dist/queryBuilder-DU4RQa7H.d.cts +320 -0
  38. package/dist/queryBuilder-DU4RQa7H.d.cts.map +1 -0
  39. package/dist/queryBuilder-n9ocnT4P.cjs +381 -0
  40. package/dist/types/index.cjs +0 -0
  41. package/dist/types/index.d.cts +2 -0
  42. package/dist/types/index.d.ts +2 -0
  43. package/dist/types/index.js +0 -0
  44. package/dist/utils/index.cjs +36 -0
  45. package/dist/utils/index.d.cts +21 -0
  46. package/dist/utils/index.d.cts.map +1 -0
  47. package/dist/utils/index.d.ts +21 -0
  48. package/dist/utils/index.d.ts.map +1 -0
  49. package/dist/utils/index.js +30 -0
  50. package/dist/utils/index.js.map +1 -0
  51. package/package.json +102 -116
  52. package/dist/_cjs/accounts/index.d.ts +0 -2
  53. package/dist/_cjs/accounts/index.d.ts.map +0 -1
  54. package/dist/_cjs/accounts/index.js +0 -18
  55. package/dist/_cjs/accounts/index.js.map +0 -1
  56. package/dist/_cjs/actions/public/buildQuery.d.ts +0 -4
  57. package/dist/_cjs/actions/public/buildQuery.d.ts.map +0 -1
  58. package/dist/_cjs/actions/public/buildQuery.js +0 -8
  59. package/dist/_cjs/actions/public/buildQuery.js.map +0 -1
  60. package/dist/_cjs/actions/public/getBlockTiming.d.ts +0 -12
  61. package/dist/_cjs/actions/public/getBlockTiming.d.ts.map +0 -1
  62. package/dist/_cjs/actions/public/getBlockTiming.js +0 -16
  63. package/dist/_cjs/actions/public/getBlockTiming.js.map +0 -1
  64. package/dist/_cjs/actions/public/getEntity.d.ts +0 -4
  65. package/dist/_cjs/actions/public/getEntity.d.ts.map +0 -1
  66. package/dist/_cjs/actions/public/getEntity.js +0 -17
  67. package/dist/_cjs/actions/public/getEntity.js.map +0 -1
  68. package/dist/_cjs/actions/public/getEntityCount.d.ts +0 -3
  69. package/dist/_cjs/actions/public/getEntityCount.d.ts.map +0 -1
  70. package/dist/_cjs/actions/public/getEntityCount.js +0 -11
  71. package/dist/_cjs/actions/public/getEntityCount.js.map +0 -1
  72. package/dist/_cjs/actions/public/query.d.ts +0 -3
  73. package/dist/_cjs/actions/public/query.d.ts.map +0 -1
  74. package/dist/_cjs/actions/public/query.js +0 -13
  75. package/dist/_cjs/actions/public/query.js.map +0 -1
  76. package/dist/_cjs/actions/public/subscribeEntityEvents.d.ts +0 -96
  77. package/dist/_cjs/actions/public/subscribeEntityEvents.d.ts.map +0 -1
  78. package/dist/_cjs/actions/public/subscribeEntityEvents.js +0 -79
  79. package/dist/_cjs/actions/public/subscribeEntityEvents.js.map +0 -1
  80. package/dist/_cjs/actions/wallet/createEntity.d.ts +0 -25
  81. package/dist/_cjs/actions/wallet/createEntity.d.ts.map +0 -1
  82. package/dist/_cjs/actions/wallet/createEntity.js +0 -15
  83. package/dist/_cjs/actions/wallet/createEntity.js.map +0 -1
  84. package/dist/_cjs/actions/wallet/deleteEntity.d.ts +0 -21
  85. package/dist/_cjs/actions/wallet/deleteEntity.d.ts.map +0 -1
  86. package/dist/_cjs/actions/wallet/deleteEntity.js +0 -15
  87. package/dist/_cjs/actions/wallet/deleteEntity.js.map +0 -1
  88. package/dist/_cjs/actions/wallet/extendEntity.d.ts +0 -23
  89. package/dist/_cjs/actions/wallet/extendEntity.d.ts.map +0 -1
  90. package/dist/_cjs/actions/wallet/extendEntity.js +0 -15
  91. package/dist/_cjs/actions/wallet/extendEntity.js.map +0 -1
  92. package/dist/_cjs/actions/wallet/mutateEntities.d.ts +0 -37
  93. package/dist/_cjs/actions/wallet/mutateEntities.d.ts.map +0 -1
  94. package/dist/_cjs/actions/wallet/mutateEntities.js +0 -56
  95. package/dist/_cjs/actions/wallet/mutateEntities.js.map +0 -1
  96. package/dist/_cjs/actions/wallet/updateEntity.d.ts +0 -27
  97. package/dist/_cjs/actions/wallet/updateEntity.d.ts.map +0 -1
  98. package/dist/_cjs/actions/wallet/updateEntity.js +0 -15
  99. package/dist/_cjs/actions/wallet/updateEntity.js.map +0 -1
  100. package/dist/_cjs/chains/index.d.ts +0 -4
  101. package/dist/_cjs/chains/index.d.ts.map +0 -1
  102. package/dist/_cjs/chains/index.js +0 -10
  103. package/dist/_cjs/chains/index.js.map +0 -1
  104. package/dist/_cjs/chains/kaolin.d.ts +0 -42
  105. package/dist/_cjs/chains/kaolin.d.ts.map +0 -1
  106. package/dist/_cjs/chains/kaolin.js +0 -29
  107. package/dist/_cjs/chains/kaolin.js.map +0 -1
  108. package/dist/_cjs/chains/localhost.d.ts +0 -45
  109. package/dist/_cjs/chains/localhost.d.ts.map +0 -1
  110. package/dist/_cjs/chains/localhost.js +0 -17
  111. package/dist/_cjs/chains/localhost.js.map +0 -1
  112. package/dist/_cjs/chains/marketplace.d.ts +0 -42
  113. package/dist/_cjs/chains/marketplace.d.ts.map +0 -1
  114. package/dist/_cjs/chains/marketplace.js +0 -29
  115. package/dist/_cjs/chains/marketplace.js.map +0 -1
  116. package/dist/_cjs/clients/baseClient.d.ts +0 -4
  117. package/dist/_cjs/clients/baseClient.d.ts.map +0 -1
  118. package/dist/_cjs/clients/baseClient.js +0 -3
  119. package/dist/_cjs/clients/baseClient.js.map +0 -1
  120. package/dist/_cjs/clients/createPublicClient.d.ts +0 -25
  121. package/dist/_cjs/clients/createPublicClient.d.ts.map +0 -1
  122. package/dist/_cjs/clients/createPublicClient.js +0 -34
  123. package/dist/_cjs/clients/createPublicClient.js.map +0 -1
  124. package/dist/_cjs/clients/createWalletClient.d.ts +0 -25
  125. package/dist/_cjs/clients/createWalletClient.d.ts.map +0 -1
  126. package/dist/_cjs/clients/createWalletClient.js +0 -39
  127. package/dist/_cjs/clients/createWalletClient.js.map +0 -1
  128. package/dist/_cjs/clients/decorators/arkivPublic.d.ts +0 -136
  129. package/dist/_cjs/clients/decorators/arkivPublic.d.ts.map +0 -1
  130. package/dist/_cjs/clients/decorators/arkivPublic.js +0 -27
  131. package/dist/_cjs/clients/decorators/arkivPublic.js.map +0 -1
  132. package/dist/_cjs/clients/decorators/arkivWallet.d.ts +0 -167
  133. package/dist/_cjs/clients/decorators/arkivWallet.d.ts.map +0 -1
  134. package/dist/_cjs/clients/decorators/arkivWallet.js +0 -18
  135. package/dist/_cjs/clients/decorators/arkivWallet.js.map +0 -1
  136. package/dist/_cjs/consts.d.ts +0 -3
  137. package/dist/_cjs/consts.d.ts.map +0 -1
  138. package/dist/_cjs/consts.js +0 -6
  139. package/dist/_cjs/consts.js.map +0 -1
  140. package/dist/_cjs/index.d.ts +0 -11
  141. package/dist/_cjs/index.d.ts.map +0 -1
  142. package/dist/_cjs/index.js +0 -16
  143. package/dist/_cjs/index.js.map +0 -1
  144. package/dist/_cjs/query/engine.d.ts +0 -18
  145. package/dist/_cjs/query/engine.d.ts.map +0 -1
  146. package/dist/_cjs/query/engine.js +0 -76
  147. package/dist/_cjs/query/engine.js.map +0 -1
  148. package/dist/_cjs/query/errors.d.ts +0 -13
  149. package/dist/_cjs/query/errors.d.ts.map +0 -1
  150. package/dist/_cjs/query/errors.js +0 -28
  151. package/dist/_cjs/query/errors.js.map +0 -1
  152. package/dist/_cjs/query/index.d.ts +0 -5
  153. package/dist/_cjs/query/index.d.ts.map +0 -1
  154. package/dist/_cjs/query/index.js +0 -21
  155. package/dist/_cjs/query/index.js.map +0 -1
  156. package/dist/_cjs/query/predicate.d.ts +0 -111
  157. package/dist/_cjs/query/predicate.d.ts.map +0 -1
  158. package/dist/_cjs/query/predicate.js +0 -130
  159. package/dist/_cjs/query/predicate.js.map +0 -1
  160. package/dist/_cjs/query/queryBuilder.d.ts +0 -132
  161. package/dist/_cjs/query/queryBuilder.d.ts.map +0 -1
  162. package/dist/_cjs/query/queryBuilder.js +0 -194
  163. package/dist/_cjs/query/queryBuilder.js.map +0 -1
  164. package/dist/_cjs/query/queryResult.d.ts +0 -16
  165. package/dist/_cjs/query/queryResult.d.ts.map +0 -1
  166. package/dist/_cjs/query/queryResult.js +0 -51
  167. package/dist/_cjs/query/queryResult.js.map +0 -1
  168. package/dist/_cjs/types/annotation.d.ts +0 -5
  169. package/dist/_cjs/types/annotation.d.ts.map +0 -1
  170. package/dist/_cjs/types/annotation.js +0 -3
  171. package/dist/_cjs/types/annotation.js.map +0 -1
  172. package/dist/_cjs/types/entity.d.ts +0 -13
  173. package/dist/_cjs/types/entity.d.ts.map +0 -1
  174. package/dist/_cjs/types/entity.js +0 -26
  175. package/dist/_cjs/types/entity.js.map +0 -1
  176. package/dist/_cjs/types/events.d.ts +0 -30
  177. package/dist/_cjs/types/events.d.ts.map +0 -1
  178. package/dist/_cjs/types/events.js +0 -3
  179. package/dist/_cjs/types/events.js.map +0 -1
  180. package/dist/_cjs/types/index.d.ts +0 -4
  181. package/dist/_cjs/types/index.d.ts.map +0 -1
  182. package/dist/_cjs/types/index.js +0 -3
  183. package/dist/_cjs/types/index.js.map +0 -1
  184. package/dist/_cjs/types/rpcSchema.d.ts +0 -76
  185. package/dist/_cjs/types/rpcSchema.d.ts.map +0 -1
  186. package/dist/_cjs/types/rpcSchema.js +0 -3
  187. package/dist/_cjs/types/rpcSchema.js.map +0 -1
  188. package/dist/_cjs/types/txParams.d.ts +0 -14
  189. package/dist/_cjs/types/txParams.d.ts.map +0 -1
  190. package/dist/_cjs/types/txParams.js +0 -3
  191. package/dist/_cjs/types/txParams.js.map +0 -1
  192. package/dist/_cjs/utils/arkivTransactions.d.ts +0 -15
  193. package/dist/_cjs/utils/arkivTransactions.d.ts.map +0 -1
  194. package/dist/_cjs/utils/arkivTransactions.js +0 -67
  195. package/dist/_cjs/utils/arkivTransactions.js.map +0 -1
  196. package/dist/_cjs/utils/entities.d.ts +0 -4
  197. package/dist/_cjs/utils/entities.d.ts.map +0 -1
  198. package/dist/_cjs/utils/entities.js +0 -18
  199. package/dist/_cjs/utils/entities.js.map +0 -1
  200. package/dist/_cjs/utils/expirationTime.d.ts +0 -12
  201. package/dist/_cjs/utils/expirationTime.d.ts.map +0 -1
  202. package/dist/_cjs/utils/expirationTime.js +0 -16
  203. package/dist/_cjs/utils/expirationTime.js.map +0 -1
  204. package/dist/_cjs/utils/index.d.ts +0 -4
  205. package/dist/_cjs/utils/index.d.ts.map +0 -1
  206. package/dist/_cjs/utils/index.js +0 -20
  207. package/dist/_cjs/utils/index.js.map +0 -1
  208. package/dist/_cjs/utils/payload.d.ts +0 -3
  209. package/dist/_cjs/utils/payload.d.ts.map +0 -1
  210. package/dist/_cjs/utils/payload.js +0 -12
  211. package/dist/_cjs/utils/payload.js.map +0 -1
  212. package/dist/_esm/accounts/index.d.ts +0 -2
  213. package/dist/_esm/accounts/index.d.ts.map +0 -1
  214. package/dist/_esm/accounts/index.js +0 -2
  215. package/dist/_esm/accounts/index.js.map +0 -1
  216. package/dist/_esm/actions/public/buildQuery.d.ts +0 -4
  217. package/dist/_esm/actions/public/buildQuery.d.ts.map +0 -1
  218. package/dist/_esm/actions/public/buildQuery.js +0 -5
  219. package/dist/_esm/actions/public/buildQuery.js.map +0 -1
  220. package/dist/_esm/actions/public/getBlockTiming.d.ts +0 -12
  221. package/dist/_esm/actions/public/getBlockTiming.d.ts.map +0 -1
  222. package/dist/_esm/actions/public/getBlockTiming.js +0 -13
  223. package/dist/_esm/actions/public/getBlockTiming.js.map +0 -1
  224. package/dist/_esm/actions/public/getEntity.d.ts +0 -4
  225. package/dist/_esm/actions/public/getEntity.d.ts.map +0 -1
  226. package/dist/_esm/actions/public/getEntity.js +0 -14
  227. package/dist/_esm/actions/public/getEntity.js.map +0 -1
  228. package/dist/_esm/actions/public/getEntityCount.d.ts +0 -3
  229. package/dist/_esm/actions/public/getEntityCount.d.ts.map +0 -1
  230. package/dist/_esm/actions/public/getEntityCount.js +0 -8
  231. package/dist/_esm/actions/public/getEntityCount.js.map +0 -1
  232. package/dist/_esm/actions/public/query.d.ts +0 -3
  233. package/dist/_esm/actions/public/query.d.ts.map +0 -1
  234. package/dist/_esm/actions/public/query.js +0 -10
  235. package/dist/_esm/actions/public/query.js.map +0 -1
  236. package/dist/_esm/actions/public/subscribeEntityEvents.d.ts +0 -96
  237. package/dist/_esm/actions/public/subscribeEntityEvents.d.ts.map +0 -1
  238. package/dist/_esm/actions/public/subscribeEntityEvents.js +0 -75
  239. package/dist/_esm/actions/public/subscribeEntityEvents.js.map +0 -1
  240. package/dist/_esm/actions/wallet/createEntity.d.ts +0 -25
  241. package/dist/_esm/actions/wallet/createEntity.d.ts.map +0 -1
  242. package/dist/_esm/actions/wallet/createEntity.js +0 -12
  243. package/dist/_esm/actions/wallet/createEntity.js.map +0 -1
  244. package/dist/_esm/actions/wallet/deleteEntity.d.ts +0 -21
  245. package/dist/_esm/actions/wallet/deleteEntity.d.ts.map +0 -1
  246. package/dist/_esm/actions/wallet/deleteEntity.js +0 -12
  247. package/dist/_esm/actions/wallet/deleteEntity.js.map +0 -1
  248. package/dist/_esm/actions/wallet/extendEntity.d.ts +0 -23
  249. package/dist/_esm/actions/wallet/extendEntity.d.ts.map +0 -1
  250. package/dist/_esm/actions/wallet/extendEntity.js +0 -12
  251. package/dist/_esm/actions/wallet/extendEntity.js.map +0 -1
  252. package/dist/_esm/actions/wallet/mutateEntities.d.ts +0 -37
  253. package/dist/_esm/actions/wallet/mutateEntities.d.ts.map +0 -1
  254. package/dist/_esm/actions/wallet/mutateEntities.js +0 -53
  255. package/dist/_esm/actions/wallet/mutateEntities.js.map +0 -1
  256. package/dist/_esm/actions/wallet/updateEntity.d.ts +0 -27
  257. package/dist/_esm/actions/wallet/updateEntity.d.ts.map +0 -1
  258. package/dist/_esm/actions/wallet/updateEntity.js +0 -12
  259. package/dist/_esm/actions/wallet/updateEntity.js.map +0 -1
  260. package/dist/_esm/chains/index.d.ts +0 -4
  261. package/dist/_esm/chains/index.d.ts.map +0 -1
  262. package/dist/_esm/chains/index.js +0 -4
  263. package/dist/_esm/chains/index.js.map +0 -1
  264. package/dist/_esm/chains/kaolin.d.ts +0 -42
  265. package/dist/_esm/chains/kaolin.d.ts.map +0 -1
  266. package/dist/_esm/chains/kaolin.js +0 -26
  267. package/dist/_esm/chains/kaolin.js.map +0 -1
  268. package/dist/_esm/chains/localhost.d.ts +0 -45
  269. package/dist/_esm/chains/localhost.d.ts.map +0 -1
  270. package/dist/_esm/chains/localhost.js +0 -14
  271. package/dist/_esm/chains/localhost.js.map +0 -1
  272. package/dist/_esm/chains/marketplace.d.ts +0 -42
  273. package/dist/_esm/chains/marketplace.d.ts.map +0 -1
  274. package/dist/_esm/chains/marketplace.js +0 -26
  275. package/dist/_esm/chains/marketplace.js.map +0 -1
  276. package/dist/_esm/clients/baseClient.d.ts +0 -4
  277. package/dist/_esm/clients/baseClient.d.ts.map +0 -1
  278. package/dist/_esm/clients/baseClient.js +0 -2
  279. package/dist/_esm/clients/baseClient.js.map +0 -1
  280. package/dist/_esm/clients/createPublicClient.d.ts +0 -25
  281. package/dist/_esm/clients/createPublicClient.d.ts.map +0 -1
  282. package/dist/_esm/clients/createPublicClient.js +0 -31
  283. package/dist/_esm/clients/createPublicClient.js.map +0 -1
  284. package/dist/_esm/clients/createWalletClient.d.ts +0 -25
  285. package/dist/_esm/clients/createWalletClient.d.ts.map +0 -1
  286. package/dist/_esm/clients/createWalletClient.js +0 -36
  287. package/dist/_esm/clients/createWalletClient.js.map +0 -1
  288. package/dist/_esm/clients/decorators/arkivPublic.d.ts +0 -136
  289. package/dist/_esm/clients/decorators/arkivPublic.d.ts.map +0 -1
  290. package/dist/_esm/clients/decorators/arkivPublic.js +0 -24
  291. package/dist/_esm/clients/decorators/arkivPublic.js.map +0 -1
  292. package/dist/_esm/clients/decorators/arkivWallet.d.ts +0 -167
  293. package/dist/_esm/clients/decorators/arkivWallet.d.ts.map +0 -1
  294. package/dist/_esm/clients/decorators/arkivWallet.js +0 -15
  295. package/dist/_esm/clients/decorators/arkivWallet.js.map +0 -1
  296. package/dist/_esm/consts.d.ts +0 -3
  297. package/dist/_esm/consts.d.ts.map +0 -1
  298. package/dist/_esm/consts.js +0 -3
  299. package/dist/_esm/consts.js.map +0 -1
  300. package/dist/_esm/index.d.ts +0 -11
  301. package/dist/_esm/index.d.ts.map +0 -1
  302. package/dist/_esm/index.js +0 -6
  303. package/dist/_esm/index.js.map +0 -1
  304. package/dist/_esm/query/engine.d.ts +0 -18
  305. package/dist/_esm/query/engine.d.ts.map +0 -1
  306. package/dist/_esm/query/engine.js +0 -73
  307. package/dist/_esm/query/engine.js.map +0 -1
  308. package/dist/_esm/query/errors.d.ts +0 -13
  309. package/dist/_esm/query/errors.d.ts.map +0 -1
  310. package/dist/_esm/query/errors.js +0 -21
  311. package/dist/_esm/query/errors.js.map +0 -1
  312. package/dist/_esm/query/index.d.ts +0 -5
  313. package/dist/_esm/query/index.d.ts.map +0 -1
  314. package/dist/_esm/query/index.js +0 -5
  315. package/dist/_esm/query/index.js.map +0 -1
  316. package/dist/_esm/query/predicate.d.ts +0 -111
  317. package/dist/_esm/query/predicate.d.ts.map +0 -1
  318. package/dist/_esm/query/predicate.js +0 -119
  319. package/dist/_esm/query/predicate.js.map +0 -1
  320. package/dist/_esm/query/queryBuilder.d.ts +0 -132
  321. package/dist/_esm/query/queryBuilder.d.ts.map +0 -1
  322. package/dist/_esm/query/queryBuilder.js +0 -190
  323. package/dist/_esm/query/queryBuilder.js.map +0 -1
  324. package/dist/_esm/query/queryResult.d.ts +0 -16
  325. package/dist/_esm/query/queryResult.d.ts.map +0 -1
  326. package/dist/_esm/query/queryResult.js +0 -47
  327. package/dist/_esm/query/queryResult.js.map +0 -1
  328. package/dist/_esm/types/annotation.d.ts +0 -5
  329. package/dist/_esm/types/annotation.d.ts.map +0 -1
  330. package/dist/_esm/types/annotation.js +0 -2
  331. package/dist/_esm/types/annotation.js.map +0 -1
  332. package/dist/_esm/types/entity.d.ts +0 -13
  333. package/dist/_esm/types/entity.d.ts.map +0 -1
  334. package/dist/_esm/types/entity.js +0 -22
  335. package/dist/_esm/types/entity.js.map +0 -1
  336. package/dist/_esm/types/events.d.ts +0 -30
  337. package/dist/_esm/types/events.d.ts.map +0 -1
  338. package/dist/_esm/types/events.js +0 -2
  339. package/dist/_esm/types/events.js.map +0 -1
  340. package/dist/_esm/types/index.d.ts +0 -4
  341. package/dist/_esm/types/index.d.ts.map +0 -1
  342. package/dist/_esm/types/index.js +0 -2
  343. package/dist/_esm/types/index.js.map +0 -1
  344. package/dist/_esm/types/rpcSchema.d.ts +0 -76
  345. package/dist/_esm/types/rpcSchema.d.ts.map +0 -1
  346. package/dist/_esm/types/rpcSchema.js +0 -2
  347. package/dist/_esm/types/rpcSchema.js.map +0 -1
  348. package/dist/_esm/types/txParams.d.ts +0 -14
  349. package/dist/_esm/types/txParams.d.ts.map +0 -1
  350. package/dist/_esm/types/txParams.js +0 -2
  351. package/dist/_esm/types/txParams.js.map +0 -1
  352. package/dist/_esm/utils/arkivTransactions.d.ts +0 -15
  353. package/dist/_esm/utils/arkivTransactions.d.ts.map +0 -1
  354. package/dist/_esm/utils/arkivTransactions.js +0 -63
  355. package/dist/_esm/utils/arkivTransactions.js.map +0 -1
  356. package/dist/_esm/utils/entities.d.ts +0 -4
  357. package/dist/_esm/utils/entities.d.ts.map +0 -1
  358. package/dist/_esm/utils/entities.js +0 -15
  359. package/dist/_esm/utils/entities.js.map +0 -1
  360. package/dist/_esm/utils/expirationTime.d.ts +0 -12
  361. package/dist/_esm/utils/expirationTime.d.ts.map +0 -1
  362. package/dist/_esm/utils/expirationTime.js +0 -13
  363. package/dist/_esm/utils/expirationTime.js.map +0 -1
  364. package/dist/_esm/utils/index.d.ts +0 -4
  365. package/dist/_esm/utils/index.d.ts.map +0 -1
  366. package/dist/_esm/utils/index.js +0 -4
  367. package/dist/_esm/utils/index.js.map +0 -1
  368. package/dist/_esm/utils/payload.d.ts +0 -3
  369. package/dist/_esm/utils/payload.d.ts.map +0 -1
  370. package/dist/_esm/utils/payload.js +0 -8
  371. package/dist/_esm/utils/payload.js.map +0 -1
  372. package/dist/_types/accounts/index.d.ts +0 -2
  373. package/dist/_types/accounts/index.d.ts.map +0 -1
  374. package/dist/_types/actions/public/buildQuery.d.ts +0 -4
  375. package/dist/_types/actions/public/buildQuery.d.ts.map +0 -1
  376. package/dist/_types/actions/public/getBlockTiming.d.ts +0 -12
  377. package/dist/_types/actions/public/getBlockTiming.d.ts.map +0 -1
  378. package/dist/_types/actions/public/getEntity.d.ts +0 -4
  379. package/dist/_types/actions/public/getEntity.d.ts.map +0 -1
  380. package/dist/_types/actions/public/getEntityCount.d.ts +0 -3
  381. package/dist/_types/actions/public/getEntityCount.d.ts.map +0 -1
  382. package/dist/_types/actions/public/query.d.ts +0 -3
  383. package/dist/_types/actions/public/query.d.ts.map +0 -1
  384. package/dist/_types/actions/public/subscribeEntityEvents.d.ts +0 -96
  385. package/dist/_types/actions/public/subscribeEntityEvents.d.ts.map +0 -1
  386. package/dist/_types/actions/wallet/createEntity.d.ts +0 -25
  387. package/dist/_types/actions/wallet/createEntity.d.ts.map +0 -1
  388. package/dist/_types/actions/wallet/deleteEntity.d.ts +0 -21
  389. package/dist/_types/actions/wallet/deleteEntity.d.ts.map +0 -1
  390. package/dist/_types/actions/wallet/extendEntity.d.ts +0 -23
  391. package/dist/_types/actions/wallet/extendEntity.d.ts.map +0 -1
  392. package/dist/_types/actions/wallet/mutateEntities.d.ts +0 -37
  393. package/dist/_types/actions/wallet/mutateEntities.d.ts.map +0 -1
  394. package/dist/_types/actions/wallet/updateEntity.d.ts +0 -27
  395. package/dist/_types/actions/wallet/updateEntity.d.ts.map +0 -1
  396. package/dist/_types/chains/index.d.ts +0 -4
  397. package/dist/_types/chains/index.d.ts.map +0 -1
  398. package/dist/_types/chains/kaolin.d.ts +0 -42
  399. package/dist/_types/chains/kaolin.d.ts.map +0 -1
  400. package/dist/_types/chains/localhost.d.ts +0 -45
  401. package/dist/_types/chains/localhost.d.ts.map +0 -1
  402. package/dist/_types/chains/marketplace.d.ts +0 -42
  403. package/dist/_types/chains/marketplace.d.ts.map +0 -1
  404. package/dist/_types/clients/baseClient.d.ts +0 -4
  405. package/dist/_types/clients/baseClient.d.ts.map +0 -1
  406. package/dist/_types/clients/createPublicClient.d.ts +0 -25
  407. package/dist/_types/clients/createPublicClient.d.ts.map +0 -1
  408. package/dist/_types/clients/createWalletClient.d.ts +0 -25
  409. package/dist/_types/clients/createWalletClient.d.ts.map +0 -1
  410. package/dist/_types/clients/decorators/arkivPublic.d.ts +0 -136
  411. package/dist/_types/clients/decorators/arkivPublic.d.ts.map +0 -1
  412. package/dist/_types/clients/decorators/arkivWallet.d.ts +0 -167
  413. package/dist/_types/clients/decorators/arkivWallet.d.ts.map +0 -1
  414. package/dist/_types/consts.d.ts +0 -3
  415. package/dist/_types/consts.d.ts.map +0 -1
  416. package/dist/_types/index.d.ts +0 -11
  417. package/dist/_types/index.d.ts.map +0 -1
  418. package/dist/_types/query/engine.d.ts +0 -18
  419. package/dist/_types/query/engine.d.ts.map +0 -1
  420. package/dist/_types/query/errors.d.ts +0 -13
  421. package/dist/_types/query/errors.d.ts.map +0 -1
  422. package/dist/_types/query/index.d.ts +0 -5
  423. package/dist/_types/query/index.d.ts.map +0 -1
  424. package/dist/_types/query/predicate.d.ts +0 -111
  425. package/dist/_types/query/predicate.d.ts.map +0 -1
  426. package/dist/_types/query/queryBuilder.d.ts +0 -132
  427. package/dist/_types/query/queryBuilder.d.ts.map +0 -1
  428. package/dist/_types/query/queryResult.d.ts +0 -16
  429. package/dist/_types/query/queryResult.d.ts.map +0 -1
  430. package/dist/_types/types/annotation.d.ts +0 -5
  431. package/dist/_types/types/annotation.d.ts.map +0 -1
  432. package/dist/_types/types/entity.d.ts +0 -13
  433. package/dist/_types/types/entity.d.ts.map +0 -1
  434. package/dist/_types/types/events.d.ts +0 -30
  435. package/dist/_types/types/events.d.ts.map +0 -1
  436. package/dist/_types/types/index.d.ts +0 -4
  437. package/dist/_types/types/index.d.ts.map +0 -1
  438. package/dist/_types/types/rpcSchema.d.ts +0 -76
  439. package/dist/_types/types/rpcSchema.d.ts.map +0 -1
  440. package/dist/_types/types/txParams.d.ts +0 -14
  441. package/dist/_types/types/txParams.d.ts.map +0 -1
  442. package/dist/_types/utils/arkivTransactions.d.ts +0 -15
  443. package/dist/_types/utils/arkivTransactions.d.ts.map +0 -1
  444. package/dist/_types/utils/entities.d.ts +0 -4
  445. package/dist/_types/utils/entities.d.ts.map +0 -1
  446. package/dist/_types/utils/expirationTime.d.ts +0 -12
  447. package/dist/_types/utils/expirationTime.d.ts.map +0 -1
  448. package/dist/_types/utils/index.d.ts +0 -4
  449. package/dist/_types/utils/index.d.ts.map +0 -1
  450. package/dist/_types/utils/payload.d.ts +0 -3
  451. package/dist/_types/utils/payload.d.ts.map +0 -1
  452. package/src/actions/public/buildQuery.ts +0 -6
  453. package/src/actions/public/getBlockTiming.ts +0 -20
  454. package/src/actions/public/getEntity.ts +0 -18
  455. package/src/actions/public/getEntityCount.ts +0 -10
  456. package/src/actions/public/query.ts +0 -13
  457. package/src/actions/public/subscribeEntityEvents.ts +0 -105
  458. package/src/actions/wallet/createEntity.ts +0 -43
  459. package/src/actions/wallet/deleteEntity.ts +0 -39
  460. package/src/actions/wallet/extendEntity.ts +0 -41
  461. package/src/actions/wallet/mutateEntities.ts +0 -100
  462. package/src/actions/wallet/updateEntity.ts +0 -45
  463. package/src/chains/index.ts +0 -3
  464. package/src/chains/kaolin.ts +0 -26
  465. package/src/chains/localhost.ts +0 -14
  466. package/src/chains/marketplace.ts +0 -26
  467. package/src/clients/baseClient.ts +0 -9
  468. package/src/clients/createPublicClient.ts +0 -65
  469. package/src/clients/createWalletClient.ts +0 -70
  470. package/src/clients/decorators/arkivPublic.ts +0 -205
  471. package/src/clients/decorators/arkivWallet.ts +0 -232
  472. package/src/consts.ts +0 -2
  473. package/src/index.ts +0 -21
  474. package/src/query/engine.ts +0 -111
  475. package/src/query/errors.ts +0 -23
  476. package/src/query/index.ts +0 -4
  477. package/src/query/predicate.ts +0 -140
  478. package/src/query/queryBuilder.ts +0 -209
  479. package/src/query/queryResult.ts +0 -61
  480. package/src/types/annotation.ts +0 -4
  481. package/src/types/entity.ts +0 -32
  482. package/src/types/events.ts +0 -34
  483. package/src/types/index.ts +0 -3
  484. package/src/types/rpcSchema.ts +0 -68
  485. package/src/types/txParams.ts +0 -15
  486. package/src/utils/arkivTransactions.ts +0 -91
  487. package/src/utils/entities.ts +0 -16
  488. package/src/utils/expirationTime.ts +0 -13
  489. package/src/utils/index.ts +0 -3
  490. package/src/utils/payload.ts +0 -9
  491. /package/{src/accounts/index.ts → dist/accounts/index.js} +0 -0
@@ -1,39 +0,0 @@
1
- import type { Hex } from "viem"
2
- import type { ArkivClient } from "../../clients/baseClient"
3
- import type { TxParams } from "../../types"
4
- import { opsToTxData, sendArkivTransaction } from "../../utils/arkivTransactions"
5
-
6
- /**
7
- * Parameters for the deleteEntity function.
8
- * - entityKey: The key of the entity to delete.
9
- */
10
- export type DeleteEntityParameters = {
11
- entityKey: Hex
12
- }
13
-
14
- /**
15
- * Return type for the deleteEntity function.
16
- * - entityKey: The key of the entity.
17
- * - txHash: The transaction hash.
18
- */
19
- export type DeleteEntityReturnType = {
20
- entityKey: Hex
21
- txHash: string
22
- }
23
-
24
- export async function deleteEntity(
25
- client: ArkivClient,
26
- data: DeleteEntityParameters,
27
- txParams?: TxParams,
28
- ): Promise<DeleteEntityReturnType> {
29
- console.debug("deleteEntity", data)
30
- const txData = opsToTxData({ deletes: [data] })
31
- const receipt = await sendArkivTransaction(client, txData, txParams)
32
-
33
- console.debug("Receipt from deleteEntity", receipt)
34
-
35
- return {
36
- txHash: receipt.transactionHash,
37
- entityKey: data.entityKey,
38
- }
39
- }
@@ -1,41 +0,0 @@
1
- import type { Hex } from "viem"
2
- import type { ArkivClient } from "../../clients/baseClient"
3
- import type { TxParams } from "../../types"
4
- import { opsToTxData, sendArkivTransaction } from "../../utils/arkivTransactions"
5
-
6
- /**
7
- * Parameters for the extendEntity function.
8
- * - entityKey: The key of the entity to extend.
9
- * - expiresIn: The expires in of the entity in seconds.
10
- */
11
- export type ExtendEntityParameters = {
12
- entityKey: Hex
13
- expiresIn: number
14
- }
15
-
16
- /**
17
- * Return type for the extendEntity function.
18
- * - entityKey: The key of the entity.
19
- * - txHash: The transaction hash.
20
- */
21
- export type ExtendEntityReturnType = {
22
- entityKey: Hex
23
- txHash: string
24
- }
25
-
26
- export async function extendEntity(
27
- client: ArkivClient,
28
- data: ExtendEntityParameters,
29
- txParams?: TxParams,
30
- ): Promise<ExtendEntityReturnType> {
31
- console.debug("extendEntity", data)
32
- const txData = opsToTxData({ extensions: [data] })
33
- const receipt = await sendArkivTransaction(client, txData, txParams)
34
-
35
- console.debug("Receipt from extendEntity", receipt)
36
-
37
- return {
38
- txHash: receipt.transactionHash,
39
- entityKey: receipt.logs[0].topics[1] as Hex,
40
- }
41
- }
@@ -1,100 +0,0 @@
1
- import type { Hex, TransactionReceipt } from "viem"
2
- import type { ArkivClient } from "../../clients/baseClient"
3
- import type { TxParams } from "../../types"
4
- import { opsToTxData, sendArkivTransaction } from "../../utils/arkivTransactions"
5
- import type { CreateEntityParameters } from "./createEntity"
6
- import type { DeleteEntityParameters } from "./deleteEntity"
7
- import type { ExtendEntityParameters } from "./extendEntity"
8
- import type { UpdateEntityParameters } from "./updateEntity"
9
-
10
- /**
11
- * Parameters for the mutateEntities function.
12
- * - creates: The creates to perform.
13
- * - updates: The updates to perform.
14
- * - deletes: The deletes to perform.
15
- * - extensions: The extensions to perform.
16
- */
17
- export type MutateEntitiesParameters = {
18
- creates?: CreateEntityParameters[]
19
- updates?: UpdateEntityParameters[]
20
- deletes?: DeleteEntityParameters[]
21
- extensions?: ExtendEntityParameters[]
22
- }
23
-
24
- function parseReceipt(receipt: TransactionReceipt, params: MutateEntitiesParameters) {
25
- const createdEntities: Hex[] = []
26
- const updatedEntities: Hex[] = []
27
- const deletedEntities: Hex[] = []
28
- const extendedEntities: Hex[] = []
29
- const totalCreates = params.creates?.length ?? 0
30
- const totalUpdates = params.updates?.length ?? 0
31
- const totalDeletes = params.deletes?.length ?? 0
32
-
33
- // iterate over all logs and parse the event
34
- // each odd log is the interested ones, logs goes in order like: creates, deleted, updates, extends
35
- for (let i = 0; i < receipt.logs.length; i++) {
36
- const log = receipt.logs[i]
37
- if (i % 2 === 1) continue
38
-
39
- const index = i / 2
40
- if (index < totalCreates) {
41
- createdEntities.push(log.topics[1] as Hex)
42
- } else if (index < totalCreates + totalDeletes) {
43
- deletedEntities.push(log.topics[1] as Hex)
44
- } else if (index < totalCreates + totalUpdates + totalDeletes) {
45
- updatedEntities.push(log.topics[1] as Hex)
46
- } else {
47
- extendedEntities.push(log.topics[1] as Hex)
48
- }
49
- }
50
-
51
- return { createdEntities, updatedEntities, deletedEntities, extendedEntities }
52
- }
53
-
54
- /**
55
- * Return type for the mutateEntities function.
56
- * - txHash: The transaction hash.
57
- * - createdEntities: The keys of the created entities.
58
- * - updatedEntities: The keys of the updated entities.
59
- * - deletedEntities: The keys of the deleted entities.
60
- * - extendedEntities: The keys of the extended entities.
61
- */
62
- export type MutateEntitiesReturnType = {
63
- txHash: string
64
- createdEntities: Hex[]
65
- updatedEntities: Hex[]
66
- deletedEntities: Hex[]
67
- extendedEntities: Hex[]
68
- }
69
- export async function mutateEntities(
70
- client: ArkivClient,
71
- data: MutateEntitiesParameters,
72
- txParams?: TxParams,
73
- ): Promise<MutateEntitiesReturnType> {
74
- if (!data.creates && !data.updates && !data.deletes && !data.extensions) {
75
- throw new Error("No operations to perform")
76
- }
77
-
78
- const txData = opsToTxData({
79
- creates: data.creates ?? [],
80
- updates: data.updates ?? [],
81
- deletes: data.deletes ?? [],
82
- extensions: data.extensions ?? [],
83
- })
84
-
85
- const receipt = await sendArkivTransaction(client, txData, txParams)
86
-
87
- console.debug("Receipt from mutateEntities", receipt)
88
-
89
- const { createdEntities, updatedEntities, deletedEntities, extendedEntities } = parseReceipt(
90
- receipt,
91
- data,
92
- )
93
- return {
94
- txHash: receipt.transactionHash,
95
- createdEntities,
96
- updatedEntities,
97
- deletedEntities,
98
- extendedEntities,
99
- }
100
- }
@@ -1,45 +0,0 @@
1
- import type { Hex } from "viem"
2
- import type { ArkivClient } from "../../clients/baseClient"
3
- import type { Annotation, TxParams } from "../../types"
4
- import { opsToTxData, sendArkivTransaction } from "../../utils/arkivTransactions"
5
-
6
- /**
7
- * Parameters for the updateEntity function.
8
- * - entityKey: The key of the entity to update.
9
- * - payload: The payload of the entity.
10
- * - annotations: The annotations of the entity.
11
- * - expiresIn: The expires in of the entity in seconds.
12
- */
13
- export type UpdateEntityParameters = {
14
- entityKey: Hex
15
- payload: Uint8Array | string
16
- annotations: Annotation[]
17
- expiresIn: number
18
- }
19
-
20
- /**
21
- * Return type for the updateEntity function.
22
- * - entityKey: The key of the entity.
23
- * - txHash: The transaction hash.
24
- */
25
- export type UpdateEntityReturnType = {
26
- entityKey: Hex
27
- txHash: string
28
- }
29
-
30
- export async function updateEntity(
31
- client: ArkivClient,
32
- data: UpdateEntityParameters,
33
- txParams?: TxParams,
34
- ): Promise<UpdateEntityReturnType> {
35
- console.debug("updateEntity", data)
36
- const txData = opsToTxData({ updates: [data] })
37
- const receipt = await sendArkivTransaction(client, txData, txParams)
38
-
39
- console.debug("Receipt from updateEntity", receipt)
40
-
41
- return {
42
- txHash: receipt.transactionHash,
43
- entityKey: receipt.logs[0].topics[1] as Hex,
44
- }
45
- }
@@ -1,3 +0,0 @@
1
- export { kaolin } from "./kaolin"
2
- export { localhost } from "./localhost"
3
- export { marketplace } from "./marketplace"
@@ -1,26 +0,0 @@
1
- import { defineChain } from "viem"
2
-
3
- export const kaolin = defineChain({
4
- id: 60138453025,
5
- name: "Kaolin",
6
- network: "kaolin",
7
- nativeCurrency: {
8
- name: "Ethereum",
9
- symbol: "ETH",
10
- decimals: 18,
11
- },
12
- rpcUrls: {
13
- default: {
14
- http: ["https://kaolin.hoodi.arkiv.network/rpc"],
15
- webSocket: ["wss://kaolin.hoodi.arkiv.network/rpc/ws"],
16
- },
17
- },
18
- blockExplorers: {
19
- default: {
20
- name: "Kaolin Arkiv Explorer",
21
- url: "https://explorer.kaolin.hoodi.arkiv.network",
22
- apiUrl: "https://explorer.kaolin.hoodi.arkiv.network/api",
23
- },
24
- },
25
- testnet: true,
26
- })
@@ -1,14 +0,0 @@
1
- import { defineChain } from "viem"
2
-
3
- export const localhost = defineChain({
4
- id: 1337,
5
- name: "Localhost",
6
- nativeCurrency: {
7
- decimals: 18,
8
- name: "Ether",
9
- symbol: "ETH",
10
- },
11
- rpcUrls: {
12
- default: { http: ["http://127.0.0.1:8545"] },
13
- },
14
- })
@@ -1,26 +0,0 @@
1
- import { defineChain } from "viem"
2
-
3
- export const marketplace = defineChain({
4
- id: 60138453027,
5
- name: "Marketplace",
6
- network: "marketplace",
7
- nativeCurrency: {
8
- name: "Ethereum",
9
- symbol: "ETH",
10
- decimals: 18,
11
- },
12
- rpcUrls: {
13
- default: {
14
- http: ["https://marketplace.hoodi.arkiv.network/rpc"],
15
- webSocket: ["wss://marketplace.hoodi.arkiv.network/rpc/ws"],
16
- },
17
- },
18
- blockExplorers: {
19
- default: {
20
- name: "Marketplace Arkiv Explorer",
21
- url: "https://explorer.marketplace.hoodi.arkiv.network",
22
- apiUrl: "https://explorer.marketplace.hoodi.arkiv.network/api",
23
- },
24
- },
25
- testnet: true,
26
- })
@@ -1,9 +0,0 @@
1
- import type { Account, Chain, Client, RpcSchema, Transport } from "viem"
2
- import type { ArkivRpcSchema } from "../types/rpcSchema"
3
-
4
- export type ArkivClient<
5
- transport extends Transport = Transport,
6
- chain extends Chain | undefined = Chain | undefined,
7
- accountOrAddress extends Account | undefined = Account | undefined,
8
- rpcSchema extends RpcSchema | undefined = ArkivRpcSchema,
9
- > = Client<transport, chain, accountOrAddress, rpcSchema>
@@ -1,65 +0,0 @@
1
- import type {
2
- Account,
3
- Address,
4
- Chain,
5
- Client,
6
- ParseAccount,
7
- Prettify,
8
- PublicClientConfig,
9
- RpcSchema,
10
- Transport,
11
- } from "viem"
12
- import { createClient, publicActions } from "viem"
13
- import type { ArkivRpcSchema } from "../types/rpcSchema"
14
- import { type PublicArkivActions, publicArkivActions } from "./decorators/arkivPublic"
15
-
16
- export type PublicArkivClient<
17
- transport extends Transport = Transport,
18
- chain extends Chain | undefined = Chain | undefined,
19
- accountOrAddress extends Account | undefined = undefined,
20
- rpcSchema extends RpcSchema | undefined = ArkivRpcSchema,
21
- > = Prettify<
22
- Client<transport, chain, accountOrAddress, rpcSchema, PublicArkivActions<transport, chain>>
23
- >
24
-
25
- /**
26
- * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
27
- *
28
- * - Docs: https://docs.golemdb.io/ts-sdk/clients/public
29
- *
30
- * A Public Client is an interface to "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/), [Arkiv JSON-RPC API](https://docs.golemdb.io/json-rpc/), and [Kaolin JSON-RPC API](https://kaolin.holesky.golemdb.io/rpc) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction).
31
- *
32
- * @param config - {@link PublicClientConfig}
33
- * @returns A Arkiv Public Client. {@link PublicArkivClient}
34
- *
35
- * @example
36
- * import { createPublicClient, http } from 'arkiv'
37
- * import { kaolin } from 'arkiv/chains'
38
- *
39
- * const client = createPublicClient({
40
- * chain: kaolin,
41
- * transport: http(),
42
- * })
43
- */
44
- export function createPublicClient<
45
- transport extends Transport,
46
- chain extends Chain | undefined = undefined,
47
- accountOrAddress extends Account | Address | undefined = undefined,
48
- rpcSchema extends RpcSchema | undefined = ArkivRpcSchema,
49
- >(
50
- parameters: PublicClientConfig<transport, chain, accountOrAddress, rpcSchema>,
51
- ): PublicArkivClient<transport, chain, ParseAccount<accountOrAddress>, rpcSchema> {
52
- const { key = "public", name = "Public Client" } = parameters
53
- const client = createClient({
54
- ...parameters,
55
- key,
56
- name,
57
- })
58
-
59
- return client.extend(publicArkivActions).extend(publicActions) as unknown as PublicArkivClient<
60
- transport,
61
- chain,
62
- ParseAccount<accountOrAddress>,
63
- rpcSchema
64
- >
65
- }
@@ -1,70 +0,0 @@
1
- import type {
2
- Account,
3
- Address,
4
- Chain,
5
- Client,
6
- ParseAccount,
7
- Prettify,
8
- RpcSchema,
9
- Transport,
10
- WalletClientConfig,
11
- } from "viem"
12
- import { createClient, publicActions, walletActions } from "viem"
13
- import type { ArkivRpcSchema } from "../types/rpcSchema"
14
- import { publicArkivActions } from "./decorators/arkivPublic"
15
- import { type WalletArkivActions, walletArkivActions } from "./decorators/arkivWallet"
16
-
17
- export type WalletArkivClient<
18
- transport extends Transport = Transport,
19
- chain extends Chain | undefined = Chain | undefined,
20
- account extends Account | undefined = Account | undefined,
21
- rpcSchema extends RpcSchema | undefined = ArkivRpcSchema,
22
- > = Prettify<
23
- Client<transport, chain, account, rpcSchema, WalletArkivActions<transport, chain, account>>
24
- >
25
-
26
- /**
27
- * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
28
- *
29
- * - Docs: https://docs.golemdb.io/ts-sdk/clients/public
30
- *
31
- * A Public Client is an interface to "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/), [Arkiv JSON-RPC API](https://docs.golemdb.io/json-rpc/), and [Kaolin JSON-RPC API](https://kaolin.holesky.golemdb.io/rpc) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction).
32
- *
33
- * @param config - {@link PublicClientConfig}
34
- * @returns A Arkiv Public Client. {@link PublicArkivClient}
35
- *
36
- * @example
37
- * import { createPublicClient, http } from 'arkiv'
38
- * import { kaolin } from 'arkiv/chains'
39
- *
40
- * const client = createPublicClient({
41
- * chain: kaolin,
42
- * transport: http(),
43
- * })
44
- */
45
- export function createWalletClient<
46
- transport extends Transport,
47
- chain extends Chain | undefined = undefined,
48
- accountOrAddress extends Account | Address | undefined = undefined,
49
- rpcSchema extends RpcSchema | undefined = ArkivRpcSchema,
50
- >(
51
- parameters: WalletClientConfig<transport, chain, accountOrAddress, rpcSchema>,
52
- ): WalletArkivClient<transport, chain, ParseAccount<accountOrAddress>, rpcSchema> {
53
- const { key = "wallet", name = "Wallet Client" } = parameters
54
- const client = createClient({
55
- ...parameters,
56
- key,
57
- name,
58
- })
59
-
60
- return client
61
- .extend(walletActions)
62
- .extend(publicActions)
63
- .extend(walletArkivActions)
64
- .extend(publicArkivActions) as unknown as WalletArkivClient<
65
- transport,
66
- chain,
67
- ParseAccount<accountOrAddress>,
68
- rpcSchema
69
- >
70
- }
@@ -1,205 +0,0 @@
1
- import type { Account, Chain, Client, Hex, PublicActions, Transport } from "viem"
2
- import { getBlockTiming } from "../../actions/public/getBlockTiming"
3
- import { getEntity } from "../../actions/public/getEntity"
4
- import { getEntityCount } from "../../actions/public/getEntityCount"
5
- import { query } from "../../actions/public/query"
6
- import { subscribeEntityEvents } from "../../actions/public/subscribeEntityEvents"
7
- import { QueryBuilder } from "../../query/queryBuilder"
8
- import type { Entity } from "../../types/entity"
9
- import type {
10
- OnEntityCreatedEvent,
11
- OnEntityDeletedEvent,
12
- OnEntityExpiredEvent,
13
- OnEntityExpiresInExtendedEvent,
14
- OnEntityUpdatedEvent,
15
- } from "../../types/events"
16
-
17
- export type PublicArkivActions<
18
- transport extends Transport = Transport,
19
- chain extends Chain | undefined = Chain | undefined,
20
- account extends Account | undefined = Account | undefined,
21
- > = Pick<
22
- PublicActions<transport, chain, account>,
23
- | "getBalance"
24
- | "getBlock"
25
- | "getBlockNumber"
26
- | "getChainId"
27
- | "getLogs"
28
- | "getTransaction"
29
- | "getTransactionCount"
30
- | "getTransactionReceipt"
31
- | "waitForTransactionReceipt"
32
- | "watchEvent"
33
- > & {
34
- /**
35
- * Returns the entity with the given key.
36
- *
37
- * - Docs: https://docs.golemdb.io/ts-sdk/actions/public/getEntity
38
- * - JSON-RPC Methods: [`golembase_getStorageValue`](https://docs.golemdb.io/dev/json-rpc-api/#golembase_getstoragevalue)
39
- * - JSON-RPC Methods: [`golembase_getEntityMetaData`](https://docs.golemdb.io/dev/json-rpc-api/#golembase_getEntityMetaData)
40
- *
41
- * @param args - {entityKey}
42
- * @returns The entity with the given key. {@link Entity}
43
- *
44
- * @example
45
- * import { createPublicClient, http } from 'arkiv'
46
- * import { kaolin } from 'arkiv/chains'
47
- *
48
- * const client = createPublicClient({
49
- * chain: kaolin,
50
- * transport: http(),
51
- * })
52
- * const entity = await client.getEntity("0x123")
53
- * // {
54
- * // key: "0x123",
55
- * // value: "0x123",
56
- * // }
57
- */
58
- getEntity: (key: Hex) => Promise<Entity>
59
-
60
- /**
61
- * Returns a QueryBuilder instance for building and executing queries.
62
- * The QueryBuilder object follows the Builder pattern, allowing you to chain methods to build a query and then execute it.
63
- *
64
- * - Docs: https://docs.golemdb.io/ts-sdk/actions/public/query
65
- *
66
- * @returns A QueryBuilder instance for building and executing queries. {@link QueryBuilder}
67
- *
68
- * @example
69
- * import { createPublicClient, http } from 'arkiv'
70
- * import { kaolin } from 'arkiv/chains'
71
- *
72
- * const client = createPublicClient({
73
- * chain: kaolin,
74
- * transport: http(),
75
- * })
76
- * const query = client.buildQuery()
77
- * const entities = await query.where("key", "=", "value").ownedBy("0x123").fetch()
78
- *
79
- */
80
- buildQuery: () => QueryBuilder
81
-
82
- /**
83
- * Returns a QueryResult instance for fetching the results of a raw query.
84
- * @returns A QueryResult instance for fetching the results of a raw query. {@link QueryResult}
85
- *
86
- * @example
87
- * import { createPublicClient, http } from 'arkiv'
88
- * import { kaolin } from 'arkiv/chains'
89
- *
90
- * const client = createPublicClient({
91
- * chain: kaolin,
92
- * transport: http(),
93
- * })
94
- * const queryResult = client.query('key = value && $owner = 0x123')
95
- *
96
- */
97
- query: (query: string) => Promise<Entity[]>
98
-
99
- /**
100
- * Returns the number of entities in the DBChain.
101
- * @returns The number of entities in the DBChain. {@link number}
102
- *
103
- * @example
104
- * import { createPublicClient, http } from 'arkiv'
105
- * import { kaolin } from 'arkiv/chains'
106
- *
107
- * const client = createPublicClient({
108
- * chain: kaolin,
109
- * transport: http(),
110
- * })
111
- * const entityCount = await client.getEntityCount()
112
- * // entityCount = 0
113
- */
114
- getEntityCount: () => Promise<number>
115
-
116
- /**
117
- * Returns the current block timing.
118
- * @returns The current block timing. {@link GetBlockTimingReturnType}
119
- *
120
- * @example
121
- * import { createPublicClient, http } from 'arkiv'
122
- * import { kaolin } from 'arkiv/chains'
123
- *
124
- * const client = createPublicClient({
125
- * chain: kaolin,
126
- * transport: http(),
127
- * })
128
- * const blockTiming = await client.getBlockTiming()
129
- * // {
130
- * // currentBlock: 10n, // block number
131
- * // currentBlockTime: 1234567890, // block timestamp
132
- * // blockDuration: 2, // in seconds
133
- * // }
134
- */
135
- getBlockTiming: () => Promise<{
136
- currentBlock: bigint
137
- currentBlockTime: number
138
- blockDuration: number
139
- }>
140
-
141
- subscribeEntityEvents: (
142
- {
143
- onError,
144
- onEntityCreated,
145
- onEntityUpdated,
146
- onEntityDeleted,
147
- onEntityExpiresInExtended,
148
- }: {
149
- onError?: (error: Error) => void
150
- onEntityCreated?: (event: OnEntityCreatedEvent) => void
151
- onEntityUpdated?: (event: OnEntityUpdatedEvent) => void
152
- onEntityDeleted?: (event: OnEntityDeletedEvent) => void
153
- onEntityExpired?: (event: OnEntityExpiredEvent) => void
154
- onEntityExpiresInExtended?: (event: OnEntityExpiresInExtendedEvent) => void
155
- },
156
- pollingInterval?: number,
157
- fromBlock?: bigint,
158
- ) => Promise<() => void>
159
- }
160
-
161
- export function publicArkivActions<
162
- transport extends Transport = Transport,
163
- chain extends Chain | undefined = Chain | undefined,
164
- account extends Account | undefined = Account | undefined,
165
- >(client: Client<transport, chain, account>) {
166
- return {
167
- getEntity: (key: Hex) => getEntity(client, key),
168
- query: (rawQuery: string) => query(client, rawQuery),
169
- buildQuery: () => new QueryBuilder(client),
170
- getBlockTiming: () => getBlockTiming(client),
171
- getEntityCount: () => getEntityCount(client),
172
- subscribeEntityEvents: (
173
- {
174
- onError,
175
- onEntityCreated,
176
- onEntityUpdated,
177
- onEntityDeleted,
178
- onEntityExpired,
179
- onEntityExpiresInExtended,
180
- }: {
181
- onError?: (error: Error) => void
182
- onEntityCreated?: (event: OnEntityCreatedEvent) => void
183
- onEntityUpdated?: (event: OnEntityUpdatedEvent) => void
184
- onEntityDeleted?: (event: OnEntityDeletedEvent) => void
185
- onEntityExpired?: (event: OnEntityExpiredEvent) => void
186
- onEntityExpiresInExtended?: (event: OnEntityExpiresInExtendedEvent) => void
187
- },
188
- pollingInterval?: number,
189
- fromBlock?: bigint,
190
- ) =>
191
- subscribeEntityEvents(
192
- client,
193
- {
194
- onError,
195
- onEntityCreated,
196
- onEntityUpdated,
197
- onEntityDeleted,
198
- onEntityExpired,
199
- onEntityExpiresInExtended,
200
- },
201
- pollingInterval,
202
- fromBlock,
203
- ),
204
- }
205
- }