@opendatalabs/vana-sdk 0.1.0-alpha.606fa2d → 0.1.0-alpha.64b26ef

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +4 -13
  2. package/dist/{browser-Bb8gLWHp.d.ts → browser-DY8XDblx.d.ts} +14 -61
  3. package/dist/browser.d.ts +1 -1
  4. package/dist/browser.js +106 -723
  5. package/dist/browser.js.map +1 -1
  6. package/dist/chains.browser.cjs +2 -2
  7. package/dist/chains.browser.cjs.map +1 -1
  8. package/dist/chains.browser.js +2 -2
  9. package/dist/chains.browser.js.map +1 -1
  10. package/dist/chains.cjs +2 -2
  11. package/dist/chains.cjs.map +1 -1
  12. package/dist/chains.js +2 -2
  13. package/dist/chains.js.map +1 -1
  14. package/dist/chains.node.cjs +2 -2
  15. package/dist/chains.node.cjs.map +1 -1
  16. package/dist/chains.node.js +2 -2
  17. package/dist/chains.node.js.map +1 -1
  18. package/dist/index.browser.d.ts +258 -350
  19. package/dist/index.browser.js +696 -869
  20. package/dist/index.browser.js.map +1 -1
  21. package/dist/index.node.cjs +734 -1018
  22. package/dist/index.node.cjs.map +1 -1
  23. package/dist/index.node.d.cts +262 -109
  24. package/dist/index.node.d.ts +262 -109
  25. package/dist/index.node.js +736 -1032
  26. package/dist/index.node.js.map +1 -1
  27. package/dist/node.cjs +53 -692
  28. package/dist/node.cjs.map +1 -1
  29. package/dist/node.js +52 -704
  30. package/dist/node.js.map +1 -1
  31. package/dist/platform.browser.d.ts +2 -2
  32. package/dist/platform.browser.js +116 -780
  33. package/dist/platform.browser.js.map +1 -1
  34. package/dist/platform.cjs +156 -933
  35. package/dist/platform.cjs.map +1 -1
  36. package/dist/platform.js +156 -945
  37. package/dist/platform.js.map +1 -1
  38. package/dist/platform.node.cjs +156 -933
  39. package/dist/platform.node.cjs.map +1 -1
  40. package/dist/platform.node.d.cts +14 -61
  41. package/dist/platform.node.d.ts +14 -61
  42. package/dist/platform.node.js +156 -945
  43. package/dist/platform.node.js.map +1 -1
  44. package/package.json +15 -31
@@ -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";
@@ -28967,7 +29059,7 @@ interface GranteeRegisterResult extends BaseTransactionResult {
28967
29059
  }
28968
29060
  /**
28969
29061
  * Result of a successful file addition operation.
28970
- * Contains data from the FileAdded blockchain event.
29062
+ * Contains data from the FileAddedV2 blockchain event.
28971
29063
  */
28972
29064
  interface FileAddedResult extends BaseTransactionResult {
28973
29065
  /** Unique file ID assigned by the registry */
@@ -28976,6 +29068,8 @@ interface FileAddedResult extends BaseTransactionResult {
28976
29068
  ownerAddress: Address;
28977
29069
  /** URL where the file is stored */
28978
29070
  url: string;
29071
+ /** Schema ID associated with the file (0 for no schema) */
29072
+ schemaId: bigint;
28979
29073
  }
28980
29074
  /**
28981
29075
  * Result of a successful file permission addition operation.
@@ -31642,16 +31736,16 @@ declare class SchemaValidationError extends Error {
31642
31736
  }>);
31643
31737
  }
31644
31738
  /**
31645
- * Schema validation utility class
31739
+ * Data schema validation utility class
31646
31740
  */
31647
31741
  declare class SchemaValidator {
31648
31742
  private ajv;
31649
31743
  private dataSchemaValidator;
31650
31744
  constructor();
31651
31745
  /**
31652
- * Validates a data schema against the Vana meta-schema
31746
+ * Validates a data schema definition against the Vana meta-schema
31653
31747
  *
31654
- * @param schema - The data schema to validate
31748
+ * @param schema - The data schema definition to validate
31655
31749
  * @throws SchemaValidationError if invalid
31656
31750
  * @example
31657
31751
  * ```typescript
@@ -31670,15 +31764,15 @@ declare class SchemaValidator {
31670
31764
  * }
31671
31765
  * };
31672
31766
  *
31673
- * validator.validateDataSchema(schema); // throws if invalid
31767
+ * validator.validateDataSchemaAgainstMetaSchema(schema); // throws if invalid
31674
31768
  * ```
31675
31769
  */
31676
- validateDataSchema(schema: unknown): asserts schema is DataSchema;
31770
+ validateDataSchemaAgainstMetaSchema(schema: unknown): asserts schema is DataSchema;
31677
31771
  /**
31678
- * Validates data against a JSON Schema from a schema
31772
+ * Validates data against a JSON Schema
31679
31773
  *
31680
31774
  * @param data - The data to validate
31681
- * @param schema - The schema containing the validation rules (DataSchema or Schema)
31775
+ * @param schema - The schema containing the validation rules (must have been validated or fetched from chain)
31682
31776
  * @throws SchemaValidationError if invalid
31683
31777
  * @example
31684
31778
  * ```typescript
@@ -31688,13 +31782,13 @@ declare class SchemaValidator {
31688
31782
  * const schema = await vana.schemas.get(1);
31689
31783
  * validator.validateDataAgainstSchema(userData, schema);
31690
31784
  *
31691
- * // Also works with DataSchema object
31692
- * const dataSchema: DataSchema = {
31785
+ * // Also works with pre-validated DataSchema object
31786
+ * const dataSchema = validator.validateDataSchemaAgainstMetaSchema({
31693
31787
  * name: "User Profile",
31694
31788
  * version: "1.0.0",
31695
31789
  * dialect: "json",
31696
31790
  * schema: { type: "object", properties: { name: { type: "string" } } }
31697
- * };
31791
+ * });
31698
31792
  * validator.validateDataAgainstSchema(userData, dataSchema);
31699
31793
  * ```
31700
31794
  */
@@ -31709,9 +31803,9 @@ declare class SchemaValidator {
31709
31803
  */
31710
31804
  validateSQLiteDDL(ddl: string, dialectVersion?: string): void;
31711
31805
  /**
31712
- * Fetches and validates a schema from a URL
31806
+ * Fetches and validates a data schema from a URL
31713
31807
  *
31714
- * @param url - The URL to fetch the schema from
31808
+ * @param url - The URL to fetch the data schema from
31715
31809
  * @returns The validated data schema
31716
31810
  * @throws SchemaValidationError if invalid or fetch fails
31717
31811
  * @example
@@ -31727,13 +31821,24 @@ declare class SchemaValidator {
31727
31821
  */
31728
31822
  declare const schemaValidator: SchemaValidator;
31729
31823
  /**
31730
- * Convenience function to validate a data schema
31824
+ * Convenience function to validate a data schema definition against the Vana meta-schema
31731
31825
  *
31732
- * @param schema - The data schema to validate
31733
- * @returns void - Assertion function that doesn't return a value
31826
+ * @param schema - The data schema definition to validate
31827
+ * @returns The validated DataSchema
31734
31828
  * @throws SchemaValidationError if invalid
31829
+ * @example
31830
+ * ```typescript
31831
+ * const schemaDefinition = {
31832
+ * name: "User Profile",
31833
+ * version: "1.0.0",
31834
+ * dialect: "json",
31835
+ * schema: { type: "object", properties: { name: { type: "string" } } }
31836
+ * };
31837
+ *
31838
+ * const validatedSchema = validateDataSchemaAgainstMetaSchema(schemaDefinition);
31839
+ * ```
31735
31840
  */
31736
- declare function validateDataSchema(schema: unknown): asserts schema is DataSchema;
31841
+ declare function validateDataSchemaAgainstMetaSchema(schema: unknown): DataSchema;
31737
31842
  /**
31738
31843
  * Convenience function to validate data against a schema
31739
31844
  *
@@ -31744,9 +31849,9 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
31744
31849
  */
31745
31850
  declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31746
31851
  /**
31747
- * Convenience function to fetch and validate a schema from a URL
31852
+ * Convenience function to fetch and validate a data schema from a URL
31748
31853
  *
31749
- * @param url - The URL to fetch the schema from
31854
+ * @param url - The URL to fetch the data schema from
31750
31855
  * @returns The validated data schema
31751
31856
  * @throws SchemaValidationError if invalid or fetch fails
31752
31857
  */
@@ -34237,6 +34342,89 @@ declare class DataController {
34237
34342
  owner: Address;
34238
34343
  subgraphUrl?: string;
34239
34344
  }): Promise<UserFile$1[]>;
34345
+ /**
34346
+ * Fetches proof data for multiple files from the subgraph.
34347
+ *
34348
+ * @private
34349
+ * @param fileIds - Array of file IDs to fetch proofs for
34350
+ * @param subgraphUrl - The subgraph endpoint URL
34351
+ * @returns Map of file IDs to their associated DLP IDs
34352
+ */
34353
+ private _fetchProofsFromSubgraph;
34354
+ /**
34355
+ * Fetches proof data for multiple files from the blockchain.
34356
+ * Falls back to this when subgraph is unavailable.
34357
+ *
34358
+ * @private
34359
+ * @param fileIds - Array of file IDs to fetch proofs for
34360
+ * @returns Map of file IDs to their associated DLP IDs
34361
+ */
34362
+ private _fetchProofsFromChain;
34363
+ /**
34364
+ * Retrieves information about a specific Data Liquidity Pool (DLP).
34365
+ *
34366
+ * @remarks
34367
+ * DLPs are entities that process and verify data files in the Vana network.
34368
+ * This method fetches DLP metadata including name, status, and performance rating.
34369
+ * Uses subgraph first for efficiency, falls back to chain if unavailable.
34370
+ *
34371
+ * @param dlpId - The unique identifier of the DLP
34372
+ * @param options - Optional parameters
34373
+ * @param options.subgraphUrl - Custom subgraph URL to override default
34374
+ * @returns Promise resolving to DLP information
34375
+ * @throws {Error} When DLP cannot be found - "DLP not found: {dlpId}"
34376
+ * @throws {Error} When query fails - "Failed to fetch DLP: {error}"
34377
+ * @example
34378
+ * ```typescript
34379
+ * const dlp = await vana.data.getDLP(26);
34380
+ * console.log(`DLP ${dlp.name}: ${dlp.status}`);
34381
+ * ```
34382
+ */
34383
+ getDLP(dlpId: number, options?: {
34384
+ subgraphUrl?: string;
34385
+ }): Promise<{
34386
+ id: number;
34387
+ name: string;
34388
+ metadata?: string;
34389
+ status?: number;
34390
+ address?: Address;
34391
+ owner?: Address;
34392
+ }>;
34393
+ /**
34394
+ * Lists all Data Liquidity Pools (DLPs) with optional pagination.
34395
+ *
34396
+ * @remarks
34397
+ * Fetches a paginated list of all DLPs registered in the network.
34398
+ * Uses subgraph for efficient querying with fallback to chain multicall.
34399
+ *
34400
+ * @param options - Optional parameters for pagination and filtering
34401
+ * @param options.limit - Maximum number of DLPs to return (default: 100)
34402
+ * @param options.offset - Number of DLPs to skip (default: 0)
34403
+ * @param options.subgraphUrl - Custom subgraph URL to override default
34404
+ * @returns Promise resolving to array of DLP information
34405
+ * @throws {Error} When query fails - "Failed to list DLPs: {error}"
34406
+ * @example
34407
+ * ```typescript
34408
+ * // Get first 10 DLPs
34409
+ * const dlps = await vana.data.listDLPs({ limit: 10 });
34410
+ * dlps.forEach(dlp => console.log(`${dlp.id}: ${dlp.name}`));
34411
+ *
34412
+ * // Get next page
34413
+ * const nextPage = await vana.data.listDLPs({ limit: 10, offset: 10 });
34414
+ * ```
34415
+ */
34416
+ listDLPs(options?: {
34417
+ limit?: number;
34418
+ offset?: number;
34419
+ subgraphUrl?: string;
34420
+ }): Promise<Array<{
34421
+ id: number;
34422
+ name: string;
34423
+ metadata?: string;
34424
+ status?: number;
34425
+ address?: Address;
34426
+ owner?: Address;
34427
+ }>>;
34240
34428
  /**
34241
34429
  * Retrieves a list of permissions granted by a user.
34242
34430
  *
@@ -34629,19 +34817,31 @@ declare class DataController {
34629
34817
  */
34630
34818
  addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34631
34819
  /**
34632
- * Submits a file permission transaction and returns the transaction hash immediately.
34820
+ * Submits a file permission transaction to the blockchain.
34633
34821
  *
34634
- * This is the lower-level method that provides maximum control over transaction timing.
34822
+ * @remarks
34823
+ * This method supports gasless transactions via relayer callbacks when configured.
34824
+ * It encrypts the user's encryption key with the recipient's public key before submission.
34635
34825
  * Use this when you want to handle transaction confirmation and event parsing separately.
34636
34826
  *
34637
- * @param fileId - The ID of the file to add permissions for
34638
- * @param account - The address of the account to grant permission to
34639
- * @param publicKey - The public key to encrypt the user's encryption key with
34640
- * @returns Promise resolving to the transaction hash
34827
+ * @param fileId - The ID of the file to grant permission for
34828
+ * @param account - The recipient's wallet address that will access the file
34829
+ * @param publicKey - The recipient's public key for encryption.
34830
+ * Obtain via `vana.server.getIdentity(account).public_key`
34831
+ * @returns Promise resolving to TransactionHandle for tracking the transaction
34832
+ * @throws {Error} When chain ID is not available
34833
+ * @throws {Error} When encryption key generation fails
34834
+ * @throws {Error} When public key encryption fails
34835
+ *
34641
34836
  * @example
34642
34837
  * ```typescript
34643
- * const txHash = await vana.data.submitFilePermission(fileId, account, publicKey);
34644
- * console.log(`Transaction submitted: ${txHash}`);
34838
+ * const tx = await vana.data.submitFilePermission(
34839
+ * fileId,
34840
+ * "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36",
34841
+ * recipientPublicKey
34842
+ * );
34843
+ * const result = await tx.waitForEvents();
34844
+ * console.log(`Permission granted with ID: ${result.permissionId}`);
34645
34845
  * ```
34646
34846
  */
34647
34847
  submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
@@ -34740,10 +34940,10 @@ declare class DataController {
34740
34940
  gateways?: string[];
34741
34941
  }): Promise<Blob>;
34742
34942
  /**
34743
- * Validates a data schema against the Vana meta-schema.
34943
+ * Validates a data schema definition against the Vana meta-schema.
34744
34944
  *
34745
- * @param schema - The data schema to validate
34746
- * @returns Assertion that schema is valid (throws if invalid)
34945
+ * @param schema - The data schema definition to validate
34946
+ * @returns The validated DataSchema
34747
34947
  * @throws SchemaValidationError if invalid
34748
34948
  * @example
34749
34949
  * ```typescript
@@ -34760,10 +34960,10 @@ declare class DataController {
34760
34960
  * }
34761
34961
  * };
34762
34962
  *
34763
- * vana.data.validateDataSchema(schema);
34963
+ * const validatedSchema = vana.data.validateDataSchemaAgainstMetaSchema(schema);
34764
34964
  * ```
34765
34965
  */
34766
- validateDataSchema(schema: unknown): asserts schema is DataSchema;
34966
+ validateDataSchemaAgainstMetaSchema(schema: unknown): DataSchema;
34767
34967
  /**
34768
34968
  * Validates data against a JSON Schema from a data schema.
34769
34969
  *
@@ -34793,9 +34993,9 @@ declare class DataController {
34793
34993
  */
34794
34994
  validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
34795
34995
  /**
34796
- * Fetches and validates a schema from a URL, then returns the parsed data schema.
34996
+ * Fetches and validates a data schema from a URL, then returns the parsed data schema.
34797
34997
  *
34798
- * @param url - The URL to fetch the schema from
34998
+ * @param url - The URL to fetch the data schema from
34799
34999
  * @returns The validated data schema
34800
35000
  * @throws SchemaValidationError if invalid or fetch fails
34801
35001
  * @example
@@ -36899,12 +37099,12 @@ declare class SignatureCache {
36899
37099
  * Generate a deterministic hash of a message object for cache key generation
36900
37100
  *
36901
37101
  * @remarks
36902
- * Creates a cryptographically secure hash from complex objects including EIP-712 typed data.
36903
- * Uses SHA-256 for collision resistance and deterministic key generation.
36904
- * Handles BigInt serialization and sorts object keys for consistency.
37102
+ * Creates a consistent hash from complex objects including EIP-712 typed data.
37103
+ * Handles BigInt serialization and produces a 32-character hash that balances
37104
+ * uniqueness with key length constraints.
36905
37105
  *
36906
37106
  * @param message - The message object to hash (typically EIP-712 typed data)
36907
- * @returns A hex string hash (SHA-256) suitable for cache keys
37107
+ * @returns A 32-character hash string suitable for cache keys
36908
37108
  * @example
36909
37109
  * ```typescript
36910
37110
  * const typedData = {
@@ -36913,19 +37113,19 @@ declare class SignatureCache {
36913
37113
  * };
36914
37114
  *
36915
37115
  * const hash = SignatureCache.hashMessage(typedData);
36916
- * // Returns SHA-256 hash like: "a1b2c3d4e5f6..."
37116
+ * // Returns something like: "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
36917
37117
  * ```
36918
37118
  */
36919
37119
  static hashMessage(message: object): string;
36920
37120
  /**
36921
- * Deterministic JSON replacer that handles BigInt values and sorts object keys
36922
- * This ensures consistent cache key generation for EIP-712 typed data
37121
+ * Custom JSON replacer that converts BigInt values to strings for serialization
37122
+ * This ensures deterministic cache key generation for EIP-712 typed data
36923
37123
  *
36924
37124
  * @param _key - The object key being serialized (unused)
36925
37125
  * @param value - The value to serialize
36926
- * @returns The serialized value with sorted keys for objects
37126
+ * @returns The serialized value
36927
37127
  */
36928
- private static deterministicReplacer;
37128
+ private static bigIntReplacer;
36929
37129
  }
36930
37130
  /**
36931
37131
  * Wrapper function to cache signature operations
@@ -37258,73 +37458,26 @@ declare class NodePlatformAdapter implements VanaPlatformAdapter {
37258
37458
  }
37259
37459
 
37260
37460
  /**
37261
- * Browser implementation of the Vana Platform Adapter using Uint8Array
37461
+ * Browser implementation of the Vana Platform Adapter
37262
37462
  *
37263
- * This implementation uses browser-compatible libraries and native APIs
37264
- * without requiring Buffer or other Node.js polyfills.
37463
+ * This implementation uses browser-compatible libraries and configurations
37464
+ * to provide crypto, PGP, and HTTP functionality without Node.js dependencies.
37465
+ *
37466
+ * WARNING: Dependencies that access globals during init
37467
+ * MUST be dynamically imported to support Turbopack.
37468
+ * See: https://github.com/vercel/next.js/issues/82632
37265
37469
  */
37266
37470
 
37267
37471
  /**
37268
- * Browser implementation of crypto operations using Uint8Array
37269
- */
37270
- declare class BrowserCryptoAdapter implements VanaCryptoAdapter {
37271
- private eciesProvider;
37272
- private walletKeyEncryptionService;
37273
- encryptWithPublicKey(data: string, publicKeyHex: string): Promise<string>;
37274
- decryptWithPrivateKey(encryptedData: string, privateKeyHex: string): Promise<string>;
37275
- encryptWithWalletPublicKey(data: string, publicKey: string): Promise<string>;
37276
- decryptWithWalletPrivateKey(encryptedData: string, privateKey: string): Promise<string>;
37277
- generateKeyPair(): Promise<{
37278
- privateKey: string;
37279
- publicKey: string;
37280
- }>;
37281
- encryptWithPassword(data: Uint8Array, password: string): Promise<Uint8Array>;
37282
- decryptWithPassword(encryptedData: Uint8Array, password: string): Promise<Uint8Array>;
37283
- }
37284
- /**
37285
- * Browser implementation of PGP operations
37286
- */
37287
- declare class BrowserPGPAdapter implements VanaPGPAdapter {
37288
- encrypt(data: string, publicKeyArmored: string): Promise<string>;
37289
- decrypt(encryptedData: string, privateKeyArmored: string): Promise<string>;
37290
- generateKeyPair(options?: {
37291
- name?: string;
37292
- email?: string;
37293
- passphrase?: string;
37294
- }): Promise<{
37295
- publicKey: string;
37296
- privateKey: string;
37297
- }>;
37298
- }
37299
- /**
37300
- * Browser implementation of HTTP operations using Fetch API
37301
- */
37302
- declare class BrowserHttpAdapter implements VanaHttpAdapter {
37303
- fetch(url: string, options?: RequestInit): Promise<Response>;
37304
- }
37305
- /**
37306
- * Browser implementation of caching using sessionStorage for security
37307
- * SessionStorage is cleared when the tab closes, making it more secure for signature caching
37308
- */
37309
- declare class BrowserCacheAdapter implements VanaCacheAdapter {
37310
- private readonly prefix;
37311
- get(key: string): string | null;
37312
- set(key: string, value: string): void;
37313
- delete(key: string): void;
37314
- clear(): void;
37315
- }
37316
- /**
37317
- * Browser implementation of the Vana Platform Adapter
37318
- *
37319
- * This adapter provides all platform-specific functionality for browser environments
37320
- * without requiring any Node.js polyfills.
37472
+ * Complete browser platform adapter implementation
37321
37473
  */
37322
37474
  declare class BrowserPlatformAdapter implements VanaPlatformAdapter {
37323
- readonly crypto: BrowserCryptoAdapter;
37324
- readonly pgp: BrowserPGPAdapter;
37325
- readonly http: BrowserHttpAdapter;
37326
- readonly cache: BrowserCacheAdapter;
37327
- readonly platform: "browser";
37475
+ crypto: VanaCryptoAdapter;
37476
+ pgp: VanaPGPAdapter;
37477
+ http: VanaHttpAdapter;
37478
+ cache: VanaCacheAdapter;
37479
+ platform: "browser";
37480
+ constructor();
37328
37481
  }
37329
37482
 
37330
37483
  /**
@@ -37701,4 +37854,4 @@ declare function Vana(config: VanaConfig): VanaNodeImpl;
37701
37854
  */
37702
37855
  type VanaInstance = VanaNodeImpl;
37703
37856
 
37704
- 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, NodePlatformAdapter, 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 RelayerRequestPayload, 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, SchemaController, 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, 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, VanaNodeImpl, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createNodePlatformAdapter, createPlatformAdapter, createPlatformAdapterFor, 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, handleRelayerRequest, 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 };
37857
+ 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, NodePlatformAdapter, 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 RelayerRequestPayload, 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, SchemaController, 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, 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, VanaNodeImpl, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createNodePlatformAdapter, createPlatformAdapter, createPlatformAdapterFor, 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, handleRelayerRequest, 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 };