@opendatalabs/vana-sdk 0.1.0-alpha.e2e45dd → 0.1.0-alpha.e569cae

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 (50) hide show
  1. package/README.md +42 -0
  2. package/dist/{browser-cRpdLQ3-.d.ts → browser-DY8XDblx.d.ts} +4 -0
  3. package/dist/browser.d.ts +1 -1
  4. package/dist/browser.js +24 -9
  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 +973 -302
  19. package/dist/index.browser.js +33480 -32225
  20. package/dist/index.browser.js.map +1 -1
  21. package/dist/index.node.cjs +33622 -32378
  22. package/dist/index.node.cjs.map +1 -1
  23. package/dist/index.node.d.cts +1004 -309
  24. package/dist/index.node.d.ts +1004 -309
  25. package/dist/index.node.js +33581 -32339
  26. package/dist/index.node.js.map +1 -1
  27. package/dist/{node-CkdgwBiv.d.cts → node-D9-F9uEP.d.cts} +3 -2
  28. package/dist/{node-CkdgwBiv.d.ts → node-D9-F9uEP.d.ts} +3 -2
  29. package/dist/node.cjs +31 -33
  30. package/dist/node.cjs.map +1 -1
  31. package/dist/node.d.cts +1 -1
  32. package/dist/node.d.ts +1 -1
  33. package/dist/node.js +31 -33
  34. package/dist/node.js.map +1 -1
  35. package/dist/platform.browser.d.ts +2 -2
  36. package/dist/platform.browser.js +31 -8
  37. package/dist/platform.browser.js.map +1 -1
  38. package/dist/platform.cjs +72 -62
  39. package/dist/platform.cjs.map +1 -1
  40. package/dist/platform.d.cts +1 -1
  41. package/dist/platform.d.ts +1 -1
  42. package/dist/platform.js +72 -62
  43. package/dist/platform.js.map +1 -1
  44. package/dist/platform.node.cjs +72 -62
  45. package/dist/platform.node.cjs.map +1 -1
  46. package/dist/platform.node.d.cts +6 -2
  47. package/dist/platform.node.d.ts +6 -2
  48. package/dist/platform.node.js +72 -62
  49. package/dist/platform.node.js.map +1 -1
  50. package/package.json +16 -11
@@ -1,4 +1,4 @@
1
- import { Chain, Address, Hash, WalletClient, Account, Abi, GetContractReturnType, PublicClient } from 'viem';
1
+ import { Chain, Address, Hash, WalletClient, Account, Abi, GetContractReturnType, TransactionReceipt as TransactionReceipt$1, PublicClient } from 'viem';
2
2
  export { Abi, Account, Address, Chain, GetContractReturnType, Hash, PublicClient, WalletClient } from 'viem';
3
3
  import { Abi as Abi$1 } from 'abitype';
4
4
 
@@ -157,6 +157,14 @@ declare class StorageError extends Error {
157
157
  });
158
158
  }
159
159
 
160
+ /**
161
+ * Base interface for types that need to be compatible with Record<string, unknown>
162
+ *
163
+ * @category Permissions
164
+ */
165
+ interface RecordCompatible {
166
+ [key: string]: unknown;
167
+ }
160
168
  /**
161
169
  * Represents on-chain permission grant data without expensive off-chain resolution.
162
170
  *
@@ -355,7 +363,7 @@ interface PermissionGrantMessage {
355
363
  *
356
364
  * @category Permissions
357
365
  */
358
- interface PermissionInputMessage {
366
+ interface PermissionInputMessage extends RecordCompatible {
359
367
  /** Nonce */
360
368
  nonce: bigint;
361
369
  /** Grantee ID */
@@ -370,7 +378,7 @@ interface PermissionInputMessage {
370
378
  *
371
379
  * @category Permissions
372
380
  */
373
- interface RevokePermissionInput {
381
+ interface RevokePermissionInput extends RecordCompatible {
374
382
  /** Nonce */
375
383
  nonce: bigint;
376
384
  /** Permission ID to revoke */
@@ -451,9 +459,7 @@ interface GrantFile {
451
459
  *
452
460
  * @category Permissions
453
461
  */
454
- interface PermissionGrantTypedData {
455
- /** EIP-712 domain */
456
- domain: PermissionGrantDomain;
462
+ interface PermissionGrantTypedData extends GenericTypedData {
457
463
  /** EIP-712 types */
458
464
  types: {
459
465
  Permission: Array<{
@@ -471,7 +477,7 @@ interface PermissionGrantTypedData {
471
477
  *
472
478
  * @category Permissions
473
479
  */
474
- interface GenericTypedData {
480
+ interface GenericTypedData extends RecordCompatible {
475
481
  /** EIP-712 domain */
476
482
  domain: PermissionGrantDomain;
477
483
  /** EIP-712 types */
@@ -665,7 +671,7 @@ interface UntrustServerParams {
665
671
  *
666
672
  * @category Permissions
667
673
  */
668
- interface AddAndTrustServerInput {
674
+ interface AddAndTrustServerInput extends RecordCompatible {
669
675
  /** User nonce */
670
676
  nonce: bigint;
671
677
  /** Server address */
@@ -681,7 +687,7 @@ interface AddAndTrustServerInput {
681
687
  * @category Permissions
682
688
  * @deprecated Use AddAndTrustServerInput instead
683
689
  */
684
- interface TrustServerInput {
690
+ interface TrustServerInput extends RecordCompatible {
685
691
  /** User nonce */
686
692
  nonce: bigint;
687
693
  /** Server ID (numeric) */
@@ -692,7 +698,7 @@ interface TrustServerInput {
692
698
  *
693
699
  * @category Permissions
694
700
  */
695
- interface UntrustServerInput {
701
+ interface UntrustServerInput extends RecordCompatible {
696
702
  /** User nonce */
697
703
  nonce: bigint;
698
704
  /** Server ID (numeric) */
@@ -703,9 +709,7 @@ interface UntrustServerInput {
703
709
  *
704
710
  * @category Permissions
705
711
  */
706
- interface AddAndTrustServerTypedData {
707
- /** EIP-712 domain */
708
- domain: PermissionGrantDomain;
712
+ interface AddAndTrustServerTypedData extends GenericTypedData {
709
713
  /** EIP-712 types */
710
714
  types: {
711
715
  AddServer: Array<{
@@ -724,9 +728,7 @@ interface AddAndTrustServerTypedData {
724
728
  * @category Permissions
725
729
  * @deprecated Use AddAndTrustServerTypedData instead
726
730
  */
727
- interface TrustServerTypedData {
728
- /** EIP-712 domain */
729
- domain: PermissionGrantDomain;
731
+ interface TrustServerTypedData extends GenericTypedData {
730
732
  /** EIP-712 types */
731
733
  types: {
732
734
  TrustServer: Array<{
@@ -744,9 +746,7 @@ interface TrustServerTypedData {
744
746
  *
745
747
  * @category Permissions
746
748
  */
747
- interface UntrustServerTypedData {
748
- /** EIP-712 domain */
749
- domain: PermissionGrantDomain;
749
+ interface UntrustServerTypedData extends GenericTypedData {
750
750
  /** EIP-712 types */
751
751
  types: {
752
752
  UntrustServer: Array<{
@@ -903,7 +903,7 @@ interface RegisterGranteeParams {
903
903
  *
904
904
  * @category Permissions
905
905
  */
906
- interface RegisterGranteeInput extends Record<string, unknown> {
906
+ interface RegisterGranteeInput extends RecordCompatible {
907
907
  /** User nonce */
908
908
  nonce: bigint;
909
909
  /** Grantee owner address */
@@ -918,9 +918,7 @@ interface RegisterGranteeInput extends Record<string, unknown> {
918
918
  *
919
919
  * @category Permissions
920
920
  */
921
- interface RegisterGranteeTypedData {
922
- /** EIP-712 domain */
923
- domain: PermissionGrantDomain;
921
+ interface RegisterGranteeTypedData extends GenericTypedData {
924
922
  /** EIP-712 types */
925
923
  types: {
926
924
  RegisterGrantee: Array<{
@@ -986,6 +984,8 @@ interface ServerFilesAndPermissionParams {
986
984
  grant: string;
987
985
  /** File URLs */
988
986
  fileUrls: string[];
987
+ /** Schema IDs for each file - use 0 for files without schema validation */
988
+ schemaIds: number[];
989
989
  /** Server address */
990
990
  serverAddress: Address;
991
991
  /** Server URL */
@@ -1011,6 +1011,8 @@ interface ServerFilesAndPermissionTypedData extends GenericTypedData {
1011
1011
  grant: string;
1012
1012
  /** File URLs */
1013
1013
  fileUrls: string[];
1014
+ /** Schema IDs for each file - use 0 for files without schema validation */
1015
+ schemaIds: bigint[];
1014
1016
  /** Server address */
1015
1017
  serverAddress: Address;
1016
1018
  /** Server URL */
@@ -2184,8 +2186,8 @@ interface Schema {
2184
2186
  id: number;
2185
2187
  /** Schema name */
2186
2188
  name: string;
2187
- /** Schema type */
2188
- type: string;
2189
+ /** Schema dialect */
2190
+ dialect: string;
2189
2191
  /** URL containing the schema definition */
2190
2192
  definitionUrl: string;
2191
2193
  }
@@ -2216,8 +2218,8 @@ interface Refiner {
2216
2218
  interface AddSchemaParams {
2217
2219
  /** Schema name */
2218
2220
  name: string;
2219
- /** Schema type */
2220
- type: string;
2221
+ /** Schema dialect */
2222
+ dialect: string;
2221
2223
  /** URL containing the schema definition */
2222
2224
  definitionUrl: string;
2223
2225
  }
@@ -2292,13 +2294,7 @@ interface UpdateSchemaIdResult {
2292
2294
  transactionHash: Hash;
2293
2295
  }
2294
2296
  /**
2295
- * Query mode for trusted server retrieval
2296
- *
2297
- * @category Data Management
2298
- */
2299
- type TrustedServerQueryMode = "subgraph" | "rpc" | "auto";
2300
- /**
2301
- * Trusted server data structure (unified format for both subgraph and RPC modes)
2297
+ * Trusted server data structure
2302
2298
  *
2303
2299
  * @category Data Management
2304
2300
  */
@@ -2317,39 +2313,20 @@ interface TrustedServer {
2317
2313
  trustIndex?: number;
2318
2314
  }
2319
2315
  /**
2320
- * Parameters for getUserTrustedServers with dual-mode support
2316
+ * Parameters for getUserTrustedServers method
2321
2317
  *
2322
2318
  * @category Data Management
2323
2319
  */
2324
2320
  interface GetUserTrustedServersParams {
2325
- /** User address to query */
2321
+ /** User address to query trusted servers for */
2326
2322
  user: Address;
2327
- /** Query mode: 'subgraph' (fast, requires subgraph), 'rpc' (direct contract), or 'auto' (tries subgraph first) */
2328
- mode?: TrustedServerQueryMode;
2329
- /** Subgraph URL (required for subgraph mode) */
2323
+ /** Optional subgraph URL to override default */
2330
2324
  subgraphUrl?: string;
2331
- /** Pagination limit (applies to RPC mode) */
2325
+ /** Maximum number of results */
2332
2326
  limit?: number;
2333
- /** Pagination offset (applies to RPC mode) */
2327
+ /** Number of results to skip */
2334
2328
  offset?: number;
2335
2329
  }
2336
- /**
2337
- * Result of getUserTrustedServers query
2338
- *
2339
- * @category Data Management
2340
- */
2341
- interface GetUserTrustedServersResult {
2342
- /** Array of trusted servers */
2343
- servers: TrustedServer[];
2344
- /** Query mode that was actually used */
2345
- usedMode: TrustedServerQueryMode;
2346
- /** Total count (only available in RPC mode) */
2347
- total?: number;
2348
- /** Whether there are more servers (pagination info for RPC mode) */
2349
- hasMore?: boolean;
2350
- /** Any warnings or fallback information */
2351
- warnings?: string[];
2352
- }
2353
2330
 
2354
2331
  declare const contractAbis: {
2355
2332
  readonly DataPortabilityPermissions: readonly [{
@@ -2468,6 +2445,18 @@ declare const contractAbis: {
2468
2445
  }];
2469
2446
  readonly name: "InvalidPermissionsLength";
2470
2447
  readonly type: "error";
2448
+ }, {
2449
+ readonly inputs: readonly [{
2450
+ readonly internalType: "uint256";
2451
+ readonly name: "filesLength";
2452
+ readonly type: "uint256";
2453
+ }, {
2454
+ readonly internalType: "uint256";
2455
+ readonly name: "schemaIdsLength";
2456
+ readonly type: "uint256";
2457
+ }];
2458
+ readonly name: "InvalidSchemaIdsLength";
2459
+ readonly type: "error";
2471
2460
  }, {
2472
2461
  readonly inputs: readonly [];
2473
2462
  readonly name: "InvalidSignature";
@@ -2744,6 +2733,10 @@ declare const contractAbis: {
2744
2733
  readonly internalType: "string[]";
2745
2734
  readonly name: "fileUrls";
2746
2735
  readonly type: "string[]";
2736
+ }, {
2737
+ readonly internalType: "uint256[]";
2738
+ readonly name: "schemaIds";
2739
+ readonly type: "uint256[]";
2747
2740
  }, {
2748
2741
  readonly internalType: "address";
2749
2742
  readonly name: "serverAddress";
@@ -3726,7 +3719,7 @@ declare const contractAbis: {
3726
3719
  readonly name: "addServerInput";
3727
3720
  readonly type: "tuple";
3728
3721
  }];
3729
- readonly name: "addAndTrustServerOnBehalf";
3722
+ readonly name: "addAndTrustServerByManager";
3730
3723
  readonly outputs: readonly [];
3731
3724
  readonly stateMutability: "nonpayable";
3732
3725
  readonly type: "function";
@@ -4114,6 +4107,20 @@ declare const contractAbis: {
4114
4107
  readonly outputs: readonly [];
4115
4108
  readonly stateMutability: "nonpayable";
4116
4109
  readonly type: "function";
4110
+ }, {
4111
+ readonly inputs: readonly [{
4112
+ readonly internalType: "address";
4113
+ readonly name: "userAddress";
4114
+ readonly type: "address";
4115
+ }, {
4116
+ readonly internalType: "uint256";
4117
+ readonly name: "serverId";
4118
+ readonly type: "uint256";
4119
+ }];
4120
+ readonly name: "trustServerByManager";
4121
+ readonly outputs: readonly [];
4122
+ readonly stateMutability: "nonpayable";
4123
+ readonly type: "function";
4117
4124
  }, {
4118
4125
  readonly inputs: readonly [{
4119
4126
  readonly components: readonly [{
@@ -28737,6 +28744,95 @@ type VanaContract = keyof ContractAbis;
28737
28744
  */
28738
28745
  declare function getAbi<T extends VanaContract>(contract: T): ContractAbis[T];
28739
28746
 
28747
+ /**
28748
+ * Comprehensive mapping of SDK transaction operations to blockchain events.
28749
+ * Used by the generic transaction parser to know which contract and event
28750
+ * to look for when parsing transaction results.
28751
+ */
28752
+ declare const EVENT_MAPPINGS: {
28753
+ readonly grant: {
28754
+ readonly contract: "DataPortabilityPermissions";
28755
+ readonly event: "PermissionAdded";
28756
+ };
28757
+ readonly revoke: {
28758
+ readonly contract: "DataPortabilityPermissions";
28759
+ readonly event: "PermissionRevoked";
28760
+ };
28761
+ readonly revokePermission: {
28762
+ readonly contract: "DataPortabilityPermissions";
28763
+ readonly event: "PermissionRevoked";
28764
+ };
28765
+ readonly addServerFilesAndPermissions: {
28766
+ readonly contract: "DataPortabilityPermissions";
28767
+ readonly event: "PermissionAdded";
28768
+ };
28769
+ readonly trustServer: {
28770
+ readonly contract: "DataPortabilityServers";
28771
+ readonly event: "ServerTrusted";
28772
+ };
28773
+ readonly untrustServer: {
28774
+ readonly contract: "DataPortabilityServers";
28775
+ readonly event: "ServerUntrusted";
28776
+ };
28777
+ readonly registerServer: {
28778
+ readonly contract: "DataPortabilityServers";
28779
+ readonly event: "ServerRegistered";
28780
+ };
28781
+ readonly updateServer: {
28782
+ readonly contract: "DataPortabilityServers";
28783
+ readonly event: "ServerUpdated";
28784
+ };
28785
+ readonly addAndTrustServer: {
28786
+ readonly contract: "DataPortabilityServers";
28787
+ readonly event: "ServerTrusted";
28788
+ };
28789
+ readonly addFile: {
28790
+ readonly contract: "DataRegistry";
28791
+ readonly event: "FileAdded";
28792
+ };
28793
+ readonly addFileWithPermissionsAndSchema: {
28794
+ readonly contract: "DataRegistry";
28795
+ readonly event: "FileAdded";
28796
+ };
28797
+ readonly addFileWithSchema: {
28798
+ readonly contract: "DataRegistry";
28799
+ readonly event: "FileAdded";
28800
+ };
28801
+ readonly addFileWithPermissions: {
28802
+ readonly contract: "DataRegistry";
28803
+ readonly event: "FileAdded";
28804
+ };
28805
+ readonly addRefinement: {
28806
+ readonly contract: "DataRegistry";
28807
+ readonly event: "RefinementAdded";
28808
+ };
28809
+ readonly addRefiner: {
28810
+ readonly contract: "DataRefinerRegistry";
28811
+ readonly event: "RefinerAdded";
28812
+ };
28813
+ readonly updateSchemaId: {
28814
+ readonly contract: "DataRefinerRegistry";
28815
+ readonly event: "SchemaAdded";
28816
+ };
28817
+ readonly addSchema: {
28818
+ readonly contract: "DataRefinerRegistry";
28819
+ readonly event: "SchemaAdded";
28820
+ };
28821
+ readonly updateRefinement: {
28822
+ readonly contract: "DataRegistry";
28823
+ readonly event: "RefinementUpdated";
28824
+ };
28825
+ readonly addFilePermission: {
28826
+ readonly contract: "DataRegistry";
28827
+ readonly event: "PermissionGranted";
28828
+ };
28829
+ readonly registerGrantee: {
28830
+ readonly contract: "DataPortabilityGrantees";
28831
+ readonly event: "GranteeRegistered";
28832
+ };
28833
+ };
28834
+ type TransactionOperation = keyof typeof EVENT_MAPPINGS;
28835
+
28740
28836
  /**
28741
28837
  * Base interface for all transaction results.
28742
28838
  * Contains the event data plus transaction metadata.
@@ -28774,6 +28870,50 @@ interface PermissionRevokeResult extends BaseTransactionResult {
28774
28870
  /** ID of the permission that was revoked */
28775
28871
  permissionId: bigint;
28776
28872
  }
28873
+ /**
28874
+ * Result of a successful server trust operation.
28875
+ * Contains data from the ServerTrusted blockchain event.
28876
+ */
28877
+ interface ServerTrustResult extends BaseTransactionResult {
28878
+ /** Address of the user who trusted the server */
28879
+ user: Address;
28880
+ /** Address/ID of the trusted server */
28881
+ serverId: Address;
28882
+ /** URL of the trusted server */
28883
+ serverUrl: string;
28884
+ }
28885
+ /**
28886
+ * Result of a successful server untrust operation.
28887
+ * Contains data from the ServerUntrusted blockchain event.
28888
+ */
28889
+ interface ServerUntrustResult extends BaseTransactionResult {
28890
+ /** Address of the user who untrusted the server */
28891
+ user: Address;
28892
+ /** Address/ID of the untrusted server */
28893
+ serverId: Address;
28894
+ }
28895
+ /**
28896
+ * Result of a successful server update operation.
28897
+ * Contains data from the ServerUpdated blockchain event.
28898
+ */
28899
+ interface ServerUpdateResult extends BaseTransactionResult {
28900
+ /** ID of the server that was updated */
28901
+ serverId: bigint;
28902
+ /** New URL of the server */
28903
+ url: string;
28904
+ }
28905
+ /**
28906
+ * Result of a successful grantee registration operation.
28907
+ * Contains data from the GranteeRegistered blockchain event.
28908
+ */
28909
+ interface GranteeRegisterResult extends BaseTransactionResult {
28910
+ /** Unique grantee ID assigned by the registry */
28911
+ granteeId: bigint;
28912
+ /** Address of the registered grantee */
28913
+ granteeAddress: Address;
28914
+ /** Display name of the grantee */
28915
+ name: string;
28916
+ }
28777
28917
  /**
28778
28918
  * Result of a successful file permission addition operation.
28779
28919
  * Contains data from the FilePermissionAdded blockchain event.
@@ -28787,6 +28927,80 @@ interface FilePermissionResult extends BaseTransactionResult {
28787
28927
  encryptedKey: string;
28788
28928
  }
28789
28929
 
28930
+ /**
28931
+ * Provides a unified interface for blockchain transaction results with lazy-loaded event parsing.
28932
+ *
28933
+ * @remarks
28934
+ * TransactionHandle enables immediate access to transaction hashes while providing optional
28935
+ * lazy-loaded access to receipts and parsed event data. All transaction-submitting methods
28936
+ * in the SDK return this handle, allowing developers to choose between immediate hash access
28937
+ * or waiting for event data. Results are memoized to prevent redundant network calls.
28938
+ *
28939
+ * @category Transactions
28940
+ * @example
28941
+ * ```typescript
28942
+ * // Immediate hash access
28943
+ * const tx = await sdk.permissions.submitSignedGrant(typedData, signature);
28944
+ * console.log(`Transaction submitted: ${tx.hash}`);
28945
+ *
28946
+ * // Wait for and parse events
28947
+ * const eventData = await tx.waitForEvents();
28948
+ * console.log(`Permission ID: ${eventData.permissionId}`);
28949
+ *
28950
+ * // Check receipt for gas usage
28951
+ * const receipt = await tx.waitForReceipt();
28952
+ * console.log(`Gas used: ${receipt.gasUsed}`);
28953
+ * ```
28954
+ */
28955
+ declare class TransactionHandle<TEventData = unknown> {
28956
+ private readonly context;
28957
+ readonly hash: Hash;
28958
+ private readonly operation?;
28959
+ private _receipt?;
28960
+ private _eventData?;
28961
+ private _receiptPromise?;
28962
+ private _eventPromise?;
28963
+ constructor(context: ControllerContext$1, hash: Hash, operation?: TransactionOperation | undefined);
28964
+ /**
28965
+ * Waits for transaction confirmation and returns the receipt.
28966
+ * Results are memoized - multiple calls return the same promise.
28967
+ *
28968
+ * @param options Optional timeout configuration
28969
+ * @param options.timeout Timeout in milliseconds (default: 30000)
28970
+ * @returns Transaction receipt with gas usage, logs, and status
28971
+ */
28972
+ waitForReceipt(options?: {
28973
+ timeout?: number;
28974
+ }): Promise<TransactionReceipt$1>;
28975
+ /**
28976
+ * Waits for transaction confirmation and parses emitted events.
28977
+ * Results are memoized - multiple calls return the same promise.
28978
+ *
28979
+ * @returns Parsed event data with transaction metadata
28980
+ * @throws {Error} If no operation was specified for event parsing
28981
+ */
28982
+ waitForEvents(): Promise<TEventData>;
28983
+ /**
28984
+ * Enables string coercion for backwards compatibility.
28985
+ * Allows TransactionHandle to be used anywhere a Hash is expected.
28986
+ *
28987
+ * @example
28988
+ * ```typescript
28989
+ * const hash: Hash = tx; // Works via toString()
28990
+ * console.log(`Transaction: ${tx}`); // Prints hash
28991
+ * ```
28992
+ * @returns The transaction hash as a string
28993
+ */
28994
+ toString(): string;
28995
+ /**
28996
+ * JSON serialization support.
28997
+ * Returns the hash when serialized to JSON.
28998
+ *
28999
+ * @returns The transaction hash for JSON serialization
29000
+ */
29001
+ toJSON(): string;
29002
+ }
29003
+
28790
29004
  /**
28791
29005
  * Google Drive Storage Provider for Vana SDK
28792
29006
  *
@@ -29825,30 +30039,31 @@ declare class PermissionsController {
29825
30039
  */
29826
30040
  grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
29827
30041
  /**
29828
- * Submits a permission grant transaction and returns the transaction hash immediately.
30042
+ * Submits a permission grant transaction and returns a handle for flexible result access.
29829
30043
  *
29830
- * This is the lower-level method that provides maximum control over transaction timing.
29831
- * Use this when you want to handle transaction confirmation and event parsing separately,
29832
- * or when submitting multiple transactions in batch.
30044
+ * @remarks
30045
+ * This lower-level method provides maximum control over transaction timing.
30046
+ * Returns a TransactionHandle that allows immediate hash access or optional event parsing.
30047
+ * Use this when handling multiple transactions or when you need granular control.
29833
30048
  *
29834
30049
  * @param params - The permission grant configuration object
29835
- * @returns Promise that resolves to the transaction hash when successfully submitted
30050
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
29836
30051
  * @throws {RelayerError} When gasless transaction submission fails
29837
30052
  * @throws {SignatureError} When user rejects the signature request
29838
30053
  * @throws {SerializationError} When grant data cannot be serialized
29839
30054
  * @throws {BlockchainError} When permission grant preparation fails
29840
30055
  * @example
29841
30056
  * ```typescript
29842
- * // Submit transaction and handle confirmation later
29843
- * const txHash = await vana.permissions.submitPermissionGrant(params);
29844
- * console.log(`Transaction submitted: ${txHash}`);
30057
+ * // Submit transaction and get immediate hash access
30058
+ * const tx = await vana.permissions.submitPermissionGrant(params);
30059
+ * console.log(`Transaction submitted: ${tx.hash}`);
29845
30060
  *
29846
- * // Later, when you need the permission data:
29847
- * const result = await parseTransactionResult(context, txHash, 'grant');
29848
- * console.log(`Permission ID: ${result.permissionId}`);
30061
+ * // Optionally wait for and parse events
30062
+ * const eventData = await tx.waitForEvents();
30063
+ * console.log(`Permission ID: ${eventData.permissionId}`);
29849
30064
  * ```
29850
30065
  */
29851
- submitPermissionGrant(params: GrantPermissionParams$1): Promise<Hash>;
30066
+ submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
29852
30067
  /**
29853
30068
  * Prepares a permission grant with preview before signing.
29854
30069
  *
@@ -29876,15 +30091,21 @@ declare class PermissionsController {
29876
30091
  */
29877
30092
  prepareGrant(params: GrantPermissionParams$1): Promise<{
29878
30093
  preview: GrantFile;
29879
- confirm: () => Promise<Hash>;
30094
+ confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
29880
30095
  }>;
29881
30096
  /**
29882
- * Internal method to complete the grant process after user confirmation.
29883
- * This is called by the confirm() function returned from prepareGrant().
30097
+ * Completes the grant process after user confirmation.
30098
+ *
30099
+ * @remarks
30100
+ * This internal method is called by the confirm() function returned from prepareGrant().
30101
+ * It handles IPFS upload, signature creation, and transaction submission.
29884
30102
  *
29885
30103
  * @param params - The permission grant parameters containing user and operation details
29886
30104
  * @param grantFile - The prepared grant file with permissions and metadata
29887
- * @returns Promise resolving to the transaction hash
30105
+ * @returns Promise resolving to TransactionHandle for flexible result access
30106
+ * @throws {BlockchainError} When permission grant confirmation fails
30107
+ * @throws {NetworkError} When IPFS upload fails
30108
+ * @throws {SignatureError} When user rejects the signature
29888
30109
  */
29889
30110
  private confirmGrantInternal;
29890
30111
  /**
@@ -29940,49 +30161,106 @@ declare class PermissionsController {
29940
30161
  * );
29941
30162
  * ```
29942
30163
  */
29943
- submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<Hash>;
30164
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
29944
30165
  /**
29945
30166
  * Submits an already-signed trust server transaction to the blockchain.
30167
+ *
30168
+ * @remarks
29946
30169
  * This method extracts the trust server input from typed data and submits it directly.
30170
+ * Used internally by trust server methods after signature collection.
29947
30171
  *
29948
30172
  * @param typedData - The EIP-712 typed data for TrustServer
29949
- * @param signature - The user's signature
29950
- * @returns Promise resolving to the transaction hash
30173
+ * @param signature - The user's signature obtained via `signTypedData()`
30174
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30175
+ * @throws {BlockchainError} When contract submission fails
30176
+ * @throws {NetworkError} When blockchain communication fails
30177
+ * @example
30178
+ * ```typescript
30179
+ * const txHandle = await vana.permissions.submitSignedTrustServer(
30180
+ * typedData,
30181
+ * "0x1234..."
30182
+ * );
30183
+ * const result = await txHandle.waitForEvents();
30184
+ * ```
29951
30185
  */
29952
- submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<Hash>;
30186
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
29953
30187
  /**
29954
30188
  * Submits an already-signed add and trust server transaction to the blockchain.
30189
+ *
30190
+ * @remarks
29955
30191
  * This method extracts the add and trust server input from typed data and submits it directly.
30192
+ * Combines server registration and trust operations in a single transaction.
29956
30193
  *
29957
30194
  * @param typedData - The EIP-712 typed data for AddAndTrustServer
29958
- * @param signature - The user's signature
29959
- * @returns Promise resolving to the transaction hash
30195
+ * @param signature - The user's signature obtained via `signTypedData()`
30196
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30197
+ * @throws {BlockchainError} When contract submission fails
30198
+ * @throws {NetworkError} When blockchain communication fails
30199
+ * @example
30200
+ * ```typescript
30201
+ * const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
30202
+ * typedData,
30203
+ * "0x1234..."
30204
+ * );
30205
+ * const result = await txHandle.waitForEvents();
30206
+ * ```
29960
30207
  */
29961
- submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<Hash>;
30208
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
29962
30209
  /**
29963
30210
  * Submits an already-signed permission revoke transaction to the blockchain.
30211
+ *
30212
+ * @remarks
29964
30213
  * This method handles the revocation of previously granted permissions.
30214
+ * Used internally by revocation methods after signature collection.
29965
30215
  *
29966
30216
  * @param typedData - The EIP-712 typed data for PermissionRevoke
29967
- * @param signature - The user's signature
29968
- * @returns Promise resolving to the transaction hash
30217
+ * @param signature - The user's signature obtained via `signTypedData()`
30218
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30219
+ * @throws {BlockchainError} When contract submission fails
30220
+ * @throws {NetworkError} When blockchain communication fails
30221
+ * @example
30222
+ * ```typescript
30223
+ * const txHandle = await vana.permissions.submitSignedRevoke(
30224
+ * typedData,
30225
+ * "0x1234..."
30226
+ * );
30227
+ * const result = await txHandle.waitForEvents();
30228
+ * ```
29969
30229
  */
29970
- submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30230
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
29971
30231
  /**
29972
30232
  * Submits an already-signed untrust server transaction to the blockchain.
30233
+ *
30234
+ * @remarks
29973
30235
  * This method handles the removal of trusted servers.
30236
+ * Used internally by untrust server methods after signature collection.
29974
30237
  *
29975
30238
  * @param typedData - The EIP-712 typed data for UntrustServer
29976
- * @param signature - The user's signature
29977
- * @returns Promise resolving to the transaction hash
30239
+ * @param signature - The user's signature obtained via `signTypedData()`
30240
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30241
+ * @throws {BlockchainError} When contract submission fails
30242
+ * @throws {NetworkError} When blockchain communication fails
30243
+ * @example
30244
+ * ```typescript
30245
+ * const txHandle = await vana.permissions.submitSignedUntrustServer(
30246
+ * typedData,
30247
+ * "0x1234..."
30248
+ * );
30249
+ * const result = await txHandle.waitForEvents();
30250
+ * ```
29978
30251
  */
29979
- submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30252
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
29980
30253
  /**
29981
30254
  * Submits a signed transaction directly to the blockchain.
29982
30255
  *
30256
+ * @remarks
30257
+ * Internal method used when relayer callbacks are not available. Formats the signature
30258
+ * and submits the permission grant directly to the smart contract.
30259
+ *
29983
30260
  * @param typedData - The typed data structure for the permission grant
29984
30261
  * @param signature - The cryptographic signature authorizing the transaction
29985
30262
  * @returns Promise resolving to the transaction hash
30263
+ * @throws {BlockchainError} When contract submission fails
29986
30264
  */
29987
30265
  private submitDirectTransaction;
29988
30266
  /**
@@ -30029,19 +30307,33 @@ declare class PermissionsController {
30029
30307
  * console.log(`Revocation submitted: ${txHash}`);
30030
30308
  * ```
30031
30309
  */
30032
- submitPermissionRevoke(params: RevokePermissionParams): Promise<Hash>;
30310
+ submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30033
30311
  /**
30034
- * Revokes a permission with a signature (gasless transaction).
30312
+ * Revokes a permission with a signature for gasless transactions.
30313
+ *
30314
+ * @remarks
30315
+ * This method creates an EIP-712 signature for permission revocation and submits
30316
+ * it either through relayer callbacks or directly to the blockchain. Provides
30317
+ * gasless revocation when relayer is configured.
30035
30318
  *
30036
30319
  * @param params - Parameters for revoking the permission
30037
- * @returns Promise resolving to transaction hash
30320
+ * @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
30321
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30038
30322
  * @throws {BlockchainError} When chain ID is not available
30039
30323
  * @throws {NonceError} When retrieving user nonce fails
30040
30324
  * @throws {SignatureError} When user rejects the signature request
30041
30325
  * @throws {RelayerError} When gasless submission fails
30042
30326
  * @throws {PermissionError} When revocation fails for any other reason
30327
+ * @example
30328
+ * ```typescript
30329
+ * const txHandle = await vana.permissions.submitRevokeWithSignature({
30330
+ * permissionId: 123n
30331
+ * });
30332
+ * const result = await txHandle.waitForEvents();
30333
+ * console.log(`Permission ${result.permissionId} revoked`);
30334
+ * ```
30043
30335
  */
30044
- submitRevokeWithSignature(params: RevokePermissionParams): Promise<Hash>;
30336
+ submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30045
30337
  /**
30046
30338
  * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30047
30339
  *
@@ -30066,6 +30358,18 @@ declare class PermissionsController {
30066
30358
  * const serversNonce = await this.getServersUserNonce();
30067
30359
  * ```
30068
30360
  */
30361
+ /**
30362
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30363
+ *
30364
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30365
+ *
30366
+ * @remarks
30367
+ * This method is deprecated in favor of more specific nonce methods that target
30368
+ * the appropriate contract for the operation being performed.
30369
+ *
30370
+ * @returns Promise resolving to the user's current nonce as a bigint
30371
+ * @throws {NonceError} When retrieving the nonce fails
30372
+ */
30069
30373
  private getUserNonce;
30070
30374
  /**
30071
30375
  * Retrieves the user's current nonce from the DataPortabilityServers contract.
@@ -30081,6 +30385,16 @@ declare class PermissionsController {
30081
30385
  * console.log(`Current servers nonce: ${nonce}`);
30082
30386
  * ```
30083
30387
  */
30388
+ /**
30389
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30390
+ *
30391
+ * @remarks
30392
+ * Used for server-related operations (trust/untrust) to prevent replay attacks.
30393
+ * The nonce must be incremented with each server operation.
30394
+ *
30395
+ * @returns Promise resolving to the user's current nonce as a bigint
30396
+ * @throws {NonceError} When retrieving the nonce fails
30397
+ */
30084
30398
  private getServersUserNonce;
30085
30399
  /**
30086
30400
  * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
@@ -30096,6 +30410,16 @@ declare class PermissionsController {
30096
30410
  * console.log(`Current permissions nonce: ${nonce}`);
30097
30411
  * ```
30098
30412
  */
30413
+ /**
30414
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30415
+ *
30416
+ * @remarks
30417
+ * Used for permission-related operations (grant/revoke) to prevent replay attacks.
30418
+ * The nonce must be incremented with each permission operation.
30419
+ *
30420
+ * @returns Promise resolving to the user's current nonce as a bigint
30421
+ * @throws {NonceError} When retrieving the nonce fails
30422
+ */
30099
30423
  private getPermissionsUserNonce;
30100
30424
  /**
30101
30425
  * Composes the EIP-712 typed data for PermissionGrant (new simplified format).
@@ -30117,6 +30441,7 @@ declare class PermissionsController {
30117
30441
  * @param params.granteeId - Grantee ID
30118
30442
  * @param params.grant - Grant URL or grant data
30119
30443
  * @param params.fileUrls - Array of file URLs
30444
+ * @param params.schemaIds - Schema IDs for each file
30120
30445
  * @param params.serverAddress - Server address
30121
30446
  * @param params.serverUrl - Server URL
30122
30447
  * @param params.serverPublicKey - Server public key
@@ -30222,7 +30547,7 @@ declare class PermissionsController {
30222
30547
  * console.log('Now trusting servers:', trustedServers);
30223
30548
  * ```
30224
30549
  */
30225
- addAndTrustServer(params: AddAndTrustServerParams): Promise<Hash>;
30550
+ addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30226
30551
  /**
30227
30552
  * Trusts a server for data processing (legacy method).
30228
30553
  *
@@ -30230,14 +30555,14 @@ declare class PermissionsController {
30230
30555
  * @returns Promise resolving to transaction hash
30231
30556
  * @deprecated Use addAndTrustServer instead
30232
30557
  */
30233
- submitTrustServer(params: TrustServerParams): Promise<Hash>;
30558
+ submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30234
30559
  /**
30235
30560
  * Adds and trusts a server using a signature (gasless transaction).
30236
30561
  *
30237
30562
  * @param params - Parameters for adding and trusting the server
30238
- * @returns Promise resolving to transaction hash
30563
+ * @returns Promise resolving to TransactionHandle with ServerTrustResult event data
30239
30564
  */
30240
- submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<Hash>;
30565
+ submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30241
30566
  /**
30242
30567
  * Trusts a server using a signature (gasless transaction - legacy method).
30243
30568
  *
@@ -30251,13 +30576,24 @@ declare class PermissionsController {
30251
30576
  * @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
30252
30577
  * @throws {BlockchainError} When trust operation fails for any other reason
30253
30578
  */
30254
- submitTrustServerWithSignature(params: TrustServerParams): Promise<Hash>;
30579
+ submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30255
30580
  /**
30256
30581
  * Submits a direct untrust server transaction (without signature).
30257
30582
  *
30258
30583
  * @param params - The untrust server parameters containing server details
30259
30584
  * @returns Promise resolving to the transaction hash
30260
30585
  */
30586
+ /**
30587
+ * Submits an untrust server transaction directly to the blockchain.
30588
+ *
30589
+ * @remarks
30590
+ * Internal method used for direct blockchain submission of untrust server operations
30591
+ * when relayer callbacks are not available.
30592
+ *
30593
+ * @param params - The untrust server parameters
30594
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30595
+ * @throws {BlockchainError} When contract submission fails
30596
+ */
30261
30597
  private submitDirectUntrustTransaction;
30262
30598
  /**
30263
30599
  * Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
@@ -30287,7 +30623,7 @@ declare class PermissionsController {
30287
30623
  * console.log('Still trusting servers:', trustedServers);
30288
30624
  * ```
30289
30625
  */
30290
- submitUntrustServer(params: UntrustServerParams): Promise<Hash>;
30626
+ submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30291
30627
  /**
30292
30628
  * Untrusts a server using a signature (gasless transaction).
30293
30629
  *
@@ -30300,7 +30636,7 @@ declare class PermissionsController {
30300
30636
  * @throws {RelayerError} When gasless submission fails
30301
30637
  * @throws {BlockchainError} When untrust transaction fails
30302
30638
  */
30303
- submitUntrustServerWithSignature(params: UntrustServerParams): Promise<Hash>;
30639
+ submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30304
30640
  /**
30305
30641
  * Retrieves all servers trusted by a user from the DataPortabilityServers contract.
30306
30642
  *
@@ -30351,22 +30687,60 @@ declare class PermissionsController {
30351
30687
  /**
30352
30688
  * Gets server information for multiple servers efficiently.
30353
30689
  *
30354
- * @param serverIds - Array of server IDs to query
30355
- * @returns Promise resolving to batch result with successes and failures
30690
+ * @remarks
30691
+ * This method uses multicall to fetch information for multiple servers in a single
30692
+ * blockchain call, improving performance when querying many servers. Failed lookups
30693
+ * are returned separately for error handling.
30694
+ *
30695
+ * @param serverIds - Array of numeric server IDs to query
30696
+ * @returns Promise resolving to batch result containing successful lookups and failed IDs
30356
30697
  * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30698
+ * @example
30699
+ * ```typescript
30700
+ * const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
30701
+ *
30702
+ * // Process successful lookups
30703
+ * result.servers.forEach((server, id) => {
30704
+ * console.log(`Server ${id}: ${server.url}`);
30705
+ * });
30706
+ *
30707
+ * // Handle failed lookups
30708
+ * if (result.failed.length > 0) {
30709
+ * console.log(`Failed to fetch: ${result.failed.join(', ')}`);
30710
+ * }
30711
+ * ```
30357
30712
  */
30358
30713
  getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
30359
30714
  /**
30360
30715
  * Checks whether a specific server is trusted by a user.
30361
30716
  *
30362
- * @param serverId - Server ID to check (numeric)
30717
+ * @remarks
30718
+ * This method queries the user's trusted server list and checks if the specified
30719
+ * server is present. Returns both the trust status and the index in the trust list
30720
+ * if trusted.
30721
+ *
30722
+ * @param serverId - Numeric server ID to check
30363
30723
  * @param userAddress - Optional user address (defaults to current user)
30364
- * @returns Promise resolving to server trust status
30724
+ * @returns Promise resolving to server trust status with trust index if applicable
30725
+ * @throws {BlockchainError} When reading from contract fails
30726
+ * @example
30727
+ * ```typescript
30728
+ * const status = await vana.permissions.checkServerTrustStatus(1);
30729
+ * if (status.isTrusted) {
30730
+ * console.log(`Server is trusted at index ${status.trustIndex}`);
30731
+ * } else {
30732
+ * console.log('Server is not trusted');
30733
+ * }
30734
+ * ```
30365
30735
  */
30366
30736
  checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
30367
30737
  /**
30368
30738
  * Composes EIP-712 typed data for AddAndTrustServer.
30369
30739
  *
30740
+ * @remarks
30741
+ * Creates the complete typed data structure required for EIP-712 signature generation
30742
+ * when adding and trusting a new server in a single transaction.
30743
+ *
30370
30744
  * @param input - The add and trust server input data containing server details
30371
30745
  * @returns Promise resolving to the typed data structure for server add and trust
30372
30746
  */
@@ -30448,7 +30822,7 @@ declare class PermissionsController {
30448
30822
  * console.log(`Grantee registered in transaction: ${txHash}`);
30449
30823
  * ```
30450
30824
  */
30451
- submitRegisterGrantee(params: RegisterGranteeParams): Promise<Hash>;
30825
+ submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
30452
30826
  /**
30453
30827
  * Registers a grantee with a signature (gasless transaction)
30454
30828
  *
@@ -30464,7 +30838,7 @@ declare class PermissionsController {
30464
30838
  * });
30465
30839
  * ```
30466
30840
  */
30467
- submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<Hash>;
30841
+ submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
30468
30842
  /**
30469
30843
  * Submits a signed register grantee transaction via relayer
30470
30844
  *
@@ -30477,7 +30851,7 @@ declare class PermissionsController {
30477
30851
  * const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
30478
30852
  * ```
30479
30853
  */
30480
- submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<Hash>;
30854
+ submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
30481
30855
  /**
30482
30856
  * Retrieves all registered grantees from the DataPortabilityGrantees contract.
30483
30857
  *
@@ -30764,7 +31138,7 @@ declare class PermissionsController {
30764
31138
  * @param url - New URL for the server
30765
31139
  * @returns Promise resolving to transaction hash
30766
31140
  */
30767
- submitUpdateServer(serverId: bigint, url: string): Promise<Hash>;
31141
+ submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
30768
31142
  /**
30769
31143
  * Get all permission IDs for a user
30770
31144
  *
@@ -30804,49 +31178,106 @@ declare class PermissionsController {
30804
31178
  * @throws {BlockchainError} When permission addition fails
30805
31179
  * @throws {NetworkError} When network communication fails
30806
31180
  */
30807
- submitAddPermission(params: ServerFilesAndPermissionParams): Promise<Hash>;
31181
+ submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
30808
31182
  /**
30809
31183
  * Submits an already-signed add permission transaction to the blockchain.
30810
31184
  * This method supports both relayer-based gasless transactions and direct transactions.
30811
31185
  *
30812
31186
  * @param typedData - The EIP-712 typed data for AddPermission
30813
31187
  * @param signature - The user's signature
30814
- * @returns Promise resolving to the transaction hash
31188
+ * @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
30815
31189
  * @throws {RelayerError} When gasless transaction submission fails
30816
31190
  * @throws {BlockchainError} When permission addition fails
30817
31191
  * @throws {NetworkError} When network communication fails
30818
31192
  */
30819
- submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
31193
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30820
31194
  /**
30821
- * Submit server files and permissions with signature to the blockchain (supports gasless transactions)
31195
+ * Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
31196
+ *
31197
+ * @remarks
31198
+ * This method validates files against their specified schemas before submission.
31199
+ * Schema validation ensures data conforms to expected formats before on-chain registration.
31200
+ * Files with schemaId = 0 bypass validation. The method supports atomic batch operations
31201
+ * where all files and permissions are registered in a single transaction.
30822
31202
  *
30823
31203
  * @param params - Parameters for adding server files and permissions
30824
- * @returns Promise resolving to transaction hash
30825
- * @throws {RelayerError} When gasless transaction submission fails
31204
+ * @param params.granteeId - The ID of the permission grantee
31205
+ * @param params.grant - Grant URL containing permission parameters (typically IPFS)
31206
+ * @param params.fileUrls - Array of file URLs to register
31207
+ * @param params.schemaIds - Schema IDs for each file. Use 0 for files without schema validation.
31208
+ * Array length must match fileUrls length.
31209
+ * @param params.serverAddress - Server wallet address for decryption permissions
31210
+ * @param params.serverUrl - Server endpoint URL
31211
+ * @param params.serverPublicKey - Server's public key for encryption.
31212
+ * Obtain via `vana.server.getIdentity(userAddress).public_key`.
31213
+ * @param params.filePermissions - Nested array of permissions for each file
31214
+ * @returns TransactionHandle with immediate hash access and event parsing capability
31215
+ * @throws {Error} When schemaIds array length doesn't match fileUrls array length
31216
+ * @throws {SchemaValidationError} When file data doesn't match the specified schema.
31217
+ * Verify data structure matches schema definition from `vana.schemas.get(schemaId)`.
31218
+ * @throws {RelayerError} When gasless transaction submission fails.
31219
+ * Retry without relayer configuration to submit direct transaction.
30826
31220
  * @throws {SignatureError} When user rejects the signature request
30827
31221
  * @throws {BlockchainError} When server files and permissions addition fails
30828
- * @throws {NetworkError} When network communication fails
31222
+ * @throws {NetworkError} When network communication fails.
31223
+ * Check network connection or configure alternative gateways.
31224
+ *
31225
+ * @example
31226
+ * ```typescript
31227
+ * const result = await vana.permissions.submitAddServerFilesAndPermissions({
31228
+ * granteeId: BigInt(1),
31229
+ * grant: "ipfs://QmXxx...",
31230
+ * fileUrls: ["https://storage.example.com/data.json"],
31231
+ * schemaIds: [123], // LinkedIn profile schema ID
31232
+ * serverAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31233
+ * serverUrl: "https://server.example.com",
31234
+ * serverPublicKey: serverInfo.public_key,
31235
+ * filePermissions: [[{
31236
+ * account: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31237
+ * key: encryptedKey
31238
+ * }]]
31239
+ * });
31240
+ * const events = await result.waitForEvents();
31241
+ * console.log(`Permission ID: ${events.permissionId}`);
31242
+ * ```
30829
31243
  */
30830
- submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<Hash>;
31244
+ submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
30831
31245
  /**
30832
31246
  * Submits an already-signed add server files and permissions transaction to the blockchain.
30833
- * This method supports both relayer-based gasless transactions and direct transactions.
31247
+ *
31248
+ * @remarks
31249
+ * This method returns a TransactionHandle that provides immediate access to the transaction hash
31250
+ * while allowing lazy-loaded access to parsed event data. Use `waitForEvents()` to retrieve
31251
+ * the permission ID and other event details after transaction confirmation.
30834
31252
  *
30835
31253
  * @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
30836
31254
  * @param signature - The user's signature
30837
- * @returns Promise resolving to the transaction hash
31255
+ * @returns TransactionHandle with immediate hash access and optional event parsing
30838
31256
  * @throws {RelayerError} When gasless transaction submission fails
30839
31257
  * @throws {BlockchainError} When server files and permissions addition fails
30840
31258
  * @throws {NetworkError} When network communication fails
31259
+ *
31260
+ * @example
31261
+ * ```typescript
31262
+ * const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
31263
+ * typedData,
31264
+ * signature
31265
+ * );
31266
+ * console.log(`Transaction submitted: ${tx.hash}`);
31267
+ *
31268
+ * // Wait for confirmation and get the permission ID
31269
+ * const { permissionId } = await tx.waitForEvents();
31270
+ * console.log(`Permission created with ID: ${permissionId}`);
31271
+ * ```
30841
31272
  */
30842
- submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<Hash>;
31273
+ submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30843
31274
  /**
30844
31275
  * Submit permission revocation with signature to the blockchain
30845
31276
  *
30846
31277
  * @param permissionId - Permission ID to revoke
30847
31278
  * @returns Promise resolving to transaction hash
30848
31279
  */
30849
- submitRevokePermission(permissionId: bigint): Promise<Hash>;
31280
+ submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
30850
31281
  /**
30851
31282
  * Submits a signed add permission transaction directly to the blockchain.
30852
31283
  *
@@ -30988,33 +31419,52 @@ declare class SchemaController {
30988
31419
  * Retrieves a schema by its ID.
30989
31420
  *
30990
31421
  * @param schemaId - The ID of the schema to retrieve
31422
+ * @param options - Optional parameters
31423
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
30991
31424
  * @returns Promise resolving to the schema object
30992
31425
  * @throws {Error} When the schema is not found or chain is unavailable
30993
31426
  * @example
30994
31427
  * ```typescript
30995
31428
  * const schema = await vana.schemas.get(1);
30996
31429
  * console.log(`Schema: ${schema.name} (${schema.type})`);
31430
+ *
31431
+ * // With custom subgraph
31432
+ * const schema = await vana.schemas.get(1, {
31433
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31434
+ * });
30997
31435
  * ```
30998
31436
  */
30999
- get(schemaId: number): Promise<Schema>;
31437
+ get(schemaId: number, options?: {
31438
+ subgraphUrl?: string;
31439
+ }): Promise<Schema>;
31000
31440
  /**
31001
31441
  * Gets the total number of schemas registered on the network.
31002
31442
  *
31443
+ * @param options - Optional parameters
31444
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31003
31445
  * @returns Promise resolving to the total schema count
31004
31446
  * @throws {Error} When the count cannot be retrieved
31005
31447
  * @example
31006
31448
  * ```typescript
31007
31449
  * const count = await vana.schemas.count();
31008
31450
  * console.log(`Total schemas: ${count}`);
31451
+ *
31452
+ * // With custom subgraph
31453
+ * const count = await vana.schemas.count({
31454
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31455
+ * });
31009
31456
  * ```
31010
31457
  */
31011
- count(): Promise<number>;
31458
+ count(options?: {
31459
+ subgraphUrl?: string;
31460
+ }): Promise<number>;
31012
31461
  /**
31013
31462
  * Lists all schemas with pagination.
31014
31463
  *
31015
31464
  * @param options - Optional parameters for listing schemas
31016
31465
  * @param options.limit - Maximum number of schemas to return
31017
31466
  * @param options.offset - Number of schemas to skip
31467
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31018
31468
  * @returns Promise resolving to an array of schemas
31019
31469
  * @example
31020
31470
  * ```typescript
@@ -31023,11 +31473,19 @@ declare class SchemaController {
31023
31473
  *
31024
31474
  * // Get schemas with pagination
31025
31475
  * const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
31476
+ *
31477
+ * // With custom subgraph
31478
+ * const schemas = await vana.schemas.list({
31479
+ * limit: 10,
31480
+ * offset: 0,
31481
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31482
+ * });
31026
31483
  * ```
31027
31484
  */
31028
31485
  list(options?: {
31029
31486
  limit?: number;
31030
31487
  offset?: number;
31488
+ subgraphUrl?: string;
31031
31489
  }): Promise<Schema[]>;
31032
31490
  /**
31033
31491
  * Adds a schema using the legacy method (low-level API).
@@ -31037,6 +31495,36 @@ declare class SchemaController {
31037
31495
  * @returns Promise resolving to the add schema result
31038
31496
  */
31039
31497
  addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
31498
+ /**
31499
+ * Internal method: Query schema via subgraph
31500
+ *
31501
+ * @param params - Query parameters
31502
+ * @param params.schemaId - The ID of the schema to retrieve
31503
+ * @param params.subgraphUrl - The subgraph URL to query
31504
+ * @returns Promise resolving to the schema object
31505
+ * @private
31506
+ */
31507
+ private _getSchemaViaSubgraph;
31508
+ /**
31509
+ * Internal method: List schemas via subgraph
31510
+ *
31511
+ * @param params - Query parameters
31512
+ * @param params.limit - Maximum number of schemas to return
31513
+ * @param params.offset - Number of schemas to skip
31514
+ * @param params.subgraphUrl - The subgraph URL to query
31515
+ * @returns Promise resolving to an array of schemas
31516
+ * @private
31517
+ */
31518
+ private _listSchemasViaSubgraph;
31519
+ /**
31520
+ * Internal method: Count schemas via subgraph
31521
+ *
31522
+ * @param params - Query parameters
31523
+ * @param params.subgraphUrl - The subgraph URL to query
31524
+ * @returns Promise resolving to the total schema count
31525
+ * @private
31526
+ */
31527
+ private _countSchemasViaSubgraph;
31040
31528
  /**
31041
31529
  * Gets the user's wallet address.
31042
31530
  *
@@ -33685,19 +34173,18 @@ declare class DataController {
33685
34173
  subgraphUrl?: string;
33686
34174
  }): Promise<UserFile$1[]>;
33687
34175
  /**
33688
- * Retrieves a list of permissions granted by a user using the new subgraph entities.
34176
+ * Retrieves a list of permissions granted by a user.
33689
34177
  *
33690
- * This method queries the Vana subgraph to find permissions directly granted by the user
33691
- * using the new Permission entity. It efficiently handles millions of permissions by:
33692
- * 1. Querying the subgraph for user's directly granted permissions
33693
- * 2. Returning complete permission information from subgraph
33694
- * 3. No need for additional contract calls as all data comes from subgraph
34178
+ * This method supports automatic fallback between subgraph and RPC modes:
34179
+ * - If subgraph URL is available, tries subgraph query first
34180
+ * - Falls back to direct contract queries via RPC if subgraph fails
34181
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
33695
34182
  *
33696
34183
  * @param params - Object containing the user address and optional subgraph URL
33697
34184
  * @param params.user - The wallet address of the user to query permissions for
33698
34185
  * @param params.subgraphUrl - Optional subgraph URL to override the default
33699
34186
  * @returns Promise resolving to an array of permission objects
33700
- * @throws Error if subgraph is unavailable or returns invalid data
34187
+ * @throws Error if both subgraph and RPC queries fail
33701
34188
  */
33702
34189
  getUserPermissions(params: {
33703
34190
  user: Address;
@@ -33713,43 +34200,59 @@ declare class DataController {
33713
34200
  user: Address;
33714
34201
  }>>;
33715
34202
  /**
33716
- * Retrieves a list of trusted servers for a user using the new subgraph entities.
34203
+ * Internal method: Query user permissions via subgraph
33717
34204
  *
33718
- * This method queries the Vana subgraph to find trusted servers directly associated with the user
33719
- * with support for both subgraph and direct RPC queries.
34205
+ * @param params - Query parameters object
34206
+ * @param params.user - The user address to query permissions for
34207
+ * @param params.subgraphUrl - The subgraph URL endpoint to query
34208
+ * @returns Promise resolving to an array of permission objects
34209
+ */
34210
+ private _getUserPermissionsViaSubgraph;
34211
+ /**
34212
+ * Internal method: Query user permissions via direct RPC
34213
+ *
34214
+ * @param params - Query parameters object
34215
+ * @param params.user - The user address to query permissions for
34216
+ * @returns Promise resolving to an array of permission objects
34217
+ */
34218
+ private _getUserPermissionsViaRpc;
34219
+ /**
34220
+ * Retrieves a list of trusted servers for a user.
33720
34221
  *
33721
- * This method supports multiple query modes:
33722
- * - 'subgraph': Fast query via subgraph (requires subgraphUrl)
33723
- * - 'rpc': Direct contract queries (slower but no external dependencies)
33724
- * - 'auto': Try subgraph first, fallback to RPC if unavailable
34222
+ * This method supports automatic fallback between subgraph and RPC modes:
34223
+ * - If subgraph URL is available, tries subgraph query first for fast results
34224
+ * - Falls back to direct contract queries via RPC if subgraph fails
34225
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
33725
34226
  *
33726
- * @param params - Query parameters including user address and mode selection
33727
- * @returns Promise resolving to trusted servers with metadata about the query
33728
- * @throws Error if query fails in both modes (when using 'auto')
34227
+ * @param params - Query parameters including user address and optional pagination
34228
+ * @param params.user - The wallet address of the user to query trusted servers for
34229
+ * @param params.subgraphUrl - Optional subgraph URL to override the default
34230
+ * @param params.limit - Maximum number of results to return (default: 50)
34231
+ * @param params.offset - Number of results to skip for pagination (default: 0)
34232
+ * @returns Promise resolving to an array of trusted server objects
34233
+ * @throws Error if both subgraph and RPC queries fail
33729
34234
  * @example
33730
34235
  * ```typescript
33731
- * // Use subgraph for fast queries
33732
- * const result = await vana.data.getUserTrustedServers({
33733
- * user: '0x...',
33734
- * mode: 'subgraph',
33735
- * subgraphUrl: 'https://...'
34236
+ * // Basic usage with automatic fallback
34237
+ * const servers = await vana.data.getUserTrustedServers({
34238
+ * user: '0x...'
33736
34239
  * });
33737
34240
  *
33738
- * // Use direct RPC (no external dependencies)
33739
- * const result = await vana.data.getUserTrustedServers({
34241
+ * // With pagination
34242
+ * const servers = await vana.data.getUserTrustedServers({
33740
34243
  * user: '0x...',
33741
- * mode: 'rpc',
33742
- * limit: 10
34244
+ * limit: 10,
34245
+ * offset: 20
33743
34246
  * });
33744
34247
  *
33745
- * // Auto-fallback mode
33746
- * const result = await vana.data.getUserTrustedServers({
34248
+ * // With custom subgraph URL
34249
+ * const servers = await vana.data.getUserTrustedServers({
33747
34250
  * user: '0x...',
33748
- * mode: 'auto' // tries subgraph first, falls back to RPC
34251
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
33749
34252
  * });
33750
34253
  * ```
33751
34254
  */
33752
- getUserTrustedServers(params: GetUserTrustedServersParams): Promise<GetUserTrustedServersResult>;
34255
+ getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
33753
34256
  /**
33754
34257
  * Internal method: Query trusted servers via subgraph
33755
34258
  *
@@ -33814,75 +34317,28 @@ declare class DataController {
33814
34317
  * for specific files by ID.
33815
34318
  */
33816
34319
  getFileById(fileId: number): Promise<UserFile$1>;
33817
- /**
33818
- * Uploads an encrypted file to storage and registers it on the blockchain.
33819
- *
33820
- * @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption
33821
- *
33822
- * Migration guide:
33823
- * ```typescript
33824
- * // Old way (deprecated):
33825
- * const encrypted = await encryptBlob(data, key);
33826
- * const result = await vana.data.uploadEncryptedFile(encrypted, filename);
33827
- *
33828
- * // New way:
33829
- * const result = await vana.data.upload({
33830
- * content: data,
33831
- * filename: filename,
33832
- * encrypt: true // Handles encryption automatically
33833
- * });
33834
- * ```
33835
- * @param encryptedFile - The encrypted file blob to upload
33836
- * @param filename - Optional filename for the upload
33837
- * @param providerName - Optional storage provider to use
33838
- * @returns Promise resolving to upload result with file ID and storage URL
33839
- *
33840
- * This method handles the complete flow of:
33841
- * 1. Uploading the encrypted file to the specified storage provider
33842
- * 2. Registering the file URL on the DataRegistry contract via relayer
33843
- * 3. Returning the assigned file ID and storage URL
33844
- */
33845
- uploadEncryptedFile(encryptedFile: Blob, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
33846
- /**
33847
- * Uploads an encrypted file to storage and registers it on the blockchain with a schema.
33848
- *
33849
- * @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption and schema validation
33850
- *
33851
- * Migration guide:
33852
- * ```typescript
33853
- * // Old way (deprecated):
33854
- * const encrypted = await encryptBlob(data, key);
33855
- * const result = await vana.data.uploadEncryptedFileWithSchema(encrypted, schemaId, filename);
33856
- *
33857
- * // New way:
33858
- * const result = await vana.data.upload({
33859
- * content: data,
33860
- * filename: filename,
33861
- * schemaId: schemaId, // Automatic validation
33862
- * encrypt: true
33863
- * });
33864
- * ```
33865
- * @param encryptedFile - The encrypted file blob to upload
33866
- * @param schemaId - The schema ID to associate with the file
33867
- * @param filename - Optional filename for the upload
33868
- * @param providerName - Optional storage provider to use
33869
- * @returns Promise resolving to upload result with file ID and storage URL
33870
- *
33871
- * This method handles the complete flow of:
33872
- * 1. Uploading the encrypted file to the specified storage provider
33873
- * 2. Registering the file URL on the DataRegistry contract with a schema ID
33874
- * 3. Returning the assigned file ID and storage URL
33875
- */
33876
- uploadEncryptedFileWithSchema(encryptedFile: Blob, schemaId: number, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
33877
34320
  /**
33878
34321
  * Registers a file URL directly on the blockchain with a schema ID.
33879
34322
  *
33880
- * @param url - The URL of the file to register
34323
+ * @remarks
34324
+ * This method registers an existing file URL on the DataRegistry contract
34325
+ * with a schema ID, without uploading any data. Useful when you have already
34326
+ * uploaded content to storage and just need to register it on-chain.
34327
+ *
34328
+ * @param url - The URL of the file to register (IPFS or HTTP/HTTPS)
33881
34329
  * @param schemaId - The schema ID to associate with the file
33882
34330
  * @returns Promise resolving to the file ID and transaction hash
33883
- *
33884
- * This method registers an existing file URL on the DataRegistry
33885
- * contract with a schema ID, without uploading any data.
34331
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34332
+ * @throws {Error} When wallet address is unavailable - "No addresses available"
34333
+ * @throws {Error} When transaction fails - "Failed to register file with schema"
34334
+ * @example
34335
+ * ```typescript
34336
+ * const { fileId, transactionHash } = await vana.data.registerFileWithSchema(
34337
+ * "ipfs://QmXxx...",
34338
+ * 1
34339
+ * );
34340
+ * console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
34341
+ * ```
33886
34342
  */
33887
34343
  registerFileWithSchema(url: string, schemaId: number): Promise<{
33888
34344
  fileId: number;
@@ -33940,95 +34396,114 @@ declare class DataController {
33940
34396
  transactionHash: string;
33941
34397
  }>;
33942
34398
  /**
33943
- * Adds a new schema to the DataRefinerRegistry.
33944
- *
33945
- * @deprecated Since v2.0.0 - Use vana.schemas.create() instead for the high-level API with automatic IPFS upload
34399
+ * Adds a new refiner to the DataRefinerRegistry.
33946
34400
  *
33947
- * Migration guide:
34401
+ * @remarks
34402
+ * Refiners are data processing templates that define how raw data should be
34403
+ * transformed into structured formats. Each refiner is associated with a DLP
34404
+ * (Data Liquidity Pool), has a specific schema for output, and includes
34405
+ * instructions for the refinement process.
34406
+ *
34407
+ * @param params - Refiner configuration parameters
34408
+ * @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
34409
+ * @param params.name - Human-readable name for the refiner
34410
+ * @param params.schemaId - Schema ID that defines the output format
34411
+ * @param params.refinementInstructionUrl - URL containing processing instructions
34412
+ * @returns Promise resolving to the new refiner ID and transaction hash
34413
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34414
+ * @throws {Error} When transaction fails - "Failed to add refiner: {error}"
34415
+ * @example
33948
34416
  * ```typescript
33949
- * // Old way (deprecated):
33950
- * const result = await vana.data.addSchema({
33951
- * name: "UserProfile",
33952
- * type: "JSON",
33953
- * definitionUrl: "ipfs://..."
33954
- * });
33955
- *
33956
- * // New way:
33957
- * const result = await vana.schemas.create({
33958
- * name: "UserProfile",
33959
- * type: "JSON",
33960
- * definition: schemaObject // Automatically uploads to IPFS
34417
+ * const result = await vana.data.addRefiner({
34418
+ * dlpId: 1,
34419
+ * name: "Social Media Sentiment Analyzer",
34420
+ * schemaId: 42,
34421
+ * refinementInstructionUrl: "ipfs://QmXxx..."
33961
34422
  * });
34423
+ * console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
33962
34424
  * ```
33963
- * @param params - Schema parameters including name, type, and definition URL
33964
- * @returns Promise resolving to the new schema ID and transaction hash
33965
34425
  */
33966
- addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
34426
+ addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
33967
34427
  /**
33968
- * Retrieves a schema by its ID.
34428
+ * Retrieves a refiner by its ID.
33969
34429
  *
33970
- * @deprecated Since v2.0.0 - Use vana.schemas.get() instead
34430
+ * @remarks
34431
+ * Queries the DataRefinerRegistry contract to get complete information about
34432
+ * a specific refiner including its DLP association, schema, and instructions.
33971
34433
  *
33972
- * Migration guide:
34434
+ * @param refinerId - The numeric refiner ID to retrieve
34435
+ * @returns Promise resolving to the refiner information object
34436
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34437
+ * @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
34438
+ * @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
34439
+ * @example
33973
34440
  * ```typescript
33974
- * // Old way (deprecated):
33975
- * const schema = await vana.data.getSchema(schemaId);
33976
- *
33977
- * // New way:
33978
- * const schema = await vana.schemas.get(schemaId);
34441
+ * const refiner = await vana.data.getRefiner(1);
34442
+ * console.log({
34443
+ * name: refiner.name,
34444
+ * dlp: refiner.dlpId,
34445
+ * schema: refiner.schemaId,
34446
+ * instructions: refiner.refinementInstructionUrl
34447
+ * });
33979
34448
  * ```
33980
- * @param schemaId - The schema ID to retrieve
33981
- * @returns Promise resolving to the schema information
33982
34449
  */
33983
- getSchema(schemaId: number): Promise<Schema>;
34450
+ getRefiner(refinerId: number): Promise<Refiner>;
33984
34451
  /**
33985
- * Gets the total number of schemas in the registry.
34452
+ * Validates if a schema ID exists in the registry.
33986
34453
  *
33987
- * @deprecated Since v2.0.0 - Use vana.schemas.count() instead
34454
+ * @remarks
34455
+ * Checks the DataRefinerRegistry contract to determine if a given schema ID
34456
+ * has been registered and is available for use.
33988
34457
  *
33989
- * Migration guide:
34458
+ * @param schemaId - The numeric schema ID to validate
34459
+ * @returns Promise resolving to true if schema exists, false otherwise
34460
+ * @example
33990
34461
  * ```typescript
33991
- * // Old way (deprecated):
33992
- * const count = await vana.data.getSchemasCount();
33993
- *
33994
- * // New way:
33995
- * const count = await vana.schemas.count();
34462
+ * const isValid = await vana.data.isValidSchemaId(42);
34463
+ * if (isValid) {
34464
+ * console.log('Schema 42 is available for use');
34465
+ * } else {
34466
+ * console.log('Schema 42 does not exist');
34467
+ * }
33996
34468
  * ```
33997
- * @returns Promise resolving to the total schema count
33998
- */
33999
- getSchemasCount(): Promise<number>;
34000
- /**
34001
- * Adds a new refiner to the DataRefinerRegistry.
34002
- *
34003
- * @param params - Refiner parameters including DLP ID, name, schema ID, and instruction URL
34004
- * @returns Promise resolving to the new refiner ID and transaction hash
34005
- */
34006
- addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
34007
- /**
34008
- * Retrieves a refiner by its ID.
34009
- *
34010
- * @param refinerId - The refiner ID to retrieve
34011
- * @returns Promise resolving to the refiner information
34012
- */
34013
- getRefiner(refinerId: number): Promise<Refiner>;
34014
- /**
34015
- * Validates if a schema ID exists in the registry.
34016
- *
34017
- * @param schemaId - The schema ID to validate
34018
- * @returns Promise resolving to boolean indicating if the schema ID is valid
34019
34469
  */
34020
34470
  isValidSchemaId(schemaId: number): Promise<boolean>;
34021
34471
  /**
34022
34472
  * Gets the total number of refiners in the registry.
34023
34473
  *
34474
+ * @remarks
34475
+ * Queries the DataRefinerRegistry contract to get the total count of all
34476
+ * registered refiners across all DLPs.
34477
+ *
34024
34478
  * @returns Promise resolving to the total refiner count
34479
+ * @example
34480
+ * ```typescript
34481
+ * const count = await vana.data.getRefinersCount();
34482
+ * console.log(`Total refiners registered: ${count}`);
34483
+ * ```
34025
34484
  */
34026
34485
  getRefinersCount(): Promise<number>;
34027
34486
  /**
34028
34487
  * Updates the schema ID for an existing refiner.
34029
34488
  *
34030
- * @param params - Parameters including refiner ID and new schema ID
34489
+ * @remarks
34490
+ * Allows the owner of a refiner to update its associated schema ID.
34491
+ * This is useful when refiner output format needs to change.
34492
+ *
34493
+ * @param params - Update parameters
34494
+ * @param params.refinerId - The refiner ID to update
34495
+ * @param params.newSchemaId - The new schema ID to set
34031
34496
  * @returns Promise resolving to the transaction hash
34497
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34498
+ * @throws {Error} When transaction fails - "Failed to update schema ID: {error}"
34499
+ * @example
34500
+ * ```typescript
34501
+ * const result = await vana.data.updateSchemaId({
34502
+ * refinerId: 1,
34503
+ * newSchemaId: 55
34504
+ * });
34505
+ * console.log(`Schema updated in tx ${result.transactionHash}`);
34506
+ * ```
34032
34507
  */
34033
34508
  updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
34034
34509
  /**
@@ -34050,6 +34525,17 @@ declare class DataController {
34050
34525
  account: Address;
34051
34526
  publicKey: string;
34052
34527
  }>, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34528
+ /**
34529
+ * Uploads content to storage without registering it on the blockchain.
34530
+ * This method only handles the storage upload and returns the file URL.
34531
+ *
34532
+ * @param content - The content to upload (string, Blob, Buffer, or object - objects will be JSON stringified)
34533
+ * @param filename - Optional filename for the uploaded file (defaults to timestamp-based name)
34534
+ * @param encrypt - Optional flag to encrypt the content before upload
34535
+ * @param providerName - Optional specific storage provider to use
34536
+ * @returns Promise resolving to the storage upload result with url, size, and contentType
34537
+ */
34538
+ uploadToStorage(content: string | Blob | Buffer | object, filename?: string, encrypt?: boolean, providerName?: string): Promise<StorageUploadResult>;
34053
34539
  /**
34054
34540
  * Adds a permission for a party to access an existing file.
34055
34541
  *
@@ -34076,7 +34562,7 @@ declare class DataController {
34076
34562
  * console.log(`Transaction: ${result.transactionHash}`);
34077
34563
  * ```
34078
34564
  */
34079
- addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult>;
34565
+ addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34080
34566
  /**
34081
34567
  * Submits a file permission transaction and returns the transaction hash immediately.
34082
34568
  *
@@ -34093,7 +34579,7 @@ declare class DataController {
34093
34579
  * console.log(`Transaction submitted: ${txHash}`);
34094
34580
  * ```
34095
34581
  */
34096
- submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<Hash>;
34582
+ submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34097
34583
  /**
34098
34584
  * Gets the encrypted key for a specific account's permission to access a file.
34099
34585
  *
@@ -34480,6 +34966,31 @@ interface Chains {
34480
34966
  }
34481
34967
  declare const chains: Chains;
34482
34968
 
34969
+ /**
34970
+ * Creates or retrieves a cached public client for blockchain read operations.
34971
+ *
34972
+ * @remarks
34973
+ * This function provides an optimized way to access blockchain data by maintaining
34974
+ * a cached client instance per chain. The client is used for reading contract state,
34975
+ * querying events, and other read-only blockchain operations. It automatically
34976
+ * handles HTTP transport configuration and chain switching.
34977
+ *
34978
+ * @param chainId - The chain ID to connect to (defaults to Moksha testnet)
34979
+ * @returns A public client configured for the specified chain with caching optimization
34980
+ * @throws {Error} When the specified chain ID is not supported by the SDK
34981
+ * @example
34982
+ * ```typescript
34983
+ * // Get client for default chain (Moksha testnet)
34984
+ * const client = createClient();
34985
+ *
34986
+ * // Get client for specific chain
34987
+ * const mainnetClient = createClient(14800);
34988
+ *
34989
+ * // Use client for blockchain reads
34990
+ * const blockNumber = await client.getBlockNumber();
34991
+ * ```
34992
+ * @category Blockchain
34993
+ */
34483
34994
  declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
34484
34995
  chain: Chain;
34485
34996
  };
@@ -35198,51 +35709,157 @@ declare class SerializationError extends VanaError {
35198
35709
  constructor(message: string);
35199
35710
  }
35200
35711
  /**
35201
- * Error thrown when a signature operation fails.
35712
+ * Thrown when a signature operation fails or cannot be completed.
35202
35713
  *
35203
35714
  * @remarks
35204
- * Recovery strategies: Check wallet connection and account unlock status,
35205
- * retry operation with explicit user interaction, or for gasless operations
35206
- * consider switching to direct transactions.
35715
+ * This error occurs when wallet signature operations fail due to disconnection,
35716
+ * locked accounts, or other wallet-related issues. It preserves the original
35717
+ * error for debugging while providing consistent error handling across the SDK.
35718
+ *
35719
+ * Recovery strategies:
35720
+ * - Check wallet connection and account unlock status
35721
+ * - Retry operation with explicit user interaction
35722
+ * - For gasless operations, consider switching to direct transactions
35723
+ *
35724
+ * @example
35725
+ * ```typescript
35726
+ * try {
35727
+ * await vana.permissions.grant({ grantee: '0x...' });
35728
+ * } catch (error) {
35729
+ * if (error instanceof SignatureError) {
35730
+ * // Prompt user to unlock wallet
35731
+ * await promptWalletUnlock();
35732
+ * // Retry operation
35733
+ * }
35734
+ * }
35735
+ * ```
35736
+ * @category Error Handling
35207
35737
  */
35208
35738
  declare class SignatureError extends VanaError {
35209
35739
  readonly originalError?: Error | undefined;
35210
35740
  constructor(message: string, originalError?: Error | undefined);
35211
35741
  }
35212
35742
  /**
35213
- * Error thrown when a network operation fails.
35743
+ * Thrown when network communication fails during API calls or blockchain interactions.
35214
35744
  *
35215
35745
  * @remarks
35216
- * Recovery strategies: Check network connectivity, retry with exponential backoff,
35217
- * verify API endpoints are accessible, or switch to alternative network providers.
35746
+ * This error encompasses network connectivity issues, API unavailability,
35747
+ * timeout errors, and CORS restrictions. It's commonly encountered during
35748
+ * IPFS operations, subgraph queries, or RPC calls.
35749
+ *
35750
+ * Recovery strategies:
35751
+ * - Check network connectivity
35752
+ * - Retry with exponential backoff
35753
+ * - Verify API endpoints are accessible
35754
+ * - Switch to alternative network providers or gateways
35755
+ *
35756
+ * @example
35757
+ * ```typescript
35758
+ * try {
35759
+ * const files = await vana.data.getUserFiles({ owner: '0x...' });
35760
+ * } catch (error) {
35761
+ * if (error instanceof NetworkError) {
35762
+ * // Implement retry with exponential backoff
35763
+ * await retryWithBackoff(() => vana.data.getUserFiles({ owner: '0x...' }));
35764
+ * }
35765
+ * }
35766
+ * ```
35767
+ * @category Error Handling
35218
35768
  */
35219
35769
  declare class NetworkError extends VanaError {
35220
35770
  readonly originalError?: Error | undefined;
35221
35771
  constructor(message: string, originalError?: Error | undefined);
35222
35772
  }
35223
35773
  /**
35224
- * Error thrown when the nonce retrieval fails.
35774
+ * Thrown when transaction nonce retrieval fails during gasless operations.
35225
35775
  *
35226
35776
  * @remarks
35227
- * Recovery strategies: Retry nonce retrieval after brief delay, check wallet connection
35228
- * and account status, or use manual nonce specification if supported by the operation.
35777
+ * This error occurs when the SDK cannot retrieve the user's current nonce from
35778
+ * smart contracts, preventing gasless transaction submission. Nonces are critical
35779
+ * for preventing replay attacks in signed transactions.
35780
+ *
35781
+ * Recovery strategies:
35782
+ * - Retry nonce retrieval after brief delay
35783
+ * - Check wallet connection and account status
35784
+ * - Use manual nonce specification if supported by the operation
35785
+ * - Switch to direct transactions as fallback
35786
+ *
35787
+ * @example
35788
+ * ```typescript
35789
+ * try {
35790
+ * await vana.permissions.grant({ grantee: '0x...' });
35791
+ * } catch (error) {
35792
+ * if (error instanceof NonceError) {
35793
+ * // Wait and retry
35794
+ * await delay(1000);
35795
+ * await vana.permissions.grant({ grantee: '0x...' });
35796
+ * }
35797
+ * }
35798
+ * ```
35799
+ * @category Error Handling
35229
35800
  */
35230
35801
  declare class NonceError extends VanaError {
35231
35802
  constructor(message: string);
35232
35803
  }
35233
35804
  /**
35234
- * Error thrown when a personal server operation fails.
35805
+ * Thrown when personal server operations fail or cannot be completed.
35235
35806
  *
35236
35807
  * @remarks
35237
- * Recovery strategies: Verify server URL accessibility, check server trust status via
35238
- * `vana.permissions.getUserTrustedServers()`, or retry after server becomes available.
35808
+ * This error occurs during interactions with personal servers for computation
35809
+ * requests, identity retrieval, or operation status checks. Common causes include
35810
+ * server unavailability, untrusted server status, or invalid permission grants.
35811
+ *
35812
+ * Recovery strategies:
35813
+ * - Verify server URL accessibility
35814
+ * - Check server trust status via `vana.permissions.getTrustedServers()`
35815
+ * - Ensure valid permissions exist for the operation
35816
+ * - Retry after server becomes available
35817
+ *
35818
+ * @example
35819
+ * ```typescript
35820
+ * try {
35821
+ * const result = await vana.server.createOperation({ permissionId: 123 });
35822
+ * } catch (error) {
35823
+ * if (error instanceof PersonalServerError) {
35824
+ * // Check if server is trusted
35825
+ * const trustedServers = await vana.permissions.getTrustedServers();
35826
+ * if (!trustedServers.includes(serverId)) {
35827
+ * await vana.permissions.trustServer({ serverId });
35828
+ * }
35829
+ * }
35830
+ * }
35831
+ * ```
35832
+ * @category Error Handling
35239
35833
  */
35240
35834
  declare class PersonalServerError extends VanaError {
35241
35835
  readonly originalError?: Error | undefined;
35242
35836
  constructor(message: string, originalError?: Error | undefined);
35243
35837
  }
35244
35838
  /**
35245
- * Error thrown when trying to register a server with a URL that doesn't match the existing registration.
35839
+ * Thrown when attempting to register a server with a URL different from its existing registration.
35840
+ *
35841
+ * @remarks
35842
+ * This error occurs when trying to add or trust a server that's already registered
35843
+ * on-chain with a different URL. Server URLs are immutable once registered to
35844
+ * maintain consistency and security. Applications should use the existing URL
35845
+ * or register a new server with a different ID.
35846
+ *
35847
+ * @example
35848
+ * ```typescript
35849
+ * try {
35850
+ * await vana.permissions.addAndTrustServer({
35851
+ * serverId: 1,
35852
+ * serverUrl: 'https://new-url.com',
35853
+ * publicKey: '0x...'
35854
+ * });
35855
+ * } catch (error) {
35856
+ * if (error instanceof ServerUrlMismatchError) {
35857
+ * console.log(`Server already registered with: ${error.existingUrl}`);
35858
+ * // Use existing URL or register new server
35859
+ * }
35860
+ * }
35861
+ * ```
35862
+ * @category Error Handling
35246
35863
  */
35247
35864
  declare class ServerUrlMismatchError extends VanaError {
35248
35865
  constructor(existingUrl: string, providedUrl: string, serverId: string);
@@ -35251,7 +35868,25 @@ declare class ServerUrlMismatchError extends VanaError {
35251
35868
  readonly serverId: string;
35252
35869
  }
35253
35870
  /**
35254
- * Error thrown when a permission operation fails.
35871
+ * Thrown when permission grant, revoke, or validation operations fail.
35872
+ *
35873
+ * @remarks
35874
+ * This error occurs during permission management operations including grants,
35875
+ * revocations, and permission validation checks. Common causes include invalid
35876
+ * grantee addresses, expired permissions, or insufficient privileges.
35877
+ *
35878
+ * @example
35879
+ * ```typescript
35880
+ * try {
35881
+ * await vana.permissions.revoke({ permissionId: 999999 });
35882
+ * } catch (error) {
35883
+ * if (error instanceof PermissionError) {
35884
+ * console.error('Permission operation failed:', error.message);
35885
+ * // Permission may not exist or user may not be owner
35886
+ * }
35887
+ * }
35888
+ * ```
35889
+ * @category Error Handling
35255
35890
  */
35256
35891
  declare class PermissionError extends VanaError {
35257
35892
  readonly originalError?: Error | undefined;
@@ -36259,21 +36894,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
36259
36894
 
36260
36895
  declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
36261
36896
  /**
36262
- * Retrieves the deployed contract address for a specific contract on a given chain.
36897
+ * Retrieves the deployed contract address for a specific Vana protocol contract on a given chain.
36263
36898
  *
36264
- * @param chainId - The chain ID to look up the contract on
36265
- * @param contract - The contract name to get the address for
36266
- * @returns The contract address as a hex string
36267
- * @throws {Error} When contract address not found for the specified contract and chain
36899
+ * @remarks
36900
+ * This function provides type-safe access to contract addresses across all supported Vana networks.
36901
+ * It automatically searches both current and legacy contract registries to ensure backwards
36902
+ * compatibility while providing clear error messages for unsupported combinations.
36903
+ *
36904
+ * The function validates that both the chain ID and contract name are supported before
36905
+ * attempting address lookup, helping developers identify deployment or configuration issues
36906
+ * early in the development process.
36907
+ *
36908
+ * **Supported Chains:**
36909
+ * - 14800: Vana Mainnet
36910
+ * - 1480: Moksha Testnet
36911
+ *
36912
+ * **Contract Categories:**
36913
+ * - Data Management: DataRegistry, DataRefinerRegistry
36914
+ * - Permissions: DataPortabilityPermissions, DataPortabilityServers, DataPortabilityGrantees
36915
+ * - Computing: TeePoolPhala, TeePoolDedicatedGpu, etc.
36916
+ * - Token & Governance: DATImplementation, VanaPoolStaking, etc.
36917
+ *
36918
+ * @param chainId - The chain ID to look up the contract on (14800 for mainnet, 1480 for testnet)
36919
+ * @param contract - The contract name to get the address for (use TypeScript autocomplete for available options)
36920
+ * @returns The contract address as a checksummed hex string (0x...)
36921
+ * @throws {Error} When contract address not found for the specified contract and chain combination.
36922
+ * This typically indicates the contract is not deployed on the requested network.
36268
36923
  * @example
36269
36924
  * ```typescript
36925
+ * // Get core protocol contract addresses
36926
+ * const dataRegistry = getContractAddress(14800, 'DataRegistry');
36927
+ * const permissions = getContractAddress(14800, 'DataPortabilityPermissions');
36928
+ * const trustedServers = getContractAddress(14800, 'DataPortabilityServers');
36929
+ *
36930
+ * // Handle unsupported combinations gracefully
36270
36931
  * try {
36271
- * const dataRegistryAddress = getContractAddress(1480, 'DataRegistry');
36272
- * console.log('DataRegistry address:', dataRegistryAddress);
36932
+ * const address = getContractAddress(1480, 'DataRegistry');
36933
+ * console.log('DataRegistry testnet address:', address);
36273
36934
  * } catch (error) {
36274
- * console.error('Contract not deployed on this chain:', error.message);
36935
+ * console.error('Contract not available on testnet:', error.message);
36936
+ * // Fallback to mainnet or show user-friendly error
36275
36937
  * }
36938
+ *
36939
+ * // TypeScript provides autocomplete for contract names
36940
+ * const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
36941
+ * // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
36276
36942
  * ```
36943
+ * @category Configuration
36277
36944
  */
36278
36945
  declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
36279
36946
 
@@ -36448,6 +37115,10 @@ declare class CircuitBreaker {
36448
37115
  *
36449
37116
  * This implementation uses browser-compatible libraries and configurations
36450
37117
  * to provide crypto, PGP, and HTTP functionality without Node.js dependencies.
37118
+ *
37119
+ * WARNING: Dependencies that access globals during init
37120
+ * MUST be dynamically imported to support Turbopack.
37121
+ * See: https://github.com/vercel/next.js/issues/82632
36451
37122
  */
36452
37123
 
36453
37124
  /**
@@ -36787,4 +37458,4 @@ declare function Vana(config: VanaConfig): VanaBrowserImpl;
36787
37458
  */
36788
37459
  type VanaInstance = VanaBrowserImpl;
36789
37460
 
36790
- 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 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, type GetUserTrustedServersResult, 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, 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, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryMode, 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 };
37461
+ 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 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, 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 };