@opendatalabs/vana-sdk 0.1.0-alpha.fd33fc9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +33 -1
- package/dist/browser.js.map +1 -1
- package/dist/chains/index.cjs.map +1 -1
- package/dist/chains/index.d.ts +30 -1
- package/dist/chains/index.js.map +1 -1
- package/dist/client/__tests__/enhancedResponse.test.d.ts +1 -0
- package/dist/client/enhancedResponse.cjs +164 -0
- package/dist/client/enhancedResponse.cjs.map +1 -0
- package/dist/client/enhancedResponse.d.ts +120 -0
- package/dist/client/enhancedResponse.js +138 -0
- package/dist/client/enhancedResponse.js.map +1 -0
- package/dist/config/chains.cjs.map +1 -1
- package/dist/config/chains.d.ts +99 -0
- package/dist/config/chains.js.map +1 -1
- package/dist/contracts/contractController.cjs.map +1 -1
- package/dist/contracts/contractController.d.ts +66 -10
- package/dist/contracts/contractController.js.map +1 -1
- package/dist/controllers/__tests__/data-consistency-integration.test.d.ts +7 -0
- package/dist/controllers/__tests__/operations.processQueue.test.d.ts +1 -0
- package/dist/controllers/base.cjs +33 -0
- package/dist/controllers/base.cjs.map +1 -1
- package/dist/controllers/base.d.ts +10 -0
- package/dist/controllers/base.js +33 -0
- package/dist/controllers/base.js.map +1 -1
- package/dist/controllers/data.cjs +417 -276
- package/dist/controllers/data.cjs.map +1 -1
- package/dist/controllers/data.d.ts +246 -193
- package/dist/controllers/data.js +430 -279
- package/dist/controllers/data.js.map +1 -1
- package/dist/controllers/operations.cjs +430 -0
- package/dist/controllers/operations.cjs.map +1 -0
- package/dist/controllers/operations.d.ts +229 -0
- package/dist/controllers/operations.js +406 -0
- package/dist/controllers/operations.js.map +1 -0
- package/dist/controllers/permissions.cjs +690 -209
- package/dist/controllers/permissions.cjs.map +1 -1
- package/dist/controllers/permissions.d.ts +196 -68
- package/dist/controllers/permissions.js +690 -209
- package/dist/controllers/permissions.js.map +1 -1
- package/dist/controllers/protocol.cjs.map +1 -1
- package/dist/controllers/protocol.d.ts +27 -28
- package/dist/controllers/protocol.js.map +1 -1
- package/dist/controllers/schemas.cjs +104 -25
- package/dist/controllers/schemas.cjs.map +1 -1
- package/dist/controllers/schemas.d.ts +88 -40
- package/dist/controllers/schemas.js +104 -25
- package/dist/controllers/schemas.js.map +1 -1
- package/dist/controllers/server.cjs +269 -58
- package/dist/controllers/server.cjs.map +1 -1
- package/dist/controllers/server.d.ts +157 -52
- package/dist/controllers/server.js +269 -58
- package/dist/controllers/server.js.map +1 -1
- package/dist/core/__tests__/health.test.d.ts +1 -0
- package/dist/core/__tests__/inMemoryNonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/nonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/pollingManager.test.d.ts +4 -0
- package/dist/core/apiClient.cjs +53 -3
- package/dist/core/apiClient.cjs.map +1 -1
- package/dist/core/apiClient.d.ts +132 -7
- package/dist/core/apiClient.js +53 -3
- package/dist/core/apiClient.js.map +1 -1
- package/dist/core/generics.cjs +30 -3
- package/dist/core/generics.cjs.map +1 -1
- package/dist/core/generics.d.ts +95 -6
- package/dist/core/generics.js +30 -3
- package/dist/core/generics.js.map +1 -1
- package/dist/core/health.cjs +289 -0
- package/dist/core/health.cjs.map +1 -0
- package/dist/core/health.d.ts +143 -0
- package/dist/core/health.js +265 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/inMemoryNonceManager.cjs +138 -0
- package/dist/core/inMemoryNonceManager.cjs.map +1 -0
- package/dist/core/inMemoryNonceManager.d.ts +69 -0
- package/dist/core/inMemoryNonceManager.js +114 -0
- package/dist/core/inMemoryNonceManager.js.map +1 -0
- package/dist/core/nonceManager.cjs +304 -0
- package/dist/core/nonceManager.cjs.map +1 -0
- package/dist/core/nonceManager.d.ts +116 -0
- package/dist/core/nonceManager.js +280 -0
- package/dist/core/nonceManager.js.map +1 -0
- package/dist/core/pollingManager.cjs +292 -0
- package/dist/core/pollingManager.cjs.map +1 -0
- package/dist/core/pollingManager.d.ts +120 -0
- package/dist/core/pollingManager.js +268 -0
- package/dist/core/pollingManager.js.map +1 -0
- package/dist/core.cjs +55 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +54 -3
- package/dist/core.js +55 -1
- package/dist/core.js.map +1 -1
- package/dist/crypto/ecies/base.cjs +16 -3
- package/dist/crypto/ecies/base.cjs.map +1 -1
- package/dist/crypto/ecies/base.js +16 -3
- package/dist/crypto/ecies/base.js.map +1 -1
- package/dist/errors.cjs +29 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +64 -0
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -1
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DLPPerformanceImplementation.cjs +42 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +32 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js +42 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRegistryImplementation.cjs +5 -5
- package/dist/generated/abi/DLPRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRegistryImplementation.d.ts +4 -4
- package/dist/generated/abi/DLPRegistryImplementation.js +5 -5
- package/dist/generated/abi/DLPRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +166 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +129 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.js +166 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs +167 -19
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +127 -14
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js +167 -19
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs +0 -19
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +0 -14
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js +0 -19
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs +0 -19
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +0 -14
- package/dist/generated/abi/DataPortabilityServersImplementation.js +0 -19
- package/dist/generated/abi/DataPortabilityServersImplementation.js.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.cjs +0 -13
- package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.d.ts +0 -10
- package/dist/generated/abi/DataRegistryImplementation.js +0 -13
- package/dist/generated/abi/DataRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/SwapHelperImplementation.cjs +0 -43
- package/dist/generated/abi/SwapHelperImplementation.cjs.map +1 -1
- package/dist/generated/abi/SwapHelperImplementation.d.ts +0 -35
- package/dist/generated/abi/SwapHelperImplementation.js +0 -43
- package/dist/generated/abi/SwapHelperImplementation.js.map +1 -1
- package/dist/generated/abi/VanaEpochImplementation.cjs +195 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaEpochImplementation.d.ts +151 -0
- package/dist/generated/abi/VanaEpochImplementation.js +195 -0
- package/dist/generated/abi/VanaEpochImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs +22 -65
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +17 -51
- package/dist/generated/abi/VanaPoolEntityImplementation.js +22 -65
- package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs +113 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +85 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.js +113 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.js.map +1 -1
- package/dist/generated/abi/index.d.ts +546 -146
- package/dist/generated/event-types.cjs.map +1 -1
- package/dist/generated/event-types.d.ts +14 -8
- package/dist/generated/eventRegistry.cjs +42 -18
- package/dist/generated/eventRegistry.cjs.map +1 -1
- package/dist/generated/eventRegistry.js +42 -18
- package/dist/generated/eventRegistry.js.map +1 -1
- package/dist/generated/server/server-exports.cjs +22 -0
- package/dist/generated/server/server-exports.cjs.map +1 -1
- package/dist/generated/server/server-exports.d.ts +27 -10
- package/dist/generated/server/server-exports.js +17 -0
- package/dist/generated/server/server-exports.js.map +1 -1
- package/dist/generated/server/server.cjs.map +1 -1
- package/dist/generated/server/server.d.ts +771 -402
- package/dist/generated/subgraph.cjs +797 -32
- package/dist/generated/subgraph.cjs.map +1 -1
- package/dist/generated/subgraph.d.ts +135 -0
- package/dist/generated/subgraph.js +792 -32
- package/dist/generated/subgraph.js.map +1 -1
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +10 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.node.cjs +26 -0
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +49 -5
- package/dist/index.node.js +25 -1
- package/dist/index.node.js.map +1 -1
- package/dist/lib/__tests__/redisAtomicStore.test.d.ts +1 -0
- package/dist/lib/redisAtomicStore.cjs +201 -0
- package/dist/lib/redisAtomicStore.cjs.map +1 -0
- package/dist/lib/redisAtomicStore.d.ts +120 -0
- package/dist/lib/redisAtomicStore.js +177 -0
- package/dist/lib/redisAtomicStore.js.map +1 -0
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +39 -1
- package/dist/node.js.map +1 -1
- package/dist/platform/browser.cjs +160 -2
- package/dist/platform/browser.cjs.map +1 -1
- package/dist/platform/browser.d.ts +232 -12
- package/dist/platform/browser.js +160 -2
- package/dist/platform/browser.js.map +1 -1
- package/dist/platform/interface.cjs.map +1 -1
- package/dist/platform/interface.d.ts +283 -90
- package/dist/platform/node.cjs +163 -2
- package/dist/platform/node.cjs.map +1 -1
- package/dist/platform/node.d.ts +69 -6
- package/dist/platform/node.js +163 -2
- package/dist/platform/node.js.map +1 -1
- package/dist/server/relayerHandler.cjs +315 -81
- package/dist/server/relayerHandler.cjs.map +1 -1
- package/dist/server/relayerHandler.d.ts +35 -2
- package/dist/server/relayerHandler.js +315 -81
- package/dist/server/relayerHandler.js.map +1 -1
- package/dist/storage/index.cjs +3 -0
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/manager.cjs +108 -25
- package/dist/storage/manager.cjs.map +1 -1
- package/dist/storage/manager.d.ts +119 -25
- package/dist/storage/manager.js +108 -25
- package/dist/storage/manager.js.map +1 -1
- package/dist/storage/providers/callback-storage.cjs +86 -15
- package/dist/storage/providers/callback-storage.cjs.map +1 -1
- package/dist/storage/providers/callback-storage.d.ts +109 -20
- package/dist/storage/providers/callback-storage.js +86 -15
- package/dist/storage/providers/callback-storage.js.map +1 -1
- package/dist/storage/providers/dropbox.cjs +237 -0
- package/dist/storage/providers/dropbox.cjs.map +1 -0
- package/dist/storage/providers/dropbox.d.ts +39 -0
- package/dist/storage/providers/dropbox.js +215 -0
- package/dist/storage/providers/dropbox.js.map +1 -0
- package/dist/storage/providers/dropbox.test.d.ts +1 -0
- package/dist/storage/providers/pinata.cjs.map +1 -1
- package/dist/storage/providers/pinata.d.ts +12 -14
- package/dist/storage/providers/pinata.js.map +1 -1
- package/dist/tests/data-upload-owner-validation.test.d.ts +1 -0
- package/dist/tests/permissions-transaction-options.test.d.ts +1 -0
- package/dist/types/atomicStore.cjs +31 -0
- package/dist/types/atomicStore.cjs.map +1 -0
- package/dist/types/atomicStore.d.ts +236 -0
- package/dist/types/atomicStore.js +7 -0
- package/dist/types/atomicStore.js.map +1 -0
- package/dist/types/blockchain.cjs.map +1 -1
- package/dist/types/blockchain.d.ts +39 -11
- package/dist/types/chains.cjs.map +1 -1
- package/dist/types/chains.d.ts +74 -7
- package/dist/types/chains.js.map +1 -1
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.ts +38 -4
- package/dist/types/config.js.map +1 -1
- package/dist/types/contracts.cjs.map +1 -1
- package/dist/types/contracts.d.ts +71 -7
- package/dist/types/controller-context.cjs.map +1 -1
- package/dist/types/controller-context.d.ts +4 -1
- package/dist/types/data.cjs.map +1 -1
- package/dist/types/data.d.ts +11 -10
- package/dist/types/generics.cjs.map +1 -1
- package/dist/types/generics.d.ts +81 -10
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.ts +31 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/operationStore.cjs +17 -0
- package/dist/types/operationStore.cjs.map +1 -0
- package/dist/types/operationStore.d.ts +171 -0
- package/dist/types/operationStore.js +1 -0
- package/dist/types/operationStore.js.map +1 -0
- package/dist/types/operations.cjs +3 -15
- package/dist/types/operations.cjs.map +1 -1
- package/dist/types/operations.d.ts +131 -39
- package/dist/types/operations.js +2 -13
- package/dist/types/operations.js.map +1 -1
- package/dist/types/options.cjs +17 -0
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.ts +308 -0
- package/dist/types/options.js +1 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/permissions.cjs.map +1 -1
- package/dist/types/permissions.d.ts +19 -20
- package/dist/types/personal.cjs.map +1 -1
- package/dist/types/personal.d.ts +150 -14
- package/dist/types/relayer.cjs.map +1 -1
- package/dist/types/relayer.d.ts +145 -24
- package/dist/types/storage.cjs.map +1 -1
- package/dist/types/storage.d.ts +9 -21
- package/dist/types/storage.js.map +1 -1
- package/dist/types/utils.cjs.map +1 -1
- package/dist/types/utils.d.ts +0 -45
- package/dist/utils/__tests__/chainQuery.test.d.ts +1 -0
- package/dist/utils/__tests__/subgraphConsistency.test.d.ts +4 -0
- package/dist/utils/__tests__/subgraphPagination.test.d.ts +4 -0
- package/dist/utils/chainQuery.cjs +107 -0
- package/dist/utils/chainQuery.cjs.map +1 -0
- package/dist/utils/chainQuery.d.ts +31 -0
- package/dist/utils/chainQuery.js +82 -0
- package/dist/utils/chainQuery.js.map +1 -0
- package/dist/utils/grantFiles.cjs +4 -1
- package/dist/utils/grantFiles.cjs.map +1 -1
- package/dist/utils/grantFiles.d.ts +10 -20
- package/dist/utils/grantFiles.js +4 -1
- package/dist/utils/grantFiles.js.map +1 -1
- package/dist/utils/grantValidation.cjs.map +1 -1
- package/dist/utils/grantValidation.d.ts +95 -16
- package/dist/utils/grantValidation.js.map +1 -1
- package/dist/utils/grants.cjs.map +1 -1
- package/dist/utils/grants.d.ts +93 -12
- package/dist/utils/grants.js.map +1 -1
- package/dist/utils/ipfs.cjs +2 -4
- package/dist/utils/ipfs.cjs.map +1 -1
- package/dist/utils/ipfs.d.ts +1 -1
- package/dist/utils/ipfs.js +2 -4
- package/dist/utils/ipfs.js.map +1 -1
- package/dist/utils/lazy-import.cjs.map +1 -1
- package/dist/utils/lazy-import.d.ts +32 -7
- package/dist/utils/lazy-import.js.map +1 -1
- package/dist/utils/signatureCache.cjs +8 -2
- package/dist/utils/signatureCache.cjs.map +1 -1
- package/dist/utils/signatureCache.d.ts +49 -8
- package/dist/utils/signatureCache.js +8 -2
- package/dist/utils/signatureCache.js.map +1 -1
- package/dist/utils/subgraphConsistency.cjs +184 -0
- package/dist/utils/subgraphConsistency.cjs.map +1 -0
- package/dist/utils/subgraphConsistency.d.ts +65 -0
- package/dist/utils/subgraphConsistency.js +155 -0
- package/dist/utils/subgraphConsistency.js.map +1 -0
- package/dist/utils/subgraphMetaCache.cjs +101 -0
- package/dist/utils/subgraphMetaCache.cjs.map +1 -0
- package/dist/utils/subgraphMetaCache.d.ts +56 -0
- package/dist/utils/subgraphMetaCache.js +76 -0
- package/dist/utils/subgraphMetaCache.js.map +1 -0
- package/dist/utils/subgraphPagination.cjs +104 -0
- package/dist/utils/subgraphPagination.cjs.map +1 -0
- package/dist/utils/subgraphPagination.d.ts +78 -0
- package/dist/utils/subgraphPagination.js +78 -0
- package/dist/utils/subgraphPagination.js.map +1 -0
- package/dist/utils/transactionHelpers.cjs.map +1 -1
- package/dist/utils/transactionHelpers.d.ts +12 -12
- package/dist/utils/transactionHelpers.js.map +1 -1
- package/dist/utils/typedDataConverter.cjs.map +1 -1
- package/dist/utils/typedDataConverter.d.ts +39 -3
- package/dist/utils/typedDataConverter.js.map +1 -1
- package/dist/utils/urlResolver.cjs +7 -0
- package/dist/utils/urlResolver.cjs.map +1 -1
- package/dist/utils/urlResolver.d.ts +22 -4
- package/dist/utils/urlResolver.js +7 -0
- package/dist/utils/urlResolver.js.map +1 -1
- package/dist/utils/wallet.cjs.map +1 -1
- package/dist/utils/wallet.d.ts +78 -16
- package/dist/utils/wallet.js.map +1 -1
- package/package.json +3 -1
|
@@ -1,69 +1,78 @@
|
|
|
1
|
-
import type { CreateOperationParams, InitPersonalServerParams, PersonalServerIdentity } from "../types";
|
|
1
|
+
import type { CreateOperationParams, InitPersonalServerParams, PersonalServerIdentity, DownloadArtifactParams } from "../types";
|
|
2
|
+
import type { CreateOperationResponse } from "../generated/server/server-exports";
|
|
2
3
|
import type { ControllerContext } from "./permissions";
|
|
3
4
|
import type { Operation, PollingOptions } from "../types/operations";
|
|
4
5
|
import { BaseController } from "./base";
|
|
5
6
|
/**
|
|
6
|
-
* Manages
|
|
7
|
+
* Manages personal server interactions for secure data processing.
|
|
7
8
|
*
|
|
8
9
|
* @remarks
|
|
9
|
-
*
|
|
10
|
-
* and identity
|
|
11
|
-
*
|
|
12
|
-
* cryptographic keys for secure data sharing. All server interactions use the
|
|
13
|
-
* Replicate API infrastructure with proper authentication and error handling.
|
|
10
|
+
* Handles communication with personal servers for computation requests
|
|
11
|
+
* and identity retrieval. Personal servers process user data with
|
|
12
|
+
* cryptographic verification, ensuring privacy and permission compliance.
|
|
14
13
|
*
|
|
15
|
-
* **
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* **Architecture:**
|
|
15
|
+
* Servers use deterministic key derivation from user addresses.
|
|
16
|
+
* Identity cached for offline retrieval. Operations authenticated
|
|
17
|
+
* via wallet signatures and permission verification.
|
|
18
18
|
*
|
|
19
19
|
* **Method Selection:**
|
|
20
|
-
* - `getIdentity()`
|
|
21
|
-
* - `createOperation()`
|
|
22
|
-
* - `getOperation()`
|
|
23
|
-
* - `
|
|
20
|
+
* - `getIdentity()` - Retrieve server public key for encryption
|
|
21
|
+
* - `createOperation()` - Submit computation with permission ID
|
|
22
|
+
* - `getOperation()` - Check status and retrieve results
|
|
23
|
+
* - `waitForOperation()` - Poll until completion or timeout
|
|
24
|
+
* - `cancelOperation()` - Stop running operations
|
|
24
25
|
*
|
|
25
|
-
* **Workflow
|
|
26
|
-
*
|
|
26
|
+
* **Typical Workflow:**
|
|
27
|
+
* 1. Get server identity for encryption key
|
|
28
|
+
* 2. Create operation with permission ID
|
|
29
|
+
* 3. Poll for completion
|
|
30
|
+
* 4. Retrieve results
|
|
27
31
|
*
|
|
28
32
|
* @example
|
|
29
33
|
* ```typescript
|
|
30
|
-
* // Get
|
|
34
|
+
* // Get server identity for encryption
|
|
31
35
|
* const identity = await vana.server.getIdentity({
|
|
32
36
|
* userAddress: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36"
|
|
33
37
|
* });
|
|
38
|
+
* console.log(`Server key: ${identity.publicKey}`);
|
|
34
39
|
*
|
|
35
|
-
* //
|
|
36
|
-
* const
|
|
37
|
-
* permissionId: 123
|
|
40
|
+
* // Submit computation request
|
|
41
|
+
* const operation = await vana.server.createOperation({
|
|
42
|
+
* permissionId: 123
|
|
38
43
|
* });
|
|
39
44
|
*
|
|
40
|
-
* //
|
|
41
|
-
* const result = await vana.server.
|
|
45
|
+
* // Wait for results
|
|
46
|
+
* const result = await vana.server.waitForOperation(operation.id);
|
|
47
|
+
* console.log("Processing complete:", result.result);
|
|
42
48
|
* ```
|
|
49
|
+
*
|
|
43
50
|
* @category Server Management
|
|
44
|
-
* @see {@link https://docs.vana.
|
|
51
|
+
* @see For conceptual overview, visit {@link https://docs.vana.org/docs/personal-servers}
|
|
45
52
|
*/
|
|
46
53
|
export declare class ServerController extends BaseController {
|
|
47
54
|
constructor(context: ControllerContext);
|
|
48
55
|
private get personalServerBaseUrl();
|
|
49
56
|
/**
|
|
50
|
-
* Retrieves
|
|
57
|
+
* Retrieves cryptographic identity for a personal server.
|
|
51
58
|
*
|
|
52
59
|
* @remarks
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
61
|
-
*
|
|
62
|
-
* @throws {NetworkError}
|
|
63
|
-
*
|
|
60
|
+
* Fetches public key and metadata required for data encryption.
|
|
61
|
+
* Identity cached by infrastructure for offline retrieval.
|
|
62
|
+
* Each user address maps to deterministic server identity.
|
|
63
|
+
*
|
|
64
|
+
* @param request - Identity request parameters
|
|
65
|
+
* @param request.userAddress - Wallet address of server owner
|
|
66
|
+
*
|
|
67
|
+
* @returns Server identity with public key and metadata
|
|
68
|
+
*
|
|
69
|
+
* @throws {NetworkError} Identity service unavailable.
|
|
70
|
+
* Check network connection and server URL configuration.
|
|
71
|
+
* @throws {PersonalServerError} Identity retrieval failed.
|
|
72
|
+
* Verify user address and server registration.
|
|
73
|
+
*
|
|
64
74
|
* @example
|
|
65
75
|
* ```typescript
|
|
66
|
-
* // Get server identity for data encryption
|
|
67
76
|
* const identity = await vana.server.getIdentity({
|
|
68
77
|
* userAddress: "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36"
|
|
69
78
|
* });
|
|
@@ -72,60 +81,63 @@ export declare class ServerController extends BaseController {
|
|
|
72
81
|
* console.log(`Address: ${identity.address}`);
|
|
73
82
|
* console.log(`Public Key: ${identity.publicKey}`);
|
|
74
83
|
*
|
|
75
|
-
* // Use
|
|
76
|
-
* const
|
|
77
|
-
*
|
|
84
|
+
* // Use for encryption before data sharing
|
|
85
|
+
* const encrypted = await encryptWithPublicKey(
|
|
86
|
+
* data,
|
|
78
87
|
* identity.publicKey
|
|
79
88
|
* );
|
|
80
89
|
* ```
|
|
81
90
|
*/
|
|
82
91
|
getIdentity(request: InitPersonalServerParams): Promise<PersonalServerIdentity>;
|
|
83
92
|
/**
|
|
84
|
-
* Creates a server operation and returns its details
|
|
93
|
+
* Creates a server operation and returns its details from the OpenAPI schema.
|
|
85
94
|
*
|
|
86
95
|
* @remarks
|
|
87
96
|
* This method submits a computation request to the personal server and returns
|
|
88
|
-
*
|
|
89
|
-
*
|
|
97
|
+
* the server's CreateOperationResponse. The response contains the operation ID
|
|
98
|
+
* which can be used with `waitForOperation()` to poll for completion.
|
|
90
99
|
*
|
|
91
100
|
* @param params - The operation request parameters
|
|
92
101
|
* @param params.permissionId - The permission ID authorizing this operation.
|
|
93
102
|
* Obtain via `vana.permissions.getUserPermissionGrantsOnChain()`.
|
|
94
|
-
* @returns
|
|
103
|
+
* @returns Server response with operation ID
|
|
95
104
|
* @throws {PersonalServerError} When the server request fails or parameters are invalid
|
|
96
105
|
* @throws {NetworkError} When personal server API communication fails
|
|
97
106
|
* @example
|
|
98
107
|
* ```typescript
|
|
99
|
-
* const
|
|
108
|
+
* const response = await vana.server.createOperation({
|
|
100
109
|
* permissionId: 123
|
|
101
110
|
* });
|
|
102
|
-
* console.log(`Operation ID: ${
|
|
111
|
+
* console.log(`Operation ID: ${response.id}`);
|
|
103
112
|
*
|
|
104
113
|
* // Wait for completion
|
|
105
|
-
* const result = await vana.server.waitForOperation(
|
|
114
|
+
* const result = await vana.server.waitForOperation(response.id);
|
|
106
115
|
* console.log("Result:", result.result);
|
|
107
116
|
* ```
|
|
108
117
|
*/
|
|
109
|
-
createOperation
|
|
118
|
+
createOperation(params: CreateOperationParams): Promise<CreateOperationResponse>;
|
|
110
119
|
/**
|
|
111
120
|
* Retrieves the current status and result of a server operation.
|
|
112
121
|
*
|
|
113
122
|
* @remarks
|
|
114
|
-
* Common status values: `starting`, `
|
|
123
|
+
* Common status values: `starting`, `processing`, `succeeded`, `failed`, `canceled`.
|
|
115
124
|
* When status is `succeeded`, the result field contains the operation output.
|
|
125
|
+
* Returns the server response directly from the OpenAPI schema.
|
|
116
126
|
*
|
|
117
127
|
* @param operationId - The ID of the operation to query
|
|
118
|
-
* @returns The operation
|
|
128
|
+
* @returns The operation status response from the server
|
|
119
129
|
* @throws {NetworkError} When the API request fails or returns invalid data
|
|
120
130
|
* @example
|
|
121
131
|
* ```typescript
|
|
122
132
|
* const operation = await vana.server.getOperation(operationId);
|
|
123
133
|
* if (operation.status === 'succeeded') {
|
|
124
134
|
* console.log('Result:', operation.result);
|
|
135
|
+
* console.log('Started at:', operation.started_at);
|
|
136
|
+
* console.log('Finished at:', operation.finished_at);
|
|
125
137
|
* }
|
|
126
138
|
* ```
|
|
127
139
|
*/
|
|
128
|
-
getOperation
|
|
140
|
+
getOperation(operationId: string): Promise<Operation>;
|
|
129
141
|
/**
|
|
130
142
|
* Waits for an operation to complete and returns the final result.
|
|
131
143
|
*
|
|
@@ -133,10 +145,11 @@ export declare class ServerController extends BaseController {
|
|
|
133
145
|
* This method polls the operation status at regular intervals until it
|
|
134
146
|
* reaches a terminal state (succeeded, failed, or canceled). Supports
|
|
135
147
|
* ergonomic overloads to accept either an Operation object or just the ID.
|
|
148
|
+
* Returns the server response directly from the OpenAPI schema.
|
|
136
149
|
*
|
|
137
150
|
* @param opOrId - Either an Operation object or operation ID string
|
|
138
151
|
* @param options - Optional polling configuration
|
|
139
|
-
* @returns The completed operation with result
|
|
152
|
+
* @returns The completed operation with result and timestamp data
|
|
140
153
|
* @throws {PersonalServerError} When the operation fails or times out
|
|
141
154
|
* @example
|
|
142
155
|
* ```typescript
|
|
@@ -152,9 +165,94 @@ export declare class ServerController extends BaseController {
|
|
|
152
165
|
* timeout: 60000,
|
|
153
166
|
* pollingInterval: 1000
|
|
154
167
|
* });
|
|
168
|
+
*
|
|
169
|
+
* // Access server-provided timestamps
|
|
170
|
+
* console.log('Started:', completed.started_at);
|
|
171
|
+
* console.log('Finished:', completed.finished_at);
|
|
155
172
|
* ```
|
|
156
173
|
*/
|
|
157
|
-
waitForOperation
|
|
174
|
+
waitForOperation(opOrId: Operation | string, options?: PollingOptions): Promise<Operation>;
|
|
175
|
+
/**
|
|
176
|
+
* Downloads an artifact generated by a server operation.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* Artifacts are files generated during operations like Gemini agent analysis.
|
|
180
|
+
* The download requires authentication using the application's signature.
|
|
181
|
+
* This method returns the artifact as a Blob that can be saved or processed.
|
|
182
|
+
*
|
|
183
|
+
* **Simplified Signature Scheme:**
|
|
184
|
+
* The signature is generated over the operation ID only, allowing a single signature
|
|
185
|
+
* to be reused for listing and downloading multiple artifacts from the same operation.
|
|
186
|
+
* This simplifies client implementation while maintaining security - access to the
|
|
187
|
+
* operation ID grants access to all artifacts.
|
|
188
|
+
*
|
|
189
|
+
* @param params - The download parameters
|
|
190
|
+
* @param params.operationId - The operation ID that generated the artifact
|
|
191
|
+
* @param params.artifactPath - The path to the artifact file to download
|
|
192
|
+
* @returns A Blob containing the artifact data
|
|
193
|
+
* @throws {PersonalServerError} When the artifact cannot be downloaded or doesn't exist
|
|
194
|
+
* @throws {NetworkError} When unable to reach the personal server API
|
|
195
|
+
* @throws {SignatureError} When unable to create the required signature
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* // Download an artifact after a Gemini operation
|
|
199
|
+
* const blob = await vana.server.downloadArtifact({
|
|
200
|
+
* operationId: 'op_123',
|
|
201
|
+
* artifactPath: 'analysis_report.pdf'
|
|
202
|
+
* });
|
|
203
|
+
*
|
|
204
|
+
* // Save to file in Node.js
|
|
205
|
+
* const buffer = await blob.arrayBuffer();
|
|
206
|
+
* fs.writeFileSync('report.pdf', Buffer.from(buffer));
|
|
207
|
+
*
|
|
208
|
+
* // Or create download link in browser
|
|
209
|
+
* const url = URL.createObjectURL(blob);
|
|
210
|
+
* const a = document.createElement('a');
|
|
211
|
+
* a.href = url;
|
|
212
|
+
* a.download = 'report.pdf';
|
|
213
|
+
* a.click();
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
downloadArtifact(params: DownloadArtifactParams): Promise<Blob>;
|
|
217
|
+
/**
|
|
218
|
+
* Lists all artifacts generated by a server operation.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* Retrieves metadata for all artifact files produced by an operation,
|
|
222
|
+
* including file paths, sizes, and content types. This provides visibility
|
|
223
|
+
* into available outputs without downloading them.
|
|
224
|
+
*
|
|
225
|
+
* **Simplified Signature Scheme:**
|
|
226
|
+
* Uses the same signature as downloadArtifact - signs only operation_id.
|
|
227
|
+
* This allows reusing the same signature for listing and downloading.
|
|
228
|
+
*
|
|
229
|
+
* @param operationId - The operation ID that generated the artifacts
|
|
230
|
+
* @returns Promise resolving to array of artifact metadata objects
|
|
231
|
+
* @throws {PersonalServerError} When artifacts cannot be listed
|
|
232
|
+
* @throws {NetworkError} When unable to reach the personal server API
|
|
233
|
+
* @throws {SignatureError} When unable to create the required signature
|
|
234
|
+
* @example
|
|
235
|
+
* ```typescript
|
|
236
|
+
* // List artifacts from a Gemini operation
|
|
237
|
+
* const artifacts = await vana.server.listArtifacts('op_123');
|
|
238
|
+
*
|
|
239
|
+
* console.log(`Found ${artifacts.length} artifacts:`);
|
|
240
|
+
* artifacts.forEach(artifact => {
|
|
241
|
+
* console.log(`- ${artifact.path} (${artifact.size} bytes)`);
|
|
242
|
+
* });
|
|
243
|
+
*
|
|
244
|
+
* // Download a specific artifact
|
|
245
|
+
* const blob = await vana.server.downloadArtifact({
|
|
246
|
+
* operationId: 'op_123',
|
|
247
|
+
* artifactPath: artifacts[0].path
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
listArtifacts(operationId: string): Promise<Array<{
|
|
252
|
+
path: string;
|
|
253
|
+
size: number;
|
|
254
|
+
content_type: string;
|
|
255
|
+
}>>;
|
|
158
256
|
/**
|
|
159
257
|
* Cancels a running operation on the personal server.
|
|
160
258
|
*
|
|
@@ -207,6 +305,13 @@ export declare class ServerController extends BaseController {
|
|
|
207
305
|
* @returns JSON string representation of the request data
|
|
208
306
|
*/
|
|
209
307
|
private makeRequest;
|
|
308
|
+
/**
|
|
309
|
+
* Gets the account address from the wallet client.
|
|
310
|
+
*
|
|
311
|
+
* @returns The account address
|
|
312
|
+
* @throws {Error} When no account is available
|
|
313
|
+
*/
|
|
314
|
+
private getAccountAddress;
|
|
210
315
|
/**
|
|
211
316
|
* Creates a signature for the request JSON.
|
|
212
317
|
*
|