@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
@@ -1,95 +1,122 @@
1
1
  import type { Address } from "viem";
2
+ import type { TransactionOptions, TransactionResult } from "../types/operations";
2
3
  import type { StorageUploadResult } from "../types/storage";
3
4
  import type { UserFile, UploadParams, UploadResult, UploadEncryptedFileResult, Refiner, AddRefinerParams, AddRefinerResult, UpdateSchemaIdParams, UpdateSchemaIdResult, TrustedServer, GetUserTrustedServersParams, EncryptedUploadParams, UnencryptedUploadParams, EncryptFileOptions, EncryptFileResult, DecryptFileOptions, UploadFileWithPermissionsParams, AddFilePermissionParams, DecryptFileWithPermissionOptions } from "../types/index";
4
- import type { TransactionResult } from "../types/operations";
5
5
  import type { ControllerContext } from "./permissions";
6
6
  import { BaseController } from "./base";
7
+ import type { ConsistencyOptions, PaginationOptions } from "../types/options";
7
8
  import { type DataSchema } from "../utils/schemaValidation";
8
9
  /**
9
- * Manages encrypted user data files and their blockchain registration on the Vana network.
10
+ * Manages encrypted user data files and blockchain registration on the Vana network.
10
11
  *
11
12
  * @remarks
12
- * This controller handles the complete file lifecycle from encrypted upload to
13
- * blockchain registration and decryption. It provides methods for querying user files,
14
- * uploading new encrypted content, managing file schemas, and handling permissions for
15
- * secure data sharing. All operations respect the user's privacy through client-side
16
- * encryption before any data leaves the user's device.
13
+ * The DataController provides comprehensive file lifecycle management from encrypted upload
14
+ * through blockchain registration to decryption. Client-side encryption ensures data privacy
15
+ * before transmission. The controller integrates with multiple storage providers (IPFS, Pinata,
16
+ * Google Drive) and supports both gasless transactions via relayers and direct blockchain interaction.
17
17
  *
18
- * The controller integrates with multiple storage providers (IPFS, Pinata, Google Drive)
19
- * and supports both gasless transactions via relayers and direct blockchain interaction.
20
- * File metadata and access permissions are stored on the Vana blockchain while encrypted
21
- * file content is stored on decentralized storage networks.
18
+ * **Architecture:**
19
+ * Files use dual storage: encrypted content on decentralized storage (IPFS/Pinata/Google Drive),
20
+ * metadata and permissions on blockchain. This design minimizes on-chain data while maintaining
21
+ * decentralization and access control.
22
22
  *
23
23
  * **Method Selection:**
24
- * - `upload()` handles encryption, storage, and blockchain registration automatically
25
- * - `getUserFiles()` queries existing file metadata from blockchain and subgraph
26
- * - `decryptFile()` decrypts files for which you have access permissions
27
- * - `getFileById()` retrieves specific file metadata when you have the file ID
24
+ * - `upload()` - Complete workflow: encryption, storage, blockchain registration
25
+ * - `getUserFiles()` - Query file metadata from blockchain/subgraph
26
+ * - `decryptFile()` - Decrypt files you have permission to access
27
+ * - `getFileById()` - Retrieve specific file metadata by ID
28
28
  *
29
29
  * **Storage Requirements:**
30
- * Methods requiring storage configuration: `upload()`
31
- * Methods working without storage: `getUserFiles()`, `decryptFile()`, `getFileById()`
30
+ * - Methods requiring storage: `upload()`, `encryptFile()`
31
+ * - Methods working without storage: `getUserFiles()`, `decryptFile()`, `getFileById()`
32
+ *
33
+ * **Permission Model:**
34
+ * - File permissions (decryption access) are handled during upload
35
+ * - Operation permissions (what can be done with data) use `vana.permissions.grant()`
36
+ *
32
37
  * @example
33
38
  * ```typescript
34
- * // Upload an encrypted file with automatic schema validation
39
+ * // Upload encrypted file with schema validation
35
40
  * const result = await vana.data.upload({
36
- * content: "My personal data",
37
- * filename: "personal-data.json"
41
+ * content: { name: "Alice", age: 30 },
42
+ * filename: "profile.json",
43
+ * schemaId: 1
38
44
  * });
45
+ * console.log(`File uploaded: ID ${result.fileId}, URL ${result.url}`);
39
46
  *
40
- * // Query files owned by a user
47
+ * // Query user's files
41
48
  * const files = await vana.data.getUserFiles({
42
- * owner: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
49
+ * owner: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36"
43
50
  * });
51
+ * files.forEach(file => console.log(`File ${file.id}: ${file.url}`));
44
52
  *
45
- * // Decrypt accessible file content
53
+ * // Decrypt accessible file
46
54
  * const decryptedData = await vana.data.decryptFile(files[0]);
55
+ * console.log("Decrypted content:", decryptedData);
47
56
  * ```
57
+ *
48
58
  * @category Data Management
49
- * @see {@link https://docs.vana.com/developer/data-registry | Vana Data Registry Documentation} for conceptual overview
59
+ * @see For conceptual overview, visit {@link https://docs.vana.org/docs/data-registry}
50
60
  */
51
61
  export declare class DataController extends BaseController {
52
62
  constructor(context: ControllerContext);
53
63
  /**
54
- * Uploads user data with automatic encryption and blockchain registration.
64
+ * Uploads data with automatic encryption and blockchain registration.
55
65
  *
56
66
  * @remarks
57
- * This is the primary method for uploading user data to the Vana network. It handles
58
- * the complete workflow including content normalization, schema validation, encryption,
59
- * storage upload, file permission granting, and blockchain registration.
60
- *
61
- * The method automatically:
62
- * - Normalizes input content to a Blob
63
- * - Validates data against schema if provided
64
- * - Generates encryption keys and encrypts the data
65
- * - Uploads to the configured storage provider
66
- * - Grants file decryption permissions to specified accounts
67
- * - Registers the file on the blockchain
67
+ * Primary method for uploading data to Vana. Handles complete workflow:
68
+ * content normalization, schema validation, encryption, storage upload,
69
+ * permission granting, and blockchain registration.
70
+ *
71
+ * **Automatic Processing:**
72
+ * - Normalizes content to Blob format
73
+ * - Validates against schema if provided
74
+ * - Generates encryption keys
75
+ * - Uploads to configured storage
76
+ * - Grants decryption permissions
77
+ * - Registers on blockchain
68
78
  *
69
79
  * **TypeScript Overloads:**
70
- * This method has three overloads to ensure type safety:
71
- * 1. `EncryptedUploadParams` - When `encrypt: true` (default), permissions require publicKey
72
- * 2. `UnencryptedUploadParams` - When `encrypt: false`, permissions are optional
73
- * 3. `UploadParams` - General signature for runtime determination
74
- *
75
- * IMPORTANT: The permissions parameter only grants decryption access to the file.
76
- * To grant operation permissions (like "llm_inference"), use vana.permissions.grant()
77
- * after uploading. This separation ensures clear distinction between:
78
- * - File permissions: Who can decrypt and read the encrypted file (handled here)
79
- * - Operation permissions: What operations can be performed on the data (handled separately)
80
- *
81
- * @param params - Upload parameters including content, filename, schema, and permissions
82
- * @param params.permissions - Optional array of file permissions for granting decryption access
83
- * @param params.schemaId - Optional schema ID for data validation. Get available schemas from `vana.schemas.list()`.
84
- * @param params.owner - Optional owner address if uploading on behalf of another user (requires delegation).
85
- * @returns Promise resolving to upload results with file ID and transaction hash
86
- * @throws {Error} When storage manager is not configured - "Storage manager not configured. Please provide storage providers in VanaConfig."
87
- * @throws {Error} When no wallet addresses available - "No addresses available in wallet client"
88
- * @throws {Error} When chain ID is not available - "Chain ID not available"
89
- * @throws {Error} When relay callback doesn't support required features - "The configured relay callback does not support schemas or permissions"
90
- * @throws {Error} When schema fetch fails - "Failed to fetch schema definition: {status}"
91
- * @throws {SchemaValidationError} When data doesn't match schema - includes specific validation errors
92
- * @throws {Error} General upload failures - "Upload failed: {specific error message}"
80
+ * - `EncryptedUploadParams`: When `encrypt: true` (default), permissions require `publicKey`
81
+ * - `UnencryptedUploadParams`: When `encrypt: false`, permissions optional
82
+ * - `UploadParams`: General signature for runtime determination
83
+ *
84
+ * **Permission Separation:**
85
+ * - File permissions (here): Decryption access only
86
+ * - Operation permissions: Use `vana.permissions.grant()` separately
87
+ *
88
+ * **Owner/Encryption Constraint:**
89
+ * When encryption is enabled (default), the `owner` parameter must match
90
+ * the connected wallet address. This ensures only the wallet that performs
91
+ * encryption can decrypt the file. For delegation scenarios where the owner
92
+ * differs from the connected wallet, set `encrypt: false`.
93
+ *
94
+ * @param params - Upload configuration object
95
+ * @param params.content - Data to upload (string, object, or Blob)
96
+ * @param params.filename - Name for the uploaded file
97
+ * @param params.permissions - Decryption access grants.
98
+ * Each requires `account` and `publicKey` for encryption.
99
+ * @param params.schemaId - Schema for validation.
100
+ * Obtain via `vana.schemas.list()`.
101
+ * @param params.owner - Owner address for blockchain registration.
102
+ * Must match connected wallet when encryption is enabled.
103
+ * For delegation scenarios, disable encryption with `encrypt: false`.
104
+ * Defaults to connected wallet address.
105
+ * @param params.encrypt - Enable encryption (default: `true`)
106
+ * @param params.providerName - Storage provider override
107
+ *
108
+ * @returns Upload result with file ID, URL, and transaction hash
109
+ *
110
+ * @throws {InvalidConfigurationError} When encryption is enabled and owner differs from wallet.
111
+ * Set `encrypt: false` for delegation scenarios, or omit `owner` to use connected wallet.
112
+ * @throws {Error} Storage not configured.
113
+ * Configure storage providers in `VanaConfig`.
114
+ * @throws {Error} No wallet addresses available.
115
+ * Ensure wallet is connected.
116
+ * @throws {SchemaValidationError} Data doesn't match schema.
117
+ * Verify data structure matches schema from `vana.schemas.get(schemaId)`.
118
+ * @throws {Error} Upload failed with specific error message.
119
+ *
93
120
  * @example
94
121
  * ```typescript
95
122
  * // Basic file upload
@@ -131,15 +158,12 @@ export declare class DataController extends BaseController {
131
158
  * encrypt: false
132
159
  * } as const); // 'as const' ensures TypeScript infers encrypt: false literally
133
160
  *
134
- * // Upload on behalf of another user (delegation)
161
+ * // Upload on behalf of another user (delegation without encryption)
135
162
  * const result = await vana.data.upload({
136
163
  * content: "User's data",
137
164
  * filename: "delegated.txt",
138
- * owner: "0x5678...", // Different from connected wallet
139
- * permissions: [{
140
- * account: "0x1234...", // Address that can decrypt
141
- * publicKey: "0x04..." // Their public key for encryption
142
- * }]
165
+ * owner: "0x5678...", // Different from connected wallet
166
+ * encrypt: false // Required when owner differs from wallet
143
167
  * });
144
168
  * ```
145
169
  */
@@ -192,35 +216,33 @@ export declare class DataController extends BaseController {
192
216
  */
193
217
  encryptFile(data: Blob | string | object, options?: EncryptFileOptions): Promise<EncryptFileResult>;
194
218
  /**
195
- * Decrypts a file owned by the user using their wallet signature.
219
+ * Decrypts a file using wallet-derived decryption key.
196
220
  *
197
221
  * @remarks
198
- * This is the high-level convenience method for decrypting user files, serving as the
199
- * symmetrical counterpart to the `upload` method. It handles the complete decryption
200
- * workflow including key generation, URL protocol detection, content fetching, and
201
- * decryption.
222
+ * Counterpart to `upload()` for decrypting user files. Automatically
223
+ * generates decryption key from wallet, fetches encrypted content,
224
+ * and decrypts. Supports IPFS (with gateway fallback) and HTTP URLs.
225
+ *
226
+ * @param file - UserFile object from `getUserFiles()`
227
+ * @param options - Decryption options
228
+ * @param options.seed - Custom encryption seed.
229
+ * Defaults to standard Vana seed.
230
+ *
231
+ * @returns Decrypted content as Blob
232
+ *
233
+ * @throws {Error} No wallet connected.
234
+ * Connect wallet before decrypting.
235
+ * @throws {Error} Network error accessing file.
236
+ * Check CORS settings or server availability.
237
+ * @throws {Error} File not found (404).
238
+ * File no longer available at stored URL.
239
+ * @throws {Error} Access denied (403).
240
+ * No permission to access file.
241
+ * @throws {Error} Invalid file format.
242
+ * File not encrypted with Vana protocol.
243
+ * @throws {Error} Wrong encryption key.
244
+ * Verify seed matches upload or use default.
202
245
  *
203
- * The method automatically:
204
- * - Generates the decryption key from the user's wallet signature
205
- * - Determines the appropriate fetch method based on the file URL protocol
206
- * - Fetches the encrypted content from IPFS or standard HTTP URLs
207
- * - Decrypts the content using the generated key
208
- *
209
- * For IPFS URLs, the method uses gateway fallback for improved reliability. For
210
- * standard HTTP URLs, it uses a simple fetch. If you need custom authentication
211
- * headers or specific gateway configurations, use the low-level primitives directly.
212
- *
213
- * @param file - The user file to decrypt (typically from getUserFiles)
214
- * @param encryptionSeed - Optional custom encryption seed (defaults to Vana standard)
215
- * @returns Promise resolving to the decrypted file content as a Blob
216
- * @throws {Error} "No addresses available in wallet client" - When wallet is not connected
217
- * @throws {Error} "Network error: Cannot access the file URL" - When file URL is inaccessible (CORS, server down)
218
- * @throws {Error} "File not found: The encrypted file is no longer available" - When file returns 404
219
- * @throws {Error} "Access denied" - When file returns 403 (no permission)
220
- * @throws {Error} "File is empty or could not be retrieved" - When file has no content
221
- * @throws {Error} "Invalid file format: This file doesn't appear to be encrypted with the Vana protocol" - When file is not properly encrypted
222
- * @throws {Error} "Wrong encryption key" - When decryption fails due to incorrect key/seed
223
- * @throws {Error} "Failed to decrypt file: {error}" - General decryption failures
224
246
  * @example
225
247
  * ```typescript
226
248
  * // Basic file decryption
@@ -248,42 +270,45 @@ export declare class DataController extends BaseController {
248
270
  */
249
271
  decryptFile(file: UserFile, options?: DecryptFileOptions): Promise<Blob>;
250
272
  /**
251
- * Retrieves all data files owned by a specific user address.
273
+ * Retrieves all files owned by a specific user address.
252
274
  *
253
275
  * @remarks
254
- * This method queries the Vana subgraph to find files directly owned by the user.
255
- * It efficiently handles large datasets by using the File entity's owner field
256
- * and returns complete file metadata without additional contract calls.
257
- *
258
- * **Deduplication Behavior:**
259
- * The method automatically deduplicates files by ID, keeping only the latest version
260
- * (highest timestamp) when duplicate file IDs are found. This handles cases where
261
- * the subgraph may contain multiple entries for the same file due to re-indexing
262
- * or blockchain reorganizations.
263
- * @param params - The query parameters object
264
- * @param params.owner - The wallet address of the file owner to query
265
- * @param params.subgraphUrl - Optional subgraph URL to override the default endpoint
266
- * @returns A Promise that resolves to an array of UserFile objects with metadata, sorted by latest timestamp first
267
- * @throws {Error} When subgraphUrl is not provided and not configured - "subgraphUrl is required"
268
- * @throws {Error} When subgraph request fails - "Subgraph request failed: {status} {statusText}"
269
- * @throws {Error} When subgraph returns errors - "Subgraph errors: {error messages}"
270
- * @throws {Error} When JSON parsing fails - "Failed to fetch user files from subgraph: {error}"
276
+ * Queries the Vana subgraph for files owned by the specified address.
277
+ * Automatically deduplicates by file ID, keeping the latest version
278
+ * when duplicates exist from re-indexing or chain reorganizations.
279
+ * Enriches results with DLP proof data when available.
280
+ *
281
+ * @param params - Query configuration
282
+ * @param params.owner - Wallet address of the file owner
283
+ * @param params.subgraphUrl - Subgraph endpoint override.
284
+ * Defaults to context configuration.
285
+ *
286
+ * @returns Array of UserFile objects sorted by timestamp (newest first)
287
+ *
288
+ * @throws {Error} Subgraph URL not configured.
289
+ * Provide `subgraphUrl` parameter or configure in Vana constructor.
290
+ * @throws {Error} Subgraph request failed.
291
+ * Check network connectivity and subgraph availability.
292
+ * @throws {Error} Subgraph returned errors.
293
+ * Review query parameters and subgraph logs.
294
+ *
271
295
  * @example
272
296
  * ```typescript
273
- * // Query files for a specific user
274
297
  * const files = await vana.data.getUserFiles({
275
- * owner: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
298
+ * owner: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36"
276
299
  * });
277
300
  *
278
301
  * files.forEach(file => {
279
- * console.log(`File ${file.id}: ${file.url} (Schema: ${file.schemaId})`);
302
+ * console.log(`File ${file.id}: ${file.url}`);
303
+ * console.log(` Schema: ${file.schemaId}`);
304
+ * console.log(` DLPs: ${file.dlpIds?.join(", ") || "none"}`);
280
305
  * });
281
306
  * ```
282
307
  */
283
308
  getUserFiles(params: {
284
309
  owner: Address;
285
310
  subgraphUrl?: string;
286
- }): Promise<UserFile[]>;
311
+ }, options?: ConsistencyOptions & PaginationOptions): Promise<UserFile[]>;
287
312
  /**
288
313
  * Fetches proof data for multiple files from the subgraph.
289
314
  *
@@ -324,6 +349,8 @@ export declare class DataController extends BaseController {
324
349
  */
325
350
  getDLP(dlpId: number, options?: {
326
351
  subgraphUrl?: string;
352
+ minBlock?: number;
353
+ waitForSync?: number;
327
354
  }): Promise<{
328
355
  id: number;
329
356
  name: string;
@@ -384,7 +411,7 @@ export declare class DataController extends BaseController {
384
411
  getUserPermissions(params: {
385
412
  user: Address;
386
413
  subgraphUrl?: string;
387
- }): Promise<Array<{
414
+ }, options?: ConsistencyOptions & PaginationOptions): Promise<Array<{
388
415
  id: string;
389
416
  grant: string;
390
417
  nonce: bigint;
@@ -447,7 +474,7 @@ export declare class DataController extends BaseController {
447
474
  * });
448
475
  * ```
449
476
  */
450
- getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
477
+ getUserTrustedServers(params: GetUserTrustedServersParams, options?: ConsistencyOptions & PaginationOptions): Promise<TrustedServer[]>;
451
478
  /**
452
479
  * Internal method: Query trusted servers via subgraph
453
480
  *
@@ -468,48 +495,56 @@ export declare class DataController extends BaseController {
468
495
  */
469
496
  private _getUserTrustedServersViaRpc;
470
497
  /**
471
- * Gets the total number of files in the registry from the contract.
498
+ * Retrieves total file count from Data Registry.
499
+ *
500
+ * @remarks
501
+ * Queries blockchain for complete file count across all users.
502
+ * Useful for pagination and network statistics.
503
+ *
504
+ * @returns Total number of registered files
505
+ *
506
+ * @throws {Error} Chain ID not available.
507
+ * Ensure network connection.
508
+ * @throws {Error} Contract read failed.
509
+ * Check RPC availability.
472
510
  *
473
- * @returns Promise resolving to the total file count
474
511
  * @example
475
512
  * ```typescript
476
- * const totalFiles = await vana.data.getTotalFilesCount();
477
- * console.log(`Total files in registry: ${totalFiles}`);
513
+ * const total = await vana.data.getTotalFilesCount();
514
+ * console.log(`Total files: ${total}`);
478
515
  *
479
- * // Use for pagination calculations
480
- * const filesPerPage = 20;
481
- * const totalPages = Math.ceil(totalFiles / filesPerPage);
482
- * console.log(`Total pages: ${totalPages}`);
516
+ * // Calculate pagination
517
+ * const pages = Math.ceil(total / 20);
483
518
  * ```
484
519
  */
485
520
  getTotalFilesCount(): Promise<number>;
486
521
  /**
487
- * Retrieves details for a specific file by its ID.
522
+ * Retrieves file metadata by ID from the blockchain.
523
+ *
524
+ * @remarks
525
+ * Queries DataRegistry contract directly for file details.
526
+ * Works for any file ID regardless of ownership, enabling
527
+ * cross-user file discovery and verification.
528
+ *
529
+ * @param fileId - Numeric file ID to retrieve
530
+ *
531
+ * @returns UserFile object with metadata
532
+ *
533
+ * @throws {Error} Chain ID not available.
534
+ * Ensure proper network connection.
535
+ * @throws {Error} File not found.
536
+ * Verify file ID exists on-chain.
537
+ * @throws {Error} Contract call failed.
538
+ * Check network and RPC availability.
488
539
  *
489
- * @param fileId - The file ID to look up
490
- * @returns Promise resolving to UserFile object
491
- * @throws {Error} "Chain ID not available" - When wallet chain is not configured
492
- * @throws {Error} "File not found" - When file ID doesn't exist or returns empty data
493
- * @throws {Error} "Failed to fetch file {fileId}: {error}" - General contract read failures
494
540
  * @example
495
541
  * ```typescript
496
- * try {
497
- * const file = await vana.data.getFileById(123);
498
- * console.log('File details:', {
499
- * id: file.id,
500
- * url: file.url,
501
- * owner: file.ownerAddress,
502
- * addedAt: file.addedAtBlock
503
- * });
504
- * } catch (error) {
505
- * console.error('File not found or error retrieving file:', error);
506
- * }
542
+ * const file = await vana.data.getFileById(123);
543
+ * console.log(`File ${file.id}:`);
544
+ * console.log(` URL: ${file.url}`);
545
+ * console.log(` Owner: ${file.ownerAddress}`);
546
+ * console.log(` Block: ${file.addedAtBlock}`);
507
547
  * ```
508
- *
509
- * This method queries the DataRegistry contract directly
510
- * to get file details for any file ID, regardless of user ownership.
511
- * This is useful for file lookup functionality where users can search
512
- * for specific files by ID.
513
548
  */
514
549
  getFileById(fileId: number): Promise<UserFile>;
515
550
  /**
@@ -535,7 +570,7 @@ export declare class DataController extends BaseController {
535
570
  * console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
536
571
  * ```
537
572
  */
538
- registerFileWithSchema(url: string, schemaId: number): Promise<TransactionResult<"DataRegistry", "addFileWithSchema">>;
573
+ registerFileWithSchema(url: string, schemaId: number, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithSchema">>;
539
574
  /**
540
575
  * Gets the user's address from the wallet client.
541
576
  *
@@ -561,7 +596,7 @@ export declare class DataController extends BaseController {
561
596
  addFileWithPermissions(url: string, ownerAddress: Address, permissions?: Array<{
562
597
  account: Address;
563
598
  key: string;
564
- }>): Promise<TransactionResult<"DataRegistry", "addFileWithPermissions">>;
599
+ }>, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithPermissions">>;
565
600
  /**
566
601
  * Adds a file to the registry with permissions and schema.
567
602
  * This combines the functionality of addFileWithPermissions and schema validation.
@@ -604,7 +639,7 @@ export declare class DataController extends BaseController {
604
639
  addFileWithPermissionsAndSchema(url: string, ownerAddress: Address, permissions?: Array<{
605
640
  account: Address;
606
641
  publicKey: string;
607
- }>, schemaId?: number): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
642
+ }>, schemaId?: number, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
608
643
  /**
609
644
  * Adds a file with pre-encrypted permissions and schema to the DataRegistry.
610
645
  *
@@ -646,76 +681,89 @@ export declare class DataController extends BaseController {
646
681
  addFileWithEncryptedPermissionsAndSchema(url: string, ownerAddress: Address, permissions?: Array<{
647
682
  account: Address;
648
683
  key: string;
649
- }>, schemaId?: number): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
684
+ }>, schemaId?: number, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
650
685
  /**
651
- * Adds a new refiner to the DataRefinerRegistry.
686
+ * Registers a data refiner for processing templates.
652
687
  *
653
688
  * @remarks
654
- * Refiners are data processing templates that define how raw data should be
655
- * transformed into structured formats. Each refiner is associated with a DLP
656
- * (Data Liquidity Pool), has a specific schema for output, and includes
657
- * instructions for the refinement process.
658
- *
659
- * @param params - Refiner configuration parameters
660
- * @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
661
- * @param params.name - Human-readable name for the refiner
662
- * @param params.schemaId - Schema ID that defines the output format
663
- * @param params.refinementInstructionUrl - URL containing processing instructions
664
- * @returns Promise resolving to the new refiner ID and transaction hash
665
- * @throws {Error} When chain ID is not available - "Chain ID not available"
666
- * @throws {Error} When transaction fails - "Failed to add refiner: {error}"
689
+ * Refiners define data transformation rules for DLPs.
690
+ * Associates schema, instructions, and processing logic.
691
+ *
692
+ * @param params - Refiner configuration
693
+ * @param params.dlpId - Data Liquidity Pool ID
694
+ * @param params.name - Refiner display name
695
+ * @param params.schemaId - Output schema ID.
696
+ * Obtain via `vana.schemas.list()`.
697
+ * @param params.refinementInstructionUrl - Processing instructions URL
698
+ *
699
+ * @returns Refiner ID and transaction hash
700
+ *
701
+ * @throws {Error} Chain ID not available.
702
+ * Ensure network connection.
703
+ * @throws {Error} Transaction failed.
704
+ * Check wallet balance and network status.
705
+ *
667
706
  * @example
668
707
  * ```typescript
669
708
  * const result = await vana.data.addRefiner({
670
709
  * dlpId: 1,
671
- * name: "Social Media Sentiment Analyzer",
710
+ * name: "Sentiment Analyzer",
672
711
  * schemaId: 42,
673
712
  * refinementInstructionUrl: "ipfs://QmXxx..."
674
713
  * });
675
- * console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
714
+ * console.log(`Refiner ${result.refinerId} created`);
676
715
  * ```
677
716
  */
678
- addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
717
+ addRefiner(params: AddRefinerParams, options?: TransactionOptions): Promise<AddRefinerResult>;
679
718
  /**
680
- * Retrieves a refiner by its ID.
719
+ * Retrieves refiner configuration by ID.
681
720
  *
682
721
  * @remarks
683
- * Queries the DataRefinerRegistry contract to get complete information about
684
- * a specific refiner including its DLP association, schema, and instructions.
722
+ * Queries DataRefinerRegistry for refiner details.
723
+ * Returns DLP association, schema, and processing instructions.
724
+ *
725
+ * @param refinerId - Numeric refiner ID
726
+ *
727
+ * @returns Refiner configuration object
728
+ *
729
+ * @throws {Error} Chain ID not available.
730
+ * Ensure network connection.
731
+ * @throws {Error} Refiner not found.
732
+ * Verify refiner ID exists.
733
+ * @throws {Error} Contract read failed.
734
+ * Check network and RPC status.
685
735
  *
686
- * @param refinerId - The numeric refiner ID to retrieve
687
- * @returns Promise resolving to the refiner information object
688
- * @throws {Error} When chain ID is not available - "Chain ID not available"
689
- * @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
690
- * @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
691
736
  * @example
692
737
  * ```typescript
693
738
  * const refiner = await vana.data.getRefiner(1);
694
- * console.log({
695
- * name: refiner.name,
696
- * dlp: refiner.dlpId,
697
- * schema: refiner.schemaId,
698
- * instructions: refiner.refinementInstructionUrl
699
- * });
739
+ * console.log(`Refiner: ${refiner.name}`);
740
+ * console.log(`DLP: ${refiner.dlpId}`);
741
+ * console.log(`Schema: ${refiner.schemaId}`);
700
742
  * ```
701
743
  */
702
744
  getRefiner(refinerId: number): Promise<Refiner>;
703
745
  /**
704
- * Validates if a schema ID exists in the registry.
746
+ * Validates schema ID existence.
705
747
  *
706
748
  * @remarks
707
- * Checks the DataRefinerRegistry contract to determine if a given schema ID
708
- * has been registered and is available for use.
749
+ * Verifies schema registration in DataRegistry.
750
+ * Check before using schemas for uploads.
751
+ *
752
+ * @param schemaId - Numeric schema ID to validate
753
+ *
754
+ * @returns True if schema exists, false otherwise
755
+ *
756
+ * @throws {Error} Chain ID not available.
757
+ * Ensure network connection.
758
+ * @throws {Error} Contract read failed.
759
+ * Check RPC availability.
709
760
  *
710
- * @param schemaId - The numeric schema ID to validate
711
- * @returns Promise resolving to true if schema exists, false otherwise
712
761
  * @example
713
762
  * ```typescript
714
- * const isValid = await vana.data.isValidSchemaId(42);
715
- * if (isValid) {
716
- * console.log('Schema 42 is available for use');
717
- * } else {
718
- * console.log('Schema 42 does not exist');
763
+ * const valid = await vana.data.isValidSchemaId(42);
764
+ * if (valid) {
765
+ * // Safe to use schema 42
766
+ * await vana.data.upload({ schemaId: 42, ... });
719
767
  * }
720
768
  * ```
721
769
  */
@@ -757,7 +805,7 @@ export declare class DataController extends BaseController {
757
805
  * console.log(`Schema updated in tx ${result.transactionHash}`);
758
806
  * ```
759
807
  */
760
- updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
808
+ updateSchemaId(params: UpdateSchemaIdParams, options?: TransactionOptions): Promise<UpdateSchemaIdResult>;
761
809
  /**
762
810
  * Uploads an encrypted file and grants permission to a party with a public key.
763
811
  *
@@ -814,7 +862,7 @@ export declare class DataController extends BaseController {
814
862
  * console.log(`Transaction: ${result.transactionHash}`);
815
863
  * ```
816
864
  */
817
- addPermissionToFile(params: AddFilePermissionParams): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
865
+ addPermissionToFile(params: AddFilePermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
818
866
  /**
819
867
  * Submits a file permission transaction to the blockchain.
820
868
  *
@@ -843,7 +891,7 @@ export declare class DataController extends BaseController {
843
891
  * console.log(`Permission granted with ID: ${result.permissionId}`);
844
892
  * ```
845
893
  */
846
- submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
894
+ submitFilePermission(fileId: number, account: Address, publicKey: string, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
847
895
  /**
848
896
  * Gets the encrypted key for a specific account's permission to access a file.
849
897
  *
@@ -1011,4 +1059,9 @@ export declare class DataController extends BaseController {
1011
1059
  * ```
1012
1060
  */
1013
1061
  fetchAndValidateSchema(url: string): Promise<DataSchema>;
1062
+ /**
1063
+ * Polls for confirmation of a relayer operation.
1064
+ * @internal
1065
+ */
1066
+ private pollRelayerForConfirmation;
1014
1067
  }