@opendatalabs/vana-sdk 0.1.0-alpha.3bc04d8 → 0.1.0-alpha.3cd7595

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.
@@ -191,10 +191,10 @@ interface OnChainPermissionGrant {
191
191
  grantUrl: string;
192
192
  /** Cryptographic signature that authorized this permission */
193
193
  grantSignature: string;
194
- /** Hash of the grant file content for integrity verification */
195
- grantHash: string;
196
194
  /** Nonce used when granting the permission */
197
195
  nonce: bigint;
196
+ /** Block number when permission started */
197
+ startBlock: bigint;
198
198
  /** Block number when permission was granted */
199
199
  addedAtBlock: bigint;
200
200
  /** Timestamp when permission was added */
@@ -203,6 +203,13 @@ interface OnChainPermissionGrant {
203
203
  transactionHash: string;
204
204
  /** Address that granted the permission */
205
205
  grantor: Address;
206
+ /** Grantee information */
207
+ grantee: {
208
+ /** Grantee ID */
209
+ id: string;
210
+ /** Grantee address */
211
+ address: string;
212
+ };
206
213
  /** Whether the permission is still active (not revoked) */
207
214
  active: boolean;
208
215
  }
@@ -490,6 +497,48 @@ interface GenericTypedData extends RecordCompatible {
490
497
  /** Message to sign */
491
498
  message: Record<string, unknown>;
492
499
  }
500
+ /**
501
+ * Represents EIP-712 typed data for permission revocation.
502
+ *
503
+ * @remarks
504
+ * Used when revoking previously granted permissions through gasless transactions.
505
+ * The message contains a nonce and the permission ID to revoke.
506
+ *
507
+ * @category Permissions
508
+ */
509
+ interface RevokePermissionTypedData extends GenericTypedData {
510
+ /** EIP-712 type definitions for the RevokePermission structure */
511
+ types: {
512
+ RevokePermission: Array<{
513
+ name: string;
514
+ type: string;
515
+ }>;
516
+ };
517
+ /** The primary type identifier for revocation operations */
518
+ primaryType: "RevokePermission";
519
+ /** The structured message containing revocation parameters */
520
+ message: RevokePermissionInput;
521
+ }
522
+ /**
523
+ * Defines all valid primary types for EIP-712 typed data in the Vana SDK.
524
+ *
525
+ * @remarks
526
+ * These literal types ensure compile-time safety when handling typed data operations.
527
+ * Each corresponds to a specific blockchain operation type.
528
+ *
529
+ * @category Permissions
530
+ */
531
+ type TypedDataPrimaryType = "Permission" | "RevokePermission" | "TrustServer" | "UntrustServer" | "AddServer" | "RegisterGrantee" | "ServerFilesAndPermission";
532
+ /**
533
+ * Represents the union of all specific typed data interfaces.
534
+ *
535
+ * @remarks
536
+ * Enables type-safe handling of any typed data structure in the SDK.
537
+ * Used internally by relayer handlers and signature verification.
538
+ *
539
+ * @category Permissions
540
+ */
541
+ type SpecificTypedData = PermissionGrantTypedData | RevokePermissionTypedData | TrustServerTypedData | UntrustServerTypedData | AddAndTrustServerTypedData | RegisterGranteeTypedData | ServerFilesAndPermissionTypedData;
493
542
  /**
494
543
  * Permission operation types
495
544
  *
@@ -1071,6 +1120,36 @@ interface StorageConfig {
1071
1120
  */
1072
1121
  defaultProvider?: string;
1073
1122
  }
1123
+ /**
1124
+ * Download relayer callbacks for proxying CORS-restricted downloads.
1125
+ *
1126
+ * Provides a callback to proxy download requests through your application server
1127
+ * when direct browser access fails due to CORS restrictions (e.g., Google Drive).
1128
+ *
1129
+ * @category Configuration
1130
+ * @example
1131
+ * ```typescript
1132
+ * const downloadRelayer: DownloadRelayerCallbacks = {
1133
+ * async proxyDownload(url) {
1134
+ * const response = await fetch('https://my-app.com/api/proxy', {
1135
+ * method: 'POST',
1136
+ * headers: { 'Content-Type': 'application/json' },
1137
+ * body: JSON.stringify({ url })
1138
+ * });
1139
+ * return response.blob();
1140
+ * }
1141
+ * };
1142
+ * ```
1143
+ */
1144
+ interface DownloadRelayerCallbacks {
1145
+ /**
1146
+ * Proxy a download request through your application server
1147
+ *
1148
+ * @param url - The URL to download from
1149
+ * @returns Promise resolving to the downloaded content as a Blob
1150
+ */
1151
+ proxyDownload: (url: string) => Promise<Blob>;
1152
+ }
1074
1153
  /**
1075
1154
  * Relayer callback functions for handling gasless transactions.
1076
1155
  *
@@ -1374,6 +1453,11 @@ interface BaseConfig {
1374
1453
  * Provides flexible relay mechanism - can use HTTP, WebSocket, or any custom implementation.
1375
1454
  */
1376
1455
  relayerCallbacks?: RelayerCallbacks;
1456
+ /**
1457
+ * Optional download relayer for proxying CORS-restricted downloads.
1458
+ * Provides a proxy mechanism for files stored on servers with CORS restrictions.
1459
+ */
1460
+ downloadRelayer?: DownloadRelayerCallbacks;
1377
1461
  /**
1378
1462
  * Optional storage providers configuration for file upload/download.
1379
1463
  * Required for: upload(), grant() without pre-stored URLs, schema operations.
@@ -1415,6 +1499,11 @@ interface BaseConfigWithStorage {
1415
1499
  * Provides flexible relay mechanism - can use HTTP, WebSocket, or any custom implementation.
1416
1500
  */
1417
1501
  relayerCallbacks?: RelayerCallbacks;
1502
+ /**
1503
+ * Optional download relayer for proxying CORS-restricted downloads.
1504
+ * Provides a proxy mechanism for files stored on servers with CORS restrictions.
1505
+ */
1506
+ downloadRelayer?: DownloadRelayerCallbacks;
1418
1507
  /** Required storage providers configuration for file upload/download */
1419
1508
  storage: StorageConfig;
1420
1509
  /**
@@ -5451,6 +5540,16 @@ declare const contractAbis: {
5451
5540
  }];
5452
5541
  readonly name: "Upgraded";
5453
5542
  readonly type: "event";
5543
+ }, {
5544
+ readonly inputs: readonly [];
5545
+ readonly name: "DATA_PORTABILITY_ROLE";
5546
+ readonly outputs: readonly [{
5547
+ readonly internalType: "bytes32";
5548
+ readonly name: "";
5549
+ readonly type: "bytes32";
5550
+ }];
5551
+ readonly stateMutability: "view";
5552
+ readonly type: "function";
5454
5553
  }, {
5455
5554
  readonly inputs: readonly [];
5456
5555
  readonly name: "DEFAULT_ADMIN_ROLE";
@@ -5523,6 +5622,33 @@ declare const contractAbis: {
5523
5622
  readonly outputs: readonly [];
5524
5623
  readonly stateMutability: "nonpayable";
5525
5624
  readonly type: "function";
5625
+ }, {
5626
+ readonly inputs: readonly [{
5627
+ readonly internalType: "uint256";
5628
+ readonly name: "fileId";
5629
+ readonly type: "uint256";
5630
+ }, {
5631
+ readonly components: readonly [{
5632
+ readonly internalType: "address";
5633
+ readonly name: "account";
5634
+ readonly type: "address";
5635
+ }, {
5636
+ readonly internalType: "string";
5637
+ readonly name: "key";
5638
+ readonly type: "string";
5639
+ }];
5640
+ readonly internalType: "struct IDataRegistry.Permission[]";
5641
+ readonly name: "permissions";
5642
+ readonly type: "tuple[]";
5643
+ }, {
5644
+ readonly internalType: "uint256";
5645
+ readonly name: "schemaId";
5646
+ readonly type: "uint256";
5647
+ }];
5648
+ readonly name: "addFilePermissionsAndSchema";
5649
+ readonly outputs: readonly [];
5650
+ readonly stateMutability: "nonpayable";
5651
+ readonly type: "function";
5526
5652
  }, {
5527
5653
  readonly inputs: readonly [{
5528
5654
  readonly internalType: "string";
@@ -30045,6 +30171,8 @@ interface ControllerContext$1 {
30045
30171
  applicationClient?: WalletClient;
30046
30172
  /** Handles gasless transaction submission through relayer services. */
30047
30173
  relayerCallbacks?: RelayerCallbacks;
30174
+ /** Proxies CORS-restricted downloads through application server. */
30175
+ downloadRelayer?: DownloadRelayerCallbacks;
30048
30176
  /** Manages file upload and download operations across storage providers. */
30049
30177
  storageManager?: StorageManager;
30050
30178
  /** Provides subgraph endpoint for querying indexed blockchain data. */
@@ -31685,16 +31813,16 @@ declare class SchemaValidationError extends Error {
31685
31813
  }>);
31686
31814
  }
31687
31815
  /**
31688
- * Schema validation utility class
31816
+ * Data schema validation utility class
31689
31817
  */
31690
31818
  declare class SchemaValidator {
31691
31819
  private ajv;
31692
31820
  private dataSchemaValidator;
31693
31821
  constructor();
31694
31822
  /**
31695
- * Validates a data schema against the Vana meta-schema
31823
+ * Validates a data schema definition against the Vana meta-schema
31696
31824
  *
31697
- * @param schema - The data schema to validate
31825
+ * @param schema - The data schema definition to validate
31698
31826
  * @throws SchemaValidationError if invalid
31699
31827
  * @example
31700
31828
  * ```typescript
@@ -31713,15 +31841,15 @@ declare class SchemaValidator {
31713
31841
  * }
31714
31842
  * };
31715
31843
  *
31716
- * validator.validateDataSchema(schema); // throws if invalid
31844
+ * validator.validateDataSchemaAgainstMetaSchema(schema); // throws if invalid
31717
31845
  * ```
31718
31846
  */
31719
- validateDataSchema(schema: unknown): asserts schema is DataSchema;
31847
+ validateDataSchemaAgainstMetaSchema(schema: unknown): asserts schema is DataSchema;
31720
31848
  /**
31721
- * Validates data against a JSON Schema from a schema
31849
+ * Validates data against a JSON Schema
31722
31850
  *
31723
31851
  * @param data - The data to validate
31724
- * @param schema - The schema containing the validation rules (DataSchema or Schema)
31852
+ * @param schema - The schema containing the validation rules (must have been validated or fetched from chain)
31725
31853
  * @throws SchemaValidationError if invalid
31726
31854
  * @example
31727
31855
  * ```typescript
@@ -31731,13 +31859,13 @@ declare class SchemaValidator {
31731
31859
  * const schema = await vana.schemas.get(1);
31732
31860
  * validator.validateDataAgainstSchema(userData, schema);
31733
31861
  *
31734
- * // Also works with DataSchema object
31735
- * const dataSchema: DataSchema = {
31862
+ * // Also works with pre-validated DataSchema object
31863
+ * const dataSchema = validator.validateDataSchemaAgainstMetaSchema({
31736
31864
  * name: "User Profile",
31737
31865
  * version: "1.0.0",
31738
31866
  * dialect: "json",
31739
31867
  * schema: { type: "object", properties: { name: { type: "string" } } }
31740
- * };
31868
+ * });
31741
31869
  * validator.validateDataAgainstSchema(userData, dataSchema);
31742
31870
  * ```
31743
31871
  */
@@ -31752,9 +31880,11 @@ declare class SchemaValidator {
31752
31880
  */
31753
31881
  validateSQLiteDDL(ddl: string, dialectVersion?: string): void;
31754
31882
  /**
31755
- * Fetches and validates a schema from a URL
31883
+ * Fetches and validates a data schema from a URL
31756
31884
  *
31757
- * @param url - The URL to fetch the schema from
31885
+ * @param url - The URL to fetch the data schema from
31886
+ * @param downloadRelayer - Optional download relayer for CORS bypass
31887
+ * @param downloadRelayer.proxyDownload - Function to proxy downloads through application server
31758
31888
  * @returns The validated data schema
31759
31889
  * @throws SchemaValidationError if invalid or fetch fails
31760
31890
  * @example
@@ -31763,20 +31893,33 @@ declare class SchemaValidator {
31763
31893
  * const schema = await validator.fetchAndValidateSchema("https://example.com/schema.json");
31764
31894
  * ```
31765
31895
  */
31766
- fetchAndValidateSchema(url: string): Promise<DataSchema>;
31896
+ fetchAndValidateSchema(url: string, downloadRelayer?: {
31897
+ proxyDownload: (url: string) => Promise<Blob>;
31898
+ }): Promise<DataSchema>;
31767
31899
  }
31768
31900
  /**
31769
31901
  * Global schema validator instance
31770
31902
  */
31771
31903
  declare const schemaValidator: SchemaValidator;
31772
31904
  /**
31773
- * Convenience function to validate a data schema
31905
+ * Convenience function to validate a data schema definition against the Vana meta-schema
31774
31906
  *
31775
- * @param schema - The data schema to validate
31776
- * @returns void - Assertion function that doesn't return a value
31907
+ * @param schema - The data schema definition to validate
31908
+ * @returns The validated DataSchema
31777
31909
  * @throws SchemaValidationError if invalid
31910
+ * @example
31911
+ * ```typescript
31912
+ * const schemaDefinition = {
31913
+ * name: "User Profile",
31914
+ * version: "1.0.0",
31915
+ * dialect: "json",
31916
+ * schema: { type: "object", properties: { name: { type: "string" } } }
31917
+ * };
31918
+ *
31919
+ * const validatedSchema = validateDataSchemaAgainstMetaSchema(schemaDefinition);
31920
+ * ```
31778
31921
  */
31779
- declare function validateDataSchema(schema: unknown): asserts schema is DataSchema;
31922
+ declare function validateDataSchemaAgainstMetaSchema(schema: unknown): DataSchema;
31780
31923
  /**
31781
31924
  * Convenience function to validate data against a schema
31782
31925
  *
@@ -31787,13 +31930,17 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
31787
31930
  */
31788
31931
  declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31789
31932
  /**
31790
- * Convenience function to fetch and validate a schema from a URL
31933
+ * Convenience function to fetch and validate a data schema from a URL
31791
31934
  *
31792
- * @param url - The URL to fetch the schema from
31935
+ * @param url - The URL to fetch the data schema from
31936
+ * @param downloadRelayer - Optional download relayer for CORS bypass
31937
+ * @param downloadRelayer.proxyDownload - Function to proxy downloads through application server
31793
31938
  * @returns The validated data schema
31794
31939
  * @throws SchemaValidationError if invalid or fetch fails
31795
31940
  */
31796
- declare function fetchAndValidateSchema(url: string): Promise<DataSchema>;
31941
+ declare function fetchAndValidateSchema(url: string, downloadRelayer?: {
31942
+ proxyDownload: (url: string) => Promise<Blob>;
31943
+ }): Promise<DataSchema>;
31797
31944
 
31798
31945
  /**
31799
31946
  * Parameters for the `vana.personal.postRequest` method.
@@ -34755,19 +34902,31 @@ declare class DataController {
34755
34902
  */
34756
34903
  addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34757
34904
  /**
34758
- * Submits a file permission transaction and returns the transaction hash immediately.
34905
+ * Submits a file permission transaction to the blockchain.
34759
34906
  *
34760
- * This is the lower-level method that provides maximum control over transaction timing.
34907
+ * @remarks
34908
+ * This method supports gasless transactions via relayer callbacks when configured.
34909
+ * It encrypts the user's encryption key with the recipient's public key before submission.
34761
34910
  * Use this when you want to handle transaction confirmation and event parsing separately.
34762
34911
  *
34763
- * @param fileId - The ID of the file to add permissions for
34764
- * @param account - The address of the account to grant permission to
34765
- * @param publicKey - The public key to encrypt the user's encryption key with
34766
- * @returns Promise resolving to the transaction hash
34912
+ * @param fileId - The ID of the file to grant permission for
34913
+ * @param account - The recipient's wallet address that will access the file
34914
+ * @param publicKey - The recipient's public key for encryption.
34915
+ * Obtain via `vana.server.getIdentity(account).public_key`
34916
+ * @returns Promise resolving to TransactionHandle for tracking the transaction
34917
+ * @throws {Error} When chain ID is not available
34918
+ * @throws {Error} When encryption key generation fails
34919
+ * @throws {Error} When public key encryption fails
34920
+ *
34767
34921
  * @example
34768
34922
  * ```typescript
34769
- * const txHash = await vana.data.submitFilePermission(fileId, account, publicKey);
34770
- * console.log(`Transaction submitted: ${txHash}`);
34923
+ * const tx = await vana.data.submitFilePermission(
34924
+ * fileId,
34925
+ * "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
34926
+ * recipientPublicKey
34927
+ * );
34928
+ * const result = await tx.waitForEvents();
34929
+ * console.log(`Permission granted with ID: ${result.permissionId}`);
34771
34930
  * ```
34772
34931
  */
34773
34932
  submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
@@ -34866,10 +35025,10 @@ declare class DataController {
34866
35025
  gateways?: string[];
34867
35026
  }): Promise<Blob>;
34868
35027
  /**
34869
- * Validates a data schema against the Vana meta-schema.
35028
+ * Validates a data schema definition against the Vana meta-schema.
34870
35029
  *
34871
- * @param schema - The data schema to validate
34872
- * @returns Assertion that schema is valid (throws if invalid)
35030
+ * @param schema - The data schema definition to validate
35031
+ * @returns The validated DataSchema
34873
35032
  * @throws SchemaValidationError if invalid
34874
35033
  * @example
34875
35034
  * ```typescript
@@ -34886,10 +35045,10 @@ declare class DataController {
34886
35045
  * }
34887
35046
  * };
34888
35047
  *
34889
- * vana.data.validateDataSchema(schema);
35048
+ * const validatedSchema = vana.data.validateDataSchemaAgainstMetaSchema(schema);
34890
35049
  * ```
34891
35050
  */
34892
- validateDataSchema(schema: unknown): asserts schema is DataSchema;
35051
+ validateDataSchemaAgainstMetaSchema(schema: unknown): DataSchema;
34893
35052
  /**
34894
35053
  * Validates data against a JSON Schema from a data schema.
34895
35054
  *
@@ -34919,9 +35078,9 @@ declare class DataController {
34919
35078
  */
34920
35079
  validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
34921
35080
  /**
34922
- * Fetches and validates a schema from a URL, then returns the parsed data schema.
35081
+ * Fetches and validates a data schema from a URL, then returns the parsed data schema.
34923
35082
  *
34924
- * @param url - The URL to fetch the schema from
35083
+ * @param url - The URL to fetch the data schema from
34925
35084
  * @returns The validated data schema
34926
35085
  * @throws SchemaValidationError if invalid or fetch fails
34927
35086
  * @example
@@ -34939,6 +35098,56 @@ declare class DataController {
34939
35098
  fetchAndValidateSchema(url: string): Promise<DataSchema>;
34940
35099
  }
34941
35100
 
35101
+ /**
35102
+ * Configuration options for polling server operations.
35103
+ */
35104
+ interface PollingOptions {
35105
+ /** Polling interval in milliseconds (default: 500) */
35106
+ pollingInterval?: number;
35107
+ /** Maximum time to wait in milliseconds (default: 30000) */
35108
+ timeout?: number;
35109
+ }
35110
+ /**
35111
+ * Provides a Promise-based interface for server operation lifecycle management.
35112
+ *
35113
+ * @remarks
35114
+ * OperationHandle enables immediate access to operation IDs while providing
35115
+ * Promise-based methods for waiting on results. This pattern matches
35116
+ * TransactionHandle for consistency across the SDK's async operations.
35117
+ *
35118
+ * @category Server Operations
35119
+ */
35120
+ declare class OperationHandle<T = unknown> {
35121
+ private readonly controller;
35122
+ readonly id: string;
35123
+ private _resultPromise?;
35124
+ constructor(controller: ServerController, id: string);
35125
+ /**
35126
+ * Waits for the operation to complete and returns the result.
35127
+ *
35128
+ * @remarks
35129
+ * Results are memoized - multiple calls return the same promise.
35130
+ * The method polls the server at regular intervals until the operation
35131
+ * succeeds, fails, or times out. Returns the raw string result from the
35132
+ * server - callers are responsible for parsing if needed.
35133
+ *
35134
+ * @param options - Optional polling configuration
35135
+ * @returns The operation result as a string when completed
35136
+ * @throws {PersonalServerError} When the operation fails or times out
35137
+ * @example
35138
+ * ```typescript
35139
+ * const result = await handle.waitForResult({
35140
+ * timeout: 60000,
35141
+ * pollingInterval: 500
35142
+ * });
35143
+ * // If expecting JSON, parse it:
35144
+ * const data = JSON.parse(result);
35145
+ * ```
35146
+ */
35147
+ waitForResult(options?: PollingOptions): Promise<T>;
35148
+ private pollForCompletion;
35149
+ }
35150
+
34942
35151
  /**
34943
35152
  * Manages interactions with Vana personal servers and identity infrastructure.
34944
35153
  *
@@ -35019,54 +35228,47 @@ declare class ServerController {
35019
35228
  */
35020
35229
  getIdentity(request: InitPersonalServerParams): Promise<PersonalServerIdentity>;
35021
35230
  /**
35022
- * Creates an operation via the personal server API.
35231
+ * Creates a server operation and returns a handle for lifecycle management.
35023
35232
  *
35024
35233
  * @remarks
35025
- * This method submits a computation request to the personal server API.
35026
- * The response includes the operation ID.
35027
- * @param params - The request parameters object
35234
+ * This method submits a computation request to the personal server and returns
35235
+ * an OperationHandle that provides Promise-based methods for waiting on results.
35236
+ * The handle pattern matches TransactionHandle for consistency across async operations.
35237
+ *
35238
+ * @param params - The operation request parameters
35028
35239
  * @param params.permissionId - The permission ID authorizing this operation.
35029
- * Obtain from granted permissions via `vana.permissions.getUserPermissionGrantsOnChain()`.
35030
- * @returns A Promise that resolves to an operation response with status and control URLs
35031
- * @throws {PersonalServerError} When server request fails or parameters are invalid.
35032
- * Verify permissionId exists and is active for the target server.
35033
- * @throws {NetworkError} When personal server API communication fails.
35034
- * Check server URL configuration and network connectivity.
35240
+ * Obtain via `vana.permissions.getUserPermissionGrantsOnChain()`.
35241
+ * @returns An OperationHandle providing access to the operation ID and result methods
35242
+ * @throws {PersonalServerError} When the server request fails or parameters are invalid
35243
+ * @throws {NetworkError} When personal server API communication fails
35035
35244
  * @example
35036
35245
  * ```typescript
35037
- * const response = await vana.server.createOperation({
35038
- * permissionId: 123,
35246
+ * const operation = await vana.server.createOperation({
35247
+ * permissionId: 123
35039
35248
  * });
35249
+ * console.log(`Operation ID: ${operation.id}`);
35040
35250
  *
35041
- * console.log(`Operation created: ${response.id}`);
35251
+ * // Wait for completion
35252
+ * const result = await operation.waitForResult();
35253
+ * console.log("Result:", result);
35042
35254
  * ```
35043
35255
  */
35044
- createOperation(params: CreateOperationParams): Promise<CreateOperationResponse>;
35256
+ createOperation<T = unknown>(params: CreateOperationParams): Promise<OperationHandle<T>>;
35045
35257
  /**
35046
- * Polls the status of a computation request for updates and results.
35258
+ * Retrieves the current status and result of a server operation.
35047
35259
  *
35048
35260
  * @remarks
35049
- * This method checks the current status of a computation request by querying
35050
- * the personal server API using the provided operation ID. It returns the current
35051
- * status, any available output, and error information. The method can be
35052
- * called periodically until the operation completes or fails.
35053
- *
35054
- * Common status values include: `starting`, `processing`, `succeeded`, `failed`, `canceled`.
35055
- * @param operationId - The operation ID returned from the initial request submission
35056
- * @returns A Promise that resolves to the current operation response with status and results
35057
- * @throws {NetworkError} When the polling request fails or returns invalid data
35261
+ * Common status values: `starting`, `running`, `succeeded`, `failed`, `canceled`.
35262
+ * When status is `succeeded`, the result field contains the operation output.
35263
+ *
35264
+ * @param operationId - The ID of the operation to query
35265
+ * @returns The operation response containing status, result, and metadata
35266
+ * @throws {NetworkError} When the API request fails or returns invalid data
35058
35267
  * @example
35059
35268
  * ```typescript
35060
- * // Poll until completion
35061
- * let result = await vana.server.getOperation(response.id);
35062
- *
35063
- * while (result.status === "processing") {
35064
- * await new Promise(resolve => setTimeout(resolve, 1000));
35065
- * result = await vana.server.getOperation(response.id);
35066
- * }
35067
- *
35068
- * if (result.status === "succeeded") {
35069
- * console.log("Computation completed:", result.output);
35269
+ * const status = await vana.server.getOperation(operationId);
35270
+ * if (status.status === 'succeeded') {
35271
+ * console.log('Result:', JSON.parse(status.result));
35070
35272
  * }
35071
35273
  * ```
35072
35274
  */
@@ -35476,6 +35678,7 @@ declare class VanaCore {
35476
35678
  /** Handles environment-specific operations like encryption and file systems. */
35477
35679
  protected platform: VanaPlatformAdapter;
35478
35680
  private readonly relayerCallbacks?;
35681
+ private readonly downloadRelayer?;
35479
35682
  private readonly storageManager?;
35480
35683
  private readonly hasRequiredStorage;
35481
35684
  private readonly ipfsGateways?;
@@ -36530,6 +36733,8 @@ declare function storeGrantFile(grantFile: GrantFile, relayerUrl: string): Promi
36530
36733
  *
36531
36734
  * @param grantUrl - The grant file URL from OnChainPermissionGrant.grantUrl
36532
36735
  * @param _relayerUrl - URL of the relayer service (optional, unused)
36736
+ * @param downloadRelayer - Optional download relayer for proxying CORS-restricted downloads
36737
+ * @param downloadRelayer.proxyDownload - Function to proxy download requests through application server
36533
36738
  * @returns Promise resolving to the complete grant file with operation details
36534
36739
  * @throws {NetworkError} When all retrieval attempts fail
36535
36740
  * @throws {SerializationError} When grant file format is invalid
@@ -36552,7 +36757,9 @@ declare function storeGrantFile(grantFile: GrantFile, relayerUrl: string): Promi
36552
36757
  * }
36553
36758
  * ```
36554
36759
  */
36555
- declare function retrieveGrantFile(grantUrl: string, _relayerUrl?: string): Promise<GrantFile>;
36760
+ declare function retrieveGrantFile(grantUrl: string, _relayerUrl?: string, downloadRelayer?: {
36761
+ proxyDownload: (url: string) => Promise<Blob>;
36762
+ }): Promise<GrantFile>;
36556
36763
  /**
36557
36764
  * Generates a content hash for a grant file.
36558
36765
  * This can be used for integrity verification.
@@ -37631,4 +37838,4 @@ declare function Vana(config: VanaConfig): VanaBrowserImpl;
37631
37838
  */
37632
37839
  type VanaInstance = VanaBrowserImpl;
37633
37840
 
37634
- 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 };
37841
+ 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 DownloadRelayerCallbacks, 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 RevokePermissionTypedData, 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 SpecificTypedData, 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 TypedDataPrimaryType, 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 };