@opendatalabs/vana-sdk 0.1.0-alpha.fd33fc9 → 2.0.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 (351) hide show
  1. package/dist/browser.cjs.map +1 -1
  2. package/dist/browser.d.ts +33 -1
  3. package/dist/browser.js.map +1 -1
  4. package/dist/chains/index.cjs.map +1 -1
  5. package/dist/chains/index.d.ts +30 -1
  6. package/dist/chains/index.js.map +1 -1
  7. package/dist/client/__tests__/enhancedResponse.test.d.ts +1 -0
  8. package/dist/client/enhancedResponse.cjs +164 -0
  9. package/dist/client/enhancedResponse.cjs.map +1 -0
  10. package/dist/client/enhancedResponse.d.ts +120 -0
  11. package/dist/client/enhancedResponse.js +138 -0
  12. package/dist/client/enhancedResponse.js.map +1 -0
  13. package/dist/config/chains.cjs.map +1 -1
  14. package/dist/config/chains.d.ts +99 -0
  15. package/dist/config/chains.js.map +1 -1
  16. package/dist/contracts/contractController.cjs.map +1 -1
  17. package/dist/contracts/contractController.d.ts +66 -10
  18. package/dist/contracts/contractController.js.map +1 -1
  19. package/dist/controllers/__tests__/data-consistency-integration.test.d.ts +7 -0
  20. package/dist/controllers/__tests__/operations.processQueue.test.d.ts +1 -0
  21. package/dist/controllers/base.cjs +33 -0
  22. package/dist/controllers/base.cjs.map +1 -1
  23. package/dist/controllers/base.d.ts +10 -0
  24. package/dist/controllers/base.js +33 -0
  25. package/dist/controllers/base.js.map +1 -1
  26. package/dist/controllers/data.cjs +417 -276
  27. package/dist/controllers/data.cjs.map +1 -1
  28. package/dist/controllers/data.d.ts +246 -193
  29. package/dist/controllers/data.js +430 -279
  30. package/dist/controllers/data.js.map +1 -1
  31. package/dist/controllers/operations.cjs +430 -0
  32. package/dist/controllers/operations.cjs.map +1 -0
  33. package/dist/controllers/operations.d.ts +229 -0
  34. package/dist/controllers/operations.js +406 -0
  35. package/dist/controllers/operations.js.map +1 -0
  36. package/dist/controllers/permissions.cjs +690 -209
  37. package/dist/controllers/permissions.cjs.map +1 -1
  38. package/dist/controllers/permissions.d.ts +196 -68
  39. package/dist/controllers/permissions.js +690 -209
  40. package/dist/controllers/permissions.js.map +1 -1
  41. package/dist/controllers/protocol.cjs.map +1 -1
  42. package/dist/controllers/protocol.d.ts +27 -28
  43. package/dist/controllers/protocol.js.map +1 -1
  44. package/dist/controllers/schemas.cjs +104 -25
  45. package/dist/controllers/schemas.cjs.map +1 -1
  46. package/dist/controllers/schemas.d.ts +88 -40
  47. package/dist/controllers/schemas.js +104 -25
  48. package/dist/controllers/schemas.js.map +1 -1
  49. package/dist/controllers/server.cjs +269 -58
  50. package/dist/controllers/server.cjs.map +1 -1
  51. package/dist/controllers/server.d.ts +157 -52
  52. package/dist/controllers/server.js +269 -58
  53. package/dist/controllers/server.js.map +1 -1
  54. package/dist/core/__tests__/health.test.d.ts +1 -0
  55. package/dist/core/__tests__/inMemoryNonceManager.test.d.ts +1 -0
  56. package/dist/core/__tests__/nonceManager.test.d.ts +1 -0
  57. package/dist/core/__tests__/pollingManager.test.d.ts +4 -0
  58. package/dist/core/apiClient.cjs +53 -3
  59. package/dist/core/apiClient.cjs.map +1 -1
  60. package/dist/core/apiClient.d.ts +132 -7
  61. package/dist/core/apiClient.js +53 -3
  62. package/dist/core/apiClient.js.map +1 -1
  63. package/dist/core/generics.cjs +30 -3
  64. package/dist/core/generics.cjs.map +1 -1
  65. package/dist/core/generics.d.ts +95 -6
  66. package/dist/core/generics.js +30 -3
  67. package/dist/core/generics.js.map +1 -1
  68. package/dist/core/health.cjs +289 -0
  69. package/dist/core/health.cjs.map +1 -0
  70. package/dist/core/health.d.ts +143 -0
  71. package/dist/core/health.js +265 -0
  72. package/dist/core/health.js.map +1 -0
  73. package/dist/core/inMemoryNonceManager.cjs +138 -0
  74. package/dist/core/inMemoryNonceManager.cjs.map +1 -0
  75. package/dist/core/inMemoryNonceManager.d.ts +69 -0
  76. package/dist/core/inMemoryNonceManager.js +114 -0
  77. package/dist/core/inMemoryNonceManager.js.map +1 -0
  78. package/dist/core/nonceManager.cjs +304 -0
  79. package/dist/core/nonceManager.cjs.map +1 -0
  80. package/dist/core/nonceManager.d.ts +116 -0
  81. package/dist/core/nonceManager.js +280 -0
  82. package/dist/core/nonceManager.js.map +1 -0
  83. package/dist/core/pollingManager.cjs +292 -0
  84. package/dist/core/pollingManager.cjs.map +1 -0
  85. package/dist/core/pollingManager.d.ts +120 -0
  86. package/dist/core/pollingManager.js +268 -0
  87. package/dist/core/pollingManager.js.map +1 -0
  88. package/dist/core.cjs +55 -1
  89. package/dist/core.cjs.map +1 -1
  90. package/dist/core.d.ts +54 -3
  91. package/dist/core.js +55 -1
  92. package/dist/core.js.map +1 -1
  93. package/dist/crypto/ecies/base.cjs +16 -3
  94. package/dist/crypto/ecies/base.cjs.map +1 -1
  95. package/dist/crypto/ecies/base.js +16 -3
  96. package/dist/crypto/ecies/base.js.map +1 -1
  97. package/dist/errors.cjs +29 -0
  98. package/dist/errors.cjs.map +1 -1
  99. package/dist/errors.d.ts +64 -0
  100. package/dist/errors.js +28 -0
  101. package/dist/errors.js.map +1 -1
  102. package/dist/generated/abi/ComputeInstructionRegistryImplementation.cjs.map +1 -1
  103. package/dist/generated/abi/ComputeInstructionRegistryImplementation.js.map +1 -1
  104. package/dist/generated/abi/DLPPerformanceImplementation.cjs +42 -0
  105. package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +1 -1
  106. package/dist/generated/abi/DLPPerformanceImplementation.d.ts +32 -0
  107. package/dist/generated/abi/DLPPerformanceImplementation.js +42 -0
  108. package/dist/generated/abi/DLPPerformanceImplementation.js.map +1 -1
  109. package/dist/generated/abi/DLPRegistryImplementation.cjs +5 -5
  110. package/dist/generated/abi/DLPRegistryImplementation.cjs.map +1 -1
  111. package/dist/generated/abi/DLPRegistryImplementation.d.ts +4 -4
  112. package/dist/generated/abi/DLPRegistryImplementation.js +5 -5
  113. package/dist/generated/abi/DLPRegistryImplementation.js.map +1 -1
  114. package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +166 -2
  115. package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +1 -1
  116. package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +129 -2
  117. package/dist/generated/abi/DLPRewardDeployerImplementation.js +166 -2
  118. package/dist/generated/abi/DLPRewardDeployerImplementation.js.map +1 -1
  119. package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs +167 -19
  120. package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs.map +1 -1
  121. package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +127 -14
  122. package/dist/generated/abi/DataPortabilityGranteesImplementation.js +167 -19
  123. package/dist/generated/abi/DataPortabilityGranteesImplementation.js.map +1 -1
  124. package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs +0 -19
  125. package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs.map +1 -1
  126. package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +0 -14
  127. package/dist/generated/abi/DataPortabilityPermissionsImplementation.js +0 -19
  128. package/dist/generated/abi/DataPortabilityPermissionsImplementation.js.map +1 -1
  129. package/dist/generated/abi/DataPortabilityServersImplementation.cjs +0 -19
  130. package/dist/generated/abi/DataPortabilityServersImplementation.cjs.map +1 -1
  131. package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +0 -14
  132. package/dist/generated/abi/DataPortabilityServersImplementation.js +0 -19
  133. package/dist/generated/abi/DataPortabilityServersImplementation.js.map +1 -1
  134. package/dist/generated/abi/DataRegistryImplementation.cjs +0 -13
  135. package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -1
  136. package/dist/generated/abi/DataRegistryImplementation.d.ts +0 -10
  137. package/dist/generated/abi/DataRegistryImplementation.js +0 -13
  138. package/dist/generated/abi/DataRegistryImplementation.js.map +1 -1
  139. package/dist/generated/abi/SwapHelperImplementation.cjs +0 -43
  140. package/dist/generated/abi/SwapHelperImplementation.cjs.map +1 -1
  141. package/dist/generated/abi/SwapHelperImplementation.d.ts +0 -35
  142. package/dist/generated/abi/SwapHelperImplementation.js +0 -43
  143. package/dist/generated/abi/SwapHelperImplementation.js.map +1 -1
  144. package/dist/generated/abi/VanaEpochImplementation.cjs +195 -0
  145. package/dist/generated/abi/VanaEpochImplementation.cjs.map +1 -1
  146. package/dist/generated/abi/VanaEpochImplementation.d.ts +151 -0
  147. package/dist/generated/abi/VanaEpochImplementation.js +195 -0
  148. package/dist/generated/abi/VanaEpochImplementation.js.map +1 -1
  149. package/dist/generated/abi/VanaPoolEntityImplementation.cjs +22 -65
  150. package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -1
  151. package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +17 -51
  152. package/dist/generated/abi/VanaPoolEntityImplementation.js +22 -65
  153. package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -1
  154. package/dist/generated/abi/VanaPoolStakingImplementation.cjs +113 -1
  155. package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -1
  156. package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +85 -1
  157. package/dist/generated/abi/VanaPoolStakingImplementation.js +113 -1
  158. package/dist/generated/abi/VanaPoolStakingImplementation.js.map +1 -1
  159. package/dist/generated/abi/index.d.ts +546 -146
  160. package/dist/generated/event-types.cjs.map +1 -1
  161. package/dist/generated/event-types.d.ts +14 -8
  162. package/dist/generated/eventRegistry.cjs +42 -18
  163. package/dist/generated/eventRegistry.cjs.map +1 -1
  164. package/dist/generated/eventRegistry.js +42 -18
  165. package/dist/generated/eventRegistry.js.map +1 -1
  166. package/dist/generated/server/server-exports.cjs +22 -0
  167. package/dist/generated/server/server-exports.cjs.map +1 -1
  168. package/dist/generated/server/server-exports.d.ts +27 -10
  169. package/dist/generated/server/server-exports.js +17 -0
  170. package/dist/generated/server/server-exports.js.map +1 -1
  171. package/dist/generated/server/server.cjs.map +1 -1
  172. package/dist/generated/server/server.d.ts +771 -402
  173. package/dist/generated/subgraph.cjs +797 -32
  174. package/dist/generated/subgraph.cjs.map +1 -1
  175. package/dist/generated/subgraph.d.ts +135 -0
  176. package/dist/generated/subgraph.js +792 -32
  177. package/dist/generated/subgraph.js.map +1 -1
  178. package/dist/index.browser.d.ts +2 -0
  179. package/dist/index.browser.js +10 -0
  180. package/dist/index.browser.js.map +1 -1
  181. package/dist/index.cjs.map +1 -1
  182. package/dist/index.js.map +1 -1
  183. package/dist/index.node.cjs +26 -0
  184. package/dist/index.node.cjs.map +1 -1
  185. package/dist/index.node.d.ts +49 -5
  186. package/dist/index.node.js +25 -1
  187. package/dist/index.node.js.map +1 -1
  188. package/dist/lib/__tests__/redisAtomicStore.test.d.ts +1 -0
  189. package/dist/lib/redisAtomicStore.cjs +201 -0
  190. package/dist/lib/redisAtomicStore.cjs.map +1 -0
  191. package/dist/lib/redisAtomicStore.d.ts +120 -0
  192. package/dist/lib/redisAtomicStore.js +177 -0
  193. package/dist/lib/redisAtomicStore.js.map +1 -0
  194. package/dist/node.cjs.map +1 -1
  195. package/dist/node.d.ts +39 -1
  196. package/dist/node.js.map +1 -1
  197. package/dist/platform/browser.cjs +160 -2
  198. package/dist/platform/browser.cjs.map +1 -1
  199. package/dist/platform/browser.d.ts +232 -12
  200. package/dist/platform/browser.js +160 -2
  201. package/dist/platform/browser.js.map +1 -1
  202. package/dist/platform/interface.cjs.map +1 -1
  203. package/dist/platform/interface.d.ts +283 -90
  204. package/dist/platform/node.cjs +163 -2
  205. package/dist/platform/node.cjs.map +1 -1
  206. package/dist/platform/node.d.ts +69 -6
  207. package/dist/platform/node.js +163 -2
  208. package/dist/platform/node.js.map +1 -1
  209. package/dist/server/relayerHandler.cjs +315 -81
  210. package/dist/server/relayerHandler.cjs.map +1 -1
  211. package/dist/server/relayerHandler.d.ts +35 -2
  212. package/dist/server/relayerHandler.js +315 -81
  213. package/dist/server/relayerHandler.js.map +1 -1
  214. package/dist/storage/index.cjs +3 -0
  215. package/dist/storage/index.cjs.map +1 -1
  216. package/dist/storage/index.d.ts +1 -0
  217. package/dist/storage/index.js +2 -0
  218. package/dist/storage/index.js.map +1 -1
  219. package/dist/storage/manager.cjs +108 -25
  220. package/dist/storage/manager.cjs.map +1 -1
  221. package/dist/storage/manager.d.ts +119 -25
  222. package/dist/storage/manager.js +108 -25
  223. package/dist/storage/manager.js.map +1 -1
  224. package/dist/storage/providers/callback-storage.cjs +86 -15
  225. package/dist/storage/providers/callback-storage.cjs.map +1 -1
  226. package/dist/storage/providers/callback-storage.d.ts +109 -20
  227. package/dist/storage/providers/callback-storage.js +86 -15
  228. package/dist/storage/providers/callback-storage.js.map +1 -1
  229. package/dist/storage/providers/dropbox.cjs +237 -0
  230. package/dist/storage/providers/dropbox.cjs.map +1 -0
  231. package/dist/storage/providers/dropbox.d.ts +39 -0
  232. package/dist/storage/providers/dropbox.js +215 -0
  233. package/dist/storage/providers/dropbox.js.map +1 -0
  234. package/dist/storage/providers/dropbox.test.d.ts +1 -0
  235. package/dist/storage/providers/pinata.cjs.map +1 -1
  236. package/dist/storage/providers/pinata.d.ts +12 -14
  237. package/dist/storage/providers/pinata.js.map +1 -1
  238. package/dist/tests/data-upload-owner-validation.test.d.ts +1 -0
  239. package/dist/tests/permissions-transaction-options.test.d.ts +1 -0
  240. package/dist/types/atomicStore.cjs +31 -0
  241. package/dist/types/atomicStore.cjs.map +1 -0
  242. package/dist/types/atomicStore.d.ts +236 -0
  243. package/dist/types/atomicStore.js +7 -0
  244. package/dist/types/atomicStore.js.map +1 -0
  245. package/dist/types/blockchain.cjs.map +1 -1
  246. package/dist/types/blockchain.d.ts +39 -11
  247. package/dist/types/chains.cjs.map +1 -1
  248. package/dist/types/chains.d.ts +74 -7
  249. package/dist/types/chains.js.map +1 -1
  250. package/dist/types/config.cjs.map +1 -1
  251. package/dist/types/config.d.ts +38 -4
  252. package/dist/types/config.js.map +1 -1
  253. package/dist/types/contracts.cjs.map +1 -1
  254. package/dist/types/contracts.d.ts +71 -7
  255. package/dist/types/controller-context.cjs.map +1 -1
  256. package/dist/types/controller-context.d.ts +4 -1
  257. package/dist/types/data.cjs.map +1 -1
  258. package/dist/types/data.d.ts +11 -10
  259. package/dist/types/generics.cjs.map +1 -1
  260. package/dist/types/generics.d.ts +81 -10
  261. package/dist/types/index.cjs.map +1 -1
  262. package/dist/types/index.d.ts +31 -3
  263. package/dist/types/index.js.map +1 -1
  264. package/dist/types/operationStore.cjs +17 -0
  265. package/dist/types/operationStore.cjs.map +1 -0
  266. package/dist/types/operationStore.d.ts +171 -0
  267. package/dist/types/operationStore.js +1 -0
  268. package/dist/types/operationStore.js.map +1 -0
  269. package/dist/types/operations.cjs +3 -15
  270. package/dist/types/operations.cjs.map +1 -1
  271. package/dist/types/operations.d.ts +131 -39
  272. package/dist/types/operations.js +2 -13
  273. package/dist/types/operations.js.map +1 -1
  274. package/dist/types/options.cjs +17 -0
  275. package/dist/types/options.cjs.map +1 -0
  276. package/dist/types/options.d.ts +308 -0
  277. package/dist/types/options.js +1 -0
  278. package/dist/types/options.js.map +1 -0
  279. package/dist/types/permissions.cjs.map +1 -1
  280. package/dist/types/permissions.d.ts +19 -20
  281. package/dist/types/personal.cjs.map +1 -1
  282. package/dist/types/personal.d.ts +150 -14
  283. package/dist/types/relayer.cjs.map +1 -1
  284. package/dist/types/relayer.d.ts +145 -24
  285. package/dist/types/storage.cjs.map +1 -1
  286. package/dist/types/storage.d.ts +9 -21
  287. package/dist/types/storage.js.map +1 -1
  288. package/dist/types/utils.cjs.map +1 -1
  289. package/dist/types/utils.d.ts +0 -45
  290. package/dist/utils/__tests__/chainQuery.test.d.ts +1 -0
  291. package/dist/utils/__tests__/subgraphConsistency.test.d.ts +4 -0
  292. package/dist/utils/__tests__/subgraphPagination.test.d.ts +4 -0
  293. package/dist/utils/chainQuery.cjs +107 -0
  294. package/dist/utils/chainQuery.cjs.map +1 -0
  295. package/dist/utils/chainQuery.d.ts +31 -0
  296. package/dist/utils/chainQuery.js +82 -0
  297. package/dist/utils/chainQuery.js.map +1 -0
  298. package/dist/utils/grantFiles.cjs +4 -1
  299. package/dist/utils/grantFiles.cjs.map +1 -1
  300. package/dist/utils/grantFiles.d.ts +10 -20
  301. package/dist/utils/grantFiles.js +4 -1
  302. package/dist/utils/grantFiles.js.map +1 -1
  303. package/dist/utils/grantValidation.cjs.map +1 -1
  304. package/dist/utils/grantValidation.d.ts +95 -16
  305. package/dist/utils/grantValidation.js.map +1 -1
  306. package/dist/utils/grants.cjs.map +1 -1
  307. package/dist/utils/grants.d.ts +93 -12
  308. package/dist/utils/grants.js.map +1 -1
  309. package/dist/utils/ipfs.cjs +2 -4
  310. package/dist/utils/ipfs.cjs.map +1 -1
  311. package/dist/utils/ipfs.d.ts +1 -1
  312. package/dist/utils/ipfs.js +2 -4
  313. package/dist/utils/ipfs.js.map +1 -1
  314. package/dist/utils/lazy-import.cjs.map +1 -1
  315. package/dist/utils/lazy-import.d.ts +32 -7
  316. package/dist/utils/lazy-import.js.map +1 -1
  317. package/dist/utils/signatureCache.cjs +8 -2
  318. package/dist/utils/signatureCache.cjs.map +1 -1
  319. package/dist/utils/signatureCache.d.ts +49 -8
  320. package/dist/utils/signatureCache.js +8 -2
  321. package/dist/utils/signatureCache.js.map +1 -1
  322. package/dist/utils/subgraphConsistency.cjs +184 -0
  323. package/dist/utils/subgraphConsistency.cjs.map +1 -0
  324. package/dist/utils/subgraphConsistency.d.ts +65 -0
  325. package/dist/utils/subgraphConsistency.js +155 -0
  326. package/dist/utils/subgraphConsistency.js.map +1 -0
  327. package/dist/utils/subgraphMetaCache.cjs +101 -0
  328. package/dist/utils/subgraphMetaCache.cjs.map +1 -0
  329. package/dist/utils/subgraphMetaCache.d.ts +56 -0
  330. package/dist/utils/subgraphMetaCache.js +76 -0
  331. package/dist/utils/subgraphMetaCache.js.map +1 -0
  332. package/dist/utils/subgraphPagination.cjs +104 -0
  333. package/dist/utils/subgraphPagination.cjs.map +1 -0
  334. package/dist/utils/subgraphPagination.d.ts +78 -0
  335. package/dist/utils/subgraphPagination.js +78 -0
  336. package/dist/utils/subgraphPagination.js.map +1 -0
  337. package/dist/utils/transactionHelpers.cjs.map +1 -1
  338. package/dist/utils/transactionHelpers.d.ts +12 -12
  339. package/dist/utils/transactionHelpers.js.map +1 -1
  340. package/dist/utils/typedDataConverter.cjs.map +1 -1
  341. package/dist/utils/typedDataConverter.d.ts +39 -3
  342. package/dist/utils/typedDataConverter.js.map +1 -1
  343. package/dist/utils/urlResolver.cjs +7 -0
  344. package/dist/utils/urlResolver.cjs.map +1 -1
  345. package/dist/utils/urlResolver.d.ts +22 -4
  346. package/dist/utils/urlResolver.js +7 -0
  347. package/dist/utils/urlResolver.js.map +1 -1
  348. package/dist/utils/wallet.cjs.map +1 -1
  349. package/dist/utils/wallet.d.ts +78 -16
  350. package/dist/utils/wallet.js.map +1 -1
  351. package/package.json +3 -1
@@ -11,6 +11,7 @@ import type { StorageManager } from "../storage";
11
11
  import type { DownloadRelayerCallbacks } from "./config";
12
12
  import type { UnifiedRelayerRequest, UnifiedRelayerResponse } from "./relayer";
13
13
  import type { TransactionResult, TransactionWaitOptions, Operation, PollingOptions } from "./operations";
14
+ import type { IOperationStore, IRelayerStateStore } from "./operationStore";
14
15
  import type { Contract, Fn, TypedTransactionResult } from "../generated/event-types";
15
16
  /**
16
17
  * Type definition for waitForTransactionEvents function.
@@ -23,7 +24,7 @@ export type WaitForTransactionEventsFn = <C extends Contract, F extends Fn<C>>(t
23
24
  /**
24
25
  * Type definition for waitForOperation function.
25
26
  */
26
- export type WaitForOperationFn = <T = unknown>(opOrId: Operation<T> | string, options?: PollingOptions) => Promise<Operation<T>>;
27
+ export type WaitForOperationFn = (opOrId: Operation | string, options?: PollingOptions) => Promise<Operation>;
27
28
  /**
28
29
  * Shared controller context interface.
29
30
  *
@@ -62,4 +63,6 @@ export interface ControllerContext {
62
63
  waitForTransactionEvents?: WaitForTransactionEventsFn;
63
64
  /** Waits for an operation to complete with polling. */
64
65
  waitForOperation?: WaitForOperationFn;
66
+ /** Tracks async relayed transactions for resilient management. */
67
+ operationStore?: IOperationStore | IRelayerStateStore;
65
68
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/data.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\n\n/**\n * Represents a registered data file in the Vana network with complete blockchain metadata.\n *\n * @remarks\n * This interface describes files that have been uploaded to storage and registered\n * on the Vana blockchain, including their storage location, ownership, and blockchain\n * tracking information. Each file receives a unique ID and is linked to the owner's\n * address for permission management. Used throughout the SDK for file operations\n * and access control workflows.\n *\n * @category Data Management\n */\nexport interface UserFile {\n /** Unique identifier assigned by the Data Registry contract. */\n id: number;\n /** Storage URL where the encrypted file content is hosted. */\n url: string;\n /** Wallet address of the user who owns this file. */\n ownerAddress: Address;\n /** Block number when this file was registered on-chain. */\n addedAtBlock: bigint;\n /**\n * Schema identifier for data validation and structure definition.\n * Obtain schema IDs from `vana.schemas.list()` or when creating schemas via `vana.schemas.create()`.\n */\n schemaId?: number;\n /** Unix timestamp when the file was registered on-chain. */\n addedAtTimestamp?: bigint;\n /** Transaction hash of the on-chain file registration. */\n transactionHash?: Address;\n /** Additional file properties and custom application data. */\n metadata?: FileMetadata;\n /**\n * Array of DLP IDs that have submitted proofs for this file.\n * Each proof represents verification or processing by a Data Liquidity Pool.\n * Obtain DLP details via `vana.data.getDLP(dlpId)`.\n */\n dlpIds?: number[];\n}\n\n/**\n * Provides optional metadata for uploaded files and content description.\n *\n * @remarks\n * This interface contains descriptive information about uploaded files, including\n * file properties and custom application-specific data that can be used for\n * organization, validation, and display purposes.\n * @category Data Management\n */\nexport interface FileMetadata {\n /** Original filename as provided by the user or application. */\n name?: string;\n /** Total file size in bytes for storage tracking. */\n size?: number;\n /** MIME type identifier for content type recognition. */\n mimeType?: string;\n /** Hash value for file integrity verification. */\n checksum?: string;\n /** ISO 8601 timestamp when the file was uploaded. */\n uploadedAt?: string;\n /** Application-specific metadata for custom use cases. */\n custom?: Record<string, unknown>;\n}\n\n/**\n * High-level parameters for uploading user data with automatic encryption and blockchain registration.\n *\n * @remarks\n * This is the primary interface for uploading user data through the simplified `vana.data.upload()` method.\n * It handles the complete workflow including encryption, storage, and blockchain registration.\n *\n * When using permissions with encryption enabled (default), you must provide the public key\n * for each permission recipient.\n *\n * @example\n * ```typescript\n * // Basic file upload\n * const result = await vana.data.upload({\n * content: \"My personal data\",\n * filename: \"diary.txt\"\n * });\n *\n * // Upload with schema validation\n * const result = await vana.data.upload({\n * content: { name: \"John\", age: 30 },\n * filename: \"profile.json\",\n * schemaId: 1\n * });\n *\n * // Upload with permissions for an app (encrypted - requires publicKey)\n * const result = await vana.data.upload({\n * content: \"Data for AI analysis\",\n * filename: \"analysis.txt\",\n * permissions: [{\n * grantee: \"0x1234...\",\n * operation: \"llm_inference\",\n * parameters: { model: \"gpt-4\" },\n * publicKey: \"0x04...\" // Required when encrypt is true (default)\n * }]\n * });\n *\n * // Upload without encryption (publicKey optional)\n * const result = await vana.data.upload({\n * content: \"Public data\",\n * filename: \"public.txt\",\n * encrypt: false,\n * permissions: [{\n * grantee: \"0x1234...\",\n * operation: \"read\",\n * parameters: {}\n * }]\n * });\n * ```\n * @category Data Management\n */\nexport interface UploadParams {\n /** Raw file data as string, Blob, or Buffer. */\n content: string | Blob | Buffer;\n /** Optional filename for the uploaded file. */\n filename?: string;\n /** Optional schema ID for data validation. */\n schemaId?: number;\n /** Optional file permissions to grant decryption access during upload. */\n permissions?: FilePermissionParams[];\n /** Whether to encrypt the data (defaults to true). */\n encrypt?: boolean;\n /** Optional storage provider name. */\n providerName?: string;\n /** Optional owner address (defaults to current wallet address). */\n owner?: Address;\n}\n\n/**\n * Upload parameters with encryption enabled.\n *\n * @remarks\n * This interface ensures type safety when using encrypted uploads with permissions.\n * When encrypt is true, any permissions must include public keys for encryption.\n * @category Data Management\n */\nexport interface EncryptedUploadParams\n extends Omit<UploadParams, \"permissions\" | \"encrypt\"> {\n /** File permissions with required public keys for encrypted data sharing. */\n permissions?: FilePermissionParams[];\n /** Encryption is enabled. */\n encrypt: true;\n}\n\n/**\n * Upload parameters with encryption disabled.\n *\n * @remarks\n * This interface is used when uploading unencrypted data.\n * @category Data Management\n */\nexport interface UnencryptedUploadParams extends Omit<UploadParams, \"encrypt\"> {\n /** Encryption is disabled. */\n encrypt: false;\n}\n\n/**\n * Parameters for granting file decryption access during upload.\n *\n * @remarks\n * This interface is used to grant decryption access to specific accounts when uploading\n * encrypted files. It only handles encryption key sharing, not operation permissions.\n *\n * For granting operation permissions (like \"llm_inference\"), use the separate\n * `vana.permissions.grant()` method after uploading.\n *\n * @example\n * ```typescript\n * // Upload with decryption permission\n * const result = await vana.data.upload({\n * content: \"data\",\n * permissions: [{\n * account: \"0xServerAddress...\",\n * publicKey: \"0x04...\" // Server's public key\n * }]\n * });\n * ```\n * @category Data Management\n */\nexport interface FilePermissionParams {\n /** The account address that will be able to decrypt this file. */\n account: Address;\n /** The public key to encrypt the file's encryption key with. */\n publicKey: string;\n}\n\n/**\n * Permission parameters for granting data access.\n *\n * @remarks\n * This interface defines parameters for granting permissions to access data.\n * It's used in the permissions system but kept here for compatibility.\n *\n * @category Data Management\n */\nexport interface PermissionParams {\n /** The address of the application to grant permission to. */\n grantee: Address;\n /** The operation type (e.g., \"llm_inference\", \"data_analysis\", \"compute_task\"). */\n operation: string;\n /** Additional parameters for the permission (operation-specific configuration). */\n parameters: Record<string, unknown>;\n /** Optional nonce for the permission (auto-generated if not provided). */\n nonce?: bigint;\n /** Optional expiration timestamp (Unix seconds, no expiration if not provided). */\n expiresAt?: number;\n /**\n * Public key of the recipient to encrypt the data key for (required for upload with permissions).\n * Obtain via `vana.server.getIdentity(recipientAddress).public_key` for personal servers.\n */\n publicKey?: string;\n}\n\n/**\n * Legacy permission parameters that conflated file encryption and data access grants.\n *\n * @remarks\n * This interface was removed because it conflated two different concepts:\n * 1. File encryption permissions (handled during upload)\n * 2. Data access grants (operation permissions)\n *\n * For file uploads, use FilePermissionParams instead.\n * For data access grants, use vana.permissions.grant() after uploading.\n *\n * @deprecated Removed in v2.0.0. Use FilePermissionParams for uploads.\n * @category Data Management\n */\nexport interface LegacyPermissionParams {\n grantee: Address;\n operation: string;\n parameters: Record<string, unknown>;\n nonce?: bigint;\n expiresAt?: number;\n publicKey?: string;\n}\n\n/**\n * Result of the high-level upload operation.\n *\n * @remarks\n * Returned by the `vana.data.upload()` method after successful upload and blockchain registration.\n * @category Data Management\n */\nexport interface UploadResult {\n /** The file ID assigned by the DataRegistry contract. */\n fileId: number;\n /** The storage URL where the file is hosted. */\n url: string;\n /** The transaction hash of the blockchain registration. */\n transactionHash: Hash;\n /** The actual file size in bytes. */\n size: number;\n /** Whether the data passed schema validation (if applicable). */\n isValid?: boolean;\n /** Validation errors if schema validation failed. */\n validationErrors?: string[];\n /** Permission IDs if permissions were granted during upload. */\n permissionIds?: bigint[];\n}\n\n/**\n * Defines parameters for uploading files to storage providers with encryption options.\n *\n * @remarks\n * Used with DataController upload methods and storage operations. Supports multiple\n * content formats, optional encryption, and custom storage provider selection with\n * comprehensive metadata tracking.\n * @deprecated Use UploadParams with vana.data.upload() instead for the high-level API\n * @example\n * ```typescript\n * const uploadParams: UploadFileParams = {\n * content: new TextEncoder().encode(JSON.stringify(userData)),\n * metadata: {\n * name: \"personal-profile.json\",\n * mimeType: \"application/json\",\n * size: 2048,\n * },\n * storageProvider: \"ipfs\",\n * encrypt: true,\n * };\n *\n * const result = await vana.data.uploadFile(uploadParams);\n * ```\n * @category Data Management\n */\nexport interface UploadFileParams {\n /** Raw file data in bytes, buffer, or string format. */\n content: Uint8Array | Buffer | string;\n /** Descriptive metadata for file organization and tracking. */\n metadata?: FileMetadata;\n /** Storage provider name (\"ipfs\" or custom provider, uses configured default if unspecified). */\n storageProvider?: string;\n /** Enables automatic encryption before upload to storage (defaults to false). */\n encrypt?: boolean;\n /** Custom encryption key (auto-generated if encryption enabled and not provided). */\n encryptionKey?: string;\n}\n\n/**\n * Contains the result of a successful file upload operation.\n *\n * @remarks\n * This interface provides the essential information returned after uploading\n * a file to a storage provider, including access URL, size verification,\n * and encryption details when applicable.\n * @category Data Management\n */\nexport interface UploadFileResult {\n /** Public URL where the uploaded file can be accessed. */\n url: string;\n /** Actual file size in bytes after upload processing. */\n size: number;\n /** Hash value for verifying file integrity after upload. */\n checksum?: string;\n /** Encryption metadata when file was encrypted before storage. */\n encryption?: EncryptionInfo;\n}\n\n/**\n * Result of uploading an encrypted file to storage and blockchain\n *\n * @category Data Management\n */\nexport interface UploadEncryptedFileResult extends UploadFileResult {\n /** The new file ID assigned by the DataRegistry */\n fileId: number;\n /** Transaction hash of the file registration */\n transactionHash?: Hash;\n}\n\n/**\n * Encryption information for a file\n *\n * @category Data Management\n */\nexport interface EncryptionInfo {\n /** Encryption algorithm used */\n algorithm: string;\n /** Key derivation function */\n kdf?: string;\n /** Initialization vector */\n iv?: string;\n /** Salt used for key derivation */\n salt?: string;\n /** Key identifier */\n keyId?: string;\n}\n\n/**\n * Parameters for getting user files\n *\n * @category Data Management\n */\nexport interface GetUserFilesParams {\n /** Owner address to filter by */\n owner?: Address;\n /** Starting block number for filtering */\n fromBlock?: bigint;\n /** Ending block number for filtering */\n toBlock?: bigint;\n /** Maximum number of files to return */\n limit?: number;\n /** Offset for pagination */\n offset?: number;\n}\n\n/**\n * Parameters for getting a specific file\n *\n * @category Data Management\n */\nexport interface GetFileParams {\n /** File ID to retrieve */\n fileId: number;\n /** Whether to include metadata */\n includeMetadata?: boolean;\n}\n\n/**\n * Parameters for downloading a file\n *\n * @category Data Management\n */\nexport interface DownloadFileParams {\n /** File URL or ID to download */\n file: string | number;\n /** Storage provider to use */\n storageProvider?: string;\n /** Decryption key if file is encrypted */\n decryptionKey?: string;\n}\n\n/**\n * Result of downloading a file\n *\n * @category Data Management\n */\nexport interface DownloadFileResult {\n /** File content */\n content: Uint8Array;\n /** File metadata */\n metadata?: FileMetadata;\n /** Whether the file was encrypted */\n wasEncrypted?: boolean;\n}\n\n/**\n * Parameters for deleting a file\n *\n * @category Data Management\n */\nexport interface DeleteFileParams {\n /** File ID to delete */\n fileId: number;\n /** Whether to also delete from storage */\n deleteFromStorage?: boolean;\n /** Storage provider to delete from */\n storageProvider?: string;\n}\n\n/**\n * Result of deleting a file\n *\n * @category Data Management\n */\nexport interface DeleteFileResult {\n /** Whether the file was successfully deleted from the registry */\n registryDeleted: boolean;\n /** Whether the file was successfully deleted from storage */\n storageDeleted?: boolean;\n /** Transaction hash of the deletion */\n transactionHash?: Hash;\n}\n\n/**\n * Options for encrypting a file\n *\n * @category Data Management\n */\nexport interface EncryptFileOptions {\n /** Encryption seed for key derivation. Defaults to DEFAULT_ENCRYPTION_SEED */\n seed?: string;\n /** MIME type for the encrypted blob if input is not already a Blob */\n mimeType?: string;\n}\n\n/**\n * Result of encrypting a file\n *\n * @category Data Management\n */\nexport interface EncryptFileResult {\n /** The encrypted data as a Blob */\n encryptedData: Blob;\n /** The encryption key used (derived from wallet) */\n encryptionKey: string;\n}\n\n/**\n * Options for decrypting a file\n *\n * @category Data Management\n */\nexport interface DecryptFileOptions {\n /** Encryption seed for key derivation. Defaults to DEFAULT_ENCRYPTION_SEED */\n seed?: string;\n}\n\n/**\n * Parameters for uploading a file with permissions\n *\n * @category Data Management\n */\nexport interface UploadFileWithPermissionsParams {\n /** The file data to encrypt and upload */\n data: Blob;\n /** Array of permissions to grant, each with account address and public key */\n permissions: Array<{ account: Address; publicKey: string }>;\n /** Optional filename for the upload */\n filename?: string;\n /** Optional storage provider to use */\n providerName?: string;\n}\n\n/**\n * Parameters for adding permission to a file\n *\n * @category Data Management\n */\nexport interface AddFilePermissionParams {\n /** The file ID to grant permission for */\n fileId: number;\n /** The account to grant permission to */\n account: Address;\n /** The public key of the account for encryption */\n publicKey: string;\n}\n\n/**\n * Options for decrypting a file with permission\n *\n * @category Data Management\n */\nexport interface DecryptFileWithPermissionOptions {\n /** Optional account address to verify permission against */\n account?: Address;\n}\n\n/**\n * File access permissions\n *\n * @category Data Management\n */\nexport interface FileAccessPermissions {\n /** Whether the file can be read */\n read: boolean;\n /** Whether the file can be written */\n write: boolean;\n /** Whether the file can be deleted */\n delete: boolean;\n /** Whether the file can be shared */\n share: boolean;\n}\n\n/**\n * File sharing configuration\n *\n * @category Data Management\n */\nexport interface FileSharingConfig {\n /** Addresses that can access the file */\n allowedAddresses?: Address[];\n /** Expiration time for shared access */\n expiresAt?: Date;\n /** Required permissions for shared access */\n permissions: FileAccessPermissions;\n}\n\n/**\n * Batch upload parameters\n *\n * @category Data Management\n */\nexport interface BatchUploadParams {\n /** Array of files to upload */\n files: UploadFileParams[];\n /** Storage provider to use for all files */\n storageProvider?: string;\n /** Whether to encrypt all files */\n encrypt?: boolean;\n /** Encryption key for all files */\n encryptionKey?: string;\n}\n\n/**\n * Batch upload result\n *\n * @category Data Management\n */\nexport interface BatchUploadResult {\n /** Results for each uploaded file */\n results: UploadEncryptedFileResult[];\n /** Overall success status */\n success: boolean;\n /** Any errors that occurred */\n errors?: string[];\n}\n\n/**\n * Schema metadata from the blockchain (without fetched definition).\n *\n * This represents the on-chain schema registration data before the\n * definition has been fetched from the storage URL.\n *\n * @category Data Management\n */\nexport interface SchemaMetadata {\n /** Schema ID */\n id: number;\n /** Schema name */\n name: string;\n /** Schema dialect ('json' or 'sqlite') */\n dialect: \"json\" | \"sqlite\";\n /** URL containing the schema definition */\n definitionUrl: string;\n}\n\n/**\n * Complete schema with all definition fields populated.\n * This is what schemas.get() returns - a schema with the definition fetched.\n */\nexport interface CompleteSchema extends SchemaMetadata {\n /** Version of the schema */\n version: string;\n /** Optional description of the schema */\n description?: string;\n /** Optional version of the dialect */\n dialectVersion?: string;\n /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' */\n schema: object | string;\n}\n\n/**\n * Schema with optional definition fields.\n *\n * Schemas define the structure and validation rules for user data processed by refiners.\n * They ensure data quality and consistency across the Vana network by specifying how\n * raw user data should be formatted, validated, and processed.\n *\n * When the definition has been fetched (via schemas.get() or schemas.list() with includeDefinitions),\n * the version and schema fields will be populated. Otherwise, only the metadata fields are present.\n *\n * @category Data Management\n * @example\n * ```typescript\n * // Complete schema from schemas.get()\n * const completeSchema: Schema = {\n * id: 5,\n * name: 'Social Media Profile',\n * dialect: 'json',\n * definitionUrl: 'ipfs://QmSchema...',\n * version: '1.0.0',\n * description: 'Schema for validating social media profile data',\n * schema: { // JSON Schema object\n * type: 'object',\n * properties: {\n * username: { type: 'string' }\n * }\n * }\n * };\n *\n * // Metadata-only schema from schemas.list() without includeDefinitions\n * const metadataSchema: Schema = {\n * id: 5,\n * name: 'Social Media Profile',\n * dialect: 'json',\n * definitionUrl: 'ipfs://QmSchema...'\n * };\n * ```\n */\nexport interface Schema extends SchemaMetadata {\n /** Version of the schema (present when definition is fetched) */\n version?: string;\n /** Optional description of the schema */\n description?: string;\n /** Optional version of the dialect */\n dialectVersion?: string;\n /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' (present when definition is fetched) */\n schema?: object | string;\n}\n\n/**\n * Represents a refiner with schema information\n *\n * @category Data Management\n */\nexport interface Refiner {\n /** Refiner ID */\n id: number;\n /** DLP ID this refiner belongs to */\n dlpId: number;\n /** Owner address */\n owner: Address;\n /** Refiner name */\n name: string;\n /** Schema ID associated with this refiner */\n schemaId: number;\n /** URL containing refinement instructions */\n refinementInstructionUrl: string;\n}\n\n/**\n * Parameters for adding a new schema\n *\n * @category Data Management\n */\nexport interface AddSchemaParams {\n /** Schema name */\n name: string;\n /** Schema dialect */\n dialect: string;\n /** URL containing the schema definition */\n definitionUrl: string;\n}\n\n/**\n * Result of adding a schema\n *\n * @category Data Management\n */\nexport interface AddSchemaResult {\n /** The new schema ID assigned by the contract */\n schemaId: number;\n /** Transaction hash of the schema registration */\n transactionHash: Hash;\n}\n\n/**\n * Parameters for registering a new data refiner in the Vana network.\n *\n * Refiners are processors that transform and validate user data according to specific\n * schemas and instructions. They enable applications to work with structured, verified\n * user data while maintaining privacy and user control.\n *\n * @category Data Management\n * @example\n * ```typescript\n * const refinerParams: AddRefinerParams = {\n * dlpId: 1, // Data Liquidity Pool ID\n * name: 'Social Media Refiner',\n * schemaId: 5, // Pre-defined schema for social media data\n * refinementInstructionUrl: 'ipfs://Qm...' // Instructions for data processing\n * };\n * ```\n */\nexport interface AddRefinerParams {\n /** DLP ID this refiner belongs to */\n dlpId: number;\n /** Refiner name */\n name: string;\n /** Schema ID to associate with this refiner */\n schemaId: number;\n /** URL containing refinement instructions */\n refinementInstructionUrl: string;\n}\n\n/**\n * Result of adding a refiner\n *\n * @category Data Management\n */\nexport interface AddRefinerResult {\n /** The new refiner ID assigned by the contract */\n refinerId: number;\n /** Transaction hash of the refiner registration */\n transactionHash: Hash;\n}\n\n/**\n * Parameters for updating a refiner's schema ID\n *\n * @category Data Management\n */\nexport interface UpdateSchemaIdParams {\n /** Refiner ID to update */\n refinerId: number;\n /** New schema ID to associate with the refiner */\n newSchemaId: number;\n}\n\n/**\n * Result of updating a refiner's schema ID\n *\n * @category Data Management\n */\nexport interface UpdateSchemaIdResult {\n /** Transaction hash of the update */\n transactionHash: Hash;\n}\n\n/**\n * Trusted server data structure\n *\n * @category Data Management\n */\nexport interface TrustedServer {\n /** Unique identifier for the trusted server relationship */\n id: string;\n /** Server address (EVM address) */\n serverAddress: Address;\n /** Server URL */\n serverUrl: string;\n /** Timestamp when server was trusted */\n trustedAt: bigint;\n /** User who trusted the server */\n user: Address;\n /** Index in user's trusted server list (only available in RPC mode) */\n trustIndex?: number;\n}\n\n/**\n * Parameters for getUserTrustedServers method\n *\n * @category Data Management\n */\nexport interface GetUserTrustedServersParams {\n /** User address to query trusted servers for */\n user: Address;\n /** Optional subgraph URL to override default */\n subgraphUrl?: string;\n /** Maximum number of results */\n limit?: number;\n /** Number of results to skip */\n offset?: number;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/data.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\n\n/**\n * Represents a file registered on the Vana blockchain.\n *\n * @remarks\n * Contains complete metadata for files uploaded to storage and registered\n * on-chain. Each file has a unique ID, owner address, and storage URL.\n * Used throughout SDK for file operations and permission management.\n *\n * @category Data Management\n */\nexport interface UserFile {\n /** Unique identifier assigned by the Data Registry contract. */\n id: number;\n /** Storage URL where the encrypted file content is hosted. */\n url: string;\n /** Wallet address of the user who owns this file. */\n ownerAddress: Address;\n /** Block number when this file was registered on-chain. */\n addedAtBlock: bigint;\n /**\n * Schema identifier for data validation and structure definition.\n * Obtain schema IDs from `vana.schemas.list()` or when creating schemas via `vana.schemas.create()`.\n */\n schemaId?: number;\n /** Unix timestamp when the file was registered on-chain. */\n addedAtTimestamp?: bigint;\n /** Transaction hash of the on-chain file registration. */\n transactionHash?: Address;\n /** Additional file properties and custom application data. */\n metadata?: FileMetadata;\n /**\n * Array of DLP IDs that have submitted proofs for this file.\n * Each proof represents verification or processing by a Data Liquidity Pool.\n * Obtain DLP details via `vana.data.getDLP(dlpId)`.\n */\n dlpIds?: number[];\n}\n\n/**\n * Provides optional metadata for uploaded files and content description.\n *\n * @remarks\n * This interface contains descriptive information about uploaded files, including\n * file properties and custom application-specific data that can be used for\n * organization, validation, and display purposes.\n * @category Data Management\n */\nexport interface FileMetadata {\n /** Original filename as provided by the user or application. */\n name?: string;\n /** Total file size in bytes for storage tracking. */\n size?: number;\n /** MIME type identifier for content type recognition. */\n mimeType?: string;\n /** Hash value for file integrity verification. */\n checksum?: string;\n /** ISO 8601 timestamp when the file was uploaded. */\n uploadedAt?: string;\n /** Application-specific metadata for custom use cases. */\n custom?: Record<string, unknown>;\n}\n\n/**\n * High-level parameters for uploading user data with automatic encryption and blockchain registration.\n *\n * @remarks\n * This is the primary interface for uploading user data through the simplified `vana.data.upload()` method.\n * It handles the complete workflow including encryption, storage, and blockchain registration.\n *\n * When using permissions with encryption enabled (default), you must provide the public key\n * for each permission recipient.\n *\n * @example\n * ```typescript\n * // Basic file upload\n * const result = await vana.data.upload({\n * content: \"My personal data\",\n * filename: \"diary.txt\"\n * });\n *\n * // Upload with schema validation\n * const result = await vana.data.upload({\n * content: { name: \"John\", age: 30 },\n * filename: \"profile.json\",\n * schemaId: 1\n * });\n *\n * // Upload with permissions for an app (encrypted - requires publicKey)\n * const result = await vana.data.upload({\n * content: \"Data for AI analysis\",\n * filename: \"analysis.txt\",\n * permissions: [{\n * grantee: \"0x1234...\",\n * operation: \"llm_inference\",\n * parameters: { model: \"gpt-4\" },\n * publicKey: \"0x04...\" // Required when encrypt is true (default)\n * }]\n * });\n *\n * // Upload without encryption (publicKey optional)\n * const result = await vana.data.upload({\n * content: \"Public data\",\n * filename: \"public.txt\",\n * encrypt: false,\n * permissions: [{\n * grantee: \"0x1234...\",\n * operation: \"read\",\n * parameters: {}\n * }]\n * });\n * ```\n * @category Data Management\n */\nexport interface UploadParams {\n /** Raw file data as string, Blob, or Buffer. */\n content: string | Blob | Buffer;\n /** Optional filename for the uploaded file. */\n filename?: string;\n /** Optional schema ID for data validation. */\n schemaId?: number;\n /** Optional file permissions to grant decryption access during upload. */\n permissions?: FilePermissionParams[];\n /** Whether to encrypt the data (defaults to true). */\n encrypt?: boolean;\n /** Optional storage provider name. */\n providerName?: string;\n /** Optional owner address (defaults to current wallet address). */\n owner?: Address;\n /**\n * Schema validation mode when schemaId is provided:\n * - 'strict': Throw error on validation failure (default)\n * - 'warn': Log warning and continue on validation failure\n * - 'skip': Skip validation entirely\n */\n schemaValidation?: \"strict\" | \"warn\" | \"skip\";\n}\n\n/**\n * Upload parameters with encryption enabled.\n *\n * @remarks\n * This interface ensures type safety when using encrypted uploads with permissions.\n * When encrypt is true, any permissions must include public keys for encryption.\n * @category Data Management\n */\nexport interface EncryptedUploadParams\n extends Omit<UploadParams, \"permissions\" | \"encrypt\"> {\n /** File permissions with required public keys for encrypted data sharing. */\n permissions?: FilePermissionParams[];\n /** Encryption is enabled. */\n encrypt: true;\n}\n\n/**\n * Upload parameters with encryption disabled.\n *\n * @remarks\n * This interface is used when uploading unencrypted data.\n * @category Data Management\n */\nexport interface UnencryptedUploadParams extends Omit<UploadParams, \"encrypt\"> {\n /** Encryption is disabled. */\n encrypt: false;\n}\n\n/**\n * Parameters for granting file decryption access during upload.\n *\n * @remarks\n * This interface is used to grant decryption access to specific accounts when uploading\n * encrypted files. It only handles encryption key sharing, not operation permissions.\n *\n * For granting operation permissions (like \"llm_inference\"), use the separate\n * `vana.permissions.grant()` method after uploading.\n *\n * @example\n * ```typescript\n * // Upload with decryption permission\n * const result = await vana.data.upload({\n * content: \"data\",\n * permissions: [{\n * account: \"0xServerAddress...\",\n * publicKey: \"0x04...\" // Server's public key\n * }]\n * });\n * ```\n * @category Data Management\n */\nexport interface FilePermissionParams {\n /** The account address that will be able to decrypt this file. */\n account: Address;\n /** The public key to encrypt the file's encryption key with. */\n publicKey: string;\n}\n\n/**\n * Permission parameters for granting data access.\n *\n * @remarks\n * This interface defines parameters for granting permissions to access data.\n * It's used in the permissions system but kept here for compatibility.\n *\n * @category Data Management\n */\nexport interface PermissionParams {\n /** The address of the application to grant permission to. */\n grantee: Address;\n /** The operation type (e.g., \"llm_inference\", \"data_analysis\", \"compute_task\"). */\n operation: string;\n /** Additional parameters for the permission (operation-specific configuration). */\n parameters: Record<string, unknown>;\n /** Optional nonce for the permission (auto-generated if not provided). */\n nonce?: bigint;\n /** Optional expiration timestamp (Unix seconds, no expiration if not provided). */\n expiresAt?: number;\n /**\n * Public key of the recipient to encrypt the data key for (required for upload with permissions).\n * Obtain via `vana.server.getIdentity(recipientAddress).public_key` for personal servers.\n */\n publicKey?: string;\n}\n\n/**\n * Legacy permission parameters that conflated file encryption and data access grants.\n *\n * @remarks\n * This interface was removed because it conflated two different concepts:\n * 1. File encryption permissions (handled during upload)\n * 2. Data access grants (operation permissions)\n *\n * For file uploads, use FilePermissionParams instead.\n * For data access grants, use vana.permissions.grant() after uploading.\n *\n * @deprecated Removed in v2.0.0. Use FilePermissionParams for uploads.\n * @category Data Management\n */\nexport interface LegacyPermissionParams {\n grantee: Address;\n operation: string;\n parameters: Record<string, unknown>;\n nonce?: bigint;\n expiresAt?: number;\n publicKey?: string;\n}\n\n/**\n * Result of the high-level upload operation.\n *\n * @remarks\n * Returned by the `vana.data.upload()` method after successful upload and blockchain registration.\n * @category Data Management\n */\nexport interface UploadResult {\n /** The file ID assigned by the DataRegistry contract. */\n fileId: number;\n /** The storage URL where the file is hosted. */\n url: string;\n /** The transaction hash of the blockchain registration. */\n transactionHash: Hash;\n /** The actual file size in bytes. */\n size: number;\n /** Whether the data passed schema validation (if applicable). */\n isValid?: boolean;\n /** Validation errors if schema validation failed. */\n validationErrors?: string[];\n /** Permission IDs if permissions were granted during upload. */\n permissionIds?: bigint[];\n}\n\n/**\n * Defines parameters for uploading files to storage providers with encryption options.\n *\n * @remarks\n * Used with DataController upload methods and storage operations. Supports multiple\n * content formats, optional encryption, and custom storage provider selection with\n * comprehensive metadata tracking.\n * @deprecated Use UploadParams with vana.data.upload() instead for the high-level API\n * @example\n * ```typescript\n * const uploadParams: UploadFileParams = {\n * content: new TextEncoder().encode(JSON.stringify(userData)),\n * metadata: {\n * name: \"personal-profile.json\",\n * mimeType: \"application/json\",\n * size: 2048,\n * },\n * storageProvider: \"ipfs\",\n * encrypt: true,\n * };\n *\n * const result = await vana.data.uploadFile(uploadParams);\n * ```\n * @category Data Management\n */\nexport interface UploadFileParams {\n /** Raw file data in bytes, buffer, or string format. */\n content: Uint8Array | Buffer | string;\n /** Descriptive metadata for file organization and tracking. */\n metadata?: FileMetadata;\n /** Storage provider name (\"ipfs\" or custom provider, uses configured default if unspecified). */\n storageProvider?: string;\n /** Enables automatic encryption before upload to storage (defaults to false). */\n encrypt?: boolean;\n /** Custom encryption key (auto-generated if encryption enabled and not provided). */\n encryptionKey?: string;\n}\n\n/**\n * Contains the result of a successful file upload operation.\n *\n * @remarks\n * This interface provides the essential information returned after uploading\n * a file to a storage provider, including access URL, size verification,\n * and encryption details when applicable.\n * @category Data Management\n */\nexport interface UploadFileResult {\n /** Public URL where the uploaded file can be accessed. */\n url: string;\n /** Actual file size in bytes after upload processing. */\n size: number;\n /** Hash value for verifying file integrity after upload. */\n checksum?: string;\n /** Encryption metadata when file was encrypted before storage. */\n encryption?: EncryptionInfo;\n}\n\n/**\n * Result of uploading an encrypted file to storage and blockchain\n *\n * @category Data Management\n */\nexport interface UploadEncryptedFileResult extends UploadFileResult {\n /** The new file ID assigned by the DataRegistry */\n fileId: number;\n /** Transaction hash of the file registration */\n transactionHash?: Hash;\n}\n\n/**\n * Encryption information for a file\n *\n * @category Data Management\n */\nexport interface EncryptionInfo {\n /** Encryption algorithm used */\n algorithm: string;\n /** Key derivation function */\n kdf?: string;\n /** Initialization vector */\n iv?: string;\n /** Salt used for key derivation */\n salt?: string;\n /** Key identifier */\n keyId?: string;\n}\n\n/**\n * Parameters for getting user files\n *\n * @category Data Management\n */\nexport interface GetUserFilesParams {\n /** Owner address to filter by */\n owner?: Address;\n /** Starting block number for filtering */\n fromBlock?: bigint;\n /** Ending block number for filtering */\n toBlock?: bigint;\n /** Maximum number of files to return */\n limit?: number;\n /** Offset for pagination */\n offset?: number;\n}\n\n/**\n * Parameters for getting a specific file\n *\n * @category Data Management\n */\nexport interface GetFileParams {\n /** File ID to retrieve */\n fileId: number;\n /** Whether to include metadata */\n includeMetadata?: boolean;\n}\n\n/**\n * Parameters for downloading a file\n *\n * @category Data Management\n */\nexport interface DownloadFileParams {\n /** File URL or ID to download */\n file: string | number;\n /** Storage provider to use */\n storageProvider?: string;\n /** Decryption key if file is encrypted */\n decryptionKey?: string;\n}\n\n/**\n * Result of downloading a file\n *\n * @category Data Management\n */\nexport interface DownloadFileResult {\n /** File content */\n content: Uint8Array;\n /** File metadata */\n metadata?: FileMetadata;\n /** Whether the file was encrypted */\n wasEncrypted?: boolean;\n}\n\n/**\n * Parameters for deleting a file\n *\n * @category Data Management\n */\nexport interface DeleteFileParams {\n /** File ID to delete */\n fileId: number;\n /** Whether to also delete from storage */\n deleteFromStorage?: boolean;\n /** Storage provider to delete from */\n storageProvider?: string;\n}\n\n/**\n * Result of deleting a file\n *\n * @category Data Management\n */\nexport interface DeleteFileResult {\n /** Whether the file was successfully deleted from the registry */\n registryDeleted: boolean;\n /** Whether the file was successfully deleted from storage */\n storageDeleted?: boolean;\n /** Transaction hash of the deletion */\n transactionHash?: Hash;\n}\n\n/**\n * Options for encrypting a file\n *\n * @category Data Management\n */\nexport interface EncryptFileOptions {\n /** Encryption seed for key derivation. Defaults to DEFAULT_ENCRYPTION_SEED */\n seed?: string;\n /** MIME type for the encrypted blob if input is not already a Blob */\n mimeType?: string;\n}\n\n/**\n * Result of encrypting a file\n *\n * @category Data Management\n */\nexport interface EncryptFileResult {\n /** The encrypted data as a Blob */\n encryptedData: Blob;\n /** The encryption key used (derived from wallet) */\n encryptionKey: string;\n}\n\n/**\n * Options for decrypting a file\n *\n * @category Data Management\n */\nexport interface DecryptFileOptions {\n /** Encryption seed for key derivation. Defaults to DEFAULT_ENCRYPTION_SEED */\n seed?: string;\n}\n\n/**\n * Parameters for uploading a file with permissions\n *\n * @category Data Management\n */\nexport interface UploadFileWithPermissionsParams {\n /** The file data to encrypt and upload */\n data: Blob;\n /** Array of permissions to grant, each with account address and public key */\n permissions: Array<{ account: Address; publicKey: string }>;\n /** Optional filename for the upload */\n filename?: string;\n /** Optional storage provider to use */\n providerName?: string;\n}\n\n/**\n * Parameters for adding permission to a file\n *\n * @category Data Management\n */\nexport interface AddFilePermissionParams {\n /** The file ID to grant permission for */\n fileId: number;\n /** The account to grant permission to */\n account: Address;\n /** The public key of the account for encryption */\n publicKey: string;\n}\n\n/**\n * Options for decrypting a file with permission\n *\n * @category Data Management\n */\nexport interface DecryptFileWithPermissionOptions {\n /** Optional account address to verify permission against */\n account?: Address;\n}\n\n/**\n * File access permissions\n *\n * @category Data Management\n */\nexport interface FileAccessPermissions {\n /** Whether the file can be read */\n read: boolean;\n /** Whether the file can be written */\n write: boolean;\n /** Whether the file can be deleted */\n delete: boolean;\n /** Whether the file can be shared */\n share: boolean;\n}\n\n/**\n * File sharing configuration\n *\n * @category Data Management\n */\nexport interface FileSharingConfig {\n /** Addresses that can access the file */\n allowedAddresses?: Address[];\n /** Expiration time for shared access */\n expiresAt?: Date;\n /** Required permissions for shared access */\n permissions: FileAccessPermissions;\n}\n\n/**\n * Batch upload parameters\n *\n * @category Data Management\n */\nexport interface BatchUploadParams {\n /** Array of files to upload */\n files: UploadFileParams[];\n /** Storage provider to use for all files */\n storageProvider?: string;\n /** Whether to encrypt all files */\n encrypt?: boolean;\n /** Encryption key for all files */\n encryptionKey?: string;\n}\n\n/**\n * Batch upload result\n *\n * @category Data Management\n */\nexport interface BatchUploadResult {\n /** Results for each uploaded file */\n results: UploadEncryptedFileResult[];\n /** Overall success status */\n success: boolean;\n /** Any errors that occurred */\n errors?: string[];\n}\n\n/**\n * Schema metadata from the blockchain (without fetched definition).\n *\n * This represents the on-chain schema registration data before the\n * definition has been fetched from the storage URL.\n *\n * @category Data Management\n */\nexport interface SchemaMetadata {\n /** Schema ID */\n id: number;\n /** Schema name */\n name: string;\n /** Schema dialect ('json' or 'sqlite') */\n dialect: \"json\" | \"sqlite\";\n /** URL containing the schema definition */\n definitionUrl: string;\n}\n\n/**\n * Complete schema with all definition fields populated.\n * This is what schemas.get() returns - a schema with the definition fetched.\n */\nexport interface CompleteSchema extends SchemaMetadata {\n /** Version of the schema */\n version: string;\n /** Optional description of the schema */\n description?: string;\n /** Optional version of the dialect */\n dialectVersion?: string;\n /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' */\n schema: object | string;\n}\n\n/**\n * Schema with optional definition fields.\n *\n * Schemas define the structure and validation rules for user data processed by refiners.\n * They ensure data quality and consistency across the Vana network by specifying how\n * raw user data should be formatted, validated, and processed.\n *\n * When the definition has been fetched (via schemas.get() or schemas.list() with includeDefinitions),\n * the version and schema fields will be populated. Otherwise, only the metadata fields are present.\n *\n * @category Data Management\n * @example\n * ```typescript\n * // Complete schema from schemas.get()\n * const completeSchema: Schema = {\n * id: 5,\n * name: 'Social Media Profile',\n * dialect: 'json',\n * definitionUrl: 'ipfs://QmSchema...',\n * version: '1.0.0',\n * description: 'Schema for validating social media profile data',\n * schema: { // JSON Schema object\n * type: 'object',\n * properties: {\n * username: { type: 'string' }\n * }\n * }\n * };\n *\n * // Metadata-only schema from schemas.list() without includeDefinitions\n * const metadataSchema: Schema = {\n * id: 5,\n * name: 'Social Media Profile',\n * dialect: 'json',\n * definitionUrl: 'ipfs://QmSchema...'\n * };\n * ```\n */\nexport interface Schema extends SchemaMetadata {\n /** Version of the schema (present when definition is fetched) */\n version?: string;\n /** Optional description of the schema */\n description?: string;\n /** Optional version of the dialect */\n dialectVersion?: string;\n /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' (present when definition is fetched) */\n schema?: object | string;\n}\n\n/**\n * Represents a refiner with schema information\n *\n * @category Data Management\n */\nexport interface Refiner {\n /** Refiner ID */\n id: number;\n /** DLP ID this refiner belongs to */\n dlpId: number;\n /** Owner address */\n owner: Address;\n /** Refiner name */\n name: string;\n /** Schema ID associated with this refiner */\n schemaId: number;\n /** URL containing refinement instructions */\n refinementInstructionUrl: string;\n}\n\n/**\n * Parameters for adding a new schema\n *\n * @category Data Management\n */\nexport interface AddSchemaParams {\n /** Schema name */\n name: string;\n /** Schema dialect */\n dialect: string;\n /** URL containing the schema definition */\n definitionUrl: string;\n}\n\n/**\n * Result of adding a schema\n *\n * @category Data Management\n */\nexport interface AddSchemaResult {\n /** The new schema ID assigned by the contract */\n schemaId: number;\n /** Transaction hash of the schema registration */\n transactionHash: Hash;\n}\n\n/**\n * Parameters for registering a new data refiner in the Vana network.\n *\n * Refiners are processors that transform and validate user data according to specific\n * schemas and instructions. They enable applications to work with structured, verified\n * user data while maintaining privacy and user control.\n *\n * @category Data Management\n * @example\n * ```typescript\n * const refinerParams: AddRefinerParams = {\n * dlpId: 1, // Data Liquidity Pool ID\n * name: 'Social Media Refiner',\n * schemaId: 5, // Pre-defined schema for social media data\n * refinementInstructionUrl: 'ipfs://Qm...' // Instructions for data processing\n * };\n * ```\n */\nexport interface AddRefinerParams {\n /** DLP ID this refiner belongs to */\n dlpId: number;\n /** Refiner name */\n name: string;\n /** Schema ID to associate with this refiner */\n schemaId: number;\n /** URL containing refinement instructions */\n refinementInstructionUrl: string;\n}\n\n/**\n * Result of adding a refiner\n *\n * @category Data Management\n */\nexport interface AddRefinerResult {\n /** The new refiner ID assigned by the contract */\n refinerId: number;\n /** Transaction hash of the refiner registration */\n transactionHash: Hash;\n}\n\n/**\n * Parameters for updating a refiner's schema ID\n *\n * @category Data Management\n */\nexport interface UpdateSchemaIdParams {\n /** Refiner ID to update */\n refinerId: number;\n /** New schema ID to associate with the refiner */\n newSchemaId: number;\n}\n\n/**\n * Result of updating a refiner's schema ID\n *\n * @category Data Management\n */\nexport interface UpdateSchemaIdResult {\n /** Transaction hash of the update */\n transactionHash: Hash;\n}\n\n/**\n * Trusted server data structure\n *\n * @category Data Management\n */\nexport interface TrustedServer {\n /** Unique identifier for the trusted server relationship */\n id: string;\n /** Server address (EVM address) */\n serverAddress: Address;\n /** Server URL */\n serverUrl: string;\n /** Timestamp when server was trusted */\n trustedAt: bigint;\n /** User who trusted the server */\n user: Address;\n /** Index in user's trusted server list (only available in RPC mode) */\n trustIndex?: number;\n}\n\n/**\n * Parameters for getUserTrustedServers method\n *\n * @category Data Management\n */\nexport interface GetUserTrustedServersParams {\n /** User address to query trusted servers for */\n user: Address;\n /** Optional subgraph URL to override default */\n subgraphUrl?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,13 +1,11 @@
1
1
  import type { Address, Hash } from "viem";
2
2
  /**
3
- * Represents a registered data file in the Vana network with complete blockchain metadata.
3
+ * Represents a file registered on the Vana blockchain.
4
4
  *
5
5
  * @remarks
6
- * This interface describes files that have been uploaded to storage and registered
7
- * on the Vana blockchain, including their storage location, ownership, and blockchain
8
- * tracking information. Each file receives a unique ID and is linked to the owner's
9
- * address for permission management. Used throughout the SDK for file operations
10
- * and access control workflows.
6
+ * Contains complete metadata for files uploaded to storage and registered
7
+ * on-chain. Each file has a unique ID, owner address, and storage URL.
8
+ * Used throughout SDK for file operations and permission management.
11
9
  *
12
10
  * @category Data Management
13
11
  */
@@ -127,6 +125,13 @@ export interface UploadParams {
127
125
  providerName?: string;
128
126
  /** Optional owner address (defaults to current wallet address). */
129
127
  owner?: Address;
128
+ /**
129
+ * Schema validation mode when schemaId is provided:
130
+ * - 'strict': Throw error on validation failure (default)
131
+ * - 'warn': Log warning and continue on validation failure
132
+ * - 'skip': Skip validation entirely
133
+ */
134
+ schemaValidation?: "strict" | "warn" | "skip";
130
135
  }
131
136
  /**
132
137
  * Upload parameters with encryption enabled.
@@ -755,8 +760,4 @@ export interface GetUserTrustedServersParams {
755
760
  user: Address;
756
761
  /** Optional subgraph URL to override default */
757
762
  subgraphUrl?: string;
758
- /** Maximum number of results */
759
- limit?: number;
760
- /** Number of results to skip */
761
- offset?: number;
762
763
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/generics.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\n\n/**\n * Generic request pattern for all SDK operations\n *\n * @category Reference\n */\nexport interface GenericRequest<TParams = unknown, TOptions = unknown> {\n /** Request parameters */\n params: TParams;\n /** Additional request options */\n options?: TOptions;\n}\n\n/**\n * Generic response pattern for all SDK operations\n *\n * @category Reference\n */\nexport interface GenericResponse<TData = unknown, TMeta = unknown> {\n /** Response data */\n data: TData;\n /** Response metadata */\n meta?: TMeta;\n /** Success status */\n success: boolean;\n /** Error information if not successful */\n error?: {\n code: string;\n message: string;\n details?: unknown;\n };\n}\n\n/**\n * Generic async operation result\n *\n * @category Reference\n */\nexport interface AsyncResult<T> {\n /** Operation result */\n result: T;\n /** Transaction hash if applicable */\n transactionHash?: Hash;\n /** Block number if applicable */\n blockNumber?: bigint;\n /** Gas used if applicable */\n gasUsed?: bigint;\n}\n\n/**\n * Generic contract interaction parameters\n *\n * @category Reference\n */\nexport interface ContractCall<\n TArgs extends readonly unknown[] = readonly unknown[],\n> {\n /** Contract method name */\n method: string;\n /** Method arguments */\n args: TArgs;\n /** Call options */\n options?: {\n /** Gas limit */\n gasLimit?: bigint;\n /** Gas price */\n gasPrice?: bigint;\n /** Value to send */\n value?: bigint;\n };\n}\n\n/**\n * Generic contract event filter\n *\n * @category Reference\n */\nexport interface EventFilter<TEventArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments filter */\n args?: TEventArgs;\n /** From block */\n fromBlock?: bigint;\n /** To block */\n toBlock?: bigint;\n /** Address filter */\n address?: Address | Address[];\n}\n\n/**\n * Generic event log\n *\n * @category Reference\n */\nexport interface EventLog<TArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments */\n args: TArgs;\n /** Block number */\n blockNumber: bigint;\n /** Transaction hash */\n transactionHash: Hash;\n /** Log index */\n logIndex: number;\n /** Transaction index */\n transactionIndex: number;\n /** Contract address */\n address: Address;\n}\n\n/**\n * Generic controller context for dependency injection\n *\n * @category Reference\n */\nexport interface ControllerContext<TClient = unknown, TConfig = unknown> {\n /** Client instance */\n client: TClient;\n /** Configuration */\n config?: TConfig;\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Generic controller interface\n *\n * @category Reference\n */\nexport interface Controller<TContext = unknown> {\n /** Controller context */\n readonly context: TContext;\n}\n\n/**\n * Generic storage provider interface\n *\n * @category Reference\n */\nexport interface StorageProvider<TConfig = unknown, TOptions = unknown> {\n /** Provider name */\n readonly name: string;\n /** Provider configuration */\n readonly config: TConfig;\n\n /** Upload data */\n upload(\n data: Uint8Array,\n options?: TOptions,\n ): Promise<{\n url: string;\n size: number;\n checksum?: string;\n }>;\n\n /** Download data */\n download(\n url: string,\n options?: TOptions,\n ): Promise<{\n data: Uint8Array;\n size: number;\n checksum?: string;\n }>;\n\n /** Delete data */\n delete?(url: string, options?: TOptions): Promise<boolean>;\n\n /** Check if data exists */\n exists?(url: string, options?: TOptions): Promise<boolean>;\n}\n\n/**\n * Generic cache interface\n *\n * @category Reference\n */\nexport interface Cache<TKey = string, TValue = unknown> {\n /** Get value from cache */\n get(key: TKey): Promise<TValue | undefined>;\n\n /** Set value in cache */\n set(key: TKey, value: TValue, ttl?: number): Promise<void>;\n\n /** Delete value from cache */\n delete(key: TKey): Promise<boolean>;\n\n /** Clear all cache */\n clear(): Promise<void>;\n\n /** Check if key exists */\n has(key: TKey): Promise<boolean>;\n}\n\n/**\n * Generic retry configuration\n *\n * @category Reference\n */\nexport interface RetryConfig<TError = Error> {\n /** Maximum retry attempts */\n maxAttempts: number;\n /** Base delay in milliseconds */\n baseDelay: number;\n /** Backoff multiplier */\n backoffMultiplier?: number;\n /** Maximum delay */\n maxDelay?: number;\n /** Jitter factor */\n jitter?: number;\n /** Retry condition */\n shouldRetry?: (error: TError, attempt: number) => boolean;\n}\n\n/**\n * Generic rate limiter configuration\n *\n * @category Reference\n */\nexport interface RateLimiterConfig {\n /** Requests per time window */\n requestsPerWindow: number;\n /** Time window in milliseconds */\n windowMs: number;\n /** Burst allowance */\n burstLimit?: number;\n}\n\n/**\n * Generic middleware interface\n *\n * @category Reference\n */\nexport interface Middleware<TRequest = unknown, TResponse = unknown> {\n /** Middleware name */\n readonly name: string;\n\n /** Process request */\n request?(req: TRequest): Promise<TRequest>;\n\n /** Process response */\n response?(res: TResponse): Promise<TResponse>;\n\n /** Handle errors */\n error?(error: Error, req: TRequest): Promise<TResponse | void>;\n}\n\n/**\n * Generic plugin interface\n *\n * @category Reference\n */\nexport interface Plugin<TConfig = unknown> {\n /** Plugin name */\n readonly name: string;\n /** Plugin version */\n readonly version: string;\n /** Plugin configuration */\n readonly config: TConfig;\n\n /** Initialize plugin */\n init?(): Promise<void>;\n\n /** Cleanup plugin */\n cleanup?(): Promise<void>;\n}\n\n/**\n * Generic factory interface\n *\n * @category Reference\n */\nexport interface Factory<T, TParams = unknown> {\n /** Create instance */\n create(params: TParams): T;\n\n /** Create multiple instances */\n createMany?(params: TParams[]): T[];\n\n /** Validate parameters */\n validate?(params: TParams): boolean;\n}\n\n/**\n * Generic repository interface for data access\n *\n * @category Reference\n */\nexport interface Repository<TEntity, TKey = string | number> {\n /** Find by ID */\n findById(id: TKey): Promise<TEntity | undefined>;\n\n /** Find all entities */\n findAll(options?: {\n limit?: number;\n offset?: number;\n filter?: Partial<TEntity>;\n sort?: Array<{ field: keyof TEntity; direction: \"asc\" | \"desc\" }>;\n }): Promise<{\n entities: TEntity[];\n total: number;\n hasMore: boolean;\n }>;\n\n /** Create entity */\n create(entity: Omit<TEntity, \"id\">): Promise<TEntity>;\n\n /** Update entity */\n update(id: TKey, updates: Partial<TEntity>): Promise<TEntity>;\n\n /** Delete entity */\n delete(id: TKey): Promise<boolean>;\n\n /** Check if entity exists */\n exists(id: TKey): Promise<boolean>;\n}\n\n/**\n * Generic validator interface\n *\n * @category Reference\n */\nexport interface Validator<T> {\n /** Validate value */\n validate(value: unknown): value is T;\n\n /** Get validation errors */\n getErrors?(value: unknown): string[];\n\n /** Get validation schema */\n getSchema?(): unknown;\n}\n\n/**\n * Generic transformer interface\n *\n * @category Reference\n */\nexport interface Transformer<TInput, TOutput> {\n /** Transform input to output */\n transform(input: TInput): TOutput | Promise<TOutput>;\n\n /** Reverse transform output to input */\n reverse?(output: TOutput): TInput | Promise<TInput>;\n}\n\n/**\n * Generic service interface\n *\n * @category Reference\n */\nexport interface Service<TConfig = unknown> {\n /** Service name */\n readonly name: string;\n /** Service configuration */\n readonly config: TConfig;\n /** Service status */\n readonly status:\n | \"idle\"\n | \"starting\"\n | \"running\"\n | \"stopping\"\n | \"stopped\"\n | \"error\";\n\n /** Start service */\n start(): Promise<void>;\n\n /** Stop service */\n stop(): Promise<void>;\n\n /** Restart service */\n restart?(): Promise<void>;\n\n /** Get health status */\n getHealth?(): Promise<{\n healthy: boolean;\n details?: Record<string, unknown>;\n }>;\n}\n\n/**\n * Generic observer pattern\n *\n * @category Reference\n */\nexport interface Observer<TEvent = unknown> {\n /** Handle event */\n notify(event: TEvent): void | Promise<void>;\n}\n\n/**\n * Generic observable pattern\n *\n * @category Reference\n */\nexport interface Observable<TEvent = unknown> {\n /** Subscribe to events */\n subscribe(observer: Observer<TEvent>): () => void;\n\n /** Unsubscribe from events */\n unsubscribe(observer: Observer<TEvent>): void;\n\n /** Emit event */\n emit(event: TEvent): void;\n}\n\n/**\n * Generic state machine interface\n *\n * @category Reference\n */\nexport interface StateMachine<TState, TEvent> {\n /** Current state */\n readonly currentState: TState;\n\n /** Transition to new state */\n transition(event: TEvent): TState;\n\n /** Check if transition is valid */\n canTransition(event: TEvent): boolean;\n\n /** Get available transitions */\n getAvailableTransitions(): TEvent[];\n}\n\n/**\n * Helper type to make properties optional conditionally\n *\n * @category Reference\n */\nexport type ConditionalOptional<\n T,\n K extends keyof T,\n Condition extends boolean,\n> = Condition extends true ? Omit<T, K> & Partial<Pick<T, K>> : T;\n\n/**\n * Helper type to extract promise result type\n *\n * @category Reference\n */\nexport type PromiseResult<T> = T extends Promise<infer U> ? U : T;\n\n/**\n * Helper type to create a union of all possible keys\n *\n * @category Reference\n */\nexport type AllKeys<T> = T extends unknown ? keyof T : never;\n\n/**\n * Helper type to create a deep partial type\n *\n * @category Reference\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a deep readonly type\n *\n * @category Reference\n */\nexport type DeepReadonly<T> = {\n readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a required type with specific keys\n *\n * @category Reference\n */\nexport type RequireKeys<T, K extends keyof T> = Required<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to create an optional type with specific keys\n *\n * @category Reference\n */\nexport type OptionalKeys<T, K extends keyof T> = Partial<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to exclude null and undefined\n *\n * @category Reference\n */\nexport type NonNullable<T> = T extends null | undefined ? never : T;\n\n/**\n * Helper type to create a type with only specific keys\n *\n * @category Reference\n */\nexport type PickByType<T, U> = {\n [K in keyof T as T[K] extends U ? K : never]: T[K];\n};\n\n/**\n * Helper type to omit keys by type\n *\n * @category Reference\n */\nexport type OmitByType<T, U> = {\n [K in keyof T as T[K] extends U ? never : K]: T[K];\n};\n\n/**\n * Helper type for branded types\n *\n * @category Reference\n */\nexport type Brand<T, B> = T & { readonly __brand: B };\n\n/**\n * Helper type for nominal types\n *\n * @category Reference\n */\nexport type Nominal<T, N extends string> = T & { readonly __nominal: N };\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/generics.ts"],"sourcesContent":["/**\n * Defines generic types and interfaces for SDK infrastructure.\n *\n * @remarks\n * This module provides reusable type definitions and interfaces that form\n * the foundation of the SDK's architecture. It includes patterns for requests,\n * responses, caching, middleware, repositories, and other common software\n * engineering abstractions.\n *\n * @category Types\n * @module types/generics\n */\n\nimport type { Address, Hash } from \"viem\";\n\n/**\n * Represents a standardized request structure for SDK operations.\n *\n * @remarks\n * Provides consistent request handling across all SDK methods with\n * typed parameters and optional configuration.\n *\n * @typeParam TParams - Type of request parameters\n * @typeParam TOptions - Type of optional configuration\n *\n * @category Reference\n */\nexport interface GenericRequest<TParams = unknown, TOptions = unknown> {\n /** Request parameters */\n params: TParams;\n /** Additional request options */\n options?: TOptions;\n}\n\n/**\n * Represents a standardized response structure for SDK operations.\n *\n * @remarks\n * Provides consistent response handling with success/error states\n * and optional metadata for additional context.\n *\n * @typeParam TData - Type of response data\n * @typeParam TMeta - Type of response metadata\n *\n * @category Reference\n */\nexport interface GenericResponse<TData = unknown, TMeta = unknown> {\n /** Response data */\n data: TData;\n /** Response metadata */\n meta?: TMeta;\n /** Success status */\n success: boolean;\n /** Error information if not successful */\n error?: {\n code: string;\n message: string;\n details?: unknown;\n };\n}\n\n/**\n * Represents the result of an asynchronous blockchain operation.\n *\n * @remarks\n * Includes transaction details when the operation involves\n * blockchain state changes.\n *\n * @typeParam T - Type of the operation result\n *\n * @category Reference\n */\nexport interface AsyncResult<T> {\n /** Operation result */\n result: T;\n /** Transaction hash if applicable */\n transactionHash?: Hash;\n /** Block number if applicable */\n blockNumber?: bigint;\n /** Gas used if applicable */\n gasUsed?: bigint;\n}\n\n/**\n * Generic contract interaction parameters\n *\n * @category Reference\n */\nexport interface ContractCall<\n TArgs extends readonly unknown[] = readonly unknown[],\n> {\n /** Contract method name */\n method: string;\n /** Method arguments */\n args: TArgs;\n /** Call options */\n options?: {\n /** Gas limit */\n gas?: bigint;\n /** Gas price */\n gasPrice?: bigint;\n /** Value to send */\n value?: bigint;\n };\n}\n\n/**\n * Generic contract event filter\n *\n * @category Reference\n */\nexport interface EventFilter<TEventArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments filter */\n args?: TEventArgs;\n /** From block */\n fromBlock?: bigint;\n /** To block */\n toBlock?: bigint;\n /** Address filter */\n address?: Address | Address[];\n}\n\n/**\n * Generic event log\n *\n * @category Reference\n */\nexport interface EventLog<TArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments */\n args: TArgs;\n /** Block number */\n blockNumber: bigint;\n /** Transaction hash */\n transactionHash: Hash;\n /** Log index */\n logIndex: number;\n /** Transaction index */\n transactionIndex: number;\n /** Contract address */\n address: Address;\n}\n\n/**\n * Generic controller context for dependency injection\n *\n * @category Reference\n */\nexport interface ControllerContext<TClient = unknown, TConfig = unknown> {\n /** Client instance */\n client: TClient;\n /** Configuration */\n config?: TConfig;\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Generic controller interface\n *\n * @category Reference\n */\nexport interface Controller<TContext = unknown> {\n /** Controller context */\n readonly context: TContext;\n}\n\n/**\n * Generic storage provider interface\n *\n * @category Reference\n */\nexport interface StorageProvider<TConfig = unknown, TOptions = unknown> {\n /** Provider name */\n readonly name: string;\n /** Provider configuration */\n readonly config: TConfig;\n\n /** Upload data */\n upload(\n data: Uint8Array,\n options?: TOptions,\n ): Promise<{\n url: string;\n size: number;\n checksum?: string;\n }>;\n\n /** Download data */\n download(\n url: string,\n options?: TOptions,\n ): Promise<{\n data: Uint8Array;\n size: number;\n checksum?: string;\n }>;\n\n /** Delete data */\n delete?(url: string, options?: TOptions): Promise<boolean>;\n\n /** Check if data exists */\n exists?(url: string, options?: TOptions): Promise<boolean>;\n}\n\n/**\n * Defines a generic caching interface with TTL support.\n *\n * @remarks\n * Provides standard cache operations for performance optimization\n * and reducing redundant computations or network requests.\n *\n * @typeParam TKey - Type of cache keys\n * @typeParam TValue - Type of cached values\n *\n * @category Reference\n */\nexport interface Cache<TKey = string, TValue = unknown> {\n /** Get value from cache */\n get(key: TKey): Promise<TValue | undefined>;\n\n /** Set value in cache */\n set(key: TKey, value: TValue, ttl?: number): Promise<void>;\n\n /** Delete value from cache */\n delete(key: TKey): Promise<boolean>;\n\n /** Clear all cache */\n clear(): Promise<void>;\n\n /** Check if key exists */\n has(key: TKey): Promise<boolean>;\n}\n\n/**\n * Configures retry behavior for resilient operations.\n *\n * @remarks\n * Supports exponential backoff, jitter, and custom retry conditions\n * for handling transient failures gracefully.\n *\n * @typeParam TError - Type of errors to handle\n *\n * @category Reference\n */\nexport interface RetryConfig<TError = Error> {\n /** Maximum retry attempts */\n maxAttempts: number;\n /** Base delay in milliseconds */\n baseDelay: number;\n /** Backoff multiplier */\n backoffMultiplier?: number;\n /** Maximum delay */\n maxDelay?: number;\n /** Jitter factor */\n jitter?: number;\n /** Retry condition */\n shouldRetry?: (error: TError, attempt: number) => boolean;\n}\n\n/**\n * Generic rate limiter configuration\n *\n * @category Reference\n */\nexport interface RateLimiterConfig {\n /** Requests per time window */\n requestsPerWindow: number;\n /** Time window in milliseconds */\n windowMs: number;\n /** Burst allowance */\n burstLimit?: number;\n}\n\n/**\n * Defines middleware for request/response processing pipelines.\n *\n * @remarks\n * Middleware can transform requests, responses, and handle errors\n * in a composable chain of responsibility pattern.\n *\n * @typeParam TRequest - Type of requests to process\n * @typeParam TResponse - Type of responses to process\n *\n * @category Reference\n */\nexport interface Middleware<TRequest = unknown, TResponse = unknown> {\n /** Middleware name */\n readonly name: string;\n\n /** Process request */\n request?(req: TRequest): Promise<TRequest>;\n\n /** Process response */\n response?(res: TResponse): Promise<TResponse>;\n\n /** Handle errors */\n error?(error: Error, req: TRequest): Promise<TResponse | void>;\n}\n\n/**\n * Generic plugin interface\n *\n * @category Reference\n */\nexport interface Plugin<TConfig = unknown> {\n /** Plugin name */\n readonly name: string;\n /** Plugin version */\n readonly version: string;\n /** Plugin configuration */\n readonly config: TConfig;\n\n /** Initialize plugin */\n init?(): Promise<void>;\n\n /** Cleanup plugin */\n cleanup?(): Promise<void>;\n}\n\n/**\n * Generic factory interface\n *\n * @category Reference\n */\nexport interface Factory<T, TParams = unknown> {\n /** Create instance */\n create(params: TParams): T;\n\n /** Create multiple instances */\n createMany?(params: TParams[]): T[];\n\n /** Validate parameters */\n validate?(params: TParams): boolean;\n}\n\n/**\n * Defines a repository pattern for data access abstraction.\n *\n * @remarks\n * Provides CRUD operations with filtering, sorting, and pagination\n * for consistent data access across different storage backends.\n *\n * @typeParam TEntity - Type of entities managed by the repository\n * @typeParam TKey - Type of entity identifiers\n *\n * @category Reference\n */\nexport interface Repository<TEntity, TKey = string | number> {\n /** Find by ID */\n findById(id: TKey): Promise<TEntity | undefined>;\n\n /** Find all entities */\n findAll(options?: {\n limit?: number;\n offset?: number;\n filter?: Partial<TEntity>;\n sort?: Array<{ field: keyof TEntity; direction: \"asc\" | \"desc\" }>;\n }): Promise<{\n entities: TEntity[];\n total: number;\n hasMore: boolean;\n }>;\n\n /** Create entity */\n create(entity: Omit<TEntity, \"id\">): Promise<TEntity>;\n\n /** Update entity */\n update(id: TKey, updates: Partial<TEntity>): Promise<TEntity>;\n\n /** Delete entity */\n delete(id: TKey): Promise<boolean>;\n\n /** Check if entity exists */\n exists(id: TKey): Promise<boolean>;\n}\n\n/**\n * Generic validator interface\n *\n * @category Reference\n */\nexport interface Validator<T> {\n /** Validate value */\n validate(value: unknown): value is T;\n\n /** Get validation errors */\n getErrors?(value: unknown): string[];\n\n /** Get validation schema */\n getSchema?(): unknown;\n}\n\n/**\n * Generic transformer interface\n *\n * @category Reference\n */\nexport interface Transformer<TInput, TOutput> {\n /** Transform input to output */\n transform(input: TInput): TOutput | Promise<TOutput>;\n\n /** Reverse transform output to input */\n reverse?(output: TOutput): TInput | Promise<TInput>;\n}\n\n/**\n * Generic service interface\n *\n * @category Reference\n */\nexport interface Service<TConfig = unknown> {\n /** Service name */\n readonly name: string;\n /** Service configuration */\n readonly config: TConfig;\n /** Service status */\n readonly status:\n | \"idle\"\n | \"starting\"\n | \"running\"\n | \"stopping\"\n | \"stopped\"\n | \"error\";\n\n /** Start service */\n start(): Promise<void>;\n\n /** Stop service */\n stop(): Promise<void>;\n\n /** Restart service */\n restart?(): Promise<void>;\n\n /** Get health status */\n getHealth?(): Promise<{\n healthy: boolean;\n details?: Record<string, unknown>;\n }>;\n}\n\n/**\n * Implements the observer in the observer pattern.\n *\n * @remarks\n * Receives notifications about events from observable subjects\n * for decoupled event handling.\n *\n * @typeParam TEvent - Type of events to observe\n *\n * @category Reference\n */\nexport interface Observer<TEvent = unknown> {\n /** Handle event */\n notify(event: TEvent): void | Promise<void>;\n}\n\n/**\n * Implements the subject in the observer pattern.\n *\n * @remarks\n * Manages observers and emits events to all subscribed observers\n * for event-driven architectures.\n *\n * @typeParam TEvent - Type of events to emit\n *\n * @category Reference\n */\nexport interface Observable<TEvent = unknown> {\n /** Subscribe to events */\n subscribe(observer: Observer<TEvent>): () => void;\n\n /** Unsubscribe from events */\n unsubscribe(observer: Observer<TEvent>): void;\n\n /** Emit event */\n emit(event: TEvent): void;\n}\n\n/**\n * Generic state machine interface\n *\n * @category Reference\n */\nexport interface StateMachine<TState, TEvent> {\n /** Current state */\n readonly currentState: TState;\n\n /** Transition to new state */\n transition(event: TEvent): TState;\n\n /** Check if transition is valid */\n canTransition(event: TEvent): boolean;\n\n /** Get available transitions */\n getAvailableTransitions(): TEvent[];\n}\n\n/**\n * Helper type to make properties optional conditionally\n *\n * @category Reference\n */\nexport type ConditionalOptional<\n T,\n K extends keyof T,\n Condition extends boolean,\n> = Condition extends true ? Omit<T, K> & Partial<Pick<T, K>> : T;\n\n/**\n * Helper type to extract promise result type\n *\n * @category Reference\n */\nexport type PromiseResult<T> = T extends Promise<infer U> ? U : T;\n\n/**\n * Helper type to create a union of all possible keys\n *\n * @category Reference\n */\nexport type AllKeys<T> = T extends unknown ? keyof T : never;\n\n/**\n * Helper type to create a deep partial type\n *\n * @category Reference\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a deep readonly type\n *\n * @category Reference\n */\nexport type DeepReadonly<T> = {\n readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a required type with specific keys\n *\n * @category Reference\n */\nexport type RequireKeys<T, K extends keyof T> = Required<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to create an optional type with specific keys\n *\n * @category Reference\n */\nexport type OptionalKeys<T, K extends keyof T> = Partial<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to exclude null and undefined\n *\n * @category Reference\n */\nexport type NonNullable<T> = T extends null | undefined ? never : T;\n\n/**\n * Helper type to create a type with only specific keys\n *\n * @category Reference\n */\nexport type PickByType<T, U> = {\n [K in keyof T as T[K] extends U ? K : never]: T[K];\n};\n\n/**\n * Helper type to omit keys by type\n *\n * @category Reference\n */\nexport type OmitByType<T, U> = {\n [K in keyof T as T[K] extends U ? never : K]: T[K];\n};\n\n/**\n * Helper type for branded types\n *\n * @category Reference\n */\nexport type Brand<T, B> = T & { readonly __brand: B };\n\n/**\n * Helper type for nominal types\n *\n * @category Reference\n */\nexport type Nominal<T, N extends string> = T & { readonly __nominal: N };\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,6 +1,25 @@
1
+ /**
2
+ * Defines generic types and interfaces for SDK infrastructure.
3
+ *
4
+ * @remarks
5
+ * This module provides reusable type definitions and interfaces that form
6
+ * the foundation of the SDK's architecture. It includes patterns for requests,
7
+ * responses, caching, middleware, repositories, and other common software
8
+ * engineering abstractions.
9
+ *
10
+ * @category Types
11
+ * @module types/generics
12
+ */
1
13
  import type { Address, Hash } from "viem";
2
14
  /**
3
- * Generic request pattern for all SDK operations
15
+ * Represents a standardized request structure for SDK operations.
16
+ *
17
+ * @remarks
18
+ * Provides consistent request handling across all SDK methods with
19
+ * typed parameters and optional configuration.
20
+ *
21
+ * @typeParam TParams - Type of request parameters
22
+ * @typeParam TOptions - Type of optional configuration
4
23
  *
5
24
  * @category Reference
6
25
  */
@@ -11,7 +30,14 @@ export interface GenericRequest<TParams = unknown, TOptions = unknown> {
11
30
  options?: TOptions;
12
31
  }
13
32
  /**
14
- * Generic response pattern for all SDK operations
33
+ * Represents a standardized response structure for SDK operations.
34
+ *
35
+ * @remarks
36
+ * Provides consistent response handling with success/error states
37
+ * and optional metadata for additional context.
38
+ *
39
+ * @typeParam TData - Type of response data
40
+ * @typeParam TMeta - Type of response metadata
15
41
  *
16
42
  * @category Reference
17
43
  */
@@ -30,7 +56,13 @@ export interface GenericResponse<TData = unknown, TMeta = unknown> {
30
56
  };
31
57
  }
32
58
  /**
33
- * Generic async operation result
59
+ * Represents the result of an asynchronous blockchain operation.
60
+ *
61
+ * @remarks
62
+ * Includes transaction details when the operation involves
63
+ * blockchain state changes.
64
+ *
65
+ * @typeParam T - Type of the operation result
34
66
  *
35
67
  * @category Reference
36
68
  */
@@ -57,7 +89,7 @@ export interface ContractCall<TArgs extends readonly unknown[] = readonly unknow
57
89
  /** Call options */
58
90
  options?: {
59
91
  /** Gas limit */
60
- gasLimit?: bigint;
92
+ gas?: bigint;
61
93
  /** Gas price */
62
94
  gasPrice?: bigint;
63
95
  /** Value to send */
@@ -152,7 +184,14 @@ export interface StorageProvider<TConfig = unknown, TOptions = unknown> {
152
184
  exists?(url: string, options?: TOptions): Promise<boolean>;
153
185
  }
154
186
  /**
155
- * Generic cache interface
187
+ * Defines a generic caching interface with TTL support.
188
+ *
189
+ * @remarks
190
+ * Provides standard cache operations for performance optimization
191
+ * and reducing redundant computations or network requests.
192
+ *
193
+ * @typeParam TKey - Type of cache keys
194
+ * @typeParam TValue - Type of cached values
156
195
  *
157
196
  * @category Reference
158
197
  */
@@ -169,7 +208,13 @@ export interface Cache<TKey = string, TValue = unknown> {
169
208
  has(key: TKey): Promise<boolean>;
170
209
  }
171
210
  /**
172
- * Generic retry configuration
211
+ * Configures retry behavior for resilient operations.
212
+ *
213
+ * @remarks
214
+ * Supports exponential backoff, jitter, and custom retry conditions
215
+ * for handling transient failures gracefully.
216
+ *
217
+ * @typeParam TError - Type of errors to handle
173
218
  *
174
219
  * @category Reference
175
220
  */
@@ -201,7 +246,14 @@ export interface RateLimiterConfig {
201
246
  burstLimit?: number;
202
247
  }
203
248
  /**
204
- * Generic middleware interface
249
+ * Defines middleware for request/response processing pipelines.
250
+ *
251
+ * @remarks
252
+ * Middleware can transform requests, responses, and handle errors
253
+ * in a composable chain of responsibility pattern.
254
+ *
255
+ * @typeParam TRequest - Type of requests to process
256
+ * @typeParam TResponse - Type of responses to process
205
257
  *
206
258
  * @category Reference
207
259
  */
@@ -246,7 +298,14 @@ export interface Factory<T, TParams = unknown> {
246
298
  validate?(params: TParams): boolean;
247
299
  }
248
300
  /**
249
- * Generic repository interface for data access
301
+ * Defines a repository pattern for data access abstraction.
302
+ *
303
+ * @remarks
304
+ * Provides CRUD operations with filtering, sorting, and pagination
305
+ * for consistent data access across different storage backends.
306
+ *
307
+ * @typeParam TEntity - Type of entities managed by the repository
308
+ * @typeParam TKey - Type of entity identifiers
250
309
  *
251
310
  * @category Reference
252
311
  */
@@ -325,7 +384,13 @@ export interface Service<TConfig = unknown> {
325
384
  }>;
326
385
  }
327
386
  /**
328
- * Generic observer pattern
387
+ * Implements the observer in the observer pattern.
388
+ *
389
+ * @remarks
390
+ * Receives notifications about events from observable subjects
391
+ * for decoupled event handling.
392
+ *
393
+ * @typeParam TEvent - Type of events to observe
329
394
  *
330
395
  * @category Reference
331
396
  */
@@ -334,7 +399,13 @@ export interface Observer<TEvent = unknown> {
334
399
  notify(event: TEvent): void | Promise<void>;
335
400
  }
336
401
  /**
337
- * Generic observable pattern
402
+ * Implements the subject in the observer pattern.
403
+ *
404
+ * @remarks
405
+ * Manages observers and emits events to all subscribed observers
406
+ * for event-driven architectures.
407
+ *
408
+ * @typeParam TEvent - Type of events to emit
338
409
  *
339
410
  * @category Reference
340
411
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n VanaConfigWithWallet,\n VanaConfigReadOnly,\n VanaConfigAddressOnly,\n VanaConfigWithWalletWithStorage,\n VanaConfigReadOnlyWithStorage,\n VanaConfigAddressOnlyWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n DownloadRelayerCallbacks,\n StorageRequiredMarker,\n} from \"./config\";\n\nexport {\n isWalletConfig,\n isChainConfig,\n isReadOnlyConfig,\n isAddressOnlyConfig,\n hasStorageConfig,\n} from \"./config\";\n\n// Chain types\nexport type { VanaChainId, VanaChain } from \"./chains\";\n\nexport { isVanaChainId, isVanaChain } from \"./chains\";\n\n// Contract types\nexport type {\n VanaContractName,\n ContractInfo,\n ContractDeployment,\n VanaContractInstance,\n ContractAddresses,\n ContractMethodParams,\n ContractMethodReturnType,\n} from \"./contracts\";\n\n// Note: VanaContract and ContractAbis are exported directly from src/index.ts\n// to avoid circular dependencies. Do not re-export them here.\n\n// Storage types\nexport type {\n StorageProvider,\n StorageUploadResult,\n StorageFile,\n StorageListOptions,\n StorageProviderConfig,\n} from \"./storage\";\n\nexport { StorageError } from \"./storage\";\n\n// Data types\nexport type {\n UserFile,\n FileMetadata,\n UploadParams,\n FilePermissionParams,\n LegacyPermissionParams,\n EncryptedUploadParams,\n UnencryptedUploadParams,\n UploadResult,\n UploadFileParams,\n UploadFileResult,\n UploadEncryptedFileResult,\n EncryptionInfo,\n GetUserFilesParams,\n GetFileParams,\n EncryptFileOptions,\n EncryptFileResult,\n DecryptFileOptions,\n UploadFileWithPermissionsParams,\n AddFilePermissionParams,\n DecryptFileWithPermissionOptions,\n DownloadFileParams,\n DownloadFileResult,\n DeleteFileParams,\n DeleteFileResult,\n FileAccessPermissions,\n FileSharingConfig,\n BatchUploadParams,\n BatchUploadResult,\n SchemaMetadata,\n CompleteSchema,\n Schema,\n Refiner,\n AddSchemaParams,\n AddSchemaResult,\n AddRefinerParams,\n AddRefinerResult,\n UpdateSchemaIdParams,\n UpdateSchemaIdResult,\n TrustedServer,\n GetUserTrustedServersParams,\n} from \"./data\";\n\n// Schema types\nexport type {\n CreateSchemaParams,\n CreateSchemaResult,\n} from \"../controllers/schemas\";\n\n// Schema validation types\nexport type { DataSchema } from \"../utils/schemaValidation\";\nexport {\n SchemaValidationError,\n SchemaValidator,\n validateDataSchemaAgainstMetaSchema,\n validateDataAgainstSchema,\n fetchAndValidateSchema,\n} from \"../utils/schemaValidation\";\n\n// Permission types\nexport type {\n OnChainPermissionGrant,\n GetUserPermissionsOptions,\n GrantPermissionParams,\n RevokePermissionParams,\n CheckPermissionParams,\n PermissionCheckResult,\n PermissionGrantDomain,\n PermissionGrantMessage,\n PermissionInputMessage,\n SimplifiedPermissionMessage,\n GrantFile,\n PermissionGrantTypedData,\n RevokePermissionTypedData,\n GenericTypedData,\n TypedDataPrimaryType,\n SpecificTypedData,\n PermissionOperation,\n PermissionStatus,\n QueryPermissionsParams,\n PermissionQueryResult,\n PermissionAnalytics,\n PermissionEvent,\n GrantedPermission,\n Server,\n AddAndTrustServerParams,\n TrustServerParams,\n UntrustServerParams,\n AddAndTrustServerInput,\n TrustServerInput,\n UntrustServerInput,\n AddAndTrustServerTypedData,\n TrustServerTypedData,\n UntrustServerTypedData,\n PermissionInfo,\n RevokePermissionInput,\n TrustedServerInfo,\n PaginatedTrustedServers,\n TrustedServerQueryOptions,\n BatchServerInfoResult,\n ServerTrustStatus,\n ServerInfo,\n Grantee,\n GranteeInfo,\n RegisterGranteeParams,\n RegisterGranteeInput,\n RegisterGranteeTypedData,\n GranteeQueryOptions,\n PaginatedGrantees,\n ServerFilesAndPermissionParams,\n ServerFilesAndPermissionTypedData,\n Permission,\n} from \"./permissions\";\n\n// Personal server types\nexport type {\n PostRequestParams,\n CreateOperationParams,\n InitPersonalServerParams,\n PersonalServerIdentity,\n} from \"./personal\";\n\n// Server API types (auto-generated via fetch-server-types.ts)\nexport type * from \"../generated/server/server-exports\";\n\n// External API types\nexport type {\n ReplicateAPIResponse,\n ReplicateStatus,\n PinataUploadResponse,\n PinataPin,\n PinataListResponse,\n APIResponse,\n} from \"./external-apis\";\n\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./external-apis\";\n\n// Relayer types\nexport type {\n RelayerStorageResponse,\n RelayerTransactionResponse,\n RelayerStoreParams,\n RelayerSubmitParams,\n RelayerStatus,\n RelayerConfig,\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n SignedRelayerRequest,\n DirectRelayerRequest,\n RelayerRequestOptions,\n RelayerErrorResponse,\n RelayerQueueInfo,\n RelayerTransactionStatus,\n RelayerMetrics,\n RelayerWebhookConfig,\n RelayerWebhookPayload,\n} from \"./relayer\";\n\n// Utility types\nexport type {\n PartialExcept,\n RequiredExcept,\n Awaited,\n MaybePromise,\n MaybeArray,\n PaginationParams,\n PaginationResult,\n BlockRange,\n TransactionOptions,\n TransactionReceipt,\n ApiResponse,\n CacheConfig,\n ValidationResult,\n StatusInfo,\n RateLimitInfo,\n UploadProgress,\n NetworkInfo,\n GasEstimate,\n TimeRange,\n} from \"./utils\";\n\n// Generic types for extensibility\nexport type {\n GenericRequest,\n GenericResponse,\n AsyncResult,\n ContractCall,\n EventFilter,\n EventLog,\n ControllerContext,\n Controller,\n Cache,\n RetryConfig,\n RateLimiterConfig,\n Middleware,\n Plugin,\n Factory,\n Repository,\n Validator,\n Transformer,\n Service,\n Observer,\n Observable,\n StateMachine,\n ConditionalOptional,\n PromiseResult,\n AllKeys,\n DeepPartial,\n DeepReadonly,\n RequireKeys,\n OptionalKeys,\n NonNullable,\n PickByType,\n OmitByType,\n Brand,\n Nominal,\n} from \"./generics\";\n\n// Re-export viem types that are commonly used\nexport type {\n Address,\n Hash,\n Abi,\n Chain,\n WalletClient,\n PublicClient,\n Account,\n GetContractReturnType,\n} from \"viem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,oBAMO;AAKP,oBAA2C;AAyB3C,qBAA6B;AAsD7B,8BAMO;AA8EP,2BAKO;","names":[]}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Centralized type exports for the Vana SDK.\n *\n * @remarks\n * This module re-exports all public types from their respective modules,\n * providing a single import point for SDK consumers. Types are organized\n * by category for easy discovery and usage.\n *\n * **Import Strategy:**\n * - Import types from this module for application code\n * - Import from specific modules only for advanced use cases\n * - Avoid importing from internal paths\n *\n * @example\n * ```typescript\n * // Recommended: Import from types module\n * import type { VanaConfig, UserFile, GrantPermissionParams } from '@opendatalabs/vana-sdk';\n *\n * // Alternative: Import from specific category\n * import type { StorageProvider } from '@opendatalabs/vana-sdk';\n * ```\n *\n * @category Types\n * @module types\n */\n\n// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n VanaConfigWithWallet,\n VanaConfigReadOnly,\n VanaConfigAddressOnly,\n VanaConfigWithWalletWithStorage,\n VanaConfigReadOnlyWithStorage,\n VanaConfigAddressOnlyWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n DownloadRelayerCallbacks,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./config\";\n\nexport {\n isWalletConfig,\n isChainConfig,\n isReadOnlyConfig,\n isAddressOnlyConfig,\n hasStorageConfig,\n} from \"./config\";\n\n// Chain types\nexport type { VanaChainId, VanaChain } from \"./chains\";\n\nexport { isVanaChainId, isVanaChain } from \"./chains\";\n\n// Contract types\nexport type {\n VanaContractName,\n ContractInfo,\n ContractDeployment,\n VanaContractInstance,\n ContractAddresses,\n ContractMethodParams,\n ContractMethodReturnType,\n} from \"./contracts\";\n\n// Note: VanaContract and ContractAbis are exported directly from src/index.ts\n// to avoid circular dependencies. Do not re-export them here.\n\n// Storage types\nexport type {\n StorageProvider,\n StorageUploadResult,\n StorageFile,\n StorageListOptions,\n StorageProviderConfig,\n} from \"./storage\";\n\nexport { StorageError } from \"./storage\";\n\n// Data types\nexport type {\n UserFile,\n FileMetadata,\n UploadParams,\n FilePermissionParams,\n LegacyPermissionParams,\n EncryptedUploadParams,\n UnencryptedUploadParams,\n UploadResult,\n UploadFileParams,\n UploadFileResult,\n UploadEncryptedFileResult,\n EncryptionInfo,\n GetUserFilesParams,\n GetFileParams,\n EncryptFileOptions,\n EncryptFileResult,\n DecryptFileOptions,\n UploadFileWithPermissionsParams,\n AddFilePermissionParams,\n DecryptFileWithPermissionOptions,\n DownloadFileParams,\n DownloadFileResult,\n DeleteFileParams,\n DeleteFileResult,\n FileAccessPermissions,\n FileSharingConfig,\n BatchUploadParams,\n BatchUploadResult,\n SchemaMetadata,\n CompleteSchema,\n Schema,\n Refiner,\n AddSchemaParams,\n AddSchemaResult,\n AddRefinerParams,\n AddRefinerResult,\n UpdateSchemaIdParams,\n UpdateSchemaIdResult,\n TrustedServer,\n GetUserTrustedServersParams,\n} from \"./data\";\n\n// Schema types\nexport type {\n CreateSchemaParams,\n CreateSchemaResult,\n} from \"../controllers/schemas\";\n\n// Schema validation types\nexport type { DataSchema } from \"../utils/schemaValidation\";\nexport {\n SchemaValidationError,\n SchemaValidator,\n validateDataSchemaAgainstMetaSchema,\n validateDataAgainstSchema,\n fetchAndValidateSchema,\n} from \"../utils/schemaValidation\";\n\n// Permission types\nexport type {\n OnChainPermissionGrant,\n GetUserPermissionsOptions,\n GrantPermissionParams,\n RevokePermissionParams,\n CheckPermissionParams,\n PermissionCheckResult,\n PermissionGrantDomain,\n PermissionGrantMessage,\n PermissionInputMessage,\n SimplifiedPermissionMessage,\n GrantFile,\n PermissionGrantTypedData,\n RevokePermissionTypedData,\n GenericTypedData,\n TypedDataPrimaryType,\n SpecificTypedData,\n PermissionOperation,\n PermissionStatus,\n QueryPermissionsParams,\n PermissionQueryResult,\n PermissionAnalytics,\n PermissionEvent,\n GrantedPermission,\n Server,\n AddAndTrustServerParams,\n TrustServerParams,\n UntrustServerParams,\n AddAndTrustServerInput,\n TrustServerInput,\n UntrustServerInput,\n AddAndTrustServerTypedData,\n TrustServerTypedData,\n UntrustServerTypedData,\n PermissionInfo,\n RevokePermissionInput,\n TrustedServerInfo,\n PaginatedTrustedServers,\n TrustedServerQueryOptions,\n BatchServerInfoResult,\n ServerTrustStatus,\n ServerInfo,\n Grantee,\n GranteeInfo,\n RegisterGranteeParams,\n RegisterGranteeInput,\n RegisterGranteeTypedData,\n GranteeQueryOptions,\n PaginatedGrantees,\n ServerFilesAndPermissionParams,\n ServerFilesAndPermissionTypedData,\n Permission,\n} from \"./permissions\";\n\n// Personal server types\nexport type {\n PostRequestParams,\n CreateOperationParams,\n DownloadArtifactParams,\n InitPersonalServerParams,\n PersonalServerIdentity,\n} from \"./personal\";\n\n// Operations types\nexport type {\n Operation,\n Artifact,\n PollingOptions,\n TransactionResult,\n TransactionReceipt as OperationTransactionReceipt,\n TransactionWaitOptions,\n} from \"./operations\";\n\n// Server API types (auto-generated via fetch-server-types.ts)\nexport type * from \"../generated/server/server-exports\";\n\n// External API types\nexport type {\n ReplicateAPIResponse,\n ReplicateStatus,\n PinataUploadResponse,\n PinataPin,\n PinataListResponse,\n APIResponse,\n} from \"./external-apis\";\n\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./external-apis\";\n\n// Relayer types\nexport type {\n RelayerStorageResponse,\n RelayerTransactionResponse,\n RelayerStoreParams,\n RelayerSubmitParams,\n RelayerStatus,\n RelayerConfig,\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n SignedRelayerRequest,\n DirectRelayerRequest,\n RelayerRequestOptions,\n RelayerErrorResponse,\n RelayerQueueInfo,\n RelayerTransactionStatus,\n RelayerMetrics,\n RelayerWebhookConfig,\n RelayerWebhookPayload,\n} from \"./relayer\";\n\n// Utility types\nexport type {\n PartialExcept,\n RequiredExcept,\n Awaited,\n MaybePromise,\n MaybeArray,\n PaginationParams,\n PaginationResult,\n BlockRange,\n ApiResponse,\n CacheConfig,\n ValidationResult,\n StatusInfo,\n RateLimitInfo,\n UploadProgress,\n NetworkInfo,\n GasEstimate,\n TimeRange,\n} from \"./utils\";\n\n// Operation store types\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./operationStore\";\n\n// Options types\nexport type {\n ConsistencyOptions,\n DataSource,\n PaginationOptions,\n ListOptions,\n WriteOptions,\n LegacyTransactionOptions,\n} from \"./options\";\n\n// Generic types for extensibility\nexport type {\n GenericRequest,\n GenericResponse,\n AsyncResult,\n ContractCall,\n EventFilter,\n EventLog,\n ControllerContext,\n Controller,\n Cache,\n RetryConfig,\n RateLimiterConfig,\n Middleware,\n Plugin,\n Factory,\n Repository,\n Validator,\n Transformer,\n Service,\n Observer,\n Observable,\n StateMachine,\n ConditionalOptional,\n PromiseResult,\n AllKeys,\n DeepPartial,\n DeepReadonly,\n RequireKeys,\n OptionalKeys,\n NonNullable,\n PickByType,\n OmitByType,\n Brand,\n Nominal,\n} from \"./generics\";\n\n// Re-export viem types that are commonly used\nexport type {\n Address,\n Hash,\n Abi,\n Chain,\n WalletClient,\n PublicClient,\n Account,\n GetContractReturnType,\n} from \"viem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDA,oBAMO;AAKP,oBAA2C;AAyB3C,qBAA6B;AAsD7B,8BAMO;AAyFP,2BAKO;","names":[]}
@@ -1,4 +1,29 @@
1
- export type { BaseConfig, BaseConfigWithStorage, WalletConfig, WalletConfigWithStorage, ChainConfig, ChainConfigWithStorage, VanaConfig, VanaConfigWithStorage, VanaConfigWithWallet, VanaConfigReadOnly, VanaConfigAddressOnly, VanaConfigWithWalletWithStorage, VanaConfigReadOnlyWithStorage, VanaConfigAddressOnlyWithStorage, RuntimeConfig, StorageConfig, ConfigValidationOptions, ConfigValidationResult, DownloadRelayerCallbacks, StorageRequiredMarker, } from "./config";
1
+ /**
2
+ * Centralized type exports for the Vana SDK.
3
+ *
4
+ * @remarks
5
+ * This module re-exports all public types from their respective modules,
6
+ * providing a single import point for SDK consumers. Types are organized
7
+ * by category for easy discovery and usage.
8
+ *
9
+ * **Import Strategy:**
10
+ * - Import types from this module for application code
11
+ * - Import from specific modules only for advanced use cases
12
+ * - Avoid importing from internal paths
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * // Recommended: Import from types module
17
+ * import type { VanaConfig, UserFile, GrantPermissionParams } from '@opendatalabs/vana-sdk';
18
+ *
19
+ * // Alternative: Import from specific category
20
+ * import type { StorageProvider } from '@opendatalabs/vana-sdk';
21
+ * ```
22
+ *
23
+ * @category Types
24
+ * @module types
25
+ */
26
+ export type { BaseConfig, BaseConfigWithStorage, WalletConfig, WalletConfigWithStorage, ChainConfig, ChainConfigWithStorage, VanaConfig, VanaConfigWithStorage, VanaConfigWithWallet, VanaConfigReadOnly, VanaConfigAddressOnly, VanaConfigWithWalletWithStorage, VanaConfigReadOnlyWithStorage, VanaConfigAddressOnlyWithStorage, RuntimeConfig, StorageConfig, ConfigValidationOptions, ConfigValidationResult, DownloadRelayerCallbacks, StorageRequiredMarker, RelayerRequiredMarker, } from "./config";
2
27
  export { isWalletConfig, isChainConfig, isReadOnlyConfig, isAddressOnlyConfig, hasStorageConfig, } from "./config";
3
28
  export type { VanaChainId, VanaChain } from "./chains";
4
29
  export { isVanaChainId, isVanaChain } from "./chains";
@@ -10,11 +35,14 @@ export type { CreateSchemaParams, CreateSchemaResult, } from "../controllers/sch
10
35
  export type { DataSchema } from "../utils/schemaValidation";
11
36
  export { SchemaValidationError, SchemaValidator, validateDataSchemaAgainstMetaSchema, validateDataAgainstSchema, fetchAndValidateSchema, } from "../utils/schemaValidation";
12
37
  export type { OnChainPermissionGrant, GetUserPermissionsOptions, GrantPermissionParams, RevokePermissionParams, CheckPermissionParams, PermissionCheckResult, PermissionGrantDomain, PermissionGrantMessage, PermissionInputMessage, SimplifiedPermissionMessage, GrantFile, PermissionGrantTypedData, RevokePermissionTypedData, GenericTypedData, TypedDataPrimaryType, SpecificTypedData, PermissionOperation, PermissionStatus, QueryPermissionsParams, PermissionQueryResult, PermissionAnalytics, PermissionEvent, GrantedPermission, Server, AddAndTrustServerParams, TrustServerParams, UntrustServerParams, AddAndTrustServerInput, TrustServerInput, UntrustServerInput, AddAndTrustServerTypedData, TrustServerTypedData, UntrustServerTypedData, PermissionInfo, RevokePermissionInput, TrustedServerInfo, PaginatedTrustedServers, TrustedServerQueryOptions, BatchServerInfoResult, ServerTrustStatus, ServerInfo, Grantee, GranteeInfo, RegisterGranteeParams, RegisterGranteeInput, RegisterGranteeTypedData, GranteeQueryOptions, PaginatedGrantees, ServerFilesAndPermissionParams, ServerFilesAndPermissionTypedData, Permission, } from "./permissions";
13
- export type { PostRequestParams, CreateOperationParams, InitPersonalServerParams, PersonalServerIdentity, } from "./personal";
38
+ export type { PostRequestParams, CreateOperationParams, DownloadArtifactParams, InitPersonalServerParams, PersonalServerIdentity, } from "./personal";
39
+ export type { Operation, Artifact, PollingOptions, TransactionResult, TransactionReceipt as OperationTransactionReceipt, TransactionWaitOptions, } from "./operations";
14
40
  export type * from "../generated/server/server-exports";
15
41
  export type { ReplicateAPIResponse, ReplicateStatus, PinataUploadResponse, PinataPin, PinataListResponse, APIResponse, } from "./external-apis";
16
42
  export { isReplicateAPIResponse, isAPIResponse, safeParseJSON, parseReplicateOutput, } from "./external-apis";
17
43
  export type { RelayerStorageResponse, RelayerTransactionResponse, RelayerStoreParams, RelayerSubmitParams, RelayerStatus, RelayerConfig, UnifiedRelayerRequest, UnifiedRelayerResponse, SignedRelayerRequest, DirectRelayerRequest, RelayerRequestOptions, RelayerErrorResponse, RelayerQueueInfo, RelayerTransactionStatus, RelayerMetrics, RelayerWebhookConfig, RelayerWebhookPayload, } from "./relayer";
18
- export type { PartialExcept, RequiredExcept, Awaited, MaybePromise, MaybeArray, PaginationParams, PaginationResult, BlockRange, TransactionOptions, TransactionReceipt, ApiResponse, CacheConfig, ValidationResult, StatusInfo, RateLimitInfo, UploadProgress, NetworkInfo, GasEstimate, TimeRange, } from "./utils";
44
+ export type { PartialExcept, RequiredExcept, Awaited, MaybePromise, MaybeArray, PaginationParams, PaginationResult, BlockRange, ApiResponse, CacheConfig, ValidationResult, StatusInfo, RateLimitInfo, UploadProgress, NetworkInfo, GasEstimate, TimeRange, } from "./utils";
45
+ export type { IOperationStore, StoredOperation, IRelayerStateStore, OperationState, } from "./operationStore";
46
+ export type { ConsistencyOptions, DataSource, PaginationOptions, ListOptions, WriteOptions, LegacyTransactionOptions, } from "./options";
19
47
  export type { GenericRequest, GenericResponse, AsyncResult, ContractCall, EventFilter, EventLog, ControllerContext, Controller, Cache, RetryConfig, RateLimiterConfig, Middleware, Plugin, Factory, Repository, Validator, Transformer, Service, Observer, Observable, StateMachine, ConditionalOptional, PromiseResult, AllKeys, DeepPartial, DeepReadonly, RequireKeys, OptionalKeys, NonNullable, PickByType, OmitByType, Brand, Nominal, } from "./generics";
20
48
  export type { Address, Hash, Abi, Chain, WalletClient, PublicClient, Account, GetContractReturnType, } from "viem";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n VanaConfigWithWallet,\n VanaConfigReadOnly,\n VanaConfigAddressOnly,\n VanaConfigWithWalletWithStorage,\n VanaConfigReadOnlyWithStorage,\n VanaConfigAddressOnlyWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n DownloadRelayerCallbacks,\n StorageRequiredMarker,\n} from \"./config\";\n\nexport {\n isWalletConfig,\n isChainConfig,\n isReadOnlyConfig,\n isAddressOnlyConfig,\n hasStorageConfig,\n} from \"./config\";\n\n// Chain types\nexport type { VanaChainId, VanaChain } from \"./chains\";\n\nexport { isVanaChainId, isVanaChain } from \"./chains\";\n\n// Contract types\nexport type {\n VanaContractName,\n ContractInfo,\n ContractDeployment,\n VanaContractInstance,\n ContractAddresses,\n ContractMethodParams,\n ContractMethodReturnType,\n} from \"./contracts\";\n\n// Note: VanaContract and ContractAbis are exported directly from src/index.ts\n// to avoid circular dependencies. Do not re-export them here.\n\n// Storage types\nexport type {\n StorageProvider,\n StorageUploadResult,\n StorageFile,\n StorageListOptions,\n StorageProviderConfig,\n} from \"./storage\";\n\nexport { StorageError } from \"./storage\";\n\n// Data types\nexport type {\n UserFile,\n FileMetadata,\n UploadParams,\n FilePermissionParams,\n LegacyPermissionParams,\n EncryptedUploadParams,\n UnencryptedUploadParams,\n UploadResult,\n UploadFileParams,\n UploadFileResult,\n UploadEncryptedFileResult,\n EncryptionInfo,\n GetUserFilesParams,\n GetFileParams,\n EncryptFileOptions,\n EncryptFileResult,\n DecryptFileOptions,\n UploadFileWithPermissionsParams,\n AddFilePermissionParams,\n DecryptFileWithPermissionOptions,\n DownloadFileParams,\n DownloadFileResult,\n DeleteFileParams,\n DeleteFileResult,\n FileAccessPermissions,\n FileSharingConfig,\n BatchUploadParams,\n BatchUploadResult,\n SchemaMetadata,\n CompleteSchema,\n Schema,\n Refiner,\n AddSchemaParams,\n AddSchemaResult,\n AddRefinerParams,\n AddRefinerResult,\n UpdateSchemaIdParams,\n UpdateSchemaIdResult,\n TrustedServer,\n GetUserTrustedServersParams,\n} from \"./data\";\n\n// Schema types\nexport type {\n CreateSchemaParams,\n CreateSchemaResult,\n} from \"../controllers/schemas\";\n\n// Schema validation types\nexport type { DataSchema } from \"../utils/schemaValidation\";\nexport {\n SchemaValidationError,\n SchemaValidator,\n validateDataSchemaAgainstMetaSchema,\n validateDataAgainstSchema,\n fetchAndValidateSchema,\n} from \"../utils/schemaValidation\";\n\n// Permission types\nexport type {\n OnChainPermissionGrant,\n GetUserPermissionsOptions,\n GrantPermissionParams,\n RevokePermissionParams,\n CheckPermissionParams,\n PermissionCheckResult,\n PermissionGrantDomain,\n PermissionGrantMessage,\n PermissionInputMessage,\n SimplifiedPermissionMessage,\n GrantFile,\n PermissionGrantTypedData,\n RevokePermissionTypedData,\n GenericTypedData,\n TypedDataPrimaryType,\n SpecificTypedData,\n PermissionOperation,\n PermissionStatus,\n QueryPermissionsParams,\n PermissionQueryResult,\n PermissionAnalytics,\n PermissionEvent,\n GrantedPermission,\n Server,\n AddAndTrustServerParams,\n TrustServerParams,\n UntrustServerParams,\n AddAndTrustServerInput,\n TrustServerInput,\n UntrustServerInput,\n AddAndTrustServerTypedData,\n TrustServerTypedData,\n UntrustServerTypedData,\n PermissionInfo,\n RevokePermissionInput,\n TrustedServerInfo,\n PaginatedTrustedServers,\n TrustedServerQueryOptions,\n BatchServerInfoResult,\n ServerTrustStatus,\n ServerInfo,\n Grantee,\n GranteeInfo,\n RegisterGranteeParams,\n RegisterGranteeInput,\n RegisterGranteeTypedData,\n GranteeQueryOptions,\n PaginatedGrantees,\n ServerFilesAndPermissionParams,\n ServerFilesAndPermissionTypedData,\n Permission,\n} from \"./permissions\";\n\n// Personal server types\nexport type {\n PostRequestParams,\n CreateOperationParams,\n InitPersonalServerParams,\n PersonalServerIdentity,\n} from \"./personal\";\n\n// Server API types (auto-generated via fetch-server-types.ts)\nexport type * from \"../generated/server/server-exports\";\n\n// External API types\nexport type {\n ReplicateAPIResponse,\n ReplicateStatus,\n PinataUploadResponse,\n PinataPin,\n PinataListResponse,\n APIResponse,\n} from \"./external-apis\";\n\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./external-apis\";\n\n// Relayer types\nexport type {\n RelayerStorageResponse,\n RelayerTransactionResponse,\n RelayerStoreParams,\n RelayerSubmitParams,\n RelayerStatus,\n RelayerConfig,\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n SignedRelayerRequest,\n DirectRelayerRequest,\n RelayerRequestOptions,\n RelayerErrorResponse,\n RelayerQueueInfo,\n RelayerTransactionStatus,\n RelayerMetrics,\n RelayerWebhookConfig,\n RelayerWebhookPayload,\n} from \"./relayer\";\n\n// Utility types\nexport type {\n PartialExcept,\n RequiredExcept,\n Awaited,\n MaybePromise,\n MaybeArray,\n PaginationParams,\n PaginationResult,\n BlockRange,\n TransactionOptions,\n TransactionReceipt,\n ApiResponse,\n CacheConfig,\n ValidationResult,\n StatusInfo,\n RateLimitInfo,\n UploadProgress,\n NetworkInfo,\n GasEstimate,\n TimeRange,\n} from \"./utils\";\n\n// Generic types for extensibility\nexport type {\n GenericRequest,\n GenericResponse,\n AsyncResult,\n ContractCall,\n EventFilter,\n EventLog,\n ControllerContext,\n Controller,\n Cache,\n RetryConfig,\n RateLimiterConfig,\n Middleware,\n Plugin,\n Factory,\n Repository,\n Validator,\n Transformer,\n Service,\n Observer,\n Observable,\n StateMachine,\n ConditionalOptional,\n PromiseResult,\n AllKeys,\n DeepPartial,\n DeepReadonly,\n RequireKeys,\n OptionalKeys,\n NonNullable,\n PickByType,\n OmitByType,\n Brand,\n Nominal,\n} from \"./generics\";\n\n// Re-export viem types that are commonly used\nexport type {\n Address,\n Hash,\n Abi,\n Chain,\n WalletClient,\n PublicClient,\n Account,\n GetContractReturnType,\n} from \"viem\";\n"],"mappings":"AAwBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,eAAe,mBAAmB;AAyB3C,SAAS,oBAAoB;AAsD7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8EP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Centralized type exports for the Vana SDK.\n *\n * @remarks\n * This module re-exports all public types from their respective modules,\n * providing a single import point for SDK consumers. Types are organized\n * by category for easy discovery and usage.\n *\n * **Import Strategy:**\n * - Import types from this module for application code\n * - Import from specific modules only for advanced use cases\n * - Avoid importing from internal paths\n *\n * @example\n * ```typescript\n * // Recommended: Import from types module\n * import type { VanaConfig, UserFile, GrantPermissionParams } from '@opendatalabs/vana-sdk';\n *\n * // Alternative: Import from specific category\n * import type { StorageProvider } from '@opendatalabs/vana-sdk';\n * ```\n *\n * @category Types\n * @module types\n */\n\n// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n VanaConfigWithWallet,\n VanaConfigReadOnly,\n VanaConfigAddressOnly,\n VanaConfigWithWalletWithStorage,\n VanaConfigReadOnlyWithStorage,\n VanaConfigAddressOnlyWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n DownloadRelayerCallbacks,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./config\";\n\nexport {\n isWalletConfig,\n isChainConfig,\n isReadOnlyConfig,\n isAddressOnlyConfig,\n hasStorageConfig,\n} from \"./config\";\n\n// Chain types\nexport type { VanaChainId, VanaChain } from \"./chains\";\n\nexport { isVanaChainId, isVanaChain } from \"./chains\";\n\n// Contract types\nexport type {\n VanaContractName,\n ContractInfo,\n ContractDeployment,\n VanaContractInstance,\n ContractAddresses,\n ContractMethodParams,\n ContractMethodReturnType,\n} from \"./contracts\";\n\n// Note: VanaContract and ContractAbis are exported directly from src/index.ts\n// to avoid circular dependencies. Do not re-export them here.\n\n// Storage types\nexport type {\n StorageProvider,\n StorageUploadResult,\n StorageFile,\n StorageListOptions,\n StorageProviderConfig,\n} from \"./storage\";\n\nexport { StorageError } from \"./storage\";\n\n// Data types\nexport type {\n UserFile,\n FileMetadata,\n UploadParams,\n FilePermissionParams,\n LegacyPermissionParams,\n EncryptedUploadParams,\n UnencryptedUploadParams,\n UploadResult,\n UploadFileParams,\n UploadFileResult,\n UploadEncryptedFileResult,\n EncryptionInfo,\n GetUserFilesParams,\n GetFileParams,\n EncryptFileOptions,\n EncryptFileResult,\n DecryptFileOptions,\n UploadFileWithPermissionsParams,\n AddFilePermissionParams,\n DecryptFileWithPermissionOptions,\n DownloadFileParams,\n DownloadFileResult,\n DeleteFileParams,\n DeleteFileResult,\n FileAccessPermissions,\n FileSharingConfig,\n BatchUploadParams,\n BatchUploadResult,\n SchemaMetadata,\n CompleteSchema,\n Schema,\n Refiner,\n AddSchemaParams,\n AddSchemaResult,\n AddRefinerParams,\n AddRefinerResult,\n UpdateSchemaIdParams,\n UpdateSchemaIdResult,\n TrustedServer,\n GetUserTrustedServersParams,\n} from \"./data\";\n\n// Schema types\nexport type {\n CreateSchemaParams,\n CreateSchemaResult,\n} from \"../controllers/schemas\";\n\n// Schema validation types\nexport type { DataSchema } from \"../utils/schemaValidation\";\nexport {\n SchemaValidationError,\n SchemaValidator,\n validateDataSchemaAgainstMetaSchema,\n validateDataAgainstSchema,\n fetchAndValidateSchema,\n} from \"../utils/schemaValidation\";\n\n// Permission types\nexport type {\n OnChainPermissionGrant,\n GetUserPermissionsOptions,\n GrantPermissionParams,\n RevokePermissionParams,\n CheckPermissionParams,\n PermissionCheckResult,\n PermissionGrantDomain,\n PermissionGrantMessage,\n PermissionInputMessage,\n SimplifiedPermissionMessage,\n GrantFile,\n PermissionGrantTypedData,\n RevokePermissionTypedData,\n GenericTypedData,\n TypedDataPrimaryType,\n SpecificTypedData,\n PermissionOperation,\n PermissionStatus,\n QueryPermissionsParams,\n PermissionQueryResult,\n PermissionAnalytics,\n PermissionEvent,\n GrantedPermission,\n Server,\n AddAndTrustServerParams,\n TrustServerParams,\n UntrustServerParams,\n AddAndTrustServerInput,\n TrustServerInput,\n UntrustServerInput,\n AddAndTrustServerTypedData,\n TrustServerTypedData,\n UntrustServerTypedData,\n PermissionInfo,\n RevokePermissionInput,\n TrustedServerInfo,\n PaginatedTrustedServers,\n TrustedServerQueryOptions,\n BatchServerInfoResult,\n ServerTrustStatus,\n ServerInfo,\n Grantee,\n GranteeInfo,\n RegisterGranteeParams,\n RegisterGranteeInput,\n RegisterGranteeTypedData,\n GranteeQueryOptions,\n PaginatedGrantees,\n ServerFilesAndPermissionParams,\n ServerFilesAndPermissionTypedData,\n Permission,\n} from \"./permissions\";\n\n// Personal server types\nexport type {\n PostRequestParams,\n CreateOperationParams,\n DownloadArtifactParams,\n InitPersonalServerParams,\n PersonalServerIdentity,\n} from \"./personal\";\n\n// Operations types\nexport type {\n Operation,\n Artifact,\n PollingOptions,\n TransactionResult,\n TransactionReceipt as OperationTransactionReceipt,\n TransactionWaitOptions,\n} from \"./operations\";\n\n// Server API types (auto-generated via fetch-server-types.ts)\nexport type * from \"../generated/server/server-exports\";\n\n// External API types\nexport type {\n ReplicateAPIResponse,\n ReplicateStatus,\n PinataUploadResponse,\n PinataPin,\n PinataListResponse,\n APIResponse,\n} from \"./external-apis\";\n\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./external-apis\";\n\n// Relayer types\nexport type {\n RelayerStorageResponse,\n RelayerTransactionResponse,\n RelayerStoreParams,\n RelayerSubmitParams,\n RelayerStatus,\n RelayerConfig,\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n SignedRelayerRequest,\n DirectRelayerRequest,\n RelayerRequestOptions,\n RelayerErrorResponse,\n RelayerQueueInfo,\n RelayerTransactionStatus,\n RelayerMetrics,\n RelayerWebhookConfig,\n RelayerWebhookPayload,\n} from \"./relayer\";\n\n// Utility types\nexport type {\n PartialExcept,\n RequiredExcept,\n Awaited,\n MaybePromise,\n MaybeArray,\n PaginationParams,\n PaginationResult,\n BlockRange,\n ApiResponse,\n CacheConfig,\n ValidationResult,\n StatusInfo,\n RateLimitInfo,\n UploadProgress,\n NetworkInfo,\n GasEstimate,\n TimeRange,\n} from \"./utils\";\n\n// Operation store types\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./operationStore\";\n\n// Options types\nexport type {\n ConsistencyOptions,\n DataSource,\n PaginationOptions,\n ListOptions,\n WriteOptions,\n LegacyTransactionOptions,\n} from \"./options\";\n\n// Generic types for extensibility\nexport type {\n GenericRequest,\n GenericResponse,\n AsyncResult,\n ContractCall,\n EventFilter,\n EventLog,\n ControllerContext,\n Controller,\n Cache,\n RetryConfig,\n RateLimiterConfig,\n Middleware,\n Plugin,\n Factory,\n Repository,\n Validator,\n Transformer,\n Service,\n Observer,\n Observable,\n StateMachine,\n ConditionalOptional,\n PromiseResult,\n AllKeys,\n DeepPartial,\n DeepReadonly,\n RequireKeys,\n OptionalKeys,\n NonNullable,\n PickByType,\n OmitByType,\n Brand,\n Nominal,\n} from \"./generics\";\n\n// Re-export viem types that are commonly used\nexport type {\n Address,\n Hash,\n Abi,\n Chain,\n WalletClient,\n PublicClient,\n Account,\n GetContractReturnType,\n} from \"viem\";\n"],"mappings":"AAmDA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,eAAe,mBAAmB;AAyB3C,SAAS,oBAAoB;AAsD7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyFP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var operationStore_exports = {};
16
+ module.exports = __toCommonJS(operationStore_exports);
17
+ //# sourceMappingURL=operationStore.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/operationStore.ts"],"sourcesContent":["/**\n * Operation storage interfaces for queuing and managing asynchronous operations.\n *\n * @module\n */\n\nimport type { Hash, TransactionReceipt } from \"viem\";\nimport type { UnifiedRelayerRequest } from \"./relayer\";\n\n/**\n * The state of an asynchronous, relayed operation.\n *\n * @remarks\n * This is the data the application backend is responsible for persisting.\n * It serves as a complete recovery log for a given operation.\n *\n * @category Operations\n */\nexport interface OperationState {\n status: \"pending\" | \"confirmed\" | \"failed\";\n transactionHash: Hash;\n originalRequest: UnifiedRelayerRequest;\n nonce?: number;\n retryCount: number;\n lastAttemptedGas: { maxFeePerGas?: string; maxPriorityFeePerGas?: string };\n submittedAt: number; // Unix timestamp (ms)\n finalReceipt?: TransactionReceipt;\n error?: string;\n}\n\n/**\n * Simple storage interface for operation state tracking.\n *\n * @remarks\n * This interface is used by the relayer handler to track operation state\n * in a stateful mode. Implementations can use any backend storage system.\n *\n * @category Operations\n */\nexport interface IRelayerStateStore {\n /**\n * Gets the state of an operation.\n *\n * @param operationId - The operation ID\n * @returns The operation state or null if not found\n */\n get(operationId: string): Promise<OperationState | null>;\n\n /**\n * Sets the state of an operation.\n *\n * @param operationId - The operation ID\n * @param state - The operation state to store\n */\n set(operationId: string, state: OperationState): Promise<void>;\n}\n\n/**\n * Represents a stored operation in the queue.\n */\nexport interface StoredOperation {\n /** Unique identifier for the operation */\n id: string;\n /** Current status of the operation */\n status: \"queued\" | \"processing\" | \"submitted\" | \"completed\" | \"failed\";\n /** Serialized transaction or operation data */\n data: string;\n /** Number of retry attempts */\n retryCount?: number;\n /** Timestamp when the operation was created */\n createdAt?: number;\n /** Additional metadata */\n metadata?: any;\n}\n\n/**\n * Interface for operation storage backends.\n *\n * @remarks\n * Implementations of this interface provide persistent storage for queued\n * operations in a distributed relayer system. This allows operations to\n * be processed asynchronously and recovered after failures.\n *\n * Common implementations include:\n * - PostgreSQL for production environments\n * - MongoDB for document-based storage\n * - DynamoDB for serverless deployments\n * - In-memory storage for testing\n *\n * @example\n * ```typescript\n * class PostgresOperationStore implements IOperationStore {\n * async storeOperation(operation) {\n * await this.db.query(\n * 'INSERT INTO operations (id, status, data) VALUES ($1, $2, $3)',\n * [operation.id, 'queued', operation.data]\n * );\n * }\n *\n * async getQueuedOperations(options) {\n * const result = await this.db.query(\n * 'SELECT * FROM operations WHERE status = $1 LIMIT $2',\n * ['queued', options.limit || 100]\n * );\n * return result.rows;\n * }\n * }\n * ```\n *\n * @category Storage\n */\nexport interface IOperationStore {\n /**\n * Stores a new operation in the queue.\n *\n * @param operation - The operation to store\n * @returns Promise that resolves when the operation is stored\n */\n storeOperation(operation: {\n id: string;\n data: any;\n metadata?: any;\n }): Promise<void>;\n\n /**\n * Retrieves queued operations for processing.\n *\n * @param options - Query options\n * @returns Promise resolving to an array of queued operations\n */\n getQueuedOperations(options?: { limit?: number }): Promise<StoredOperation[]>;\n\n /**\n * Updates the status of an operation.\n *\n * @param operationId - The ID of the operation to update\n * @param status - The new status\n * @param metadata - Optional metadata to store with the update\n * @returns Promise that resolves when the status is updated\n */\n updateStatus(\n operationId: string,\n status: string,\n metadata?: any,\n ): Promise<void>;\n\n /**\n * Gets operations currently being processed.\n *\n * @param options - Query options\n * @returns Promise resolving to an array of processing operations\n */\n getProcessingOperations?(options?: {\n limit?: number;\n }): Promise<StoredOperation[]>;\n\n /**\n * Gets failed operations.\n *\n * @param options - Query options\n * @returns Promise resolving to an array of failed operations\n */\n getFailedOperations?(options?: {\n limit?: number;\n }): Promise<StoredOperation[]>;\n\n /**\n * Gets the status of a specific operation.\n *\n * @param operationId - The ID of the operation to check\n * @returns Promise resolving to the operation or null if not found\n */\n getOperation?(operationId: string): Promise<StoredOperation | null>;\n\n /**\n * Deletes an operation from storage.\n *\n * @param operationId - The ID of the operation to delete\n * @returns Promise that resolves when the operation is deleted\n */\n deleteOperation?(operationId: string): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}