@opendatalabs/vana-sdk 0.1.0-alpha.d7fc764 → 0.1.0-alpha.dc68f39

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 (667) hide show
  1. package/dist/__tests__/waitForTransactionEvents.test.d.ts +1 -0
  2. package/dist/browser.d.ts +4 -2
  3. package/dist/chains/definitions.cjs +9 -6
  4. package/dist/chains/definitions.cjs.map +1 -1
  5. package/dist/chains/definitions.d.ts +9 -11
  6. package/dist/chains/definitions.js +9 -6
  7. package/dist/chains/definitions.js.map +1 -1
  8. package/dist/chains/index.d.ts +5 -2
  9. package/dist/chains.browser.d.ts +8 -2
  10. package/dist/chains.d.ts +8 -2
  11. package/dist/chains.node.d.ts +8 -2
  12. package/dist/config/addresses.d.ts +8 -24
  13. package/dist/config/chains.d.ts +9 -13
  14. package/dist/config/default-services.cjs +60 -0
  15. package/dist/config/default-services.cjs.map +1 -0
  16. package/dist/config/default-services.d.ts +46 -0
  17. package/dist/config/default-services.js +33 -0
  18. package/dist/config/default-services.js.map +1 -0
  19. package/dist/config/default-services.test.d.ts +1 -0
  20. package/dist/config/features.d.ts +1 -3
  21. package/dist/config/tests/addresses.test.d.ts +1 -0
  22. package/dist/contracts/contractController.cjs +3 -3
  23. package/dist/contracts/contractController.cjs.map +1 -1
  24. package/dist/contracts/contractController.d.ts +11 -28
  25. package/dist/contracts/contractController.js +4 -7
  26. package/dist/contracts/contractController.js.map +1 -1
  27. package/dist/contracts/tests/contractController.test.d.ts +1 -0
  28. package/dist/controllers/__tests__/schemas-edge-cases.test.d.ts +1 -0
  29. package/dist/controllers/base.cjs +83 -0
  30. package/dist/controllers/base.cjs.map +1 -0
  31. package/dist/controllers/base.d.ts +84 -0
  32. package/dist/controllers/base.js +59 -0
  33. package/dist/controllers/base.js.map +1 -0
  34. package/dist/controllers/data-error-handling.test.d.ts +1 -0
  35. package/dist/controllers/data.cjs +415 -172
  36. package/dist/controllers/data.cjs.map +1 -1
  37. package/dist/controllers/data.d.ts +149 -76
  38. package/dist/controllers/data.js +415 -172
  39. package/dist/controllers/data.js.map +1 -1
  40. package/dist/controllers/permissions.cjs +508 -257
  41. package/dist/controllers/permissions.cjs.map +1 -1
  42. package/dist/controllers/permissions.d.ts +1348 -25
  43. package/dist/controllers/permissions.js +508 -257
  44. package/dist/controllers/permissions.js.map +1 -1
  45. package/dist/controllers/protocol.cjs +15 -11
  46. package/dist/controllers/protocol.cjs.map +1 -1
  47. package/dist/controllers/protocol.d.ts +7 -35
  48. package/dist/controllers/protocol.js +15 -14
  49. package/dist/controllers/protocol.js.map +1 -1
  50. package/dist/controllers/schemas.cjs +69 -54
  51. package/dist/controllers/schemas.cjs.map +1 -1
  52. package/dist/controllers/schemas.d.ts +9 -36
  53. package/dist/controllers/schemas.js +69 -54
  54. package/dist/controllers/schemas.js.map +1 -1
  55. package/dist/controllers/server-additional.test.d.ts +1 -0
  56. package/dist/controllers/server.cjs +15 -10
  57. package/dist/controllers/server.cjs.map +1 -1
  58. package/dist/controllers/server.d.ts +7 -33
  59. package/dist/controllers/server.js +15 -10
  60. package/dist/controllers/server.js.map +1 -1
  61. package/dist/core/apiClient.cjs +15 -12
  62. package/dist/core/apiClient.cjs.map +1 -1
  63. package/dist/core/apiClient.d.ts +5 -9
  64. package/dist/core/apiClient.js +19 -19
  65. package/dist/core/apiClient.js.map +1 -1
  66. package/dist/core/client.cjs +7 -7
  67. package/dist/core/client.cjs.map +1 -1
  68. package/dist/core/client.d.ts +6 -9
  69. package/dist/core/client.js +7 -7
  70. package/dist/core/client.js.map +1 -1
  71. package/dist/core/core.test.d.ts +1 -0
  72. package/dist/core/generics.cjs +11 -9
  73. package/dist/core/generics.cjs.map +1 -1
  74. package/dist/core/generics.d.ts +9 -13
  75. package/dist/core/generics.js +22 -29
  76. package/dist/core/generics.js.map +1 -1
  77. package/dist/core/tests/apiClient.test.d.ts +1 -0
  78. package/dist/core/tests/client.test.d.ts +1 -0
  79. package/dist/core/tests/generics.test.d.ts +1 -0
  80. package/dist/core.cjs +114 -48
  81. package/dist/core.cjs.map +1 -1
  82. package/dist/core.d.ts +40 -65
  83. package/dist/core.js +127 -74
  84. package/dist/core.js.map +1 -1
  85. package/dist/crypto/ecies/__tests__/base.test.d.ts +4 -0
  86. package/dist/crypto/ecies/__tests__/compatibility.test.d.ts +8 -0
  87. package/dist/crypto/ecies/__tests__/constants.test.d.ts +4 -0
  88. package/dist/crypto/ecies/__tests__/native-parity.test.d.ts +7 -0
  89. package/dist/crypto/ecies/__tests__/normalization.test.d.ts +1 -0
  90. package/dist/crypto/ecies/__tests__/test-vectors.d.ts +2 -4
  91. package/dist/crypto/ecies/base.cjs +4 -3
  92. package/dist/crypto/ecies/base.cjs.map +1 -1
  93. package/dist/crypto/ecies/base.d.ts +2 -5
  94. package/dist/crypto/ecies/base.js +12 -15
  95. package/dist/crypto/ecies/base.js.map +1 -1
  96. package/dist/crypto/ecies/browser.cjs +2 -1
  97. package/dist/crypto/ecies/browser.cjs.map +1 -1
  98. package/dist/crypto/ecies/browser.d.ts +2 -7
  99. package/dist/crypto/ecies/browser.js +2 -1
  100. package/dist/crypto/ecies/browser.js.map +1 -1
  101. package/dist/crypto/ecies/constants.d.ts +7 -9
  102. package/dist/crypto/ecies/index.d.ts +8 -1
  103. package/dist/crypto/ecies/interface.cjs +4 -5
  104. package/dist/crypto/ecies/interface.cjs.map +1 -1
  105. package/dist/crypto/ecies/interface.d.ts +9 -11
  106. package/dist/crypto/ecies/interface.js +4 -5
  107. package/dist/crypto/ecies/interface.js.map +1 -1
  108. package/dist/crypto/ecies/node.cjs +3 -2
  109. package/dist/crypto/ecies/node.cjs.map +1 -1
  110. package/dist/crypto/ecies/node.d.ts +2 -7
  111. package/dist/crypto/ecies/node.js +11 -16
  112. package/dist/crypto/ecies/node.js.map +1 -1
  113. package/dist/crypto/ecies/test-vectors/eccrypto-vectors.json +72 -0
  114. package/dist/crypto/ecies/utils.cjs +2 -41
  115. package/dist/crypto/ecies/utils.cjs.map +1 -1
  116. package/dist/crypto/ecies/utils.d.ts +3 -40
  117. package/dist/crypto/ecies/utils.js +1 -35
  118. package/dist/crypto/ecies/utils.js.map +1 -1
  119. package/dist/crypto/services/WalletKeyEncryptionService.cjs +2 -2
  120. package/dist/crypto/services/WalletKeyEncryptionService.cjs.map +1 -1
  121. package/dist/crypto/services/WalletKeyEncryptionService.d.ts +3 -7
  122. package/dist/crypto/services/WalletKeyEncryptionService.js +5 -9
  123. package/dist/crypto/services/WalletKeyEncryptionService.js.map +1 -1
  124. package/dist/crypto/services/WalletKeyEncryptionService.test.d.ts +1 -0
  125. package/dist/diagnostics.d.ts +1 -3
  126. package/dist/diagnostics.test.d.ts +1 -0
  127. package/dist/errors.cjs +16 -0
  128. package/dist/errors.cjs.map +1 -1
  129. package/dist/errors.d.ts +53 -15
  130. package/dist/errors.js +18 -6
  131. package/dist/errors.js.map +1 -1
  132. package/dist/generated/abi/ComputeEngineImplementation.d.ts +2 -3
  133. package/dist/generated/abi/ComputeInstructionRegistryImplementation.d.ts +2 -3
  134. package/dist/generated/abi/DATFactoryImplementation.d.ts +2 -3
  135. package/dist/generated/abi/DATImplementation.d.ts +2 -3
  136. package/dist/generated/abi/DATPausableImplementation.d.ts +2 -3
  137. package/dist/generated/abi/DATVotesImplementation.d.ts +2 -3
  138. package/dist/generated/abi/DLPPerformanceImplementation.d.ts +2 -3
  139. package/dist/generated/abi/DLPRegistryImplementation.d.ts +2 -3
  140. package/dist/generated/abi/DLPRegistryTreasuryImplementation.d.ts +2 -3
  141. package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +2 -3
  142. package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.ts +2 -3
  143. package/dist/generated/abi/DLPRewardSwapImplementation.d.ts +2 -3
  144. package/dist/generated/abi/DLPRootImplementation.d.ts +1 -3
  145. package/dist/generated/abi/DLPTreasuryImplementation.d.ts +2 -3
  146. package/dist/generated/abi/DataLiquidityPoolImplementation.d.ts +1 -3
  147. package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +2 -3
  148. package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +2 -3
  149. package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +2 -3
  150. package/dist/generated/abi/DataRefinerRegistryImplementation.d.ts +2 -3
  151. package/dist/generated/abi/DataRegistryImplementation.cjs +13 -0
  152. package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -1
  153. package/dist/generated/abi/DataRegistryImplementation.d.ts +12 -3
  154. package/dist/generated/abi/DataRegistryImplementation.js +13 -0
  155. package/dist/generated/abi/DataRegistryImplementation.js.map +1 -1
  156. package/dist/generated/abi/QueryEngineImplementation.d.ts +2 -3
  157. package/dist/generated/abi/SwapHelperImplementation.d.ts +2 -3
  158. package/dist/generated/abi/TeePoolDedicatedGpuImplementation.d.ts +2 -3
  159. package/dist/generated/abi/TeePoolDedicatedStandardImplementation.d.ts +2 -3
  160. package/dist/generated/abi/TeePoolEphemeralStandardImplementation.d.ts +2 -3
  161. package/dist/generated/abi/TeePoolImplementation.d.ts +2 -3
  162. package/dist/generated/abi/TeePoolPersistentGpuImplementation.d.ts +2 -3
  163. package/dist/generated/abi/TeePoolPersistentStandardImplementation.d.ts +2 -3
  164. package/dist/generated/abi/TeePoolPhalaImplementation.d.ts +2 -3
  165. package/dist/generated/abi/VanaEpochImplementation.d.ts +2 -3
  166. package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +2 -3
  167. package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +2 -3
  168. package/dist/generated/abi/VanaPoolTreasuryImplementation.d.ts +2 -3
  169. package/dist/generated/abi/index.cjs +42 -0
  170. package/dist/generated/abi/index.cjs.map +1 -1
  171. package/dist/generated/abi/index.d.ts +47 -18
  172. package/dist/generated/abi/index.js +21 -0
  173. package/dist/generated/abi/index.js.map +1 -1
  174. package/dist/generated/event-types.cjs +17 -0
  175. package/dist/generated/event-types.cjs.map +1 -0
  176. package/dist/generated/event-types.d.ts +854 -0
  177. package/dist/generated/event-types.js +1 -0
  178. package/dist/generated/event-types.js.map +1 -0
  179. package/dist/generated/eventRegistry.cjs +3351 -0
  180. package/dist/generated/eventRegistry.cjs.map +1 -0
  181. package/dist/generated/eventRegistry.d.ts +14 -0
  182. package/dist/generated/eventRegistry.js +3326 -0
  183. package/dist/generated/eventRegistry.js.map +1 -0
  184. package/dist/generated/server/server-exports.d.ts +19 -21
  185. package/dist/generated/server/server.cjs.map +1 -1
  186. package/dist/generated/server/server.d.ts +113 -87
  187. package/dist/generated/subgraph.d.ts +329 -332
  188. package/dist/index.browser.d.ts +48 -73
  189. package/dist/index.browser.js +12 -0
  190. package/dist/index.browser.js.map +1 -1
  191. package/dist/index.cjs +3 -1
  192. package/dist/index.cjs.map +1 -1
  193. package/dist/index.d.ts +0 -2
  194. package/dist/index.js +3 -1
  195. package/dist/index.js.map +1 -1
  196. package/dist/index.node.cjs +9 -0
  197. package/dist/index.node.cjs.map +1 -1
  198. package/dist/index.node.d.ts +181 -64
  199. package/dist/index.node.js +10 -0
  200. package/dist/index.node.js.map +1 -1
  201. package/dist/node.d.ts +4 -2
  202. package/dist/platform/browser-only.d.ts +5 -8
  203. package/dist/platform/browser-only.test.d.ts +1 -0
  204. package/dist/platform/browser-safe.d.ts +6 -9
  205. package/dist/platform/browser-safe.test.d.ts +1 -0
  206. package/dist/platform/browser.cjs +7 -6
  207. package/dist/platform/browser.cjs.map +1 -1
  208. package/dist/platform/browser.d.ts +3 -6
  209. package/dist/platform/browser.js +19 -27
  210. package/dist/platform/browser.js.map +1 -1
  211. package/dist/platform/browser.test.d.ts +1 -0
  212. package/dist/platform/index.d.ts +11 -5
  213. package/dist/platform/interface.d.ts +6 -8
  214. package/dist/platform/node.d.ts +3 -7
  215. package/dist/platform/node.js +12 -19
  216. package/dist/platform/node.js.map +1 -1
  217. package/dist/platform/ports/openpgp-port.cjs +74 -0
  218. package/dist/platform/ports/openpgp-port.cjs.map +1 -0
  219. package/dist/platform/ports/openpgp-port.d.ts +13 -0
  220. package/dist/platform/ports/openpgp-port.js +59 -0
  221. package/dist/platform/ports/openpgp-port.js.map +1 -0
  222. package/dist/platform/ports/pgp-port.cjs +17 -0
  223. package/dist/platform/ports/pgp-port.cjs.map +1 -0
  224. package/dist/platform/ports/pgp-port.d.ts +35 -0
  225. package/dist/platform/ports/pgp-port.js +1 -0
  226. package/dist/platform/ports/pgp-port.js.map +1 -0
  227. package/dist/platform/shared/error-utils.d.ts +2 -4
  228. package/dist/platform/shared/pgp-utils.cjs +2 -2
  229. package/dist/platform/shared/pgp-utils.cjs.map +1 -1
  230. package/dist/platform/shared/pgp-utils.d.ts +3 -5
  231. package/dist/platform/shared/pgp-utils.js +2 -2
  232. package/dist/platform/shared/pgp-utils.js.map +1 -1
  233. package/dist/platform/shared/stream-utils.d.ts +1 -3
  234. package/dist/platform/utils.d.ts +6 -10
  235. package/dist/platform/utils.test.d.ts +1 -0
  236. package/dist/platform.browser.d.ts +9 -4
  237. package/dist/platform.d.ts +11 -5
  238. package/dist/platform.node.d.ts +10 -5
  239. package/dist/schemas/dataSchema.schema.json +53 -0
  240. package/dist/schemas/grantFile.schema.json +43 -0
  241. package/dist/server/handler.cjs.map +1 -1
  242. package/dist/server/handler.d.ts +8 -203
  243. package/dist/server/handler.js.map +1 -1
  244. package/dist/storage/index.d.ts +56 -10
  245. package/dist/storage/manager.cjs +6 -6
  246. package/dist/storage/manager.cjs.map +1 -1
  247. package/dist/storage/manager.d.ts +2 -5
  248. package/dist/storage/manager.js +5 -12
  249. package/dist/storage/manager.js.map +1 -1
  250. package/dist/storage/providers/callback-storage.cjs +3 -3
  251. package/dist/storage/providers/callback-storage.cjs.map +1 -1
  252. package/dist/storage/providers/callback-storage.d.ts +3 -9
  253. package/dist/storage/providers/callback-storage.js +3 -3
  254. package/dist/storage/providers/callback-storage.js.map +1 -1
  255. package/dist/storage/providers/google-drive.cjs +2 -2
  256. package/dist/storage/providers/google-drive.cjs.map +1 -1
  257. package/dist/storage/providers/google-drive.d.ts +3 -7
  258. package/dist/storage/providers/google-drive.js +4 -7
  259. package/dist/storage/providers/google-drive.js.map +1 -1
  260. package/dist/storage/providers/google-drive.test.d.ts +1 -0
  261. package/dist/storage/providers/ipfs.cjs +5 -5
  262. package/dist/storage/providers/ipfs.cjs.map +1 -1
  263. package/dist/storage/providers/ipfs.d.ts +3 -6
  264. package/dist/storage/providers/ipfs.js +7 -10
  265. package/dist/storage/providers/ipfs.js.map +1 -1
  266. package/dist/storage/providers/pinata.cjs +6 -6
  267. package/dist/storage/providers/pinata.cjs.map +1 -1
  268. package/dist/storage/providers/pinata.d.ts +5 -8
  269. package/dist/storage/providers/pinata.js +8 -11
  270. package/dist/storage/providers/pinata.js.map +1 -1
  271. package/dist/storage/tests/callbackStorage.test.d.ts +1 -0
  272. package/dist/storage/tests/googleDriveStorage.test.d.ts +1 -0
  273. package/dist/storage/tests/ipfsStorage.test.d.ts +1 -0
  274. package/dist/storage/tests/pinataStorage.test.d.ts +1 -0
  275. package/dist/storage/tests/storageManager.test.d.ts +1 -0
  276. package/dist/tests/abi.test.d.ts +1 -0
  277. package/dist/tests/chains-definitions.test.d.ts +1 -0
  278. package/dist/tests/core-encryption.test.d.ts +1 -0
  279. package/dist/tests/core-extended.test.d.ts +1 -0
  280. package/dist/tests/core-generics-coverage.test.d.ts +1 -0
  281. package/dist/tests/coverage-boost.test.d.ts +1 -0
  282. package/dist/tests/crypto-cross-platform-compatibility.test.d.ts +1 -0
  283. package/dist/tests/data-addfile-permissions-schema.test.d.ts +1 -0
  284. package/dist/tests/data-additional-methods.test.d.ts +1 -0
  285. package/dist/tests/data-controller-edge-cases.test.d.ts +1 -0
  286. package/dist/tests/data-ipfs-gateways.test.d.ts +1 -0
  287. package/dist/tests/data-relayer.test.d.ts +1 -0
  288. package/dist/tests/data-schema-validation.test.d.ts +1 -0
  289. package/dist/tests/data-simple-methods.test.d.ts +1 -0
  290. package/dist/tests/data.test.d.ts +1 -0
  291. package/dist/tests/demo-integration.test.d.ts +1 -0
  292. package/dist/tests/demo-trusted-server-integration.test.d.ts +1 -0
  293. package/dist/tests/download-relayer.test.d.ts +1 -0
  294. package/dist/tests/dual-mode-permissions.test.d.ts +1 -0
  295. package/dist/tests/dual-mode-trusted-servers.test.d.ts +1 -0
  296. package/dist/tests/encryption-correct-implementation.test.d.ts +1 -0
  297. package/dist/tests/encryption-coverage.test.d.ts +1 -0
  298. package/dist/tests/encryption-edge-cases.test.d.ts +1 -0
  299. package/dist/tests/encryption-utils-updated.test.d.ts +1 -0
  300. package/dist/tests/errors-coverage.test.d.ts +1 -0
  301. package/dist/tests/errors.test.d.ts +1 -0
  302. package/dist/tests/factories/mockFactory.d.ts +316 -0
  303. package/dist/tests/fakes/FakeStorageManager.d.ts +200 -0
  304. package/dist/tests/fakes/FakeStorageManager.test.d.ts +1 -0
  305. package/dist/tests/fakes/FakeWaitForTransactionEvents.d.ts +170 -0
  306. package/dist/tests/fakes/FakeWaitForTransactionEvents.test.d.ts +1 -0
  307. package/dist/tests/fakes/fake-pgp-port.d.ts +13 -0
  308. package/dist/tests/grantValidation-edge-cases.test.d.ts +1 -0
  309. package/dist/tests/grantValidation-unreachable-branch.test.d.ts +1 -0
  310. package/dist/tests/helper-methods.test.d.ts +1 -0
  311. package/dist/tests/helpers/platformTestHelpers.d.ts +106 -0
  312. package/dist/tests/helpers/typedMocks.d.ts +64 -0
  313. package/dist/tests/index-browser.test.d.ts +1 -0
  314. package/dist/tests/index-node.test.d.ts +1 -0
  315. package/dist/tests/index.test.d.ts +1 -0
  316. package/dist/tests/mocks/platformAdapter.d.ts +12 -0
  317. package/dist/tests/new-permissions-methods.test.d.ts +1 -0
  318. package/dist/tests/no-buffer-browser.test.d.ts +1 -0
  319. package/dist/tests/permissions-grantee.test.d.ts +1 -0
  320. package/dist/tests/permissions-schema-validation.test.d.ts +1 -0
  321. package/dist/tests/permissions-server-files.test.d.ts +1 -0
  322. package/dist/tests/permissions-transaction-options.test.d.ts +1 -0
  323. package/dist/tests/permissions-trust-servers.test.d.ts +1 -0
  324. package/dist/tests/permissions.test.d.ts +1 -0
  325. package/dist/tests/personal.test.d.ts +1 -0
  326. package/dist/tests/platform-browser.test.d.ts +1 -0
  327. package/dist/tests/platform-crypto-expanded.test.d.ts +1 -0
  328. package/dist/tests/platform-crypto.test.d.ts +1 -0
  329. package/dist/tests/platform-index.test.d.ts +1 -0
  330. package/dist/tests/platform-node.test.d.ts +1 -0
  331. package/dist/tests/platform-shared-utils.test.d.ts +1 -0
  332. package/dist/tests/platform-updated.test.d.ts +1 -0
  333. package/dist/tests/protocol-additional-methods.test.d.ts +1 -0
  334. package/dist/tests/protocol.test.d.ts +1 -0
  335. package/dist/tests/read-only-mode.test.d.ts +1 -0
  336. package/dist/tests/schemas.test.d.ts +1 -0
  337. package/dist/tests/server-handler.test.d.ts +1 -0
  338. package/dist/tests/setup.d.ts +7 -0
  339. package/dist/tests/signatureFormatter.test.d.ts +1 -0
  340. package/dist/tests/trusted-server-queries.test.d.ts +1 -0
  341. package/dist/tests/typedDataConverter.test.d.ts +1 -0
  342. package/dist/tests/types-contracts.test.d.ts +1 -0
  343. package/dist/tests/types-data.test.d.ts +1 -0
  344. package/dist/tests/types-external-apis.test.d.ts +1 -0
  345. package/dist/tests/types-generics.test.d.ts +1 -0
  346. package/dist/tests/types-permissions.test.d.ts +1 -0
  347. package/dist/tests/types-upload-params.test.d.ts +1 -0
  348. package/dist/tests/types.test.d.ts +1 -0
  349. package/dist/tests/utils-formatters.test.d.ts +1 -0
  350. package/dist/tests/utils-grantFiles-edge-cases.test.d.ts +1 -0
  351. package/dist/tests/utils-grantFiles-validation.test.d.ts +1 -0
  352. package/dist/tests/utils-grantFiles.test.d.ts +1 -0
  353. package/dist/tests/utils-grantValidation-consolidated.test.d.ts +1 -0
  354. package/dist/tests/utils-grants.test.d.ts +1 -0
  355. package/dist/tests/utils-ipfs-additional.test.d.ts +1 -0
  356. package/dist/tests/utils-ipfs.test.d.ts +4 -0
  357. package/dist/tests/utils-schemaValidation.test.d.ts +1 -0
  358. package/dist/tests/vana.test.d.ts +1 -0
  359. package/dist/tests/wallet-crypto-compatibility.test.d.ts +1 -0
  360. package/dist/types/blockchain.cjs +17 -0
  361. package/dist/types/blockchain.cjs.map +1 -0
  362. package/dist/types/blockchain.d.ts +57 -0
  363. package/dist/types/blockchain.js +1 -0
  364. package/dist/types/blockchain.js.map +1 -0
  365. package/dist/types/chains-additional.test.d.ts +1 -0
  366. package/dist/types/chains.d.ts +6 -9
  367. package/dist/types/config.cjs +10 -0
  368. package/dist/types/config.cjs.map +1 -1
  369. package/dist/types/config.d.ts +161 -54
  370. package/dist/types/config.js +8 -0
  371. package/dist/types/config.js.map +1 -1
  372. package/dist/types/contracts.cjs.map +1 -1
  373. package/dist/types/contracts.d.ts +8 -11
  374. package/dist/types/controller-context.cjs +17 -0
  375. package/dist/types/controller-context.cjs.map +1 -0
  376. package/dist/types/controller-context.d.ts +64 -0
  377. package/dist/types/controller-context.js +1 -0
  378. package/dist/types/controller-context.js.map +1 -0
  379. package/dist/types/data.cjs.map +1 -1
  380. package/dist/types/data.d.ts +107 -39
  381. package/dist/types/external-apis.d.ts +10 -12
  382. package/dist/types/generics.d.ts +35 -38
  383. package/dist/types/index.cjs +5 -4
  384. package/dist/types/index.cjs.map +1 -1
  385. package/dist/types/index.d.ts +20 -34
  386. package/dist/types/index.js +9 -2
  387. package/dist/types/index.js.map +1 -1
  388. package/dist/types/operations.cjs +2 -2
  389. package/dist/types/operations.cjs.map +1 -1
  390. package/dist/types/operations.d.ts +32 -28
  391. package/dist/types/operations.js +2 -2
  392. package/dist/types/operations.js.map +1 -1
  393. package/dist/types/permissions.d.ts +55 -58
  394. package/dist/types/personal.cjs.map +1 -1
  395. package/dist/types/personal.d.ts +6 -8
  396. package/dist/types/relayer.d.ts +15 -18
  397. package/dist/types/storage.d.ts +6 -8
  398. package/dist/types/storage.js +2 -5
  399. package/dist/types/storage.js.map +1 -1
  400. package/dist/types/transactionResults.cjs.map +1 -1
  401. package/dist/types/transactionResults.d.ts +193 -25
  402. package/dist/types/utils.cjs.map +1 -1
  403. package/dist/types/utils.d.ts +26 -25
  404. package/dist/types.d.ts +4 -40
  405. package/dist/utils/__tests__/parseTransaction.test.d.ts +1 -0
  406. package/dist/utils/__tests__/pojo-serialization.test.d.ts +1 -0
  407. package/dist/utils/__tests__/signatureCache.test.d.ts +1 -0
  408. package/dist/utils/__tests__/transaction-edge-cases.test.d.ts +1 -0
  409. package/dist/utils/__tests__/transactionHelpers.test.d.ts +1 -0
  410. package/dist/utils/__tests__/urlResolver.test.d.ts +4 -0
  411. package/dist/utils/blockchain/registry.cjs +2 -2
  412. package/dist/utils/blockchain/registry.cjs.map +1 -1
  413. package/dist/utils/blockchain/registry.d.ts +6 -8
  414. package/dist/utils/blockchain/registry.js +2 -2
  415. package/dist/utils/blockchain/registry.js.map +1 -1
  416. package/dist/utils/blockchain/registry.test.d.ts +1 -0
  417. package/dist/utils/crypto-utils.cjs +0 -12
  418. package/dist/utils/crypto-utils.cjs.map +1 -1
  419. package/dist/utils/crypto-utils.d.ts +9 -27
  420. package/dist/utils/crypto-utils.js +0 -11
  421. package/dist/utils/crypto-utils.js.map +1 -1
  422. package/dist/utils/crypto-utils.test.d.ts +1 -0
  423. package/dist/utils/download.cjs +3 -3
  424. package/dist/utils/download.cjs.map +1 -1
  425. package/dist/utils/download.d.ts +13 -14
  426. package/dist/utils/download.js +2 -2
  427. package/dist/utils/download.js.map +1 -1
  428. package/dist/utils/encoding.cjs +1 -1
  429. package/dist/utils/encoding.cjs.map +1 -1
  430. package/dist/utils/encoding.d.ts +4 -6
  431. package/dist/utils/encoding.js +1 -1
  432. package/dist/utils/encoding.js.map +1 -1
  433. package/dist/utils/encoding.test.d.ts +1 -0
  434. package/dist/utils/encryption.cjs +16 -10
  435. package/dist/utils/encryption.cjs.map +1 -1
  436. package/dist/utils/encryption.d.ts +13 -17
  437. package/dist/utils/encryption.js +16 -10
  438. package/dist/utils/encryption.js.map +1 -1
  439. package/dist/utils/formatters.cjs +4 -2
  440. package/dist/utils/formatters.cjs.map +1 -1
  441. package/dist/utils/formatters.d.ts +4 -6
  442. package/dist/utils/formatters.js +4 -2
  443. package/dist/utils/formatters.js.map +1 -1
  444. package/dist/utils/grantFiles.cjs +7 -4
  445. package/dist/utils/grantFiles.cjs.map +1 -1
  446. package/dist/utils/grantFiles.d.ts +6 -10
  447. package/dist/utils/grantFiles.js +7 -4
  448. package/dist/utils/grantFiles.js.map +1 -1
  449. package/dist/utils/grantValidation.cjs +1 -1
  450. package/dist/utils/grantValidation.cjs.map +1 -1
  451. package/dist/utils/grantValidation.d.ts +14 -17
  452. package/dist/utils/grantValidation.js +1 -1
  453. package/dist/utils/grantValidation.js.map +1 -1
  454. package/dist/utils/grants.cjs +1 -1
  455. package/dist/utils/grants.cjs.map +1 -1
  456. package/dist/utils/grants.d.ts +10 -13
  457. package/dist/utils/grants.js +1 -1
  458. package/dist/utils/grants.js.map +1 -1
  459. package/dist/utils/ipfs.d.ts +8 -10
  460. package/dist/utils/lazy-import.cjs +4 -6
  461. package/dist/utils/lazy-import.cjs.map +1 -1
  462. package/dist/utils/lazy-import.d.ts +1 -3
  463. package/dist/utils/lazy-import.js +4 -6
  464. package/dist/utils/lazy-import.js.map +1 -1
  465. package/dist/utils/multicall.cjs +4 -2
  466. package/dist/utils/multicall.cjs.map +1 -1
  467. package/dist/utils/multicall.d.ts +5 -8
  468. package/dist/utils/multicall.js +4 -2
  469. package/dist/utils/multicall.js.map +1 -1
  470. package/dist/utils/parseTransactionPojo.cjs +87 -0
  471. package/dist/utils/parseTransactionPojo.cjs.map +1 -0
  472. package/dist/utils/parseTransactionPojo.d.ts +31 -0
  473. package/dist/utils/parseTransactionPojo.js +63 -0
  474. package/dist/utils/parseTransactionPojo.js.map +1 -0
  475. package/dist/utils/schemaValidation.cjs +5 -5
  476. package/dist/utils/schemaValidation.cjs.map +1 -1
  477. package/dist/utils/schemaValidation.d.ts +8 -12
  478. package/dist/utils/schemaValidation.js +7 -10
  479. package/dist/utils/schemaValidation.js.map +1 -1
  480. package/dist/utils/signatureCache.cjs +1 -2
  481. package/dist/utils/signatureCache.cjs.map +1 -1
  482. package/dist/utils/signatureCache.d.ts +4 -7
  483. package/dist/utils/signatureCache.js +4 -8
  484. package/dist/utils/signatureCache.js.map +1 -1
  485. package/dist/utils/signatureFormatter.cjs +6 -9
  486. package/dist/utils/signatureFormatter.cjs.map +1 -1
  487. package/dist/utils/signatureFormatter.d.ts +2 -5
  488. package/dist/utils/signatureFormatter.js +6 -9
  489. package/dist/utils/signatureFormatter.js.map +1 -1
  490. package/dist/utils/tests/multicall.test.d.ts +1 -0
  491. package/dist/utils/transactionHelpers.cjs +54 -0
  492. package/dist/utils/transactionHelpers.cjs.map +1 -0
  493. package/dist/utils/transactionHelpers.d.ts +80 -0
  494. package/dist/utils/transactionHelpers.js +29 -0
  495. package/dist/utils/transactionHelpers.js.map +1 -0
  496. package/dist/utils/typeGuards.cjs +109 -0
  497. package/dist/utils/typeGuards.cjs.map +1 -0
  498. package/dist/utils/typeGuards.d.ts +138 -0
  499. package/dist/utils/typeGuards.js +74 -0
  500. package/dist/utils/typeGuards.js.map +1 -0
  501. package/dist/utils/typedDataConverter.d.ts +3 -6
  502. package/dist/utils/urlResolver.cjs +1 -1
  503. package/dist/utils/urlResolver.cjs.map +1 -1
  504. package/dist/utils/urlResolver.d.ts +2 -4
  505. package/dist/utils/urlResolver.js +2 -2
  506. package/dist/utils/urlResolver.js.map +1 -1
  507. package/dist/utils/wallet.cjs +62 -0
  508. package/dist/utils/wallet.cjs.map +1 -0
  509. package/dist/utils/wallet.d.ts +32 -0
  510. package/dist/utils/wallet.js +36 -0
  511. package/dist/utils/wallet.js.map +1 -0
  512. package/dist/{chains.browser.cjs → utils/withEvents.cjs} +22 -15
  513. package/dist/utils/withEvents.cjs.map +1 -0
  514. package/dist/utils/withEvents.d.ts +56 -0
  515. package/dist/utils/withEvents.js +18 -0
  516. package/dist/utils/withEvents.js.map +1 -0
  517. package/package.json +23 -13
  518. package/dist/browser.d.cts +0 -2
  519. package/dist/chains/definitions.d.cts +0 -53
  520. package/dist/chains/index.d.cts +0 -2
  521. package/dist/chains.browser.cjs.map +0 -1
  522. package/dist/chains.browser.d.cts +0 -2
  523. package/dist/chains.d.cts +0 -2
  524. package/dist/chains.node.d.cts +0 -2
  525. package/dist/config/addresses.d.cts +0 -380
  526. package/dist/config/chains.d.cts +0 -85
  527. package/dist/config/eventMappings.cjs +0 -114
  528. package/dist/config/eventMappings.cjs.map +0 -1
  529. package/dist/config/eventMappings.d.cts +0 -108
  530. package/dist/config/eventMappings.d.ts +0 -108
  531. package/dist/config/eventMappings.js +0 -90
  532. package/dist/config/eventMappings.js.map +0 -1
  533. package/dist/config/features.d.cts +0 -64
  534. package/dist/contracts/contractController.d.cts +0 -96
  535. package/dist/controllers/data.d.cts +0 -941
  536. package/dist/controllers/permissions.d.cts +0 -25
  537. package/dist/controllers/protocol.d.cts +0 -167
  538. package/dist/controllers/schemas.d.cts +0 -272
  539. package/dist/controllers/server.d.cts +0 -243
  540. package/dist/core/apiClient.d.cts +0 -165
  541. package/dist/core/client.d.cts +0 -92
  542. package/dist/core/generics.d.cts +0 -120
  543. package/dist/core.d.cts +0 -466
  544. package/dist/crypto/ecies/__tests__/test-vectors.d.cts +0 -40
  545. package/dist/crypto/ecies/base.d.cts +0 -143
  546. package/dist/crypto/ecies/browser.d.cts +0 -48
  547. package/dist/crypto/ecies/constants.d.cts +0 -122
  548. package/dist/crypto/ecies/index.d.cts +0 -1
  549. package/dist/crypto/ecies/interface.d.cts +0 -176
  550. package/dist/crypto/ecies/node.d.cts +0 -50
  551. package/dist/crypto/ecies/utils.d.cts +0 -67
  552. package/dist/crypto/services/WalletKeyEncryptionService.d.cts +0 -92
  553. package/dist/diagnostics.d.cts +0 -26
  554. package/dist/errors.d.cts +0 -350
  555. package/dist/generated/abi/ComputeEngineImplementation.d.cts +0 -996
  556. package/dist/generated/abi/ComputeInstructionRegistryImplementation.d.cts +0 -545
  557. package/dist/generated/abi/DATFactoryImplementation.d.cts +0 -661
  558. package/dist/generated/abi/DATImplementation.d.cts +0 -693
  559. package/dist/generated/abi/DATPausableImplementation.d.cts +0 -1145
  560. package/dist/generated/abi/DATVotesImplementation.d.cts +0 -1095
  561. package/dist/generated/abi/DLPPerformanceImplementation.d.cts +0 -883
  562. package/dist/generated/abi/DLPRegistryImplementation.d.cts +0 -1123
  563. package/dist/generated/abi/DLPRegistryTreasuryImplementation.d.cts +0 -452
  564. package/dist/generated/abi/DLPRewardDeployerImplementation.d.cts +0 -714
  565. package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.cts +0 -452
  566. package/dist/generated/abi/DLPRewardSwapImplementation.d.cts +0 -706
  567. package/dist/generated/abi/DLPRootImplementation.d.cts +0 -1248
  568. package/dist/generated/abi/DLPTreasuryImplementation.d.cts +0 -452
  569. package/dist/generated/abi/DataLiquidityPoolImplementation.d.cts +0 -737
  570. package/dist/generated/abi/DataPortabilityGranteesImplementation.d.cts +0 -661
  571. package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.cts +0 -989
  572. package/dist/generated/abi/DataPortabilityServersImplementation.d.cts +0 -1086
  573. package/dist/generated/abi/DataRefinerRegistryImplementation.d.cts +0 -737
  574. package/dist/generated/abi/DataRegistryImplementation.d.cts +0 -1004
  575. package/dist/generated/abi/QueryEngineImplementation.d.cts +0 -1001
  576. package/dist/generated/abi/SwapHelperImplementation.d.cts +0 -764
  577. package/dist/generated/abi/TeePoolDedicatedGpuImplementation.d.cts +0 -701
  578. package/dist/generated/abi/TeePoolDedicatedStandardImplementation.d.cts +0 -701
  579. package/dist/generated/abi/TeePoolEphemeralStandardImplementation.d.cts +0 -701
  580. package/dist/generated/abi/TeePoolImplementation.d.cts +0 -993
  581. package/dist/generated/abi/TeePoolPersistentGpuImplementation.d.cts +0 -701
  582. package/dist/generated/abi/TeePoolPersistentStandardImplementation.d.cts +0 -701
  583. package/dist/generated/abi/TeePoolPhalaImplementation.d.cts +0 -993
  584. package/dist/generated/abi/VanaEpochImplementation.d.cts +0 -900
  585. package/dist/generated/abi/VanaPoolEntityImplementation.d.cts +0 -934
  586. package/dist/generated/abi/VanaPoolStakingImplementation.d.cts +0 -693
  587. package/dist/generated/abi/VanaPoolTreasuryImplementation.d.cts +0 -394
  588. package/dist/generated/abi/index.d.cts +0 -26516
  589. package/dist/generated/server/server-exports.d.cts +0 -21
  590. package/dist/generated/server/server.d.cts +0 -512
  591. package/dist/generated/subgraph.d.cts +0 -5981
  592. package/dist/index.browser.cjs +0 -151
  593. package/dist/index.browser.cjs.map +0 -1
  594. package/dist/index.browser.d.cts +0 -177
  595. package/dist/index.d.cts +0 -2
  596. package/dist/index.node.d.cts +0 -64
  597. package/dist/node.d.cts +0 -2
  598. package/dist/permissions-DNKPu_G0.d.cts +0 -1666
  599. package/dist/permissions-eo8YeLGf.d.ts +0 -1666
  600. package/dist/platform/browser-only.d.cts +0 -25
  601. package/dist/platform/browser-safe.d.cts +0 -32
  602. package/dist/platform/browser.d.cts +0 -74
  603. package/dist/platform/index.d.cts +0 -5
  604. package/dist/platform/interface.d.cts +0 -218
  605. package/dist/platform/node.d.cts +0 -27
  606. package/dist/platform/shared/error-utils.d.cts +0 -25
  607. package/dist/platform/shared/pgp-utils.d.cts +0 -61
  608. package/dist/platform/shared/stream-utils.d.cts +0 -16
  609. package/dist/platform/utils.d.cts +0 -53
  610. package/dist/platform.browser.cjs +0 -41
  611. package/dist/platform.browser.cjs.map +0 -1
  612. package/dist/platform.browser.d.cts +0 -4
  613. package/dist/platform.d.cts +0 -5
  614. package/dist/platform.node.d.cts +0 -5
  615. package/dist/server/handler.d.cts +0 -282
  616. package/dist/storage/index.d.cts +0 -10
  617. package/dist/storage/manager.d.cts +0 -150
  618. package/dist/storage/providers/callback-storage.d.cts +0 -100
  619. package/dist/storage/providers/google-drive.d.cts +0 -156
  620. package/dist/storage/providers/ipfs.d.cts +0 -163
  621. package/dist/storage/providers/pinata.d.cts +0 -173
  622. package/dist/types/chains.d.cts +0 -34
  623. package/dist/types/config.d.cts +0 -726
  624. package/dist/types/contracts.d.cts +0 -68
  625. package/dist/types/data.d.cts +0 -694
  626. package/dist/types/eccrypto-js.d.d.cts +0 -13
  627. package/dist/types/eccrypto-js.d.d.ts +0 -13
  628. package/dist/types/external-apis.d.cts +0 -186
  629. package/dist/types/generics.d.cts +0 -450
  630. package/dist/types/index.d.cts +0 -34
  631. package/dist/types/operations.d.cts +0 -108
  632. package/dist/types/permissions.d.cts +0 -957
  633. package/dist/types/personal.d.cts +0 -40
  634. package/dist/types/relayer.d.cts +0 -284
  635. package/dist/types/storage.d.cts +0 -131
  636. package/dist/types/transactionResults.d.cts +0 -25
  637. package/dist/types/utils.d.cts +0 -819
  638. package/dist/types.d.cts +0 -66
  639. package/dist/utils/blockchain/registry.d.cts +0 -34
  640. package/dist/utils/crypto-utils.d.cts +0 -118
  641. package/dist/utils/download.d.cts +0 -41
  642. package/dist/utils/encoding.d.cts +0 -54
  643. package/dist/utils/encryption.d.cts +0 -275
  644. package/dist/utils/eventParsing.cjs +0 -111
  645. package/dist/utils/eventParsing.cjs.map +0 -1
  646. package/dist/utils/eventParsing.d.cts +0 -60
  647. package/dist/utils/eventParsing.d.ts +0 -60
  648. package/dist/utils/eventParsing.js +0 -86
  649. package/dist/utils/eventParsing.js.map +0 -1
  650. package/dist/utils/formatters.d.cts +0 -120
  651. package/dist/utils/grantFiles.d.cts +0 -186
  652. package/dist/utils/grantValidation.d.cts +0 -150
  653. package/dist/utils/grants.d.cts +0 -70
  654. package/dist/utils/ipfs.d.cts +0 -90
  655. package/dist/utils/lazy-import.d.cts +0 -20
  656. package/dist/utils/multicall.d.cts +0 -129
  657. package/dist/utils/schemaValidation.d.cts +0 -172
  658. package/dist/utils/signatureCache.d.cts +0 -134
  659. package/dist/utils/signatureFormatter.d.cts +0 -39
  660. package/dist/utils/transactionParsing.cjs +0 -84
  661. package/dist/utils/transactionParsing.cjs.map +0 -1
  662. package/dist/utils/transactionParsing.d.cts +0 -25
  663. package/dist/utils/transactionParsing.d.ts +0 -25
  664. package/dist/utils/transactionParsing.js +0 -62
  665. package/dist/utils/transactionParsing.js.map +0 -1
  666. package/dist/utils/typedDataConverter.d.cts +0 -13
  667. package/dist/utils/urlResolver.d.cts +0 -40
@@ -1,25 +1,1348 @@
1
- import '../types/operations.js';
2
- import 'viem';
3
- import '../types/config.js';
4
- export { C as ControllerContext, P as PermissionsController } from '../permissions-eo8YeLGf.js';
5
- import '../types/permissions.js';
6
- import '../storage/manager.js';
7
- import '../platform/interface.js';
8
- import '../generated/server/server-exports.js';
9
- import '../generated/server/server.js';
10
- import '../types/chains.js';
11
- import '../types/storage.js';
12
- import '../config/eventMappings.js';
13
- import '../generated/abi/index.js';
14
- import '../generated/abi/DataPortabilityPermissionsImplementation.js';
15
- import '../generated/abi/DataPortabilityServersImplementation.js';
16
- import '../generated/abi/DataPortabilityGranteesImplementation.js';
17
- import '../generated/abi/VanaEpochImplementation.js';
18
- import '../generated/abi/DLPRegistryImplementation.js';
19
- import '../generated/abi/DLPTreasuryImplementation.js';
20
- import '../generated/abi/DLPRewardDeployerTreasuryImplementation.js';
21
- import '../generated/abi/DLPPerformanceImplementation.js';
22
- import '../generated/abi/DLPRewardDeployerImplementation.js';
23
- import '../generated/abi/DLPRootImplementation.js';
24
- import '../generated/abi/DataLiquidityPoolImplementation.js';
25
- import '../generated/abi/DLPRegistryTreasuryImplementation.js';
1
+ import type { Address, Hash } from "viem";
2
+ import type { GrantPermissionParams, RevokePermissionParams, PermissionGrantTypedData, GenericTypedData, OnChainPermissionGrant, GetUserPermissionsOptions, AddAndTrustServerParams, TrustServerParams, UntrustServerParams, AddAndTrustServerTypedData, TrustServerTypedData, TrustedServerInfo, PaginatedTrustedServers, TrustedServerQueryOptions, BatchServerInfoResult, ServerTrustStatus, GrantFile, Grantee, GranteeInfo, RegisterGranteeParams, RegisterGranteeTypedData, GranteeQueryOptions, PaginatedGrantees, ServerInfo, ServerFilesAndPermissionParams, ServerFilesAndPermissionTypedData, TransactionOptions } from "../types/index";
3
+ import type { PermissionGrantResult, PermissionRevokeResult, ServerTrustResult } from "../types/transactionResults";
4
+ import type { TransactionResult } from "../types/operations";
5
+ import type { PermissionInfo } from "../types/permissions";
6
+ /**
7
+ * Provides shared configuration and services for all SDK controllers.
8
+ *
9
+ * @remarks
10
+ * This interface defines the foundational blockchain and storage services that all
11
+ * controllers require for operation. The main Vana SDK class automatically creates
12
+ * this context during initialization and passes it to each controller. It includes
13
+ * wallet clients for transaction signing, storage managers for file operations,
14
+ * and platform adapters for environment-specific functionality.
15
+ * @category Configuration
16
+ */
17
+ import type { ControllerContext } from "../types/controller-context";
18
+ import { BaseController } from "./base";
19
+ export type { ControllerContext };
20
+ /**
21
+ * Manages gasless data access permissions and trusted server registry operations.
22
+ *
23
+ * @remarks
24
+ * This controller enables users to grant applications access to their data without
25
+ * paying gas fees. It handles the complete EIP-712 permission flow including signature
26
+ * creation, IPFS storage of permission details, and gasless transaction submission.
27
+ * The controller also manages trusted servers that can process user data and provides
28
+ * methods for revoking permissions when access is no longer needed.
29
+ *
30
+ * **Permission Architecture:**
31
+ * Permissions use dual storage: detailed parameters stored on IPFS, references stored on blockchain.
32
+ * This enables complex permissions while maintaining minimal on-chain data.
33
+ *
34
+ * **Method Selection:**
35
+ * - `grant()` creates new permissions with automatic IPFS upload and blockchain registration
36
+ * - `prepareGrant()` allows preview before signing for interactive applications
37
+ * - `revoke()` removes permissions by ID, supporting both gasless and direct transactions
38
+ * - `getUserPermissionGrantsOnChain()` queries existing permissions efficiently
39
+ * - `trustServer()` and `untrustServer()` manage server access for data processing
40
+ *
41
+ * **Transaction Types:**
42
+ * Methods with gasless support: `grant()`, `revoke()`, `trustServer()`, `untrustServer()`
43
+ * Methods requiring direct transactions: none (all support both gasless and direct)
44
+ * @example
45
+ * ```typescript
46
+ * // Grant permission for an app to access your data
47
+ * const txHash = await vana.permissions.grant({
48
+ * grantee: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
49
+ * operation: "llm_inference",
50
+ * files: [1, 2, 3],
51
+ * parameters: { model: "gpt-4", maxTokens: 1000 },
52
+ * });
53
+ *
54
+ * // Trust a server for data processing
55
+ * await vana.permissions.trustServer({
56
+ * serverId: "0x123...",
57
+ * serverUrl: "https://personal-server.vana.org",
58
+ * });
59
+ *
60
+ * // Query current permissions
61
+ * const permissions = await vana.permissions.getUserPermissionGrantsOnChain();
62
+ * ```
63
+ * @category Permissions
64
+ * @see {@link https://docs.vana.com/developer/permissions | Vana Permissions System} for conceptual overview
65
+ */
66
+ export declare class PermissionsController extends BaseController {
67
+ constructor(context: ControllerContext);
68
+ /**
69
+ * Grants permission for an application to access user data with gasless transactions.
70
+ *
71
+ * This method provides a complete end-to-end permission grant flow that returns
72
+ * the permission ID and other relevant data immediately after successful submission.
73
+ * For advanced users who need more control over the transaction lifecycle, use
74
+ * `submitPermissionGrant()` instead.
75
+ *
76
+ * @param params - The permission grant configuration object
77
+ * @returns Promise resolving to permission data from the PermissionAdded event
78
+ * @throws {RelayerError} When gasless transaction submission fails
79
+ * @throws {SignatureError} When user rejects the signature request
80
+ * @throws {SerializationError} When grant data cannot be serialized
81
+ * @throws {BlockchainError} When permission grant fails or event parsing fails
82
+ * @throws {NetworkError} When transaction confirmation times out
83
+ * @example
84
+ * ```typescript
85
+ * const result = await vana.permissions.grant({
86
+ * grantee: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
87
+ * operation: "llm_inference",
88
+ * parameters: {
89
+ * model: "gpt-4",
90
+ * maxTokens: 1000,
91
+ * temperature: 0.7,
92
+ * },
93
+ * });
94
+ *
95
+ * console.log(`Permission ${result.permissionId} granted to ${result.user}`);
96
+ * console.log(`Transaction: ${result.transactionHash}`);
97
+ *
98
+ * // Can immediately use the permission ID for other operations
99
+ * await vana.permissions.revoke({ permissionId: result.permissionId });
100
+ * ```
101
+ */
102
+ grant(params: GrantPermissionParams): Promise<PermissionGrantResult>;
103
+ /**
104
+ * Submits a permission grant transaction and returns a handle for flexible result access.
105
+ *
106
+ * @remarks
107
+ * This lower-level method provides maximum control over transaction timing.
108
+ * Returns a TransactionResult that can be serialized and passed across API boundaries.
109
+ * Use this when handling multiple transactions or when you need granular control.
110
+ *
111
+ * @param params - The permission grant configuration object
112
+ * @returns Promise resolving to TransactionResult with hash and event parsing capabilities
113
+ * @throws {RelayerError} When gasless transaction submission fails
114
+ * @throws {SignatureError} When user rejects the signature request
115
+ * @throws {SerializationError} When grant data cannot be serialized
116
+ * @throws {BlockchainError} When permission grant preparation fails
117
+ * @example
118
+ * ```typescript
119
+ * // Submit transaction and get immediate hash access
120
+ * const tx = await vana.permissions.submitPermissionGrant(params);
121
+ * console.log(`Transaction submitted: ${tx.hash}`);
122
+ *
123
+ * // To wait for events, use SDK's waitForTransactionEvents
124
+ * const eventData = await vana.waitForTransactionEvents(tx.hash);
125
+ * console.log(`Permission ID: ${eventData.permissionId}`);
126
+ * ```
127
+ */
128
+ submitPermissionGrant(params: GrantPermissionParams): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
129
+ /**
130
+ * Prepares a permission grant with preview before signing.
131
+ *
132
+ * @remarks
133
+ * This method implements a two-phase commit workflow that allows applications
134
+ * to show users a preview of what they're authorizing before requesting a signature.
135
+ * Unlike `createAndSign()`, this method does NOT upload to IPFS or prompt for signatures
136
+ * until the returned `confirm()` function is called.
137
+ * @param params - The permission grant parameters
138
+ * @returns A promise resolving to a preview object and confirm function
139
+ * @throws {SerializationError} When grant parameters are invalid or cannot be serialized
140
+ * @throws {BlockchainError} When grant validation fails or preparation encounters an error
141
+ * @example
142
+ * ```typescript
143
+ * const { preview, confirm } = await vana.permissions.prepareGrant({
144
+ * grantee: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
145
+ * operation: "llm_inference",
146
+ * files: [1, 2, 3],
147
+ * parameters: { model: "gpt-4", prompt: "Analyze my social media data" }
148
+ * });
149
+ *
150
+ * console.log(`Granting ${preview.operation} access to ${preview.files?.length} files`);
151
+ * const transactionHash = await confirm();
152
+ * ```
153
+ */
154
+ prepareGrant(params: GrantPermissionParams): Promise<{
155
+ preview: GrantFile;
156
+ confirm: () => Promise<PermissionGrantResult>;
157
+ }>;
158
+ /**
159
+ * Completes the grant process after user confirmation.
160
+ *
161
+ * @remarks
162
+ * This internal method is called by the confirm() function returned from prepareGrant().
163
+ * It handles IPFS upload, signature creation, and transaction submission.
164
+ *
165
+ * @param params - The permission grant parameters containing user and operation details
166
+ * @param grantFile - The prepared grant file with permissions and metadata
167
+ * @returns Promise resolving to TransactionResult for flexible result access
168
+ * @throws {BlockchainError} When permission grant confirmation fails
169
+ * @throws {NetworkError} When IPFS upload fails
170
+ * @throws {SignatureError} When user rejects the signature
171
+ */
172
+ private confirmGrantInternal;
173
+ /**
174
+ * Creates typed data and signature for a permission grant without submitting.
175
+ *
176
+ * @remarks
177
+ * This method handles the first phase of permission granting: creating the grant file,
178
+ * storing it on IPFS, and generating the user's EIP-712 signature. Use this when you
179
+ * want to handle submission separately or batch multiple operations. The method validates
180
+ * the grant file against the JSON schema before creating the signature.
181
+ *
182
+ * For interactive user flows, consider using `prepareGrant()` instead,
183
+ * which allows showing a preview before signing.
184
+ * @param params - The permission grant configuration object
185
+ * @returns A promise resolving to the typed data structure and signature for gasless submission
186
+ * @throws {SignatureError} When the user rejects the signature request
187
+ * @throws {SerializationError} When grant data cannot be properly formatted
188
+ * @throws {BlockchainError} When permission grant preparation fails
189
+ * @throws {NetworkError} When storage operations fail
190
+ * @example
191
+ * ```typescript
192
+ * const { typedData, signature } = await vana.permissions.createAndSign({
193
+ * grantee: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
194
+ * operation: "data_analysis",
195
+ * parameters: { analysisType: "sentiment" },
196
+ * });
197
+ *
198
+ * const transactionHash = await vana.permissions.submitSignedGrant(typedData, signature);
199
+ * ```
200
+ */
201
+ createAndSign(params: GrantPermissionParams): Promise<{
202
+ typedData: PermissionGrantTypedData;
203
+ signature: Hash;
204
+ }>;
205
+ /**
206
+ * Submits an already-signed permission grant to the blockchain.
207
+ *
208
+ * @remarks
209
+ * This method supports both relayer-based gasless transactions and direct transactions.
210
+ * It automatically converts `bigint` values to JSON-safe strings when using relayer
211
+ * callbacks and handles transaction submission with proper error handling and retry logic.
212
+ * @param typedData - The EIP-712 typed data structure for the permission grant
213
+ * @param signature - The user's signature as a hex string
214
+ * @returns A Promise that resolves to the transaction hash
215
+ * @throws {RelayerError} When gasless transaction submission fails
216
+ * @throws {BlockchainError} When permission submission fails
217
+ * @throws {NetworkError} When network communication fails
218
+ * @example
219
+ * ```typescript
220
+ * const txHash = await vana.permissions.submitSignedGrant(
221
+ * typedData,
222
+ * "0x1234..."
223
+ * );
224
+ * ```
225
+ */
226
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
227
+ /**
228
+ * Submits an already-signed trust server transaction to the blockchain.
229
+ *
230
+ * @remarks
231
+ * This method extracts the trust server input from typed data and submits it directly.
232
+ * Used internally by trust server methods after signature collection.
233
+ *
234
+ * @param typedData - The EIP-712 typed data for TrustServer
235
+ * @param signature - The user's signature obtained via `signTypedData()`
236
+ * @returns Promise resolving to TransactionResult for transaction tracking
237
+ * @throws {BlockchainError} When contract submission fails
238
+ * @throws {NetworkError} When blockchain communication fails
239
+ * @example
240
+ * ```typescript
241
+ * const txHandle = await vana.permissions.submitSignedTrustServer(
242
+ * typedData,
243
+ * "0x1234..."
244
+ * );
245
+ * const result = await txHandle.waitForEvents();
246
+ * ```
247
+ */
248
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
249
+ /**
250
+ * Submits an already-signed add and trust server transaction to the blockchain.
251
+ *
252
+ * @remarks
253
+ * This method extracts the add and trust server input from typed data and submits it directly.
254
+ * Combines server registration and trust operations in a single transaction.
255
+ *
256
+ * @param typedData - The EIP-712 typed data for AddAndTrustServer
257
+ * @param signature - The user's signature obtained via `signTypedData()`
258
+ * @returns Promise resolving to TransactionResult for transaction tracking
259
+ * @throws {BlockchainError} When contract submission fails
260
+ * @throws {NetworkError} When blockchain communication fails
261
+ * @example
262
+ * ```typescript
263
+ * const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
264
+ * typedData,
265
+ * "0x1234..."
266
+ * );
267
+ * const result = await txHandle.waitForEvents();
268
+ * ```
269
+ */
270
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
271
+ /**
272
+ * Internal method to submit a signed grant and wait for events.
273
+ *
274
+ * @internal
275
+ * @param typedData - The EIP-712 typed data for the permission grant
276
+ * @param signature - The user's signature authorizing the transaction
277
+ * @returns Promise resolving to PermissionGrantResult with parsed events
278
+ */
279
+ private submitSignedGrantWithEvents;
280
+ /**
281
+ * Internal method for confirm grant with events.
282
+ *
283
+ * @internal
284
+ * @param params - The permission grant parameters
285
+ * @param grantFile - The pre-created grant file object
286
+ * @returns Promise resolving to PermissionGrantResult with parsed events
287
+ */
288
+ private confirmGrantInternalWithEvents;
289
+ /**
290
+ * Submits an already-signed permission revoke transaction to the blockchain.
291
+ *
292
+ * @remarks
293
+ * This method handles the revocation of previously granted permissions.
294
+ * Used internally by revocation methods after signature collection.
295
+ *
296
+ * @param typedData - The EIP-712 typed data for PermissionRevoke
297
+ * @param signature - The user's signature obtained via `signTypedData()`
298
+ * @returns Promise resolving to TransactionResult for transaction tracking
299
+ * @throws {BlockchainError} When contract submission fails
300
+ * @throws {NetworkError} When blockchain communication fails
301
+ * @example
302
+ * ```typescript
303
+ * const txHandle = await vana.permissions.submitSignedRevoke(
304
+ * typedData,
305
+ * "0x1234..."
306
+ * );
307
+ * const result = await txHandle.waitForEvents();
308
+ * ```
309
+ */
310
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
311
+ /**
312
+ * Submits an already-signed untrust server transaction to the blockchain.
313
+ *
314
+ * @remarks
315
+ * This method handles the removal of trusted servers.
316
+ * Used internally by untrust server methods after signature collection.
317
+ *
318
+ * @param typedData - The EIP-712 typed data for UntrustServer
319
+ * @param signature - The user's signature obtained via `signTypedData()`
320
+ * @returns Promise resolving to TransactionResult for transaction tracking
321
+ * @throws {BlockchainError} When contract submission fails
322
+ * @throws {NetworkError} When blockchain communication fails
323
+ * @example
324
+ * ```typescript
325
+ * const txHandle = await vana.permissions.submitSignedUntrustServer(
326
+ * typedData,
327
+ * "0x1234..."
328
+ * );
329
+ * const result = await txHandle.waitForEvents();
330
+ * ```
331
+ */
332
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "untrustServerWithSignature">>;
333
+ /**
334
+ * Submits a signed transaction directly to the blockchain.
335
+ *
336
+ * @remarks
337
+ * Internal method used when relayer callbacks are not available. Formats the signature
338
+ * and submits the permission grant directly to the smart contract.
339
+ *
340
+ * @param typedData - The typed data structure for the permission grant
341
+ * @param signature - The cryptographic signature authorizing the transaction
342
+ * @returns Promise resolving to the transaction hash
343
+ * @throws {BlockchainError} When contract submission fails
344
+ */
345
+ private submitDirectTransaction;
346
+ /**
347
+ * Revokes a previously granted permission.
348
+ *
349
+ * This method provides complete revocation with automatic event parsing to confirm
350
+ * the permission was successfully revoked. For advanced users who need more control,
351
+ * use `submitPermissionRevoke()` instead.
352
+ *
353
+ * @param params - Parameters for revoking the permission
354
+ * @param params.permissionId - Permission identifier (accepts bigint, number, or string).
355
+ * Obtain from permission grants via `getUserPermissionGrantsOnChain()`.
356
+ * @returns Promise resolving to revocation data from PermissionRevoked event
357
+ * @throws {BlockchainError} When revocation fails or event parsing fails
358
+ * @throws {UserRejectedRequestError} When user rejects the transaction
359
+ * @throws {NetworkError} When transaction confirmation times out
360
+ * @example
361
+ * ```typescript
362
+ * // Revoke a permission and get confirmation
363
+ * const result = await vana.permissions.revoke({
364
+ * permissionId: 123n
365
+ * });
366
+ * console.log(`Permission ${result.permissionId} revoked in transaction ${result.transactionHash}`);
367
+ * console.log(`Revoked in block ${result.blockNumber}`);
368
+ * ```
369
+ */
370
+ revoke(params: RevokePermissionParams): Promise<PermissionRevokeResult>;
371
+ /**
372
+ * Submits a permission revocation transaction and returns the transaction hash immediately.
373
+ *
374
+ * This is the lower-level method that provides maximum control over transaction timing.
375
+ * Use this when you want to handle transaction confirmation and event parsing separately.
376
+ *
377
+ * @param params - Parameters for revoking the permission
378
+ * @param options - Optional transaction options for gas parameters and timeout
379
+ * @returns Promise resolving to the transaction hash when successfully submitted
380
+ * @throws {BlockchainError} When revocation transaction fails
381
+ * @throws {UserRejectedRequestError} When user rejects the transaction
382
+ * @example
383
+ * ```typescript
384
+ * // Submit revocation and handle confirmation later
385
+ * const txHash = await vana.permissions.submitPermissionRevoke({
386
+ * permissionId: 123n
387
+ * });
388
+ * console.log(`Revocation submitted: ${txHash}`);
389
+ * ```
390
+ */
391
+ submitPermissionRevoke(params: RevokePermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermission">>;
392
+ /**
393
+ * Revokes a permission with a signature for gasless transactions.
394
+ *
395
+ * @remarks
396
+ * This method creates an EIP-712 signature for permission revocation and submits
397
+ * it either through relayer callbacks or directly to the blockchain. Provides
398
+ * gasless revocation when relayer is configured.
399
+ *
400
+ * @param params - Parameters for revoking the permission
401
+ * @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
402
+ * @returns Promise resolving to TransactionResult for transaction tracking
403
+ * @throws {BlockchainError} When chain ID is not available
404
+ * @throws {NonceError} When retrieving user nonce fails
405
+ * @throws {SignatureError} When user rejects the signature request
406
+ * @throws {RelayerError} When gasless submission fails
407
+ * @throws {PermissionError} When revocation fails for any other reason
408
+ * @example
409
+ * ```typescript
410
+ * const txHandle = await vana.permissions.submitRevokeWithSignature({
411
+ * permissionId: 123n
412
+ * });
413
+ * const result = await txHandle.waitForEvents();
414
+ * console.log(`Permission ${result.permissionId} revoked`);
415
+ * ```
416
+ */
417
+ submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
418
+ /**
419
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
420
+ * This nonce is used for server-related operations (AddAndTrustServer, TrustServer, UntrustServer).
421
+ *
422
+ * @returns Promise resolving to the current servers nonce
423
+ * @throws {NonceError} When reading nonce from contract fails
424
+ * @private
425
+ *
426
+ * @example
427
+ * ```typescript
428
+ * const nonce = await this.getServersUserNonce();
429
+ * console.log(`Current servers nonce: ${nonce}`);
430
+ * ```
431
+ */
432
+ /**
433
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
434
+ *
435
+ * @remarks
436
+ * Used for server-related operations (trust/untrust) to prevent replay attacks.
437
+ * The nonce must be incremented with each server operation.
438
+ *
439
+ * @returns Promise resolving to the user's current nonce as a bigint
440
+ * @throws {NonceError} When retrieving the nonce fails
441
+ */
442
+ private getServersUserNonce;
443
+ /**
444
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
445
+ * This nonce is used for permission-related operations (addPermission, addServerFilesAndPermissions).
446
+ *
447
+ * @returns Promise resolving to the current permissions nonce
448
+ * @throws {NonceError} When reading nonce from contract fails
449
+ * @private
450
+ *
451
+ * @example
452
+ * ```typescript
453
+ * const nonce = await this.getPermissionsUserNonce();
454
+ * console.log(`Current permissions nonce: ${nonce}`);
455
+ * ```
456
+ */
457
+ /**
458
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
459
+ *
460
+ * @remarks
461
+ * Used for permission-related operations (grant/revoke) to prevent replay attacks.
462
+ * The nonce must be incremented with each permission operation.
463
+ *
464
+ * @returns Promise resolving to the user's current nonce as a bigint
465
+ * @throws {NonceError} When retrieving the nonce fails
466
+ */
467
+ private getPermissionsUserNonce;
468
+ /**
469
+ * Composes the EIP-712 typed data for PermissionGrant (new simplified format).
470
+ *
471
+ * @param params - The parameters for composing the permission grant message
472
+ * @param params.grantee - The recipient address for the permission grant
473
+ * @param params.operation - The type of operation being granted permission for
474
+ * @param params.files - Array of file IDs that the permission applies to
475
+ * @param params.grantUrl - URL where the grant details are stored
476
+ * @param params.serializedParameters - Serialized parameters for the operation
477
+ * @param params.nonce - Unique number to prevent replay attacks
478
+ * @returns Promise resolving to the typed data structure
479
+ */
480
+ private composePermissionGrantMessage;
481
+ /**
482
+ * Creates EIP-712 typed data structure for server files and permissions.
483
+ *
484
+ * @param params - Parameters for the server files and permissions message
485
+ * @param params.granteeId - Grantee ID
486
+ * @param params.grant - Grant URL or grant data
487
+ * @param params.fileUrls - Array of file URLs
488
+ * @param params.schemaIds - Schema IDs for each file
489
+ * @param params.serverAddress - Server address
490
+ * @param params.serverUrl - Server URL
491
+ * @param params.serverPublicKey - Server public key
492
+ * @param params.filePermissions - File permissions array
493
+ * @param params.nonce - Unique number to prevent replay attacks
494
+ * @returns Promise resolving to the typed data structure
495
+ */
496
+ private composeServerFilesAndPermissionMessage;
497
+ /**
498
+ * Gets the EIP-712 domain for PermissionGrant signatures.
499
+ *
500
+ * @returns Promise resolving to the EIP-712 domain configuration
501
+ */
502
+ private getPermissionDomain;
503
+ /**
504
+ * Signs typed data using the wallet client with signature caching.
505
+ *
506
+ * @param typedData - The EIP-712 typed data structure to sign
507
+ * @returns Promise resolving to the cryptographic signature
508
+ */
509
+ private signTypedData;
510
+ /**
511
+ * Gets the user's address from the context.
512
+ *
513
+ * @returns The user's address
514
+ */
515
+ /**
516
+ * Gets on-chain permission grant data without expensive off-chain resolution.
517
+ *
518
+ * @remarks
519
+ * This method provides a fast, performance-focused way to retrieve permission grants
520
+ * by querying only the subgraph without making expensive IPFS or individual contract calls.
521
+ * It eliminates the N+1 query problem of the legacy `getUserPermissions()` method.
522
+ *
523
+ * The returned data contains all on-chain information but does NOT include resolved
524
+ * operation details, parameters, or file IDs. Use `retrieveGrantFile()` separately
525
+ * for specific grants when detailed data is needed.
526
+ *
527
+ * **Performance**: Completes in ~100-500ms regardless of permission count.
528
+ * **Reliability**: Single point of failure (subgraph) with clear RPC fallback path.
529
+ *
530
+ * @param options - Options for retrieving permissions (limit, subgraph URL)
531
+ * @returns A Promise that resolves to an array of `OnChainPermissionGrant` objects
532
+ * @throws {BlockchainError} When subgraph query fails
533
+ * @throws {NetworkError} When network requests fail
534
+ * @example
535
+ * ```typescript
536
+ * // Fast: Get all on-chain permission data
537
+ * const grants = await vana.permissions.getUserPermissionGrantsOnChain({ limit: 20 });
538
+ *
539
+ * // Display in UI immediately
540
+ * grants.forEach(grant => {
541
+ * console.log(`Permission ${grant.id}: ${grant.grantUrl}`);
542
+ * });
543
+ *
544
+ * // Lazy load detailed data for specific permission when user clicks
545
+ * const grantFile = await retrieveGrantFile(grants[0].grantUrl);
546
+ * console.log(`Operation: ${grantFile.operation}`);
547
+ * console.log(`Parameters:`, grantFile.parameters);
548
+ * ```
549
+ */
550
+ getUserPermissionGrantsOnChain(options?: GetUserPermissionsOptions): Promise<OnChainPermissionGrant[]>;
551
+ /**
552
+ * Registers a new server and immediately trusts it in the DataPortabilityServers contract.
553
+ *
554
+ * This is a combined operation that both registers a new data portability server
555
+ * and adds it to the user's trusted servers list in a single transaction.
556
+ * Trusted servers can handle data export and portability requests from the user.
557
+ *
558
+ * @param params - Parameters for adding and trusting the server
559
+ * @param params.serverAddress - Ethereum address of the server
560
+ * @param params.serverUrl - HTTPS URL where the server can be reached
561
+ * @param params.publicKey - Server's public key for encryption (hex string)
562
+ * @returns Promise resolving to transaction hash
563
+ * @throws {UserRejectedRequestError} When user rejects the transaction
564
+ * @throws {BlockchainError} When chain ID is unavailable or transaction fails
565
+ * @throws {ServerAlreadyRegisteredError} When server address is already registered
566
+ * @throws {Error} When wallet account is not available
567
+ *
568
+ * @example
569
+ * ```typescript
570
+ * // Add and trust a server by providing all required details
571
+ * const txHash = await vana.permissions.addAndTrustServer({
572
+ * owner: '0x1234567890abcdef1234567890abcdef12345678',
573
+ * serverAddress: '0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6',
574
+ * serverUrl: 'https://myserver.example.com',
575
+ * publicKey: '0x456789abcdef456789abcdef456789abcdef456789abcdef'
576
+ * });
577
+ * console.log('Server added and trusted in transaction:', txHash);
578
+ *
579
+ * // Verify the server is now trusted
580
+ * const trustedServers = await vana.permissions.getTrustedServers();
581
+ * console.log('Now trusting servers:', trustedServers);
582
+ * ```
583
+ */
584
+ addAndTrustServer(params: AddAndTrustServerParams): Promise<ServerTrustResult>;
585
+ /**
586
+ * Trusts a server for data processing (legacy method).
587
+ *
588
+ * @param params - Parameters for trusting the server
589
+ * @returns Promise resolving to transaction hash
590
+ * @deprecated Use addAndTrustServer instead
591
+ */
592
+ submitTrustServer(params: TrustServerParams): Promise<TransactionResult<"DataPortabilityServers", "trustServer">>;
593
+ /**
594
+ * Adds and trusts a server using a signature (gasless transaction).
595
+ *
596
+ * @param params - Parameters for adding and trusting the server
597
+ * @returns Promise resolving to TransactionResult with ServerTrustResult event data
598
+ */
599
+ submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
600
+ /**
601
+ * Trusts a server using a signature (gasless transaction - legacy method).
602
+ *
603
+ * @param params - Parameters for trusting the server
604
+ * @returns Promise resolving to transaction hash
605
+ * @deprecated Use addAndTrustServerWithSignature instead
606
+ * @throws {BlockchainError} When chain ID is not available
607
+ * @throws {NonceError} When retrieving user nonce fails
608
+ * @throws {SignatureError} When user rejects the signature request
609
+ * @throws {RelayerError} When gasless submission fails
610
+ * @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
611
+ * @throws {BlockchainError} When trust operation fails for any other reason
612
+ */
613
+ submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
614
+ /**
615
+ * Submits a direct untrust server transaction (without signature).
616
+ *
617
+ * @param params - The untrust server parameters containing server details
618
+ * @returns Promise resolving to the transaction hash
619
+ */
620
+ /**
621
+ * Submits an untrust server transaction directly to the blockchain.
622
+ *
623
+ * @remarks
624
+ * Internal method used for direct blockchain submission of untrust server operations
625
+ * when relayer callbacks are not available.
626
+ *
627
+ * @param params - The untrust server parameters
628
+ * @returns Promise resolving to TransactionResult for transaction tracking
629
+ * @throws {BlockchainError} When contract submission fails
630
+ */
631
+ private submitDirectUntrustTransaction;
632
+ /**
633
+ * Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
634
+ *
635
+ * This revokes the server's authorization to handle data portability requests for the user.
636
+ * The server remains registered in the system but will no longer be trusted by this user.
637
+ *
638
+ * @param params - Parameters for untrusting the server
639
+ * @param params.serverId - The numeric ID of the server to untrust
640
+ * @param options - Optional transaction options for gas parameters and timeout
641
+ * @returns Promise resolving to transaction hash
642
+ * @throws {Error} When wallet account is not available
643
+ * @throws {NonceError} When retrieving user nonce fails
644
+ * @throws {UserRejectedRequestError} When user rejects the transaction
645
+ * @throws {ServerNotTrustedError} When the server is not currently trusted
646
+ * @throws {BlockchainError} When untrust transaction fails
647
+ *
648
+ * @example
649
+ * ```typescript
650
+ * // Untrust a specific server
651
+ * const txHash = await vana.permissions.untrustServer({
652
+ * serverId: 1
653
+ * });
654
+ * console.log('Server untrusted in transaction:', txHash);
655
+ *
656
+ * // Verify the server is no longer trusted
657
+ * const trustedServers = await vana.permissions.getTrustedServers();
658
+ * console.log('Still trusting servers:', trustedServers);
659
+ * ```
660
+ */
661
+ submitUntrustServer(params: UntrustServerParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "untrustServer">>;
662
+ /**
663
+ * Untrusts a server using a signature (gasless transaction).
664
+ *
665
+ * @param params - Parameters for untrusting the server
666
+ * @param params.serverId - The server's Ethereum address to untrust
667
+ * @returns Promise resolving to transaction hash
668
+ * @throws {Error} When wallet account is not available
669
+ * @throws {NonceError} When retrieving user nonce fails
670
+ * @throws {SignatureError} When user rejects the signature request
671
+ * @throws {RelayerError} When gasless submission fails
672
+ * @throws {BlockchainError} When untrust transaction fails
673
+ */
674
+ submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionResult<"DataPortabilityServers", "untrustServerWithSignature">>;
675
+ /**
676
+ * Retrieves all servers trusted by a user from the DataPortabilityServers contract.
677
+ *
678
+ * Returns an array of server IDs that the specified user has explicitly trusted.
679
+ * Trusted servers are those that users have authorized to handle their data portability requests.
680
+ *
681
+ * @param userAddress - Optional user address to query (defaults to current wallet user)
682
+ * @returns Promise resolving to array of trusted server IDs (numeric)
683
+ * @throws {BlockchainError} When reading from contract fails or chain is unavailable
684
+ * @throws {NetworkError} When unable to connect to the blockchain network
685
+ *
686
+ * @example
687
+ * ```typescript
688
+ * // Get trusted servers for current user
689
+ * const myServers = await vana.permissions.getTrustedServers();
690
+ * console.log(`I trust ${myServers.length} servers: ${myServers.join(', ')}`);
691
+ *
692
+ * // Get trusted servers for another user
693
+ * const userServers = await vana.permissions.getTrustedServers("0x1234...");
694
+ * console.log(`User trusts servers: ${userServers.join(', ')}`);
695
+ * ```
696
+ */
697
+ getTrustedServers(userAddress?: Address): Promise<number[]>;
698
+ /**
699
+ * Gets the total count of trusted servers for a user.
700
+ *
701
+ * @param userAddress - Optional user address (defaults to current user)
702
+ * @returns Promise resolving to the number of trusted servers
703
+ * @throws {BlockchainError} When reading from contract fails or chain is unavailable
704
+ */
705
+ getTrustedServersCount(userAddress?: Address): Promise<number>;
706
+ /**
707
+ * Gets trusted servers with pagination support.
708
+ *
709
+ * @param options - Query options including pagination parameters
710
+ * @returns Promise resolving to paginated trusted servers
711
+ * @throws {BlockchainError} When reading from contract fails or chain is unavailable
712
+ */
713
+ getTrustedServersPaginated(options?: TrustedServerQueryOptions): Promise<PaginatedTrustedServers>;
714
+ /**
715
+ * Gets trusted servers with their complete information.
716
+ *
717
+ * @param options - Query options
718
+ * @returns Promise resolving to array of trusted server info
719
+ * @throws {BlockchainError} When reading from contract fails or chain is unavailable
720
+ */
721
+ getTrustedServersWithInfo(options?: TrustedServerQueryOptions): Promise<TrustedServerInfo[]>;
722
+ /**
723
+ * Gets server information for multiple servers efficiently.
724
+ *
725
+ * @remarks
726
+ * This method uses multicall to fetch information for multiple servers in a single
727
+ * blockchain call, improving performance when querying many servers. Failed lookups
728
+ * are returned separately for error handling.
729
+ *
730
+ * @param serverIds - Array of numeric server IDs to query
731
+ * @returns Promise resolving to batch result containing successful lookups and failed IDs
732
+ * @throws {BlockchainError} When reading from contract fails or chain is unavailable
733
+ * @example
734
+ * ```typescript
735
+ * const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
736
+ *
737
+ * // Process successful lookups
738
+ * result.servers.forEach((server, id) => {
739
+ * console.log(`Server ${id}: ${server.url}`);
740
+ * });
741
+ *
742
+ * // Handle failed lookups
743
+ * if (result.failed.length > 0) {
744
+ * console.log(`Failed to fetch: ${result.failed.join(', ')}`);
745
+ * }
746
+ * ```
747
+ */
748
+ getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
749
+ /**
750
+ * Checks whether a specific server is trusted by a user.
751
+ *
752
+ * @remarks
753
+ * This method queries the user's trusted server list and checks if the specified
754
+ * server is present. Returns both the trust status and the index in the trust list
755
+ * if trusted.
756
+ *
757
+ * @param serverId - Numeric server ID to check
758
+ * @param userAddress - Optional user address (defaults to current user)
759
+ * @returns Promise resolving to server trust status with trust index if applicable
760
+ * @throws {BlockchainError} When reading from contract fails
761
+ * @example
762
+ * ```typescript
763
+ * const status = await vana.permissions.checkServerTrustStatus(1);
764
+ * if (status.isTrusted) {
765
+ * console.log(`Server is trusted at index ${status.trustIndex}`);
766
+ * } else {
767
+ * console.log('Server is not trusted');
768
+ * }
769
+ * ```
770
+ */
771
+ checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
772
+ /**
773
+ * Composes EIP-712 typed data for AddAndTrustServer.
774
+ *
775
+ * @remarks
776
+ * Creates the complete typed data structure required for EIP-712 signature generation
777
+ * when adding and trusting a new server in a single transaction.
778
+ *
779
+ * @param input - The add and trust server input data containing server details
780
+ * @returns Promise resolving to the typed data structure for server add and trust
781
+ */
782
+ private composeAddAndTrustServerMessage;
783
+ /**
784
+ * Composes EIP-712 typed data for TrustServer.
785
+ *
786
+ * @param input - The trust server input data containing server details
787
+ * @returns Promise resolving to the typed data structure for server trust
788
+ */
789
+ private composeTrustServerMessage;
790
+ /**
791
+ * Composes EIP-712 typed data for UntrustServer.
792
+ *
793
+ * @param input - The untrust server input data containing server details
794
+ * @returns Promise resolving to the typed data structure for server untrust
795
+ */
796
+ private composeUntrustServerMessage;
797
+ /**
798
+ * Gets the EIP-712 domain for DataPortabilityServers signatures.
799
+ *
800
+ * @returns Promise resolving to the EIP-712 domain configuration
801
+ */
802
+ private getServersDomain;
803
+ /**
804
+ * Submits an add and trust server transaction directly to the blockchain.
805
+ *
806
+ * @param addAndTrustServerInput - The add and trust server input data containing server details
807
+ * @param signature - The cryptographic signature for the transaction
808
+ * @returns Promise resolving to the transaction hash
809
+ */
810
+ private submitAddAndTrustServerTransaction;
811
+ /**
812
+ * Submits a trust server transaction directly to the blockchain.
813
+ *
814
+ * @param trustServerInput - The trust server input data containing server details
815
+ * @param signature - The cryptographic signature for the transaction
816
+ * @returns Promise resolving to the transaction hash
817
+ */
818
+ private submitTrustServerTransaction;
819
+ /**
820
+ * Submits a revoke transaction directly to the blockchain with signature.
821
+ *
822
+ * @param typedData - The EIP-712 typed data structure for the revoke operation
823
+ * @param signature - The cryptographic signature authorizing the revoke
824
+ * @returns Promise resolving to the transaction hash
825
+ */
826
+ private submitDirectRevokeTransaction;
827
+ /**
828
+ * Submits an untrust server transaction with signature.
829
+ *
830
+ * @param typedData - The EIP-712 typed data structure for the untrust operation
831
+ * @param signature - The cryptographic signature authorizing the untrust
832
+ * @returns Promise resolving to the transaction hash
833
+ */
834
+ private submitSignedUntrustTransaction;
835
+ /**
836
+ * Registers a new grantee in the DataPortabilityGrantees contract.
837
+ *
838
+ * A grantee is an entity (like an application) that can receive data permissions
839
+ * from users. Once registered, users can grant the grantee access to their data.
840
+ *
841
+ * @param params - Parameters for registering the grantee
842
+ * @param params.owner - The Ethereum address that will own this grantee registration
843
+ * @param params.granteeAddress - The Ethereum address of the grantee (application)
844
+ * @param params.publicKey - The public key used for data encryption/decryption (hex string)
845
+ * @param options - Optional transaction options for gas parameters and timeout
846
+ * @returns Promise resolving to the transaction hash
847
+ * @throws {BlockchainError} When the grantee registration transaction fails
848
+ * @throws {UserRejectedRequestError} When user rejects the transaction
849
+ * @throws {ContractError} When grantee is already registered
850
+ *
851
+ * @example
852
+ * ```typescript
853
+ * const txHash = await vana.permissions.registerGrantee({
854
+ * owner: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
855
+ * granteeAddress: "0xApp1234567890123456789012345678901234567890",
856
+ * publicKey: "0x1234567890abcdef..."
857
+ * });
858
+ * console.log(`Grantee registered in transaction: ${txHash}`);
859
+ * ```
860
+ */
861
+ submitRegisterGrantee(params: RegisterGranteeParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityGrantees", "registerGrantee">>;
862
+ /**
863
+ * Registers a grantee with a signature (gasless transaction)
864
+ *
865
+ * @param params - Parameters for registering the grantee
866
+ * @returns Promise resolving to the transaction hash
867
+ *
868
+ * @example
869
+ * ```typescript
870
+ * const txHash = await vana.permissions.registerGranteeWithSignature({
871
+ * owner: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
872
+ * granteeAddress: "0xApp1234567890123456789012345678901234567890",
873
+ * publicKey: "0x1234567890abcdef..."
874
+ * });
875
+ * ```
876
+ */
877
+ submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionResult<"DataPortabilityGrantees", "registerGrantee">>;
878
+ /**
879
+ * Submits a signed register grantee transaction via relayer
880
+ *
881
+ * @param typedData - The EIP-712 typed data for register grantee
882
+ * @param signature - The cryptographic signature
883
+ * @returns Promise resolving to the transaction hash
884
+ *
885
+ * @example
886
+ * ```typescript
887
+ * const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
888
+ * ```
889
+ */
890
+ submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityGrantees", "registerGrantee">>;
891
+ /**
892
+ * Retrieves all registered grantees from the DataPortabilityGrantees contract.
893
+ *
894
+ * Returns a paginated list of all grantees (applications) that have been registered
895
+ * in the system and can receive data permissions from users.
896
+ *
897
+ * @param options - Query options for pagination and filtering
898
+ * @param options.limit - Maximum number of grantees to return (default: 50)
899
+ * @param options.offset - Number of grantees to skip for pagination (default: 0)
900
+ * @returns Promise resolving to paginated grantees with metadata
901
+ * @throws {BlockchainError} When contract read operation fails
902
+ * @throws {NetworkError} When unable to connect to the blockchain network
903
+ *
904
+ * @example
905
+ * ```typescript
906
+ * // Get first 10 grantees
907
+ * const result = await vana.permissions.getGrantees({
908
+ * limit: 10,
909
+ * offset: 0
910
+ * });
911
+ *
912
+ * console.log(`Found ${result.total} total grantees`);
913
+ * result.grantees.forEach(grantee => {
914
+ * console.log(`Grantee ${grantee.id}: ${grantee.granteeAddress}`);
915
+ * });
916
+ *
917
+ * // Check if there are more results
918
+ * if (result.hasMore) {
919
+ * console.log('More grantees available');
920
+ * }
921
+ * ```
922
+ */
923
+ getGrantees(options?: GranteeQueryOptions): Promise<PaginatedGrantees>;
924
+ /**
925
+ * Retrieves a specific grantee by their Ethereum address from the DataPortabilityGrantees contract.
926
+ *
927
+ * Looks up a registered grantee (application) using their Ethereum address
928
+ * and returns their complete registration information including permissions.
929
+ *
930
+ * @param granteeAddress - The Ethereum address of the grantee to look up
931
+ * @returns Promise resolving to the grantee information, or null if not found
932
+ * @throws {BlockchainError} When contract read operation fails
933
+ * @throws {NetworkError} When unable to connect to the blockchain network
934
+ *
935
+ * @example
936
+ * ```typescript
937
+ * const granteeAddress = "0xApp1234567890123456789012345678901234567890";
938
+ * const grantee = await vana.permissions.getGranteeByAddress(granteeAddress);
939
+ *
940
+ * if (grantee) {
941
+ * console.log(`Found grantee ${grantee.id}`);
942
+ * console.log(`Owner: ${grantee.owner}`);
943
+ * console.log(`Public Key: ${grantee.publicKey}`);
944
+ * console.log(`Permissions: ${grantee.permissionIds.join(', ')}`);
945
+ * } else {
946
+ * console.log('Grantee not found');
947
+ * }
948
+ * ```
949
+ */
950
+ getGranteeByAddress(granteeAddress: Address): Promise<Grantee | null>;
951
+ /**
952
+ * Retrieves a specific grantee by their unique ID from the DataPortabilityGrantees contract.
953
+ *
954
+ * Looks up a registered grantee (application) using their numeric ID assigned during
955
+ * registration and returns their complete information including permissions.
956
+ *
957
+ * @param granteeId - The unique numeric ID of the grantee (1-indexed)
958
+ * @returns Promise resolving to the grantee information, or null if not found
959
+ * @throws {BlockchainError} When contract read operation fails
960
+ * @throws {NetworkError} When unable to connect to the blockchain network
961
+ *
962
+ * @example
963
+ * ```typescript
964
+ * const grantee = await vana.permissions.getGranteeById(1);
965
+ *
966
+ * if (grantee) {
967
+ * console.log(`Grantee ID: ${grantee.id}`);
968
+ * console.log(`Address: ${grantee.granteeAddress}`);
969
+ * console.log(`Owner: ${grantee.owner}`);
970
+ * console.log(`Total permissions: ${grantee.permissionIds.length}`);
971
+ * } else {
972
+ * console.log('Grantee with ID 1 not found');
973
+ * }
974
+ * ```
975
+ */
976
+ getGranteeById(granteeId: number): Promise<Grantee | null>;
977
+ /**
978
+ * Builds EIP-712 typed data for grantee registration
979
+ *
980
+ * @param input - The register grantee input
981
+ * @returns Promise resolving to the typed data structure
982
+ * @private
983
+ */
984
+ private buildRegisterGranteeTypedData;
985
+ /**
986
+ * Submits a register grantee transaction with signature.
987
+ *
988
+ * @param typedData - The EIP-712 typed data structure for the registration
989
+ * @param _signature - The cryptographic signature authorizing the registration (currently unused)
990
+ * @returns Promise resolving to the transaction hash
991
+ * @private
992
+ */
993
+ private submitSignedRegisterGranteeTransaction;
994
+ /**
995
+ * Get all trusted server IDs for a user
996
+ *
997
+ * @param userAddress - User address to query (defaults to current user)
998
+ * @returns Promise resolving to array of server IDs
999
+ */
1000
+ getUserServerIds(userAddress?: Address): Promise<bigint[]>;
1001
+ /**
1002
+ * Get server ID at specific index for a user
1003
+ *
1004
+ * @param userAddress - User address to query
1005
+ * @param serverIndex - Index in the user's server list
1006
+ * @returns Promise resolving to server ID
1007
+ */
1008
+ getUserServerIdAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
1009
+ /**
1010
+ * Get the number of trusted servers for a user
1011
+ *
1012
+ * @param userAddress - User address to query (defaults to current user)
1013
+ * @returns Promise resolving to number of trusted servers
1014
+ */
1015
+ getUserServerCount(userAddress?: Address): Promise<bigint>;
1016
+ /**
1017
+ * Get detailed information about trusted servers for a user
1018
+ *
1019
+ * @param userAddress - User address to query (defaults to current user)
1020
+ * @returns Promise resolving to array of trusted server info
1021
+ */
1022
+ getUserTrustedServers(userAddress?: Address): Promise<TrustedServerInfo[]>;
1023
+ /**
1024
+ * Get trusted server info for a specific server ID and user
1025
+ *
1026
+ * @param userAddress - User address to query
1027
+ * @param serverId - Server ID to get info for
1028
+ * @returns Promise resolving to trusted server info
1029
+ */
1030
+ getUserTrustedServer(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
1031
+ /**
1032
+ * Get server information by server ID
1033
+ *
1034
+ * @param serverId - Server ID to get info for
1035
+ * @returns Promise resolving to server info
1036
+ */
1037
+ getServerInfo(serverId: bigint): Promise<ServerInfo>;
1038
+ /**
1039
+ * Get server information by server address
1040
+ *
1041
+ * @param serverAddress - Server address to get info for
1042
+ * @returns Promise resolving to server info
1043
+ */
1044
+ getServerInfoByAddress(serverAddress: Address): Promise<ServerInfo>;
1045
+ /**
1046
+ * Get all permission IDs for a user
1047
+ *
1048
+ * @param userAddress - User address to query (defaults to current user)
1049
+ * @returns Promise resolving to array of permission IDs
1050
+ */
1051
+ getUserPermissionIds(userAddress?: Address): Promise<bigint[]>;
1052
+ /**
1053
+ * Get permission ID at specific index for a user
1054
+ *
1055
+ * @param userAddress - User address to query
1056
+ * @param permissionIndex - Index in the user's permission list
1057
+ * @returns Promise resolving to permission ID
1058
+ */
1059
+ getUserPermissionIdAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
1060
+ /**
1061
+ * Get the number of permissions for a user
1062
+ *
1063
+ * @param userAddress - User address to query (defaults to current user)
1064
+ * @returns Promise resolving to number of permissions
1065
+ */
1066
+ getUserPermissionCount(userAddress?: Address): Promise<bigint>;
1067
+ /**
1068
+ * Get detailed permission information by permission ID
1069
+ *
1070
+ * @param permissionId - Permission ID to get info for
1071
+ * @returns Promise resolving to permission info
1072
+ */
1073
+ getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
1074
+ /**
1075
+ * Get all permission IDs for a specific file
1076
+ *
1077
+ * @param fileId - File ID to get permissions for
1078
+ * @returns Promise resolving to array of permission IDs
1079
+ */
1080
+ getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
1081
+ /**
1082
+ * Get all file IDs for a specific permission
1083
+ *
1084
+ * @param permissionId - Permission ID to get files for
1085
+ * @returns Promise resolving to array of file IDs
1086
+ */
1087
+ getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
1088
+ /**
1089
+ * Get all permissions for a specific file (alias for getFilePermissionIds)
1090
+ *
1091
+ * @param fileId - File ID to get permissions for
1092
+ * @returns Promise resolving to array of permission IDs
1093
+ */
1094
+ getFilePermissions(fileId: bigint): Promise<bigint[]>;
1095
+ /**
1096
+ * Get grantee information by grantee ID
1097
+ *
1098
+ * @param granteeId - Grantee ID to get info for
1099
+ * @returns Promise resolving to grantee info
1100
+ */
1101
+ getGranteeInfo(granteeId: bigint): Promise<GranteeInfo>;
1102
+ /**
1103
+ * Get grantee information by grantee address
1104
+ *
1105
+ * @param granteeAddress - Grantee address to get info for
1106
+ * @returns Promise resolving to grantee info
1107
+ */
1108
+ getGranteeInfoByAddress(granteeAddress: Address): Promise<GranteeInfo>;
1109
+ /**
1110
+ * Get all permission IDs for a specific grantee
1111
+ *
1112
+ * @param granteeId - Grantee ID to get permissions for
1113
+ * @returns Promise resolving to array of permission IDs
1114
+ */
1115
+ getGranteePermissionIds(granteeId: bigint): Promise<bigint[]>;
1116
+ /**
1117
+ * Get all permissions for a specific grantee (alias for getGranteePermissionIds)
1118
+ *
1119
+ * @param granteeId - Grantee ID to get permissions for
1120
+ * @returns Promise resolving to array of permission IDs
1121
+ */
1122
+ getGranteePermissions(granteeId: bigint): Promise<bigint[]>;
1123
+ /**
1124
+ * Get all server IDs for a user
1125
+ *
1126
+ * @param userAddress - User address to get server IDs for
1127
+ * @returns Promise resolving to array of server IDs
1128
+ */
1129
+ getUserServerIdsValues(userAddress: Address): Promise<bigint[]>;
1130
+ /**
1131
+ * Get server ID at specific index for a user
1132
+ *
1133
+ * @param userAddress - User address
1134
+ * @param serverIndex - Index of the server ID
1135
+ * @returns Promise resolving to server ID
1136
+ */
1137
+ getUserServerIdsAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
1138
+ /**
1139
+ * Get the number of servers a user has
1140
+ *
1141
+ * @param userAddress - User address
1142
+ * @returns Promise resolving to number of servers
1143
+ */
1144
+ getUserServerIdsLength(userAddress: Address): Promise<bigint>;
1145
+ /**
1146
+ * Get trusted server info for a specific user and server ID
1147
+ *
1148
+ * @param userAddress - User address
1149
+ * @param serverId - Server ID
1150
+ * @returns Promise resolving to trusted server info
1151
+ */
1152
+ getUserServers(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
1153
+ /**
1154
+ * Get server info by server ID
1155
+ *
1156
+ * @param serverId - Server ID
1157
+ * @returns Promise resolving to server info
1158
+ */
1159
+ getServers(serverId: bigint): Promise<ServerInfo>;
1160
+ /**
1161
+ * Get user info including nonce and trusted server IDs
1162
+ *
1163
+ * @param userAddress - User address
1164
+ * @returns Promise resolving to user info
1165
+ */
1166
+ getUsers(userAddress: Address): Promise<{
1167
+ nonce: bigint;
1168
+ trustedServerIds: bigint[];
1169
+ }>;
1170
+ /**
1171
+ * Update server URL
1172
+ *
1173
+ * @param serverId - Server ID to update
1174
+ * @param url - New URL for the server
1175
+ * @param options - Optional transaction options for gas parameters and timeout
1176
+ * @returns Promise resolving to transaction hash
1177
+ */
1178
+ submitUpdateServer(serverId: bigint, url: string, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "updateServer">>;
1179
+ /**
1180
+ * Get all permission IDs for a user
1181
+ *
1182
+ * @param userAddress - User address to get permission IDs for
1183
+ * @returns Promise resolving to array of permission IDs
1184
+ */
1185
+ getUserPermissionIdsValues(userAddress: Address): Promise<bigint[]>;
1186
+ /**
1187
+ * Get permission ID at specific index for a user
1188
+ *
1189
+ * @param userAddress - User address
1190
+ * @param permissionIndex - Index of the permission ID
1191
+ * @returns Promise resolving to permission ID
1192
+ */
1193
+ getUserPermissionIdsAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
1194
+ /**
1195
+ * Get the number of permissions a user has
1196
+ *
1197
+ * @param userAddress - User address
1198
+ * @returns Promise resolving to number of permissions
1199
+ */
1200
+ getUserPermissionIdsLength(userAddress: Address): Promise<bigint>;
1201
+ /**
1202
+ * Get permission info by permission ID
1203
+ *
1204
+ * @param permissionId - Permission ID
1205
+ * @returns Promise resolving to permission info
1206
+ */
1207
+ getPermissions(permissionId: bigint): Promise<PermissionInfo>;
1208
+ /**
1209
+ * Submit permission with signature to the blockchain (supports gasless transactions)
1210
+ *
1211
+ * @param params - Parameters for adding permission
1212
+ * @returns Promise resolving to transaction hash
1213
+ * @throws {RelayerError} When gasless transaction submission fails
1214
+ * @throws {SignatureError} When user rejects the signature request
1215
+ * @throws {BlockchainError} When permission addition fails
1216
+ * @throws {NetworkError} When network communication fails
1217
+ */
1218
+ submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
1219
+ /**
1220
+ * Submits an already-signed add permission transaction to the blockchain.
1221
+ * This method supports both relayer-based gasless transactions and direct transactions.
1222
+ *
1223
+ * @param typedData - The EIP-712 typed data for AddPermission
1224
+ * @param signature - The user's signature
1225
+ * @returns Promise resolving to TransactionResult with PermissionGrantResult event data
1226
+ * @throws {RelayerError} When gasless transaction submission fails
1227
+ * @throws {BlockchainError} When permission addition fails
1228
+ * @throws {NetworkError} When network communication fails
1229
+ */
1230
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
1231
+ /**
1232
+ * Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
1233
+ *
1234
+ * @remarks
1235
+ * This method validates files against their specified schemas before submission.
1236
+ * Schema validation ensures data conforms to expected formats before on-chain registration.
1237
+ * Files with schemaId = 0 bypass validation. The method supports atomic batch operations
1238
+ * where all files and permissions are registered in a single transaction.
1239
+ *
1240
+ * @param params - Parameters for adding server files and permissions
1241
+ * @param params.granteeId - The ID of the permission grantee
1242
+ * @param params.grant - Grant URL containing permission parameters (typically IPFS)
1243
+ * @param params.fileUrls - Array of file URLs to register
1244
+ * @param params.schemaIds - Schema IDs for each file. Use 0 for files without schema validation.
1245
+ * Array length must match fileUrls length.
1246
+ * @param params.serverAddress - Server wallet address for decryption permissions
1247
+ * @param params.serverUrl - Server endpoint URL
1248
+ * @param params.serverPublicKey - Server's public key for encryption.
1249
+ * Obtain via `vana.server.getIdentity(userAddress).publicKey`.
1250
+ * @param params.filePermissions - Nested array of permissions for each file
1251
+ * @param options - Optional transaction options for gas parameters and timeout.
1252
+ * Note: These options are only applied for direct blockchain transactions.
1253
+ * When using relayer callbacks (gasless transactions), these options are ignored.
1254
+ * @returns TransactionResult with immediate hash access and optional event data
1255
+ * @throws {Error} When schemaIds array length doesn't match fileUrls array length
1256
+ * @throws {SchemaValidationError} When file data doesn't match the specified schema.
1257
+ * Verify data structure matches schema definition from `vana.schemas.get(schemaId)`.
1258
+ * @throws {RelayerError} When gasless transaction submission fails.
1259
+ * Retry without relayer configuration to submit direct transaction.
1260
+ * @throws {SignatureError} When user rejects the signature request
1261
+ * @throws {BlockchainError} When server files and permissions addition fails
1262
+ * @throws {NetworkError} When network communication fails.
1263
+ * Check network connection or configure alternative gateways.
1264
+ *
1265
+ * @example
1266
+ * ```typescript
1267
+ * // Submit with custom gas parameters and timeout
1268
+ * const result = await vana.permissions.submitAddServerFilesAndPermissions({
1269
+ * granteeId: BigInt(1),
1270
+ * grant: "ipfs://QmXxx...",
1271
+ * fileUrls: ["https://storage.example.com/data.json"],
1272
+ * schemaIds: [123], // LinkedIn profile schema ID
1273
+ * serverAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
1274
+ * serverUrl: "https://server.example.com",
1275
+ * serverPublicKey: serverInfo.publicKey,
1276
+ * filePermissions: [[{
1277
+ * account: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
1278
+ * key: encryptedKey
1279
+ * }]]
1280
+ * }, {
1281
+ * maxFeePerGas: 100n * 10n ** 9n, // 100 gwei
1282
+ * maxPriorityFeePerGas: 2n * 10n ** 9n, // 2 gwei tip
1283
+ * });
1284
+ *
1285
+ * // Wait for confirmation with custom timeout
1286
+ * const receipt = await vana.waitForTransactionReceipt(result, {
1287
+ * timeout: 180000 // 3 minutes
1288
+ * });
1289
+ * console.log(`Transaction confirmed: ${receipt.transactionHash}`);
1290
+ * ```
1291
+ */
1292
+ submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addServerFilesAndPermissions">>;
1293
+ /**
1294
+ * Submits an already-signed add server files and permissions transaction to the blockchain.
1295
+ *
1296
+ * @remarks
1297
+ * This method returns a TransactionResult that provides immediate access to the transaction hash.
1298
+ * The eventData field may contain parsed event details after transaction confirmation.
1299
+ *
1300
+ * @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
1301
+ * @param signature - The user's signature
1302
+ * @param options - Optional transaction options for gas parameters and timeout.
1303
+ * Note: These options are only applied for direct blockchain transactions.
1304
+ * When using relayer callbacks (gasless transactions), these options are ignored.
1305
+ * @returns TransactionResult with immediate hash access and optional event data
1306
+ * @throws {RelayerError} When gasless transaction submission fails
1307
+ * @throws {BlockchainError} When server files and permissions addition fails
1308
+ * @throws {NetworkError} When network communication fails
1309
+ *
1310
+ * @example
1311
+ * ```typescript
1312
+ * const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
1313
+ * typedData,
1314
+ * signature
1315
+ * );
1316
+ * console.log(`Transaction submitted: ${tx.hash}`);
1317
+ *
1318
+ * // Wait for confirmation and get the permission ID
1319
+ * const { permissionId } = await tx.waitForEvents();
1320
+ * console.log(`Permission created with ID: ${permissionId}`);
1321
+ * ```
1322
+ */
1323
+ submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addServerFilesAndPermissions">>;
1324
+ /**
1325
+ * Submit permission revocation with signature to the blockchain
1326
+ *
1327
+ * @param permissionId - Permission ID to revoke
1328
+ * @param options - Optional transaction options for gas parameters and timeout
1329
+ * @returns Promise resolving to transaction hash
1330
+ */
1331
+ submitRevokePermission(permissionId: bigint, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermission">>;
1332
+ /**
1333
+ * Submits a signed add permission transaction directly to the blockchain.
1334
+ *
1335
+ * @param typedData - The typed data structure for the permission addition
1336
+ * @param signature - The cryptographic signature authorizing the transaction
1337
+ * @returns Promise resolving to the transaction hash
1338
+ */
1339
+ private submitDirectAddPermissionTransaction;
1340
+ /**
1341
+ * Submits a signed add server files and permissions transaction directly to the blockchain.
1342
+ *
1343
+ * @param typedData - The typed data structure for the server files and permissions addition
1344
+ * @param signature - The cryptographic signature authorizing the transaction
1345
+ * @returns Promise resolving to the transaction hash
1346
+ */
1347
+ private submitDirectAddServerFilesAndPermissionsTransaction;
1348
+ }