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