@opendatalabs/vana-sdk 0.1.0-alpha.170e27e → 0.1.0-alpha.18ba63a

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.
@@ -1752,6 +1752,12 @@ interface UserFile$1 {
1752
1752
  transactionHash?: Address;
1753
1753
  /** Additional file properties and custom application data. */
1754
1754
  metadata?: FileMetadata;
1755
+ /**
1756
+ * Array of DLP IDs that have submitted proofs for this file.
1757
+ * Each proof represents verification or processing by a Data Liquidity Pool.
1758
+ * Obtain DLP details via `vana.data.getDLP(dlpId)`.
1759
+ */
1760
+ dlpIds?: number[];
1755
1761
  }
1756
1762
  /**
1757
1763
  * Provides optional metadata for uploaded files and content description.
@@ -5230,6 +5236,31 @@ declare const contractAbis: {
5230
5236
  }];
5231
5237
  readonly name: "FileAdded";
5232
5238
  readonly type: "event";
5239
+ }, {
5240
+ readonly anonymous: false;
5241
+ readonly inputs: readonly [{
5242
+ readonly indexed: true;
5243
+ readonly internalType: "uint256";
5244
+ readonly name: "fileId";
5245
+ readonly type: "uint256";
5246
+ }, {
5247
+ readonly indexed: true;
5248
+ readonly internalType: "address";
5249
+ readonly name: "ownerAddress";
5250
+ readonly type: "address";
5251
+ }, {
5252
+ readonly indexed: false;
5253
+ readonly internalType: "string";
5254
+ readonly name: "url";
5255
+ readonly type: "string";
5256
+ }, {
5257
+ readonly indexed: false;
5258
+ readonly internalType: "uint256";
5259
+ readonly name: "schemaId";
5260
+ readonly type: "uint256";
5261
+ }];
5262
+ readonly name: "FileAddedV2";
5263
+ readonly type: "event";
5233
5264
  }, {
5234
5265
  readonly anonymous: false;
5235
5266
  readonly inputs: readonly [{
@@ -5420,6 +5451,16 @@ declare const contractAbis: {
5420
5451
  }];
5421
5452
  readonly name: "Upgraded";
5422
5453
  readonly type: "event";
5454
+ }, {
5455
+ readonly inputs: readonly [];
5456
+ readonly name: "DATA_PORTABILITY_ROLE";
5457
+ readonly outputs: readonly [{
5458
+ readonly internalType: "bytes32";
5459
+ readonly name: "";
5460
+ readonly type: "bytes32";
5461
+ }];
5462
+ readonly stateMutability: "view";
5463
+ readonly type: "function";
5423
5464
  }, {
5424
5465
  readonly inputs: readonly [];
5425
5466
  readonly name: "DEFAULT_ADMIN_ROLE";
@@ -5492,6 +5533,33 @@ declare const contractAbis: {
5492
5533
  readonly outputs: readonly [];
5493
5534
  readonly stateMutability: "nonpayable";
5494
5535
  readonly type: "function";
5536
+ }, {
5537
+ readonly inputs: readonly [{
5538
+ readonly internalType: "uint256";
5539
+ readonly name: "fileId";
5540
+ readonly type: "uint256";
5541
+ }, {
5542
+ readonly components: readonly [{
5543
+ readonly internalType: "address";
5544
+ readonly name: "account";
5545
+ readonly type: "address";
5546
+ }, {
5547
+ readonly internalType: "string";
5548
+ readonly name: "key";
5549
+ readonly type: "string";
5550
+ }];
5551
+ readonly internalType: "struct IDataRegistry.Permission[]";
5552
+ readonly name: "permissions";
5553
+ readonly type: "tuple[]";
5554
+ }, {
5555
+ readonly internalType: "uint256";
5556
+ readonly name: "schemaId";
5557
+ readonly type: "uint256";
5558
+ }];
5559
+ readonly name: "addFilePermissionsAndSchema";
5560
+ readonly outputs: readonly [];
5561
+ readonly stateMutability: "nonpayable";
5562
+ readonly type: "function";
5495
5563
  }, {
5496
5564
  readonly inputs: readonly [{
5497
5565
  readonly internalType: "string";
@@ -5656,6 +5724,16 @@ declare const contractAbis: {
5656
5724
  }];
5657
5725
  readonly stateMutability: "view";
5658
5726
  readonly type: "function";
5727
+ }, {
5728
+ readonly inputs: readonly [];
5729
+ readonly name: "emitLegacyEvents";
5730
+ readonly outputs: readonly [{
5731
+ readonly internalType: "bool";
5732
+ readonly name: "";
5733
+ readonly type: "bool";
5734
+ }];
5735
+ readonly stateMutability: "view";
5736
+ readonly type: "function";
5659
5737
  }, {
5660
5738
  readonly inputs: readonly [{
5661
5739
  readonly internalType: "string";
@@ -5774,6 +5852,10 @@ declare const contractAbis: {
5774
5852
  readonly internalType: "string";
5775
5853
  readonly name: "url";
5776
5854
  readonly type: "string";
5855
+ }, {
5856
+ readonly internalType: "uint256";
5857
+ readonly name: "schemaId";
5858
+ readonly type: "uint256";
5777
5859
  }, {
5778
5860
  readonly internalType: "uint256";
5779
5861
  readonly name: "addedAtBlock";
@@ -5991,6 +6073,16 @@ declare const contractAbis: {
5991
6073
  readonly outputs: readonly [];
5992
6074
  readonly stateMutability: "nonpayable";
5993
6075
  readonly type: "function";
6076
+ }, {
6077
+ readonly inputs: readonly [{
6078
+ readonly internalType: "bool";
6079
+ readonly name: "newEmitLegacyEvents";
6080
+ readonly type: "bool";
6081
+ }];
6082
+ readonly name: "updateEmitLegacyEvents";
6083
+ readonly outputs: readonly [];
6084
+ readonly stateMutability: "nonpayable";
6085
+ readonly type: "function";
5994
6086
  }, {
5995
6087
  readonly inputs: readonly [{
5996
6088
  readonly internalType: "address";
@@ -28839,19 +28931,19 @@ declare const EVENT_MAPPINGS: {
28839
28931
  };
28840
28932
  readonly addFile: {
28841
28933
  readonly contract: "DataRegistry";
28842
- readonly event: "FileAdded";
28934
+ readonly event: "FileAddedV2";
28843
28935
  };
28844
28936
  readonly addFileWithPermissionsAndSchema: {
28845
28937
  readonly contract: "DataRegistry";
28846
- readonly event: "FileAdded";
28938
+ readonly event: "FileAddedV2";
28847
28939
  };
28848
28940
  readonly addFileWithSchema: {
28849
28941
  readonly contract: "DataRegistry";
28850
- readonly event: "FileAdded";
28942
+ readonly event: "FileAddedV2";
28851
28943
  };
28852
28944
  readonly addFileWithPermissions: {
28853
28945
  readonly contract: "DataRegistry";
28854
- readonly event: "FileAdded";
28946
+ readonly event: "FileAddedV2";
28855
28947
  };
28856
28948
  readonly addRefinement: {
28857
28949
  readonly contract: "DataRegistry";
@@ -31630,16 +31722,16 @@ declare class SchemaValidationError extends Error {
31630
31722
  }>);
31631
31723
  }
31632
31724
  /**
31633
- * Schema validation utility class
31725
+ * Data schema validation utility class
31634
31726
  */
31635
31727
  declare class SchemaValidator {
31636
31728
  private ajv;
31637
31729
  private dataSchemaValidator;
31638
31730
  constructor();
31639
31731
  /**
31640
- * Validates a data schema against the Vana meta-schema
31732
+ * Validates a data schema definition against the Vana meta-schema
31641
31733
  *
31642
- * @param schema - The data schema to validate
31734
+ * @param schema - The data schema definition to validate
31643
31735
  * @throws SchemaValidationError if invalid
31644
31736
  * @example
31645
31737
  * ```typescript
@@ -31658,15 +31750,15 @@ declare class SchemaValidator {
31658
31750
  * }
31659
31751
  * };
31660
31752
  *
31661
- * validator.validateDataSchema(schema); // throws if invalid
31753
+ * validator.validateDataSchemaAgainstMetaSchema(schema); // throws if invalid
31662
31754
  * ```
31663
31755
  */
31664
- validateDataSchema(schema: unknown): asserts schema is DataSchema;
31756
+ validateDataSchemaAgainstMetaSchema(schema: unknown): asserts schema is DataSchema;
31665
31757
  /**
31666
- * Validates data against a JSON Schema from a schema
31758
+ * Validates data against a JSON Schema
31667
31759
  *
31668
31760
  * @param data - The data to validate
31669
- * @param schema - The schema containing the validation rules (DataSchema or Schema)
31761
+ * @param schema - The schema containing the validation rules (must have been validated or fetched from chain)
31670
31762
  * @throws SchemaValidationError if invalid
31671
31763
  * @example
31672
31764
  * ```typescript
@@ -31676,13 +31768,13 @@ declare class SchemaValidator {
31676
31768
  * const schema = await vana.schemas.get(1);
31677
31769
  * validator.validateDataAgainstSchema(userData, schema);
31678
31770
  *
31679
- * // Also works with DataSchema object
31680
- * const dataSchema: DataSchema = {
31771
+ * // Also works with pre-validated DataSchema object
31772
+ * const dataSchema = validator.validateDataSchemaAgainstMetaSchema({
31681
31773
  * name: "User Profile",
31682
31774
  * version: "1.0.0",
31683
31775
  * dialect: "json",
31684
31776
  * schema: { type: "object", properties: { name: { type: "string" } } }
31685
- * };
31777
+ * });
31686
31778
  * validator.validateDataAgainstSchema(userData, dataSchema);
31687
31779
  * ```
31688
31780
  */
@@ -31697,9 +31789,9 @@ declare class SchemaValidator {
31697
31789
  */
31698
31790
  validateSQLiteDDL(ddl: string, dialectVersion?: string): void;
31699
31791
  /**
31700
- * Fetches and validates a schema from a URL
31792
+ * Fetches and validates a data schema from a URL
31701
31793
  *
31702
- * @param url - The URL to fetch the schema from
31794
+ * @param url - The URL to fetch the data schema from
31703
31795
  * @returns The validated data schema
31704
31796
  * @throws SchemaValidationError if invalid or fetch fails
31705
31797
  * @example
@@ -31715,13 +31807,24 @@ declare class SchemaValidator {
31715
31807
  */
31716
31808
  declare const schemaValidator: SchemaValidator;
31717
31809
  /**
31718
- * Convenience function to validate a data schema
31810
+ * Convenience function to validate a data schema definition against the Vana meta-schema
31719
31811
  *
31720
- * @param schema - The data schema to validate
31721
- * @returns void - Assertion function that doesn't return a value
31812
+ * @param schema - The data schema definition to validate
31813
+ * @returns The validated DataSchema
31722
31814
  * @throws SchemaValidationError if invalid
31815
+ * @example
31816
+ * ```typescript
31817
+ * const schemaDefinition = {
31818
+ * name: "User Profile",
31819
+ * version: "1.0.0",
31820
+ * dialect: "json",
31821
+ * schema: { type: "object", properties: { name: { type: "string" } } }
31822
+ * };
31823
+ *
31824
+ * const validatedSchema = validateDataSchemaAgainstMetaSchema(schemaDefinition);
31825
+ * ```
31723
31826
  */
31724
- declare function validateDataSchema(schema: unknown): asserts schema is DataSchema;
31827
+ declare function validateDataSchemaAgainstMetaSchema(schema: unknown): DataSchema;
31725
31828
  /**
31726
31829
  * Convenience function to validate data against a schema
31727
31830
  *
@@ -31732,9 +31835,9 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
31732
31835
  */
31733
31836
  declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31734
31837
  /**
31735
- * Convenience function to fetch and validate a schema from a URL
31838
+ * Convenience function to fetch and validate a data schema from a URL
31736
31839
  *
31737
- * @param url - The URL to fetch the schema from
31840
+ * @param url - The URL to fetch the data schema from
31738
31841
  * @returns The validated data schema
31739
31842
  * @throws SchemaValidationError if invalid or fetch fails
31740
31843
  */
@@ -34225,6 +34328,89 @@ declare class DataController {
34225
34328
  owner: Address;
34226
34329
  subgraphUrl?: string;
34227
34330
  }): Promise<UserFile$1[]>;
34331
+ /**
34332
+ * Fetches proof data for multiple files from the subgraph.
34333
+ *
34334
+ * @private
34335
+ * @param fileIds - Array of file IDs to fetch proofs for
34336
+ * @param subgraphUrl - The subgraph endpoint URL
34337
+ * @returns Map of file IDs to their associated DLP IDs
34338
+ */
34339
+ private _fetchProofsFromSubgraph;
34340
+ /**
34341
+ * Fetches proof data for multiple files from the blockchain.
34342
+ * Falls back to this when subgraph is unavailable.
34343
+ *
34344
+ * @private
34345
+ * @param fileIds - Array of file IDs to fetch proofs for
34346
+ * @returns Map of file IDs to their associated DLP IDs
34347
+ */
34348
+ private _fetchProofsFromChain;
34349
+ /**
34350
+ * Retrieves information about a specific Data Liquidity Pool (DLP).
34351
+ *
34352
+ * @remarks
34353
+ * DLPs are entities that process and verify data files in the Vana network.
34354
+ * This method fetches DLP metadata including name, status, and performance rating.
34355
+ * Uses subgraph first for efficiency, falls back to chain if unavailable.
34356
+ *
34357
+ * @param dlpId - The unique identifier of the DLP
34358
+ * @param options - Optional parameters
34359
+ * @param options.subgraphUrl - Custom subgraph URL to override default
34360
+ * @returns Promise resolving to DLP information
34361
+ * @throws {Error} When DLP cannot be found - "DLP not found: {dlpId}"
34362
+ * @throws {Error} When query fails - "Failed to fetch DLP: {error}"
34363
+ * @example
34364
+ * ```typescript
34365
+ * const dlp = await vana.data.getDLP(26);
34366
+ * console.log(`DLP ${dlp.name}: ${dlp.status}`);
34367
+ * ```
34368
+ */
34369
+ getDLP(dlpId: number, options?: {
34370
+ subgraphUrl?: string;
34371
+ }): Promise<{
34372
+ id: number;
34373
+ name: string;
34374
+ metadata?: string;
34375
+ status?: number;
34376
+ address?: Address;
34377
+ owner?: Address;
34378
+ }>;
34379
+ /**
34380
+ * Lists all Data Liquidity Pools (DLPs) with optional pagination.
34381
+ *
34382
+ * @remarks
34383
+ * Fetches a paginated list of all DLPs registered in the network.
34384
+ * Uses subgraph for efficient querying with fallback to chain multicall.
34385
+ *
34386
+ * @param options - Optional parameters for pagination and filtering
34387
+ * @param options.limit - Maximum number of DLPs to return (default: 100)
34388
+ * @param options.offset - Number of DLPs to skip (default: 0)
34389
+ * @param options.subgraphUrl - Custom subgraph URL to override default
34390
+ * @returns Promise resolving to array of DLP information
34391
+ * @throws {Error} When query fails - "Failed to list DLPs: {error}"
34392
+ * @example
34393
+ * ```typescript
34394
+ * // Get first 10 DLPs
34395
+ * const dlps = await vana.data.listDLPs({ limit: 10 });
34396
+ * dlps.forEach(dlp => console.log(`${dlp.id}: ${dlp.name}`));
34397
+ *
34398
+ * // Get next page
34399
+ * const nextPage = await vana.data.listDLPs({ limit: 10, offset: 10 });
34400
+ * ```
34401
+ */
34402
+ listDLPs(options?: {
34403
+ limit?: number;
34404
+ offset?: number;
34405
+ subgraphUrl?: string;
34406
+ }): Promise<Array<{
34407
+ id: number;
34408
+ name: string;
34409
+ metadata?: string;
34410
+ status?: number;
34411
+ address?: Address;
34412
+ owner?: Address;
34413
+ }>>;
34228
34414
  /**
34229
34415
  * Retrieves a list of permissions granted by a user.
34230
34416
  *
@@ -34617,19 +34803,31 @@ declare class DataController {
34617
34803
  */
34618
34804
  addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34619
34805
  /**
34620
- * Submits a file permission transaction and returns the transaction hash immediately.
34806
+ * Submits a file permission transaction to the blockchain.
34621
34807
  *
34622
- * This is the lower-level method that provides maximum control over transaction timing.
34808
+ * @remarks
34809
+ * This method supports gasless transactions via relayer callbacks when configured.
34810
+ * It encrypts the user's encryption key with the recipient's public key before submission.
34623
34811
  * Use this when you want to handle transaction confirmation and event parsing separately.
34624
34812
  *
34625
- * @param fileId - The ID of the file to add permissions for
34626
- * @param account - The address of the account to grant permission to
34627
- * @param publicKey - The public key to encrypt the user's encryption key with
34628
- * @returns Promise resolving to the transaction hash
34813
+ * @param fileId - The ID of the file to grant permission for
34814
+ * @param account - The recipient's wallet address that will access the file
34815
+ * @param publicKey - The recipient's public key for encryption.
34816
+ * Obtain via `vana.server.getIdentity(account).public_key`
34817
+ * @returns Promise resolving to TransactionHandle for tracking the transaction
34818
+ * @throws {Error} When chain ID is not available
34819
+ * @throws {Error} When encryption key generation fails
34820
+ * @throws {Error} When public key encryption fails
34821
+ *
34629
34822
  * @example
34630
34823
  * ```typescript
34631
- * const txHash = await vana.data.submitFilePermission(fileId, account, publicKey);
34632
- * console.log(`Transaction submitted: ${txHash}`);
34824
+ * const tx = await vana.data.submitFilePermission(
34825
+ * fileId,
34826
+ * "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
34827
+ * recipientPublicKey
34828
+ * );
34829
+ * const result = await tx.waitForEvents();
34830
+ * console.log(`Permission granted with ID: ${result.permissionId}`);
34633
34831
  * ```
34634
34832
  */
34635
34833
  submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
@@ -34728,10 +34926,10 @@ declare class DataController {
34728
34926
  gateways?: string[];
34729
34927
  }): Promise<Blob>;
34730
34928
  /**
34731
- * Validates a data schema against the Vana meta-schema.
34929
+ * Validates a data schema definition against the Vana meta-schema.
34732
34930
  *
34733
- * @param schema - The data schema to validate
34734
- * @returns Assertion that schema is valid (throws if invalid)
34931
+ * @param schema - The data schema definition to validate
34932
+ * @returns The validated DataSchema
34735
34933
  * @throws SchemaValidationError if invalid
34736
34934
  * @example
34737
34935
  * ```typescript
@@ -34748,10 +34946,10 @@ declare class DataController {
34748
34946
  * }
34749
34947
  * };
34750
34948
  *
34751
- * vana.data.validateDataSchema(schema);
34949
+ * const validatedSchema = vana.data.validateDataSchemaAgainstMetaSchema(schema);
34752
34950
  * ```
34753
34951
  */
34754
- validateDataSchema(schema: unknown): asserts schema is DataSchema;
34952
+ validateDataSchemaAgainstMetaSchema(schema: unknown): DataSchema;
34755
34953
  /**
34756
34954
  * Validates data against a JSON Schema from a data schema.
34757
34955
  *
@@ -34781,9 +34979,9 @@ declare class DataController {
34781
34979
  */
34782
34980
  validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
34783
34981
  /**
34784
- * Fetches and validates a schema from a URL, then returns the parsed data schema.
34982
+ * Fetches and validates a data schema from a URL, then returns the parsed data schema.
34785
34983
  *
34786
- * @param url - The URL to fetch the schema from
34984
+ * @param url - The URL to fetch the data schema from
34787
34985
  * @returns The validated data schema
34788
34986
  * @throws SchemaValidationError if invalid or fetch fails
34789
34987
  * @example
@@ -34801,6 +34999,56 @@ declare class DataController {
34801
34999
  fetchAndValidateSchema(url: string): Promise<DataSchema>;
34802
35000
  }
34803
35001
 
35002
+ /**
35003
+ * Configuration options for polling server operations.
35004
+ */
35005
+ interface PollingOptions {
35006
+ /** Polling interval in milliseconds (default: 500) */
35007
+ pollingInterval?: number;
35008
+ /** Maximum time to wait in milliseconds (default: 30000) */
35009
+ timeout?: number;
35010
+ }
35011
+ /**
35012
+ * Provides a Promise-based interface for server operation lifecycle management.
35013
+ *
35014
+ * @remarks
35015
+ * OperationHandle enables immediate access to operation IDs while providing
35016
+ * Promise-based methods for waiting on results. This pattern matches
35017
+ * TransactionHandle for consistency across the SDK's async operations.
35018
+ *
35019
+ * @category Server Operations
35020
+ */
35021
+ declare class OperationHandle<T = unknown> {
35022
+ private readonly controller;
35023
+ readonly id: string;
35024
+ private _resultPromise?;
35025
+ constructor(controller: ServerController, id: string);
35026
+ /**
35027
+ * Waits for the operation to complete and returns the result.
35028
+ *
35029
+ * @remarks
35030
+ * Results are memoized - multiple calls return the same promise.
35031
+ * The method polls the server at regular intervals until the operation
35032
+ * succeeds, fails, or times out. Returns the raw string result from the
35033
+ * server - callers are responsible for parsing if needed.
35034
+ *
35035
+ * @param options - Optional polling configuration
35036
+ * @returns The operation result as a string when completed
35037
+ * @throws {PersonalServerError} When the operation fails or times out
35038
+ * @example
35039
+ * ```typescript
35040
+ * const result = await handle.waitForResult({
35041
+ * timeout: 60000,
35042
+ * pollingInterval: 500
35043
+ * });
35044
+ * // If expecting JSON, parse it:
35045
+ * const data = JSON.parse(result);
35046
+ * ```
35047
+ */
35048
+ waitForResult(options?: PollingOptions): Promise<T>;
35049
+ private pollForCompletion;
35050
+ }
35051
+
34804
35052
  /**
34805
35053
  * Manages interactions with Vana personal servers and identity infrastructure.
34806
35054
  *
@@ -34881,54 +35129,47 @@ declare class ServerController {
34881
35129
  */
34882
35130
  getIdentity(request: InitPersonalServerParams): Promise<PersonalServerIdentity>;
34883
35131
  /**
34884
- * Creates an operation via the personal server API.
35132
+ * Creates a server operation and returns a handle for lifecycle management.
34885
35133
  *
34886
35134
  * @remarks
34887
- * This method submits a computation request to the personal server API.
34888
- * The response includes the operation ID.
34889
- * @param params - The request parameters object
35135
+ * This method submits a computation request to the personal server and returns
35136
+ * an OperationHandle that provides Promise-based methods for waiting on results.
35137
+ * The handle pattern matches TransactionHandle for consistency across async operations.
35138
+ *
35139
+ * @param params - The operation request parameters
34890
35140
  * @param params.permissionId - The permission ID authorizing this operation.
34891
- * Obtain from granted permissions via `vana.permissions.getUserPermissionGrantsOnChain()`.
34892
- * @returns A Promise that resolves to an operation response with status and control URLs
34893
- * @throws {PersonalServerError} When server request fails or parameters are invalid.
34894
- * Verify permissionId exists and is active for the target server.
34895
- * @throws {NetworkError} When personal server API communication fails.
34896
- * Check server URL configuration and network connectivity.
35141
+ * Obtain via `vana.permissions.getUserPermissionGrantsOnChain()`.
35142
+ * @returns An OperationHandle providing access to the operation ID and result methods
35143
+ * @throws {PersonalServerError} When the server request fails or parameters are invalid
35144
+ * @throws {NetworkError} When personal server API communication fails
34897
35145
  * @example
34898
35146
  * ```typescript
34899
- * const response = await vana.server.createOperation({
34900
- * permissionId: 123,
35147
+ * const operation = await vana.server.createOperation({
35148
+ * permissionId: 123
34901
35149
  * });
35150
+ * console.log(`Operation ID: ${operation.id}`);
34902
35151
  *
34903
- * console.log(`Operation created: ${response.id}`);
35152
+ * // Wait for completion
35153
+ * const result = await operation.waitForResult();
35154
+ * console.log("Result:", result);
34904
35155
  * ```
34905
35156
  */
34906
- createOperation(params: CreateOperationParams): Promise<CreateOperationResponse>;
35157
+ createOperation<T = unknown>(params: CreateOperationParams): Promise<OperationHandle<T>>;
34907
35158
  /**
34908
- * Polls the status of a computation request for updates and results.
35159
+ * Retrieves the current status and result of a server operation.
34909
35160
  *
34910
35161
  * @remarks
34911
- * This method checks the current status of a computation request by querying
34912
- * the personal server API using the provided operation ID. It returns the current
34913
- * status, any available output, and error information. The method can be
34914
- * called periodically until the operation completes or fails.
34915
- *
34916
- * Common status values include: `starting`, `processing`, `succeeded`, `failed`, `canceled`.
34917
- * @param operationId - The operation ID returned from the initial request submission
34918
- * @returns A Promise that resolves to the current operation response with status and results
34919
- * @throws {NetworkError} When the polling request fails or returns invalid data
35162
+ * Common status values: `starting`, `running`, `succeeded`, `failed`, `canceled`.
35163
+ * When status is `succeeded`, the result field contains the operation output.
35164
+ *
35165
+ * @param operationId - The ID of the operation to query
35166
+ * @returns The operation response containing status, result, and metadata
35167
+ * @throws {NetworkError} When the API request fails or returns invalid data
34920
35168
  * @example
34921
35169
  * ```typescript
34922
- * // Poll until completion
34923
- * let result = await vana.server.getOperation(response.id);
34924
- *
34925
- * while (result.status === "processing") {
34926
- * await new Promise(resolve => setTimeout(resolve, 1000));
34927
- * result = await vana.server.getOperation(response.id);
34928
- * }
34929
- *
34930
- * if (result.status === "succeeded") {
34931
- * console.log("Computation completed:", result.output);
35170
+ * const status = await vana.server.getOperation(operationId);
35171
+ * if (status.status === 'succeeded') {
35172
+ * console.log('Result:', JSON.parse(status.result));
34932
35173
  * }
34933
35174
  * ```
34934
35175
  */
@@ -37493,4 +37734,4 @@ declare function Vana(config: VanaConfig): VanaBrowserImpl;
37493
37734
  */
37494
37735
  type VanaInstance = VanaBrowserImpl;
37495
37736
 
37496
- export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type CompleteSchema, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, type SchemaMetadata, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, VanaBrowserImpl, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };
37737
+ export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type CompleteSchema, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, type SchemaMetadata, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, VanaBrowserImpl, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchemaAgainstMetaSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };