@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,62 @@ 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
+ }
28917
+ /**
28918
+ * Result of a successful file addition operation.
28919
+ * Contains data from the FileAdded blockchain event.
28920
+ */
28921
+ interface FileAddedResult extends BaseTransactionResult {
28922
+ /** Unique file ID assigned by the registry */
28923
+ fileId: bigint;
28924
+ /** Address of the file owner */
28925
+ ownerAddress: Address;
28926
+ /** URL where the file is stored */
28927
+ url: string;
28928
+ }
28777
28929
  /**
28778
28930
  * Result of a successful file permission addition operation.
28779
28931
  * Contains data from the FilePermissionAdded blockchain event.
@@ -28787,6 +28939,80 @@ interface FilePermissionResult extends BaseTransactionResult {
28787
28939
  encryptedKey: string;
28788
28940
  }
28789
28941
 
28942
+ /**
28943
+ * Provides a unified interface for blockchain transaction results with lazy-loaded event parsing.
28944
+ *
28945
+ * @remarks
28946
+ * TransactionHandle enables immediate access to transaction hashes while providing optional
28947
+ * lazy-loaded access to receipts and parsed event data. All transaction-submitting methods
28948
+ * in the SDK return this handle, allowing developers to choose between immediate hash access
28949
+ * or waiting for event data. Results are memoized to prevent redundant network calls.
28950
+ *
28951
+ * @category Transactions
28952
+ * @example
28953
+ * ```typescript
28954
+ * // Immediate hash access
28955
+ * const tx = await sdk.permissions.submitSignedGrant(typedData, signature);
28956
+ * console.log(`Transaction submitted: ${tx.hash}`);
28957
+ *
28958
+ * // Wait for and parse events
28959
+ * const eventData = await tx.waitForEvents();
28960
+ * console.log(`Permission ID: ${eventData.permissionId}`);
28961
+ *
28962
+ * // Check receipt for gas usage
28963
+ * const receipt = await tx.waitForReceipt();
28964
+ * console.log(`Gas used: ${receipt.gasUsed}`);
28965
+ * ```
28966
+ */
28967
+ declare class TransactionHandle<TEventData = unknown> {
28968
+ private readonly context;
28969
+ readonly hash: Hash;
28970
+ private readonly operation?;
28971
+ private _receipt?;
28972
+ private _eventData?;
28973
+ private _receiptPromise?;
28974
+ private _eventPromise?;
28975
+ constructor(context: ControllerContext$1, hash: Hash, operation?: TransactionOperation | undefined);
28976
+ /**
28977
+ * Waits for transaction confirmation and returns the receipt.
28978
+ * Results are memoized - multiple calls return the same promise.
28979
+ *
28980
+ * @param options Optional timeout configuration
28981
+ * @param options.timeout Timeout in milliseconds (default: 30000)
28982
+ * @returns Transaction receipt with gas usage, logs, and status
28983
+ */
28984
+ waitForReceipt(options?: {
28985
+ timeout?: number;
28986
+ }): Promise<TransactionReceipt$1>;
28987
+ /**
28988
+ * Waits for transaction confirmation and parses emitted events.
28989
+ * Results are memoized - multiple calls return the same promise.
28990
+ *
28991
+ * @returns Parsed event data with transaction metadata
28992
+ * @throws {Error} If no operation was specified for event parsing
28993
+ */
28994
+ waitForEvents(): Promise<TEventData>;
28995
+ /**
28996
+ * Enables string coercion for backwards compatibility.
28997
+ * Allows TransactionHandle to be used anywhere a Hash is expected.
28998
+ *
28999
+ * @example
29000
+ * ```typescript
29001
+ * const hash: Hash = tx; // Works via toString()
29002
+ * console.log(`Transaction: ${tx}`); // Prints hash
29003
+ * ```
29004
+ * @returns The transaction hash as a string
29005
+ */
29006
+ toString(): string;
29007
+ /**
29008
+ * JSON serialization support.
29009
+ * Returns the hash when serialized to JSON.
29010
+ *
29011
+ * @returns The transaction hash for JSON serialization
29012
+ */
29013
+ toJSON(): string;
29014
+ }
29015
+
28790
29016
  /**
28791
29017
  * Google Drive Storage Provider for Vana SDK
28792
29018
  *
@@ -29825,30 +30051,31 @@ declare class PermissionsController {
29825
30051
  */
29826
30052
  grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
29827
30053
  /**
29828
- * Submits a permission grant transaction and returns the transaction hash immediately.
30054
+ * Submits a permission grant transaction and returns a handle for flexible result access.
29829
30055
  *
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.
30056
+ * @remarks
30057
+ * This lower-level method provides maximum control over transaction timing.
30058
+ * Returns a TransactionHandle that allows immediate hash access or optional event parsing.
30059
+ * Use this when handling multiple transactions or when you need granular control.
29833
30060
  *
29834
30061
  * @param params - The permission grant configuration object
29835
- * @returns Promise that resolves to the transaction hash when successfully submitted
30062
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
29836
30063
  * @throws {RelayerError} When gasless transaction submission fails
29837
30064
  * @throws {SignatureError} When user rejects the signature request
29838
30065
  * @throws {SerializationError} When grant data cannot be serialized
29839
30066
  * @throws {BlockchainError} When permission grant preparation fails
29840
30067
  * @example
29841
30068
  * ```typescript
29842
- * // Submit transaction and handle confirmation later
29843
- * const txHash = await vana.permissions.submitPermissionGrant(params);
29844
- * console.log(`Transaction submitted: ${txHash}`);
30069
+ * // Submit transaction and get immediate hash access
30070
+ * const tx = await vana.permissions.submitPermissionGrant(params);
30071
+ * console.log(`Transaction submitted: ${tx.hash}`);
29845
30072
  *
29846
- * // Later, when you need the permission data:
29847
- * const result = await parseTransactionResult(context, txHash, 'grant');
29848
- * console.log(`Permission ID: ${result.permissionId}`);
30073
+ * // Optionally wait for and parse events
30074
+ * const eventData = await tx.waitForEvents();
30075
+ * console.log(`Permission ID: ${eventData.permissionId}`);
29849
30076
  * ```
29850
30077
  */
29851
- submitPermissionGrant(params: GrantPermissionParams$1): Promise<Hash>;
30078
+ submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
29852
30079
  /**
29853
30080
  * Prepares a permission grant with preview before signing.
29854
30081
  *
@@ -29876,15 +30103,21 @@ declare class PermissionsController {
29876
30103
  */
29877
30104
  prepareGrant(params: GrantPermissionParams$1): Promise<{
29878
30105
  preview: GrantFile;
29879
- confirm: () => Promise<Hash>;
30106
+ confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
29880
30107
  }>;
29881
30108
  /**
29882
- * Internal method to complete the grant process after user confirmation.
29883
- * This is called by the confirm() function returned from prepareGrant().
30109
+ * Completes the grant process after user confirmation.
30110
+ *
30111
+ * @remarks
30112
+ * This internal method is called by the confirm() function returned from prepareGrant().
30113
+ * It handles IPFS upload, signature creation, and transaction submission.
29884
30114
  *
29885
30115
  * @param params - The permission grant parameters containing user and operation details
29886
30116
  * @param grantFile - The prepared grant file with permissions and metadata
29887
- * @returns Promise resolving to the transaction hash
30117
+ * @returns Promise resolving to TransactionHandle for flexible result access
30118
+ * @throws {BlockchainError} When permission grant confirmation fails
30119
+ * @throws {NetworkError} When IPFS upload fails
30120
+ * @throws {SignatureError} When user rejects the signature
29888
30121
  */
29889
30122
  private confirmGrantInternal;
29890
30123
  /**
@@ -29940,49 +30173,106 @@ declare class PermissionsController {
29940
30173
  * );
29941
30174
  * ```
29942
30175
  */
29943
- submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<Hash>;
30176
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
29944
30177
  /**
29945
30178
  * Submits an already-signed trust server transaction to the blockchain.
30179
+ *
30180
+ * @remarks
29946
30181
  * This method extracts the trust server input from typed data and submits it directly.
30182
+ * Used internally by trust server methods after signature collection.
29947
30183
  *
29948
30184
  * @param typedData - The EIP-712 typed data for TrustServer
29949
- * @param signature - The user's signature
29950
- * @returns Promise resolving to the transaction hash
30185
+ * @param signature - The user's signature obtained via `signTypedData()`
30186
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30187
+ * @throws {BlockchainError} When contract submission fails
30188
+ * @throws {NetworkError} When blockchain communication fails
30189
+ * @example
30190
+ * ```typescript
30191
+ * const txHandle = await vana.permissions.submitSignedTrustServer(
30192
+ * typedData,
30193
+ * "0x1234..."
30194
+ * );
30195
+ * const result = await txHandle.waitForEvents();
30196
+ * ```
29951
30197
  */
29952
- submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<Hash>;
30198
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
29953
30199
  /**
29954
30200
  * Submits an already-signed add and trust server transaction to the blockchain.
30201
+ *
30202
+ * @remarks
29955
30203
  * This method extracts the add and trust server input from typed data and submits it directly.
30204
+ * Combines server registration and trust operations in a single transaction.
29956
30205
  *
29957
30206
  * @param typedData - The EIP-712 typed data for AddAndTrustServer
29958
- * @param signature - The user's signature
29959
- * @returns Promise resolving to the transaction hash
30207
+ * @param signature - The user's signature obtained via `signTypedData()`
30208
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30209
+ * @throws {BlockchainError} When contract submission fails
30210
+ * @throws {NetworkError} When blockchain communication fails
30211
+ * @example
30212
+ * ```typescript
30213
+ * const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
30214
+ * typedData,
30215
+ * "0x1234..."
30216
+ * );
30217
+ * const result = await txHandle.waitForEvents();
30218
+ * ```
29960
30219
  */
29961
- submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<Hash>;
30220
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
29962
30221
  /**
29963
30222
  * Submits an already-signed permission revoke transaction to the blockchain.
30223
+ *
30224
+ * @remarks
29964
30225
  * This method handles the revocation of previously granted permissions.
30226
+ * Used internally by revocation methods after signature collection.
29965
30227
  *
29966
30228
  * @param typedData - The EIP-712 typed data for PermissionRevoke
29967
- * @param signature - The user's signature
29968
- * @returns Promise resolving to the transaction hash
30229
+ * @param signature - The user's signature obtained via `signTypedData()`
30230
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30231
+ * @throws {BlockchainError} When contract submission fails
30232
+ * @throws {NetworkError} When blockchain communication fails
30233
+ * @example
30234
+ * ```typescript
30235
+ * const txHandle = await vana.permissions.submitSignedRevoke(
30236
+ * typedData,
30237
+ * "0x1234..."
30238
+ * );
30239
+ * const result = await txHandle.waitForEvents();
30240
+ * ```
29969
30241
  */
29970
- submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30242
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
29971
30243
  /**
29972
30244
  * Submits an already-signed untrust server transaction to the blockchain.
30245
+ *
30246
+ * @remarks
29973
30247
  * This method handles the removal of trusted servers.
30248
+ * Used internally by untrust server methods after signature collection.
29974
30249
  *
29975
30250
  * @param typedData - The EIP-712 typed data for UntrustServer
29976
- * @param signature - The user's signature
29977
- * @returns Promise resolving to the transaction hash
30251
+ * @param signature - The user's signature obtained via `signTypedData()`
30252
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30253
+ * @throws {BlockchainError} When contract submission fails
30254
+ * @throws {NetworkError} When blockchain communication fails
30255
+ * @example
30256
+ * ```typescript
30257
+ * const txHandle = await vana.permissions.submitSignedUntrustServer(
30258
+ * typedData,
30259
+ * "0x1234..."
30260
+ * );
30261
+ * const result = await txHandle.waitForEvents();
30262
+ * ```
29978
30263
  */
29979
- submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30264
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
29980
30265
  /**
29981
30266
  * Submits a signed transaction directly to the blockchain.
29982
30267
  *
30268
+ * @remarks
30269
+ * Internal method used when relayer callbacks are not available. Formats the signature
30270
+ * and submits the permission grant directly to the smart contract.
30271
+ *
29983
30272
  * @param typedData - The typed data structure for the permission grant
29984
30273
  * @param signature - The cryptographic signature authorizing the transaction
29985
30274
  * @returns Promise resolving to the transaction hash
30275
+ * @throws {BlockchainError} When contract submission fails
29986
30276
  */
29987
30277
  private submitDirectTransaction;
29988
30278
  /**
@@ -30029,19 +30319,33 @@ declare class PermissionsController {
30029
30319
  * console.log(`Revocation submitted: ${txHash}`);
30030
30320
  * ```
30031
30321
  */
30032
- submitPermissionRevoke(params: RevokePermissionParams): Promise<Hash>;
30322
+ submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30033
30323
  /**
30034
- * Revokes a permission with a signature (gasless transaction).
30324
+ * Revokes a permission with a signature for gasless transactions.
30325
+ *
30326
+ * @remarks
30327
+ * This method creates an EIP-712 signature for permission revocation and submits
30328
+ * it either through relayer callbacks or directly to the blockchain. Provides
30329
+ * gasless revocation when relayer is configured.
30035
30330
  *
30036
30331
  * @param params - Parameters for revoking the permission
30037
- * @returns Promise resolving to transaction hash
30332
+ * @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
30333
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30038
30334
  * @throws {BlockchainError} When chain ID is not available
30039
30335
  * @throws {NonceError} When retrieving user nonce fails
30040
30336
  * @throws {SignatureError} When user rejects the signature request
30041
30337
  * @throws {RelayerError} When gasless submission fails
30042
30338
  * @throws {PermissionError} When revocation fails for any other reason
30339
+ * @example
30340
+ * ```typescript
30341
+ * const txHandle = await vana.permissions.submitRevokeWithSignature({
30342
+ * permissionId: 123n
30343
+ * });
30344
+ * const result = await txHandle.waitForEvents();
30345
+ * console.log(`Permission ${result.permissionId} revoked`);
30346
+ * ```
30043
30347
  */
30044
- submitRevokeWithSignature(params: RevokePermissionParams): Promise<Hash>;
30348
+ submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30045
30349
  /**
30046
30350
  * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30047
30351
  *
@@ -30066,6 +30370,18 @@ declare class PermissionsController {
30066
30370
  * const serversNonce = await this.getServersUserNonce();
30067
30371
  * ```
30068
30372
  */
30373
+ /**
30374
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30375
+ *
30376
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30377
+ *
30378
+ * @remarks
30379
+ * This method is deprecated in favor of more specific nonce methods that target
30380
+ * the appropriate contract for the operation being performed.
30381
+ *
30382
+ * @returns Promise resolving to the user's current nonce as a bigint
30383
+ * @throws {NonceError} When retrieving the nonce fails
30384
+ */
30069
30385
  private getUserNonce;
30070
30386
  /**
30071
30387
  * Retrieves the user's current nonce from the DataPortabilityServers contract.
@@ -30081,6 +30397,16 @@ declare class PermissionsController {
30081
30397
  * console.log(`Current servers nonce: ${nonce}`);
30082
30398
  * ```
30083
30399
  */
30400
+ /**
30401
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30402
+ *
30403
+ * @remarks
30404
+ * Used for server-related operations (trust/untrust) to prevent replay attacks.
30405
+ * The nonce must be incremented with each server operation.
30406
+ *
30407
+ * @returns Promise resolving to the user's current nonce as a bigint
30408
+ * @throws {NonceError} When retrieving the nonce fails
30409
+ */
30084
30410
  private getServersUserNonce;
30085
30411
  /**
30086
30412
  * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
@@ -30096,6 +30422,16 @@ declare class PermissionsController {
30096
30422
  * console.log(`Current permissions nonce: ${nonce}`);
30097
30423
  * ```
30098
30424
  */
30425
+ /**
30426
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30427
+ *
30428
+ * @remarks
30429
+ * Used for permission-related operations (grant/revoke) to prevent replay attacks.
30430
+ * The nonce must be incremented with each permission operation.
30431
+ *
30432
+ * @returns Promise resolving to the user's current nonce as a bigint
30433
+ * @throws {NonceError} When retrieving the nonce fails
30434
+ */
30099
30435
  private getPermissionsUserNonce;
30100
30436
  /**
30101
30437
  * Composes the EIP-712 typed data for PermissionGrant (new simplified format).
@@ -30117,6 +30453,7 @@ declare class PermissionsController {
30117
30453
  * @param params.granteeId - Grantee ID
30118
30454
  * @param params.grant - Grant URL or grant data
30119
30455
  * @param params.fileUrls - Array of file URLs
30456
+ * @param params.schemaIds - Schema IDs for each file
30120
30457
  * @param params.serverAddress - Server address
30121
30458
  * @param params.serverUrl - Server URL
30122
30459
  * @param params.serverPublicKey - Server public key
@@ -30222,7 +30559,7 @@ declare class PermissionsController {
30222
30559
  * console.log('Now trusting servers:', trustedServers);
30223
30560
  * ```
30224
30561
  */
30225
- addAndTrustServer(params: AddAndTrustServerParams): Promise<Hash>;
30562
+ addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30226
30563
  /**
30227
30564
  * Trusts a server for data processing (legacy method).
30228
30565
  *
@@ -30230,14 +30567,14 @@ declare class PermissionsController {
30230
30567
  * @returns Promise resolving to transaction hash
30231
30568
  * @deprecated Use addAndTrustServer instead
30232
30569
  */
30233
- submitTrustServer(params: TrustServerParams): Promise<Hash>;
30570
+ submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30234
30571
  /**
30235
30572
  * Adds and trusts a server using a signature (gasless transaction).
30236
30573
  *
30237
30574
  * @param params - Parameters for adding and trusting the server
30238
- * @returns Promise resolving to transaction hash
30575
+ * @returns Promise resolving to TransactionHandle with ServerTrustResult event data
30239
30576
  */
30240
- submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<Hash>;
30577
+ submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30241
30578
  /**
30242
30579
  * Trusts a server using a signature (gasless transaction - legacy method).
30243
30580
  *
@@ -30251,13 +30588,24 @@ declare class PermissionsController {
30251
30588
  * @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
30252
30589
  * @throws {BlockchainError} When trust operation fails for any other reason
30253
30590
  */
30254
- submitTrustServerWithSignature(params: TrustServerParams): Promise<Hash>;
30591
+ submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30255
30592
  /**
30256
30593
  * Submits a direct untrust server transaction (without signature).
30257
30594
  *
30258
30595
  * @param params - The untrust server parameters containing server details
30259
30596
  * @returns Promise resolving to the transaction hash
30260
30597
  */
30598
+ /**
30599
+ * Submits an untrust server transaction directly to the blockchain.
30600
+ *
30601
+ * @remarks
30602
+ * Internal method used for direct blockchain submission of untrust server operations
30603
+ * when relayer callbacks are not available.
30604
+ *
30605
+ * @param params - The untrust server parameters
30606
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30607
+ * @throws {BlockchainError} When contract submission fails
30608
+ */
30261
30609
  private submitDirectUntrustTransaction;
30262
30610
  /**
30263
30611
  * Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
@@ -30287,7 +30635,7 @@ declare class PermissionsController {
30287
30635
  * console.log('Still trusting servers:', trustedServers);
30288
30636
  * ```
30289
30637
  */
30290
- submitUntrustServer(params: UntrustServerParams): Promise<Hash>;
30638
+ submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30291
30639
  /**
30292
30640
  * Untrusts a server using a signature (gasless transaction).
30293
30641
  *
@@ -30300,7 +30648,7 @@ declare class PermissionsController {
30300
30648
  * @throws {RelayerError} When gasless submission fails
30301
30649
  * @throws {BlockchainError} When untrust transaction fails
30302
30650
  */
30303
- submitUntrustServerWithSignature(params: UntrustServerParams): Promise<Hash>;
30651
+ submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30304
30652
  /**
30305
30653
  * Retrieves all servers trusted by a user from the DataPortabilityServers contract.
30306
30654
  *
@@ -30351,22 +30699,60 @@ declare class PermissionsController {
30351
30699
  /**
30352
30700
  * Gets server information for multiple servers efficiently.
30353
30701
  *
30354
- * @param serverIds - Array of server IDs to query
30355
- * @returns Promise resolving to batch result with successes and failures
30702
+ * @remarks
30703
+ * This method uses multicall to fetch information for multiple servers in a single
30704
+ * blockchain call, improving performance when querying many servers. Failed lookups
30705
+ * are returned separately for error handling.
30706
+ *
30707
+ * @param serverIds - Array of numeric server IDs to query
30708
+ * @returns Promise resolving to batch result containing successful lookups and failed IDs
30356
30709
  * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30710
+ * @example
30711
+ * ```typescript
30712
+ * const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
30713
+ *
30714
+ * // Process successful lookups
30715
+ * result.servers.forEach((server, id) => {
30716
+ * console.log(`Server ${id}: ${server.url}`);
30717
+ * });
30718
+ *
30719
+ * // Handle failed lookups
30720
+ * if (result.failed.length > 0) {
30721
+ * console.log(`Failed to fetch: ${result.failed.join(', ')}`);
30722
+ * }
30723
+ * ```
30357
30724
  */
30358
30725
  getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
30359
30726
  /**
30360
30727
  * Checks whether a specific server is trusted by a user.
30361
30728
  *
30362
- * @param serverId - Server ID to check (numeric)
30729
+ * @remarks
30730
+ * This method queries the user's trusted server list and checks if the specified
30731
+ * server is present. Returns both the trust status and the index in the trust list
30732
+ * if trusted.
30733
+ *
30734
+ * @param serverId - Numeric server ID to check
30363
30735
  * @param userAddress - Optional user address (defaults to current user)
30364
- * @returns Promise resolving to server trust status
30736
+ * @returns Promise resolving to server trust status with trust index if applicable
30737
+ * @throws {BlockchainError} When reading from contract fails
30738
+ * @example
30739
+ * ```typescript
30740
+ * const status = await vana.permissions.checkServerTrustStatus(1);
30741
+ * if (status.isTrusted) {
30742
+ * console.log(`Server is trusted at index ${status.trustIndex}`);
30743
+ * } else {
30744
+ * console.log('Server is not trusted');
30745
+ * }
30746
+ * ```
30365
30747
  */
30366
30748
  checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
30367
30749
  /**
30368
30750
  * Composes EIP-712 typed data for AddAndTrustServer.
30369
30751
  *
30752
+ * @remarks
30753
+ * Creates the complete typed data structure required for EIP-712 signature generation
30754
+ * when adding and trusting a new server in a single transaction.
30755
+ *
30370
30756
  * @param input - The add and trust server input data containing server details
30371
30757
  * @returns Promise resolving to the typed data structure for server add and trust
30372
30758
  */
@@ -30448,7 +30834,7 @@ declare class PermissionsController {
30448
30834
  * console.log(`Grantee registered in transaction: ${txHash}`);
30449
30835
  * ```
30450
30836
  */
30451
- submitRegisterGrantee(params: RegisterGranteeParams): Promise<Hash>;
30837
+ submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
30452
30838
  /**
30453
30839
  * Registers a grantee with a signature (gasless transaction)
30454
30840
  *
@@ -30464,7 +30850,7 @@ declare class PermissionsController {
30464
30850
  * });
30465
30851
  * ```
30466
30852
  */
30467
- submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<Hash>;
30853
+ submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
30468
30854
  /**
30469
30855
  * Submits a signed register grantee transaction via relayer
30470
30856
  *
@@ -30477,7 +30863,7 @@ declare class PermissionsController {
30477
30863
  * const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
30478
30864
  * ```
30479
30865
  */
30480
- submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<Hash>;
30866
+ submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
30481
30867
  /**
30482
30868
  * Retrieves all registered grantees from the DataPortabilityGrantees contract.
30483
30869
  *
@@ -30764,7 +31150,7 @@ declare class PermissionsController {
30764
31150
  * @param url - New URL for the server
30765
31151
  * @returns Promise resolving to transaction hash
30766
31152
  */
30767
- submitUpdateServer(serverId: bigint, url: string): Promise<Hash>;
31153
+ submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
30768
31154
  /**
30769
31155
  * Get all permission IDs for a user
30770
31156
  *
@@ -30804,49 +31190,106 @@ declare class PermissionsController {
30804
31190
  * @throws {BlockchainError} When permission addition fails
30805
31191
  * @throws {NetworkError} When network communication fails
30806
31192
  */
30807
- submitAddPermission(params: ServerFilesAndPermissionParams): Promise<Hash>;
31193
+ submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
30808
31194
  /**
30809
31195
  * Submits an already-signed add permission transaction to the blockchain.
30810
31196
  * This method supports both relayer-based gasless transactions and direct transactions.
30811
31197
  *
30812
31198
  * @param typedData - The EIP-712 typed data for AddPermission
30813
31199
  * @param signature - The user's signature
30814
- * @returns Promise resolving to the transaction hash
31200
+ * @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
30815
31201
  * @throws {RelayerError} When gasless transaction submission fails
30816
31202
  * @throws {BlockchainError} When permission addition fails
30817
31203
  * @throws {NetworkError} When network communication fails
30818
31204
  */
30819
- submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
31205
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30820
31206
  /**
30821
- * Submit server files and permissions with signature to the blockchain (supports gasless transactions)
31207
+ * Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
31208
+ *
31209
+ * @remarks
31210
+ * This method validates files against their specified schemas before submission.
31211
+ * Schema validation ensures data conforms to expected formats before on-chain registration.
31212
+ * Files with schemaId = 0 bypass validation. The method supports atomic batch operations
31213
+ * where all files and permissions are registered in a single transaction.
30822
31214
  *
30823
31215
  * @param params - Parameters for adding server files and permissions
30824
- * @returns Promise resolving to transaction hash
30825
- * @throws {RelayerError} When gasless transaction submission fails
31216
+ * @param params.granteeId - The ID of the permission grantee
31217
+ * @param params.grant - Grant URL containing permission parameters (typically IPFS)
31218
+ * @param params.fileUrls - Array of file URLs to register
31219
+ * @param params.schemaIds - Schema IDs for each file. Use 0 for files without schema validation.
31220
+ * Array length must match fileUrls length.
31221
+ * @param params.serverAddress - Server wallet address for decryption permissions
31222
+ * @param params.serverUrl - Server endpoint URL
31223
+ * @param params.serverPublicKey - Server's public key for encryption.
31224
+ * Obtain via `vana.server.getIdentity(userAddress).public_key`.
31225
+ * @param params.filePermissions - Nested array of permissions for each file
31226
+ * @returns TransactionHandle with immediate hash access and event parsing capability
31227
+ * @throws {Error} When schemaIds array length doesn't match fileUrls array length
31228
+ * @throws {SchemaValidationError} When file data doesn't match the specified schema.
31229
+ * Verify data structure matches schema definition from `vana.schemas.get(schemaId)`.
31230
+ * @throws {RelayerError} When gasless transaction submission fails.
31231
+ * Retry without relayer configuration to submit direct transaction.
30826
31232
  * @throws {SignatureError} When user rejects the signature request
30827
31233
  * @throws {BlockchainError} When server files and permissions addition fails
30828
- * @throws {NetworkError} When network communication fails
31234
+ * @throws {NetworkError} When network communication fails.
31235
+ * Check network connection or configure alternative gateways.
31236
+ *
31237
+ * @example
31238
+ * ```typescript
31239
+ * const result = await vana.permissions.submitAddServerFilesAndPermissions({
31240
+ * granteeId: BigInt(1),
31241
+ * grant: "ipfs://QmXxx...",
31242
+ * fileUrls: ["https://storage.example.com/data.json"],
31243
+ * schemaIds: [123], // LinkedIn profile schema ID
31244
+ * serverAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31245
+ * serverUrl: "https://server.example.com",
31246
+ * serverPublicKey: serverInfo.public_key,
31247
+ * filePermissions: [[{
31248
+ * account: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31249
+ * key: encryptedKey
31250
+ * }]]
31251
+ * });
31252
+ * const events = await result.waitForEvents();
31253
+ * console.log(`Permission ID: ${events.permissionId}`);
31254
+ * ```
30829
31255
  */
30830
- submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<Hash>;
31256
+ submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
30831
31257
  /**
30832
31258
  * 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.
31259
+ *
31260
+ * @remarks
31261
+ * This method returns a TransactionHandle that provides immediate access to the transaction hash
31262
+ * while allowing lazy-loaded access to parsed event data. Use `waitForEvents()` to retrieve
31263
+ * the permission ID and other event details after transaction confirmation.
30834
31264
  *
30835
31265
  * @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
30836
31266
  * @param signature - The user's signature
30837
- * @returns Promise resolving to the transaction hash
31267
+ * @returns TransactionHandle with immediate hash access and optional event parsing
30838
31268
  * @throws {RelayerError} When gasless transaction submission fails
30839
31269
  * @throws {BlockchainError} When server files and permissions addition fails
30840
31270
  * @throws {NetworkError} When network communication fails
31271
+ *
31272
+ * @example
31273
+ * ```typescript
31274
+ * const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
31275
+ * typedData,
31276
+ * signature
31277
+ * );
31278
+ * console.log(`Transaction submitted: ${tx.hash}`);
31279
+ *
31280
+ * // Wait for confirmation and get the permission ID
31281
+ * const { permissionId } = await tx.waitForEvents();
31282
+ * console.log(`Permission created with ID: ${permissionId}`);
31283
+ * ```
30841
31284
  */
30842
- submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<Hash>;
31285
+ submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30843
31286
  /**
30844
31287
  * Submit permission revocation with signature to the blockchain
30845
31288
  *
30846
31289
  * @param permissionId - Permission ID to revoke
30847
31290
  * @returns Promise resolving to transaction hash
30848
31291
  */
30849
- submitRevokePermission(permissionId: bigint): Promise<Hash>;
31292
+ submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
30850
31293
  /**
30851
31294
  * Submits a signed add permission transaction directly to the blockchain.
30852
31295
  *
@@ -30988,33 +31431,52 @@ declare class SchemaController {
30988
31431
  * Retrieves a schema by its ID.
30989
31432
  *
30990
31433
  * @param schemaId - The ID of the schema to retrieve
31434
+ * @param options - Optional parameters
31435
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
30991
31436
  * @returns Promise resolving to the schema object
30992
31437
  * @throws {Error} When the schema is not found or chain is unavailable
30993
31438
  * @example
30994
31439
  * ```typescript
30995
31440
  * const schema = await vana.schemas.get(1);
30996
31441
  * console.log(`Schema: ${schema.name} (${schema.type})`);
31442
+ *
31443
+ * // With custom subgraph
31444
+ * const schema = await vana.schemas.get(1, {
31445
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31446
+ * });
30997
31447
  * ```
30998
31448
  */
30999
- get(schemaId: number): Promise<Schema>;
31449
+ get(schemaId: number, options?: {
31450
+ subgraphUrl?: string;
31451
+ }): Promise<Schema>;
31000
31452
  /**
31001
31453
  * Gets the total number of schemas registered on the network.
31002
31454
  *
31455
+ * @param options - Optional parameters
31456
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31003
31457
  * @returns Promise resolving to the total schema count
31004
31458
  * @throws {Error} When the count cannot be retrieved
31005
31459
  * @example
31006
31460
  * ```typescript
31007
31461
  * const count = await vana.schemas.count();
31008
31462
  * console.log(`Total schemas: ${count}`);
31463
+ *
31464
+ * // With custom subgraph
31465
+ * const count = await vana.schemas.count({
31466
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31467
+ * });
31009
31468
  * ```
31010
31469
  */
31011
- count(): Promise<number>;
31470
+ count(options?: {
31471
+ subgraphUrl?: string;
31472
+ }): Promise<number>;
31012
31473
  /**
31013
31474
  * Lists all schemas with pagination.
31014
31475
  *
31015
31476
  * @param options - Optional parameters for listing schemas
31016
31477
  * @param options.limit - Maximum number of schemas to return
31017
31478
  * @param options.offset - Number of schemas to skip
31479
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31018
31480
  * @returns Promise resolving to an array of schemas
31019
31481
  * @example
31020
31482
  * ```typescript
@@ -31023,11 +31485,19 @@ declare class SchemaController {
31023
31485
  *
31024
31486
  * // Get schemas with pagination
31025
31487
  * const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
31488
+ *
31489
+ * // With custom subgraph
31490
+ * const schemas = await vana.schemas.list({
31491
+ * limit: 10,
31492
+ * offset: 0,
31493
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31494
+ * });
31026
31495
  * ```
31027
31496
  */
31028
31497
  list(options?: {
31029
31498
  limit?: number;
31030
31499
  offset?: number;
31500
+ subgraphUrl?: string;
31031
31501
  }): Promise<Schema[]>;
31032
31502
  /**
31033
31503
  * Adds a schema using the legacy method (low-level API).
@@ -31037,6 +31507,36 @@ declare class SchemaController {
31037
31507
  * @returns Promise resolving to the add schema result
31038
31508
  */
31039
31509
  addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
31510
+ /**
31511
+ * Internal method: Query schema via subgraph
31512
+ *
31513
+ * @param params - Query parameters
31514
+ * @param params.schemaId - The ID of the schema to retrieve
31515
+ * @param params.subgraphUrl - The subgraph URL to query
31516
+ * @returns Promise resolving to the schema object
31517
+ * @private
31518
+ */
31519
+ private _getSchemaViaSubgraph;
31520
+ /**
31521
+ * Internal method: List schemas via subgraph
31522
+ *
31523
+ * @param params - Query parameters
31524
+ * @param params.limit - Maximum number of schemas to return
31525
+ * @param params.offset - Number of schemas to skip
31526
+ * @param params.subgraphUrl - The subgraph URL to query
31527
+ * @returns Promise resolving to an array of schemas
31528
+ * @private
31529
+ */
31530
+ private _listSchemasViaSubgraph;
31531
+ /**
31532
+ * Internal method: Count schemas via subgraph
31533
+ *
31534
+ * @param params - Query parameters
31535
+ * @param params.subgraphUrl - The subgraph URL to query
31536
+ * @returns Promise resolving to the total schema count
31537
+ * @private
31538
+ */
31539
+ private _countSchemasViaSubgraph;
31040
31540
  /**
31041
31541
  * Gets the user's wallet address.
31042
31542
  *
@@ -33685,19 +34185,18 @@ declare class DataController {
33685
34185
  subgraphUrl?: string;
33686
34186
  }): Promise<UserFile$1[]>;
33687
34187
  /**
33688
- * Retrieves a list of permissions granted by a user using the new subgraph entities.
34188
+ * Retrieves a list of permissions granted by a user.
33689
34189
  *
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
34190
+ * This method supports automatic fallback between subgraph and RPC modes:
34191
+ * - If subgraph URL is available, tries subgraph query first
34192
+ * - Falls back to direct contract queries via RPC if subgraph fails
34193
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
33695
34194
  *
33696
34195
  * @param params - Object containing the user address and optional subgraph URL
33697
34196
  * @param params.user - The wallet address of the user to query permissions for
33698
34197
  * @param params.subgraphUrl - Optional subgraph URL to override the default
33699
34198
  * @returns Promise resolving to an array of permission objects
33700
- * @throws Error if subgraph is unavailable or returns invalid data
34199
+ * @throws Error if both subgraph and RPC queries fail
33701
34200
  */
33702
34201
  getUserPermissions(params: {
33703
34202
  user: Address;
@@ -33713,43 +34212,59 @@ declare class DataController {
33713
34212
  user: Address;
33714
34213
  }>>;
33715
34214
  /**
33716
- * Retrieves a list of trusted servers for a user using the new subgraph entities.
34215
+ * Internal method: Query user permissions via subgraph
34216
+ *
34217
+ * @param params - Query parameters object
34218
+ * @param params.user - The user address to query permissions for
34219
+ * @param params.subgraphUrl - The subgraph URL endpoint to query
34220
+ * @returns Promise resolving to an array of permission objects
34221
+ */
34222
+ private _getUserPermissionsViaSubgraph;
34223
+ /**
34224
+ * Internal method: Query user permissions via direct RPC
33717
34225
  *
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.
34226
+ * @param params - Query parameters object
34227
+ * @param params.user - The user address to query permissions for
34228
+ * @returns Promise resolving to an array of permission objects
34229
+ */
34230
+ private _getUserPermissionsViaRpc;
34231
+ /**
34232
+ * Retrieves a list of trusted servers for a user.
33720
34233
  *
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
34234
+ * This method supports automatic fallback between subgraph and RPC modes:
34235
+ * - If subgraph URL is available, tries subgraph query first for fast results
34236
+ * - Falls back to direct contract queries via RPC if subgraph fails
34237
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
33725
34238
  *
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')
34239
+ * @param params - Query parameters including user address and optional pagination
34240
+ * @param params.user - The wallet address of the user to query trusted servers for
34241
+ * @param params.subgraphUrl - Optional subgraph URL to override the default
34242
+ * @param params.limit - Maximum number of results to return (default: 50)
34243
+ * @param params.offset - Number of results to skip for pagination (default: 0)
34244
+ * @returns Promise resolving to an array of trusted server objects
34245
+ * @throws Error if both subgraph and RPC queries fail
33729
34246
  * @example
33730
34247
  * ```typescript
33731
- * // Use subgraph for fast queries
33732
- * const result = await vana.data.getUserTrustedServers({
33733
- * user: '0x...',
33734
- * mode: 'subgraph',
33735
- * subgraphUrl: 'https://...'
34248
+ * // Basic usage with automatic fallback
34249
+ * const servers = await vana.data.getUserTrustedServers({
34250
+ * user: '0x...'
33736
34251
  * });
33737
34252
  *
33738
- * // Use direct RPC (no external dependencies)
33739
- * const result = await vana.data.getUserTrustedServers({
34253
+ * // With pagination
34254
+ * const servers = await vana.data.getUserTrustedServers({
33740
34255
  * user: '0x...',
33741
- * mode: 'rpc',
33742
- * limit: 10
34256
+ * limit: 10,
34257
+ * offset: 20
33743
34258
  * });
33744
34259
  *
33745
- * // Auto-fallback mode
33746
- * const result = await vana.data.getUserTrustedServers({
34260
+ * // With custom subgraph URL
34261
+ * const servers = await vana.data.getUserTrustedServers({
33747
34262
  * user: '0x...',
33748
- * mode: 'auto' // tries subgraph first, falls back to RPC
34263
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
33749
34264
  * });
33750
34265
  * ```
33751
34266
  */
33752
- getUserTrustedServers(params: GetUserTrustedServersParams): Promise<GetUserTrustedServersResult>;
34267
+ getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
33753
34268
  /**
33754
34269
  * Internal method: Query trusted servers via subgraph
33755
34270
  *
@@ -33814,75 +34329,28 @@ declare class DataController {
33814
34329
  * for specific files by ID.
33815
34330
  */
33816
34331
  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
34332
  /**
33878
34333
  * Registers a file URL directly on the blockchain with a schema ID.
33879
34334
  *
33880
- * @param url - The URL of the file to register
34335
+ * @remarks
34336
+ * This method registers an existing file URL on the DataRegistry contract
34337
+ * with a schema ID, without uploading any data. Useful when you have already
34338
+ * uploaded content to storage and just need to register it on-chain.
34339
+ *
34340
+ * @param url - The URL of the file to register (IPFS or HTTP/HTTPS)
33881
34341
  * @param schemaId - The schema ID to associate with the file
33882
34342
  * @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.
34343
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34344
+ * @throws {Error} When wallet address is unavailable - "No addresses available"
34345
+ * @throws {Error} When transaction fails - "Failed to register file with schema"
34346
+ * @example
34347
+ * ```typescript
34348
+ * const { fileId, transactionHash } = await vana.data.registerFileWithSchema(
34349
+ * "ipfs://QmXxx...",
34350
+ * 1
34351
+ * );
34352
+ * console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
34353
+ * ```
33886
34354
  */
33887
34355
  registerFileWithSchema(url: string, schemaId: number): Promise<{
33888
34356
  fileId: number;
@@ -33940,95 +34408,114 @@ declare class DataController {
33940
34408
  transactionHash: string;
33941
34409
  }>;
33942
34410
  /**
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
34411
+ * Adds a new refiner to the DataRefinerRegistry.
33946
34412
  *
33947
- * Migration guide:
34413
+ * @remarks
34414
+ * Refiners are data processing templates that define how raw data should be
34415
+ * transformed into structured formats. Each refiner is associated with a DLP
34416
+ * (Data Liquidity Pool), has a specific schema for output, and includes
34417
+ * instructions for the refinement process.
34418
+ *
34419
+ * @param params - Refiner configuration parameters
34420
+ * @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
34421
+ * @param params.name - Human-readable name for the refiner
34422
+ * @param params.schemaId - Schema ID that defines the output format
34423
+ * @param params.refinementInstructionUrl - URL containing processing instructions
34424
+ * @returns Promise resolving to the new refiner ID and transaction hash
34425
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34426
+ * @throws {Error} When transaction fails - "Failed to add refiner: {error}"
34427
+ * @example
33948
34428
  * ```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
34429
+ * const result = await vana.data.addRefiner({
34430
+ * dlpId: 1,
34431
+ * name: "Social Media Sentiment Analyzer",
34432
+ * schemaId: 42,
34433
+ * refinementInstructionUrl: "ipfs://QmXxx..."
33961
34434
  * });
34435
+ * console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
33962
34436
  * ```
33963
- * @param params - Schema parameters including name, type, and definition URL
33964
- * @returns Promise resolving to the new schema ID and transaction hash
33965
34437
  */
33966
- addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
34438
+ addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
33967
34439
  /**
33968
- * Retrieves a schema by its ID.
34440
+ * Retrieves a refiner by its ID.
33969
34441
  *
33970
- * @deprecated Since v2.0.0 - Use vana.schemas.get() instead
34442
+ * @remarks
34443
+ * Queries the DataRefinerRegistry contract to get complete information about
34444
+ * a specific refiner including its DLP association, schema, and instructions.
33971
34445
  *
33972
- * Migration guide:
34446
+ * @param refinerId - The numeric refiner ID to retrieve
34447
+ * @returns Promise resolving to the refiner information object
34448
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34449
+ * @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
34450
+ * @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
34451
+ * @example
33973
34452
  * ```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);
34453
+ * const refiner = await vana.data.getRefiner(1);
34454
+ * console.log({
34455
+ * name: refiner.name,
34456
+ * dlp: refiner.dlpId,
34457
+ * schema: refiner.schemaId,
34458
+ * instructions: refiner.refinementInstructionUrl
34459
+ * });
33979
34460
  * ```
33980
- * @param schemaId - The schema ID to retrieve
33981
- * @returns Promise resolving to the schema information
33982
34461
  */
33983
- getSchema(schemaId: number): Promise<Schema>;
34462
+ getRefiner(refinerId: number): Promise<Refiner>;
33984
34463
  /**
33985
- * Gets the total number of schemas in the registry.
34464
+ * Validates if a schema ID exists in the registry.
33986
34465
  *
33987
- * @deprecated Since v2.0.0 - Use vana.schemas.count() instead
34466
+ * @remarks
34467
+ * Checks the DataRefinerRegistry contract to determine if a given schema ID
34468
+ * has been registered and is available for use.
33988
34469
  *
33989
- * Migration guide:
34470
+ * @param schemaId - The numeric schema ID to validate
34471
+ * @returns Promise resolving to true if schema exists, false otherwise
34472
+ * @example
33990
34473
  * ```typescript
33991
- * // Old way (deprecated):
33992
- * const count = await vana.data.getSchemasCount();
33993
- *
33994
- * // New way:
33995
- * const count = await vana.schemas.count();
34474
+ * const isValid = await vana.data.isValidSchemaId(42);
34475
+ * if (isValid) {
34476
+ * console.log('Schema 42 is available for use');
34477
+ * } else {
34478
+ * console.log('Schema 42 does not exist');
34479
+ * }
33996
34480
  * ```
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
34481
  */
34020
34482
  isValidSchemaId(schemaId: number): Promise<boolean>;
34021
34483
  /**
34022
34484
  * Gets the total number of refiners in the registry.
34023
34485
  *
34486
+ * @remarks
34487
+ * Queries the DataRefinerRegistry contract to get the total count of all
34488
+ * registered refiners across all DLPs.
34489
+ *
34024
34490
  * @returns Promise resolving to the total refiner count
34491
+ * @example
34492
+ * ```typescript
34493
+ * const count = await vana.data.getRefinersCount();
34494
+ * console.log(`Total refiners registered: ${count}`);
34495
+ * ```
34025
34496
  */
34026
34497
  getRefinersCount(): Promise<number>;
34027
34498
  /**
34028
34499
  * Updates the schema ID for an existing refiner.
34029
34500
  *
34030
- * @param params - Parameters including refiner ID and new schema ID
34501
+ * @remarks
34502
+ * Allows the owner of a refiner to update its associated schema ID.
34503
+ * This is useful when refiner output format needs to change.
34504
+ *
34505
+ * @param params - Update parameters
34506
+ * @param params.refinerId - The refiner ID to update
34507
+ * @param params.newSchemaId - The new schema ID to set
34031
34508
  * @returns Promise resolving to the transaction hash
34509
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34510
+ * @throws {Error} When transaction fails - "Failed to update schema ID: {error}"
34511
+ * @example
34512
+ * ```typescript
34513
+ * const result = await vana.data.updateSchemaId({
34514
+ * refinerId: 1,
34515
+ * newSchemaId: 55
34516
+ * });
34517
+ * console.log(`Schema updated in tx ${result.transactionHash}`);
34518
+ * ```
34032
34519
  */
34033
34520
  updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
34034
34521
  /**
@@ -34050,6 +34537,17 @@ declare class DataController {
34050
34537
  account: Address;
34051
34538
  publicKey: string;
34052
34539
  }>, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34540
+ /**
34541
+ * Uploads content to storage without registering it on the blockchain.
34542
+ * This method only handles the storage upload and returns the file URL.
34543
+ *
34544
+ * @param content - The content to upload (string, Blob, Buffer, or object - objects will be JSON stringified)
34545
+ * @param filename - Optional filename for the uploaded file (defaults to timestamp-based name)
34546
+ * @param encrypt - Optional flag to encrypt the content before upload
34547
+ * @param providerName - Optional specific storage provider to use
34548
+ * @returns Promise resolving to the storage upload result with url, size, and contentType
34549
+ */
34550
+ uploadToStorage(content: string | Blob | Buffer | object, filename?: string, encrypt?: boolean, providerName?: string): Promise<StorageUploadResult>;
34053
34551
  /**
34054
34552
  * Adds a permission for a party to access an existing file.
34055
34553
  *
@@ -34076,7 +34574,7 @@ declare class DataController {
34076
34574
  * console.log(`Transaction: ${result.transactionHash}`);
34077
34575
  * ```
34078
34576
  */
34079
- addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult>;
34577
+ addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34080
34578
  /**
34081
34579
  * Submits a file permission transaction and returns the transaction hash immediately.
34082
34580
  *
@@ -34093,7 +34591,7 @@ declare class DataController {
34093
34591
  * console.log(`Transaction submitted: ${txHash}`);
34094
34592
  * ```
34095
34593
  */
34096
- submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<Hash>;
34594
+ submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34097
34595
  /**
34098
34596
  * Gets the encrypted key for a specific account's permission to access a file.
34099
34597
  *
@@ -34480,6 +34978,31 @@ interface Chains {
34480
34978
  }
34481
34979
  declare const chains: Chains;
34482
34980
 
34981
+ /**
34982
+ * Creates or retrieves a cached public client for blockchain read operations.
34983
+ *
34984
+ * @remarks
34985
+ * This function provides an optimized way to access blockchain data by maintaining
34986
+ * a cached client instance per chain. The client is used for reading contract state,
34987
+ * querying events, and other read-only blockchain operations. It automatically
34988
+ * handles HTTP transport configuration and chain switching.
34989
+ *
34990
+ * @param chainId - The chain ID to connect to (defaults to Moksha testnet)
34991
+ * @returns A public client configured for the specified chain with caching optimization
34992
+ * @throws {Error} When the specified chain ID is not supported by the SDK
34993
+ * @example
34994
+ * ```typescript
34995
+ * // Get client for default chain (Moksha testnet)
34996
+ * const client = createClient();
34997
+ *
34998
+ * // Get client for specific chain
34999
+ * const mainnetClient = createClient(14800);
35000
+ *
35001
+ * // Use client for blockchain reads
35002
+ * const blockNumber = await client.getBlockNumber();
35003
+ * ```
35004
+ * @category Blockchain
35005
+ */
34483
35006
  declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
34484
35007
  chain: Chain;
34485
35008
  };
@@ -35198,51 +35721,157 @@ declare class SerializationError extends VanaError {
35198
35721
  constructor(message: string);
35199
35722
  }
35200
35723
  /**
35201
- * Error thrown when a signature operation fails.
35724
+ * Thrown when a signature operation fails or cannot be completed.
35202
35725
  *
35203
35726
  * @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.
35727
+ * This error occurs when wallet signature operations fail due to disconnection,
35728
+ * locked accounts, or other wallet-related issues. It preserves the original
35729
+ * error for debugging while providing consistent error handling across the SDK.
35730
+ *
35731
+ * Recovery strategies:
35732
+ * - Check wallet connection and account unlock status
35733
+ * - Retry operation with explicit user interaction
35734
+ * - For gasless operations, consider switching to direct transactions
35735
+ *
35736
+ * @example
35737
+ * ```typescript
35738
+ * try {
35739
+ * await vana.permissions.grant({ grantee: '0x...' });
35740
+ * } catch (error) {
35741
+ * if (error instanceof SignatureError) {
35742
+ * // Prompt user to unlock wallet
35743
+ * await promptWalletUnlock();
35744
+ * // Retry operation
35745
+ * }
35746
+ * }
35747
+ * ```
35748
+ * @category Error Handling
35207
35749
  */
35208
35750
  declare class SignatureError extends VanaError {
35209
35751
  readonly originalError?: Error | undefined;
35210
35752
  constructor(message: string, originalError?: Error | undefined);
35211
35753
  }
35212
35754
  /**
35213
- * Error thrown when a network operation fails.
35755
+ * Thrown when network communication fails during API calls or blockchain interactions.
35214
35756
  *
35215
35757
  * @remarks
35216
- * Recovery strategies: Check network connectivity, retry with exponential backoff,
35217
- * verify API endpoints are accessible, or switch to alternative network providers.
35758
+ * This error encompasses network connectivity issues, API unavailability,
35759
+ * timeout errors, and CORS restrictions. It's commonly encountered during
35760
+ * IPFS operations, subgraph queries, or RPC calls.
35761
+ *
35762
+ * Recovery strategies:
35763
+ * - Check network connectivity
35764
+ * - Retry with exponential backoff
35765
+ * - Verify API endpoints are accessible
35766
+ * - Switch to alternative network providers or gateways
35767
+ *
35768
+ * @example
35769
+ * ```typescript
35770
+ * try {
35771
+ * const files = await vana.data.getUserFiles({ owner: '0x...' });
35772
+ * } catch (error) {
35773
+ * if (error instanceof NetworkError) {
35774
+ * // Implement retry with exponential backoff
35775
+ * await retryWithBackoff(() => vana.data.getUserFiles({ owner: '0x...' }));
35776
+ * }
35777
+ * }
35778
+ * ```
35779
+ * @category Error Handling
35218
35780
  */
35219
35781
  declare class NetworkError extends VanaError {
35220
35782
  readonly originalError?: Error | undefined;
35221
35783
  constructor(message: string, originalError?: Error | undefined);
35222
35784
  }
35223
35785
  /**
35224
- * Error thrown when the nonce retrieval fails.
35786
+ * Thrown when transaction nonce retrieval fails during gasless operations.
35225
35787
  *
35226
35788
  * @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.
35789
+ * This error occurs when the SDK cannot retrieve the user's current nonce from
35790
+ * smart contracts, preventing gasless transaction submission. Nonces are critical
35791
+ * for preventing replay attacks in signed transactions.
35792
+ *
35793
+ * Recovery strategies:
35794
+ * - Retry nonce retrieval after brief delay
35795
+ * - Check wallet connection and account status
35796
+ * - Use manual nonce specification if supported by the operation
35797
+ * - Switch to direct transactions as fallback
35798
+ *
35799
+ * @example
35800
+ * ```typescript
35801
+ * try {
35802
+ * await vana.permissions.grant({ grantee: '0x...' });
35803
+ * } catch (error) {
35804
+ * if (error instanceof NonceError) {
35805
+ * // Wait and retry
35806
+ * await delay(1000);
35807
+ * await vana.permissions.grant({ grantee: '0x...' });
35808
+ * }
35809
+ * }
35810
+ * ```
35811
+ * @category Error Handling
35229
35812
  */
35230
35813
  declare class NonceError extends VanaError {
35231
35814
  constructor(message: string);
35232
35815
  }
35233
35816
  /**
35234
- * Error thrown when a personal server operation fails.
35817
+ * Thrown when personal server operations fail or cannot be completed.
35235
35818
  *
35236
35819
  * @remarks
35237
- * Recovery strategies: Verify server URL accessibility, check server trust status via
35238
- * `vana.permissions.getUserTrustedServers()`, or retry after server becomes available.
35820
+ * This error occurs during interactions with personal servers for computation
35821
+ * requests, identity retrieval, or operation status checks. Common causes include
35822
+ * server unavailability, untrusted server status, or invalid permission grants.
35823
+ *
35824
+ * Recovery strategies:
35825
+ * - Verify server URL accessibility
35826
+ * - Check server trust status via `vana.permissions.getTrustedServers()`
35827
+ * - Ensure valid permissions exist for the operation
35828
+ * - Retry after server becomes available
35829
+ *
35830
+ * @example
35831
+ * ```typescript
35832
+ * try {
35833
+ * const result = await vana.server.createOperation({ permissionId: 123 });
35834
+ * } catch (error) {
35835
+ * if (error instanceof PersonalServerError) {
35836
+ * // Check if server is trusted
35837
+ * const trustedServers = await vana.permissions.getTrustedServers();
35838
+ * if (!trustedServers.includes(serverId)) {
35839
+ * await vana.permissions.trustServer({ serverId });
35840
+ * }
35841
+ * }
35842
+ * }
35843
+ * ```
35844
+ * @category Error Handling
35239
35845
  */
35240
35846
  declare class PersonalServerError extends VanaError {
35241
35847
  readonly originalError?: Error | undefined;
35242
35848
  constructor(message: string, originalError?: Error | undefined);
35243
35849
  }
35244
35850
  /**
35245
- * Error thrown when trying to register a server with a URL that doesn't match the existing registration.
35851
+ * Thrown when attempting to register a server with a URL different from its existing registration.
35852
+ *
35853
+ * @remarks
35854
+ * This error occurs when trying to add or trust a server that's already registered
35855
+ * on-chain with a different URL. Server URLs are immutable once registered to
35856
+ * maintain consistency and security. Applications should use the existing URL
35857
+ * or register a new server with a different ID.
35858
+ *
35859
+ * @example
35860
+ * ```typescript
35861
+ * try {
35862
+ * await vana.permissions.addAndTrustServer({
35863
+ * serverId: 1,
35864
+ * serverUrl: 'https://new-url.com',
35865
+ * publicKey: '0x...'
35866
+ * });
35867
+ * } catch (error) {
35868
+ * if (error instanceof ServerUrlMismatchError) {
35869
+ * console.log(`Server already registered with: ${error.existingUrl}`);
35870
+ * // Use existing URL or register new server
35871
+ * }
35872
+ * }
35873
+ * ```
35874
+ * @category Error Handling
35246
35875
  */
35247
35876
  declare class ServerUrlMismatchError extends VanaError {
35248
35877
  constructor(existingUrl: string, providedUrl: string, serverId: string);
@@ -35251,7 +35880,25 @@ declare class ServerUrlMismatchError extends VanaError {
35251
35880
  readonly serverId: string;
35252
35881
  }
35253
35882
  /**
35254
- * Error thrown when a permission operation fails.
35883
+ * Thrown when permission grant, revoke, or validation operations fail.
35884
+ *
35885
+ * @remarks
35886
+ * This error occurs during permission management operations including grants,
35887
+ * revocations, and permission validation checks. Common causes include invalid
35888
+ * grantee addresses, expired permissions, or insufficient privileges.
35889
+ *
35890
+ * @example
35891
+ * ```typescript
35892
+ * try {
35893
+ * await vana.permissions.revoke({ permissionId: 999999 });
35894
+ * } catch (error) {
35895
+ * if (error instanceof PermissionError) {
35896
+ * console.error('Permission operation failed:', error.message);
35897
+ * // Permission may not exist or user may not be owner
35898
+ * }
35899
+ * }
35900
+ * ```
35901
+ * @category Error Handling
35255
35902
  */
35256
35903
  declare class PermissionError extends VanaError {
35257
35904
  readonly originalError?: Error | undefined;
@@ -36259,21 +36906,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
36259
36906
 
36260
36907
  declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
36261
36908
  /**
36262
- * Retrieves the deployed contract address for a specific contract on a given chain.
36909
+ * Retrieves the deployed contract address for a specific Vana protocol contract on a given chain.
36263
36910
  *
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
36911
+ * @remarks
36912
+ * This function provides type-safe access to contract addresses across all supported Vana networks.
36913
+ * It automatically searches both current and legacy contract registries to ensure backwards
36914
+ * compatibility while providing clear error messages for unsupported combinations.
36915
+ *
36916
+ * The function validates that both the chain ID and contract name are supported before
36917
+ * attempting address lookup, helping developers identify deployment or configuration issues
36918
+ * early in the development process.
36919
+ *
36920
+ * **Supported Chains:**
36921
+ * - 14800: Vana Mainnet
36922
+ * - 1480: Moksha Testnet
36923
+ *
36924
+ * **Contract Categories:**
36925
+ * - Data Management: DataRegistry, DataRefinerRegistry
36926
+ * - Permissions: DataPortabilityPermissions, DataPortabilityServers, DataPortabilityGrantees
36927
+ * - Computing: TeePoolPhala, TeePoolDedicatedGpu, etc.
36928
+ * - Token & Governance: DATImplementation, VanaPoolStaking, etc.
36929
+ *
36930
+ * @param chainId - The chain ID to look up the contract on (14800 for mainnet, 1480 for testnet)
36931
+ * @param contract - The contract name to get the address for (use TypeScript autocomplete for available options)
36932
+ * @returns The contract address as a checksummed hex string (0x...)
36933
+ * @throws {Error} When contract address not found for the specified contract and chain combination.
36934
+ * This typically indicates the contract is not deployed on the requested network.
36268
36935
  * @example
36269
36936
  * ```typescript
36937
+ * // Get core protocol contract addresses
36938
+ * const dataRegistry = getContractAddress(14800, 'DataRegistry');
36939
+ * const permissions = getContractAddress(14800, 'DataPortabilityPermissions');
36940
+ * const trustedServers = getContractAddress(14800, 'DataPortabilityServers');
36941
+ *
36942
+ * // Handle unsupported combinations gracefully
36270
36943
  * try {
36271
- * const dataRegistryAddress = getContractAddress(1480, 'DataRegistry');
36272
- * console.log('DataRegistry address:', dataRegistryAddress);
36944
+ * const address = getContractAddress(1480, 'DataRegistry');
36945
+ * console.log('DataRegistry testnet address:', address);
36273
36946
  * } catch (error) {
36274
- * console.error('Contract not deployed on this chain:', error.message);
36947
+ * console.error('Contract not available on testnet:', error.message);
36948
+ * // Fallback to mainnet or show user-friendly error
36275
36949
  * }
36950
+ *
36951
+ * // TypeScript provides autocomplete for contract names
36952
+ * const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
36953
+ * // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
36276
36954
  * ```
36955
+ * @category Configuration
36277
36956
  */
36278
36957
  declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
36279
36958
 
@@ -36443,6 +37122,8 @@ declare class CircuitBreaker {
36443
37122
  reset(): void;
36444
37123
  }
36445
37124
 
37125
+ /** Union type of all possible transaction results from relayer operations */
37126
+ type RelayerTransactionResult = PermissionGrantResult | PermissionRevokeResult | ServerTrustResult | ServerUntrustResult | GranteeRegisterResult | FileAddedResult;
36446
37127
  /**
36447
37128
  * Payload structure for relayer requests.
36448
37129
  * Contains the EIP-712 typed data, signature, and optional expected user address for security verification.
@@ -36464,7 +37145,7 @@ interface RelayerRequestPayload {
36464
37145
  * 1. Verifies the signature against the typed data
36465
37146
  * 2. Optionally checks the signer matches the expected user address
36466
37147
  * 3. Routes to the appropriate SDK method based on primaryType
36467
- * 4. Returns the resulting transaction hash
37148
+ * 4. Returns the transaction handle with hash and event parsing capability
36468
37149
  *
36469
37150
  * Supported transaction types:
36470
37151
  * - Permission: Permission grants
@@ -36477,7 +37158,7 @@ interface RelayerRequestPayload {
36477
37158
  *
36478
37159
  * @param sdk - Initialized Vana SDK instance
36479
37160
  * @param payload - Request payload containing typed data, signature, and optional security check
36480
- * @returns Promise resolving to the transaction hash
37161
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capability
36481
37162
  * @throws {SignatureError} When signature verification fails or signer mismatch occurs
36482
37163
  * @throws {Error} When primaryType is unsupported or SDK operations fail
36483
37164
  * @category Server
@@ -36491,15 +37172,24 @@ interface RelayerRequestPayload {
36491
37172
  * const body = await request.json();
36492
37173
  * const vana = await createRelayerVana();
36493
37174
  *
36494
- * const txHash = await handleRelayerRequest(vana, {
37175
+ * const tx = await handleRelayerRequest(vana, {
36495
37176
  * typedData: body.typedData,
36496
37177
  * signature: body.signature,
36497
37178
  * expectedUserAddress: body.expectedUserAddress
36498
37179
  * });
36499
37180
  *
37181
+ * // Option 1: Return just the hash immediately
36500
37182
  * return NextResponse.json({
36501
37183
  * success: true,
36502
- * transactionHash: txHash
37184
+ * transactionHash: tx.hash
37185
+ * });
37186
+ *
37187
+ * // Option 2: Wait for transaction confirmation and return event data
37188
+ * const eventData = await tx.waitForEvents();
37189
+ * return NextResponse.json({
37190
+ * success: true,
37191
+ * transactionHash: tx.hash,
37192
+ * ...eventData // Include parsed event data like permissionId, fileId, etc.
36503
37193
  * });
36504
37194
  * } catch (error) {
36505
37195
  * return NextResponse.json({
@@ -36510,13 +37200,14 @@ interface RelayerRequestPayload {
36510
37200
  * }
36511
37201
  * ```
36512
37202
  */
36513
- declare function handleRelayerRequest(sdk: VanaInstance, payload: RelayerRequestPayload): Promise<Hash>;
37203
+ declare function handleRelayerRequest(sdk: VanaInstance, payload: RelayerRequestPayload): Promise<TransactionHandle<RelayerTransactionResult>>;
36514
37204
 
36515
37205
  /**
36516
37206
  * Node.js implementation of the Vana Platform Adapter
36517
37207
  *
36518
- * This implementation uses Node.js-specific libraries and configurations
36519
- * to provide crypto, PGP, and HTTP functionality.
37208
+ * WARNING: Dependencies that access globals during init
37209
+ * MUST be dynamically imported to support Turbopack.
37210
+ * See: https://github.com/vercel/next.js/issues/82632
36520
37211
  */
36521
37212
 
36522
37213
  /**
@@ -36536,6 +37227,10 @@ declare class NodePlatformAdapter implements VanaPlatformAdapter {
36536
37227
  *
36537
37228
  * This implementation uses browser-compatible libraries and configurations
36538
37229
  * to provide crypto, PGP, and HTTP functionality without Node.js dependencies.
37230
+ *
37231
+ * WARNING: Dependencies that access globals during init
37232
+ * MUST be dynamically imported to support Turbopack.
37233
+ * See: https://github.com/vercel/next.js/issues/82632
36539
37234
  */
36540
37235
 
36541
37236
  /**
@@ -36924,4 +37619,4 @@ declare function Vana(config: VanaConfig): VanaNodeImpl;
36924
37619
  */
36925
37620
  type VanaInstance = VanaNodeImpl;
36926
37621
 
36927
- 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, NodePlatformAdapter, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerRequestPayload, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaController, 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, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, VanaNodeImpl, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createNodePlatformAdapter, createPlatformAdapter, createPlatformAdapterFor, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, handleRelayerRequest, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };
37622
+ 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, NodePlatformAdapter, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerRequestPayload, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaController, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, VanaNodeImpl, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createNodePlatformAdapter, createPlatformAdapter, createPlatformAdapterFor, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, handleRelayerRequest, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };