@opendatalabs/vana-sdk 0.1.0-alpha.1bbb6d4 → 0.1.0-alpha.273dc39

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.
@@ -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
 
@@ -2182,8 +2182,8 @@ interface Schema {
2182
2182
  id: number;
2183
2183
  /** Schema name */
2184
2184
  name: string;
2185
- /** Schema type */
2186
- type: string;
2185
+ /** Schema dialect */
2186
+ dialect: string;
2187
2187
  /** URL containing the schema definition */
2188
2188
  definitionUrl: string;
2189
2189
  }
@@ -2214,8 +2214,8 @@ interface Refiner {
2214
2214
  interface AddSchemaParams {
2215
2215
  /** Schema name */
2216
2216
  name: string;
2217
- /** Schema type */
2218
- type: string;
2217
+ /** Schema dialect */
2218
+ dialect: string;
2219
2219
  /** URL containing the schema definition */
2220
2220
  definitionUrl: string;
2221
2221
  }
@@ -2290,13 +2290,7 @@ interface UpdateSchemaIdResult {
2290
2290
  transactionHash: Hash;
2291
2291
  }
2292
2292
  /**
2293
- * Query mode for trusted server retrieval
2294
- *
2295
- * @category Data Management
2296
- */
2297
- type TrustedServerQueryMode = "subgraph" | "rpc" | "auto";
2298
- /**
2299
- * Trusted server data structure (unified format for both subgraph and RPC modes)
2293
+ * Trusted server data structure
2300
2294
  *
2301
2295
  * @category Data Management
2302
2296
  */
@@ -2315,39 +2309,20 @@ interface TrustedServer {
2315
2309
  trustIndex?: number;
2316
2310
  }
2317
2311
  /**
2318
- * Parameters for getUserTrustedServers with dual-mode support
2312
+ * Parameters for getUserTrustedServers method
2319
2313
  *
2320
2314
  * @category Data Management
2321
2315
  */
2322
2316
  interface GetUserTrustedServersParams {
2323
- /** User address to query */
2317
+ /** User address to query trusted servers for */
2324
2318
  user: Address;
2325
- /** Query mode: 'subgraph' (fast, requires subgraph), 'rpc' (direct contract), or 'auto' (tries subgraph first) */
2326
- mode?: TrustedServerQueryMode;
2327
- /** Subgraph URL (required for subgraph mode) */
2319
+ /** Optional subgraph URL to override default */
2328
2320
  subgraphUrl?: string;
2329
- /** Pagination limit (applies to RPC mode) */
2321
+ /** Maximum number of results */
2330
2322
  limit?: number;
2331
- /** Pagination offset (applies to RPC mode) */
2323
+ /** Number of results to skip */
2332
2324
  offset?: number;
2333
2325
  }
2334
- /**
2335
- * Result of getUserTrustedServers query
2336
- *
2337
- * @category Data Management
2338
- */
2339
- interface GetUserTrustedServersResult {
2340
- /** Array of trusted servers */
2341
- servers: TrustedServer[];
2342
- /** Query mode that was actually used */
2343
- usedMode: TrustedServerQueryMode;
2344
- /** Total count (only available in RPC mode) */
2345
- total?: number;
2346
- /** Whether there are more servers (pagination info for RPC mode) */
2347
- hasMore?: boolean;
2348
- /** Any warnings or fallback information */
2349
- warnings?: string[];
2350
- }
2351
2326
 
2352
2327
  declare const contractAbis: {
2353
2328
  readonly DataPortabilityPermissions: readonly [{
@@ -28735,6 +28710,95 @@ type VanaContract = keyof ContractAbis;
28735
28710
  */
28736
28711
  declare function getAbi<T extends VanaContract>(contract: T): ContractAbis[T];
28737
28712
 
28713
+ /**
28714
+ * Comprehensive mapping of SDK transaction operations to blockchain events.
28715
+ * Used by the generic transaction parser to know which contract and event
28716
+ * to look for when parsing transaction results.
28717
+ */
28718
+ declare const EVENT_MAPPINGS: {
28719
+ readonly grant: {
28720
+ readonly contract: "DataPortabilityPermissions";
28721
+ readonly event: "PermissionAdded";
28722
+ };
28723
+ readonly revoke: {
28724
+ readonly contract: "DataPortabilityPermissions";
28725
+ readonly event: "PermissionRevoked";
28726
+ };
28727
+ readonly revokePermission: {
28728
+ readonly contract: "DataPortabilityPermissions";
28729
+ readonly event: "PermissionRevoked";
28730
+ };
28731
+ readonly addServerFilesAndPermissions: {
28732
+ readonly contract: "DataPortabilityPermissions";
28733
+ readonly event: "PermissionAdded";
28734
+ };
28735
+ readonly trustServer: {
28736
+ readonly contract: "DataPortabilityServers";
28737
+ readonly event: "ServerTrusted";
28738
+ };
28739
+ readonly untrustServer: {
28740
+ readonly contract: "DataPortabilityServers";
28741
+ readonly event: "ServerUntrusted";
28742
+ };
28743
+ readonly registerServer: {
28744
+ readonly contract: "DataPortabilityServers";
28745
+ readonly event: "ServerRegistered";
28746
+ };
28747
+ readonly updateServer: {
28748
+ readonly contract: "DataPortabilityServers";
28749
+ readonly event: "ServerUpdated";
28750
+ };
28751
+ readonly addAndTrustServer: {
28752
+ readonly contract: "DataPortabilityServers";
28753
+ readonly event: "ServerTrusted";
28754
+ };
28755
+ readonly addFile: {
28756
+ readonly contract: "DataRegistry";
28757
+ readonly event: "FileAdded";
28758
+ };
28759
+ readonly addFileWithPermissionsAndSchema: {
28760
+ readonly contract: "DataRegistry";
28761
+ readonly event: "FileAdded";
28762
+ };
28763
+ readonly addFileWithSchema: {
28764
+ readonly contract: "DataRegistry";
28765
+ readonly event: "FileAdded";
28766
+ };
28767
+ readonly addFileWithPermissions: {
28768
+ readonly contract: "DataRegistry";
28769
+ readonly event: "FileAdded";
28770
+ };
28771
+ readonly addRefinement: {
28772
+ readonly contract: "DataRegistry";
28773
+ readonly event: "RefinementAdded";
28774
+ };
28775
+ readonly addRefiner: {
28776
+ readonly contract: "DataRefinerRegistry";
28777
+ readonly event: "RefinerAdded";
28778
+ };
28779
+ readonly updateSchemaId: {
28780
+ readonly contract: "DataRefinerRegistry";
28781
+ readonly event: "SchemaAdded";
28782
+ };
28783
+ readonly addSchema: {
28784
+ readonly contract: "DataRefinerRegistry";
28785
+ readonly event: "SchemaAdded";
28786
+ };
28787
+ readonly updateRefinement: {
28788
+ readonly contract: "DataRegistry";
28789
+ readonly event: "RefinementUpdated";
28790
+ };
28791
+ readonly addFilePermission: {
28792
+ readonly contract: "DataRegistry";
28793
+ readonly event: "PermissionGranted";
28794
+ };
28795
+ readonly registerGrantee: {
28796
+ readonly contract: "DataPortabilityGrantees";
28797
+ readonly event: "GranteeRegistered";
28798
+ };
28799
+ };
28800
+ type TransactionOperation = keyof typeof EVENT_MAPPINGS;
28801
+
28738
28802
  /**
28739
28803
  * Base interface for all transaction results.
28740
28804
  * Contains the event data plus transaction metadata.
@@ -28772,6 +28836,50 @@ interface PermissionRevokeResult extends BaseTransactionResult {
28772
28836
  /** ID of the permission that was revoked */
28773
28837
  permissionId: bigint;
28774
28838
  }
28839
+ /**
28840
+ * Result of a successful server trust operation.
28841
+ * Contains data from the ServerTrusted blockchain event.
28842
+ */
28843
+ interface ServerTrustResult extends BaseTransactionResult {
28844
+ /** Address of the user who trusted the server */
28845
+ user: Address;
28846
+ /** Address/ID of the trusted server */
28847
+ serverId: Address;
28848
+ /** URL of the trusted server */
28849
+ serverUrl: string;
28850
+ }
28851
+ /**
28852
+ * Result of a successful server untrust operation.
28853
+ * Contains data from the ServerUntrusted blockchain event.
28854
+ */
28855
+ interface ServerUntrustResult extends BaseTransactionResult {
28856
+ /** Address of the user who untrusted the server */
28857
+ user: Address;
28858
+ /** Address/ID of the untrusted server */
28859
+ serverId: Address;
28860
+ }
28861
+ /**
28862
+ * Result of a successful server update operation.
28863
+ * Contains data from the ServerUpdated blockchain event.
28864
+ */
28865
+ interface ServerUpdateResult extends BaseTransactionResult {
28866
+ /** ID of the server that was updated */
28867
+ serverId: bigint;
28868
+ /** New URL of the server */
28869
+ url: string;
28870
+ }
28871
+ /**
28872
+ * Result of a successful grantee registration operation.
28873
+ * Contains data from the GranteeRegistered blockchain event.
28874
+ */
28875
+ interface GranteeRegisterResult extends BaseTransactionResult {
28876
+ /** Unique grantee ID assigned by the registry */
28877
+ granteeId: bigint;
28878
+ /** Address of the registered grantee */
28879
+ granteeAddress: Address;
28880
+ /** Display name of the grantee */
28881
+ name: string;
28882
+ }
28775
28883
  /**
28776
28884
  * Result of a successful file permission addition operation.
28777
28885
  * Contains data from the FilePermissionAdded blockchain event.
@@ -28785,6 +28893,80 @@ interface FilePermissionResult extends BaseTransactionResult {
28785
28893
  encryptedKey: string;
28786
28894
  }
28787
28895
 
28896
+ /**
28897
+ * Provides a unified interface for blockchain transaction results with lazy-loaded event parsing.
28898
+ *
28899
+ * @remarks
28900
+ * TransactionHandle enables immediate access to transaction hashes while providing optional
28901
+ * lazy-loaded access to receipts and parsed event data. All transaction-submitting methods
28902
+ * in the SDK return this handle, allowing developers to choose between immediate hash access
28903
+ * or waiting for event data. Results are memoized to prevent redundant network calls.
28904
+ *
28905
+ * @category Transactions
28906
+ * @example
28907
+ * ```typescript
28908
+ * // Immediate hash access
28909
+ * const tx = await sdk.permissions.submitSignedGrant(typedData, signature);
28910
+ * console.log(`Transaction submitted: ${tx.hash}`);
28911
+ *
28912
+ * // Wait for and parse events
28913
+ * const eventData = await tx.waitForEvents();
28914
+ * console.log(`Permission ID: ${eventData.permissionId}`);
28915
+ *
28916
+ * // Check receipt for gas usage
28917
+ * const receipt = await tx.waitForReceipt();
28918
+ * console.log(`Gas used: ${receipt.gasUsed}`);
28919
+ * ```
28920
+ */
28921
+ declare class TransactionHandle<TEventData = unknown> {
28922
+ private readonly context;
28923
+ readonly hash: Hash;
28924
+ private readonly operation?;
28925
+ private _receipt?;
28926
+ private _eventData?;
28927
+ private _receiptPromise?;
28928
+ private _eventPromise?;
28929
+ constructor(context: ControllerContext$1, hash: Hash, operation?: TransactionOperation | undefined);
28930
+ /**
28931
+ * Waits for transaction confirmation and returns the receipt.
28932
+ * Results are memoized - multiple calls return the same promise.
28933
+ *
28934
+ * @param options Optional timeout configuration
28935
+ * @param options.timeout Timeout in milliseconds (default: 30000)
28936
+ * @returns Transaction receipt with gas usage, logs, and status
28937
+ */
28938
+ waitForReceipt(options?: {
28939
+ timeout?: number;
28940
+ }): Promise<TransactionReceipt$1>;
28941
+ /**
28942
+ * Waits for transaction confirmation and parses emitted events.
28943
+ * Results are memoized - multiple calls return the same promise.
28944
+ *
28945
+ * @returns Parsed event data with transaction metadata
28946
+ * @throws {Error} If no operation was specified for event parsing
28947
+ */
28948
+ waitForEvents(): Promise<TEventData>;
28949
+ /**
28950
+ * Enables string coercion for backwards compatibility.
28951
+ * Allows TransactionHandle to be used anywhere a Hash is expected.
28952
+ *
28953
+ * @example
28954
+ * ```typescript
28955
+ * const hash: Hash = tx; // Works via toString()
28956
+ * console.log(`Transaction: ${tx}`); // Prints hash
28957
+ * ```
28958
+ * @returns The transaction hash as a string
28959
+ */
28960
+ toString(): string;
28961
+ /**
28962
+ * JSON serialization support.
28963
+ * Returns the hash when serialized to JSON.
28964
+ *
28965
+ * @returns The transaction hash for JSON serialization
28966
+ */
28967
+ toJSON(): string;
28968
+ }
28969
+
28788
28970
  /**
28789
28971
  * Google Drive Storage Provider for Vana SDK
28790
28972
  *
@@ -29823,30 +30005,31 @@ declare class PermissionsController {
29823
30005
  */
29824
30006
  grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
29825
30007
  /**
29826
- * Submits a permission grant transaction and returns the transaction hash immediately.
30008
+ * Submits a permission grant transaction and returns a handle for flexible result access.
29827
30009
  *
29828
- * This is the lower-level method that provides maximum control over transaction timing.
29829
- * Use this when you want to handle transaction confirmation and event parsing separately,
29830
- * or when submitting multiple transactions in batch.
30010
+ * @remarks
30011
+ * This lower-level method provides maximum control over transaction timing.
30012
+ * Returns a TransactionHandle that allows immediate hash access or optional event parsing.
30013
+ * Use this when handling multiple transactions or when you need granular control.
29831
30014
  *
29832
30015
  * @param params - The permission grant configuration object
29833
- * @returns Promise that resolves to the transaction hash when successfully submitted
30016
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
29834
30017
  * @throws {RelayerError} When gasless transaction submission fails
29835
30018
  * @throws {SignatureError} When user rejects the signature request
29836
30019
  * @throws {SerializationError} When grant data cannot be serialized
29837
30020
  * @throws {BlockchainError} When permission grant preparation fails
29838
30021
  * @example
29839
30022
  * ```typescript
29840
- * // Submit transaction and handle confirmation later
29841
- * const txHash = await vana.permissions.submitPermissionGrant(params);
29842
- * console.log(`Transaction submitted: ${txHash}`);
30023
+ * // Submit transaction and get immediate hash access
30024
+ * const tx = await vana.permissions.submitPermissionGrant(params);
30025
+ * console.log(`Transaction submitted: ${tx.hash}`);
29843
30026
  *
29844
- * // Later, when you need the permission data:
29845
- * const result = await parseTransactionResult(context, txHash, 'grant');
29846
- * console.log(`Permission ID: ${result.permissionId}`);
30027
+ * // Optionally wait for and parse events
30028
+ * const eventData = await tx.waitForEvents();
30029
+ * console.log(`Permission ID: ${eventData.permissionId}`);
29847
30030
  * ```
29848
30031
  */
29849
- submitPermissionGrant(params: GrantPermissionParams$1): Promise<Hash>;
30032
+ submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
29850
30033
  /**
29851
30034
  * Prepares a permission grant with preview before signing.
29852
30035
  *
@@ -29874,15 +30057,21 @@ declare class PermissionsController {
29874
30057
  */
29875
30058
  prepareGrant(params: GrantPermissionParams$1): Promise<{
29876
30059
  preview: GrantFile;
29877
- confirm: () => Promise<Hash>;
30060
+ confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
29878
30061
  }>;
29879
30062
  /**
29880
- * Internal method to complete the grant process after user confirmation.
29881
- * This is called by the confirm() function returned from prepareGrant().
30063
+ * Completes the grant process after user confirmation.
30064
+ *
30065
+ * @remarks
30066
+ * This internal method is called by the confirm() function returned from prepareGrant().
30067
+ * It handles IPFS upload, signature creation, and transaction submission.
29882
30068
  *
29883
30069
  * @param params - The permission grant parameters containing user and operation details
29884
30070
  * @param grantFile - The prepared grant file with permissions and metadata
29885
- * @returns Promise resolving to the transaction hash
30071
+ * @returns Promise resolving to TransactionHandle for flexible result access
30072
+ * @throws {BlockchainError} When permission grant confirmation fails
30073
+ * @throws {NetworkError} When IPFS upload fails
30074
+ * @throws {SignatureError} When user rejects the signature
29886
30075
  */
29887
30076
  private confirmGrantInternal;
29888
30077
  /**
@@ -29938,49 +30127,106 @@ declare class PermissionsController {
29938
30127
  * );
29939
30128
  * ```
29940
30129
  */
29941
- submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<Hash>;
30130
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
29942
30131
  /**
29943
30132
  * Submits an already-signed trust server transaction to the blockchain.
30133
+ *
30134
+ * @remarks
29944
30135
  * This method extracts the trust server input from typed data and submits it directly.
30136
+ * Used internally by trust server methods after signature collection.
29945
30137
  *
29946
30138
  * @param typedData - The EIP-712 typed data for TrustServer
29947
- * @param signature - The user's signature
29948
- * @returns Promise resolving to the transaction hash
30139
+ * @param signature - The user's signature obtained via `signTypedData()`
30140
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30141
+ * @throws {BlockchainError} When contract submission fails
30142
+ * @throws {NetworkError} When blockchain communication fails
30143
+ * @example
30144
+ * ```typescript
30145
+ * const txHandle = await vana.permissions.submitSignedTrustServer(
30146
+ * typedData,
30147
+ * "0x1234..."
30148
+ * );
30149
+ * const result = await txHandle.waitForEvents();
30150
+ * ```
29949
30151
  */
29950
- submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<Hash>;
30152
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
29951
30153
  /**
29952
30154
  * Submits an already-signed add and trust server transaction to the blockchain.
30155
+ *
30156
+ * @remarks
29953
30157
  * This method extracts the add and trust server input from typed data and submits it directly.
30158
+ * Combines server registration and trust operations in a single transaction.
29954
30159
  *
29955
30160
  * @param typedData - The EIP-712 typed data for AddAndTrustServer
29956
- * @param signature - The user's signature
29957
- * @returns Promise resolving to the transaction hash
30161
+ * @param signature - The user's signature obtained via `signTypedData()`
30162
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30163
+ * @throws {BlockchainError} When contract submission fails
30164
+ * @throws {NetworkError} When blockchain communication fails
30165
+ * @example
30166
+ * ```typescript
30167
+ * const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
30168
+ * typedData,
30169
+ * "0x1234..."
30170
+ * );
30171
+ * const result = await txHandle.waitForEvents();
30172
+ * ```
29958
30173
  */
29959
- submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<Hash>;
30174
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
29960
30175
  /**
29961
30176
  * Submits an already-signed permission revoke transaction to the blockchain.
30177
+ *
30178
+ * @remarks
29962
30179
  * This method handles the revocation of previously granted permissions.
30180
+ * Used internally by revocation methods after signature collection.
29963
30181
  *
29964
30182
  * @param typedData - The EIP-712 typed data for PermissionRevoke
29965
- * @param signature - The user's signature
29966
- * @returns Promise resolving to the transaction hash
30183
+ * @param signature - The user's signature obtained via `signTypedData()`
30184
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30185
+ * @throws {BlockchainError} When contract submission fails
30186
+ * @throws {NetworkError} When blockchain communication fails
30187
+ * @example
30188
+ * ```typescript
30189
+ * const txHandle = await vana.permissions.submitSignedRevoke(
30190
+ * typedData,
30191
+ * "0x1234..."
30192
+ * );
30193
+ * const result = await txHandle.waitForEvents();
30194
+ * ```
29967
30195
  */
29968
- submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30196
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
29969
30197
  /**
29970
30198
  * Submits an already-signed untrust server transaction to the blockchain.
30199
+ *
30200
+ * @remarks
29971
30201
  * This method handles the removal of trusted servers.
30202
+ * Used internally by untrust server methods after signature collection.
29972
30203
  *
29973
30204
  * @param typedData - The EIP-712 typed data for UntrustServer
29974
- * @param signature - The user's signature
29975
- * @returns Promise resolving to the transaction hash
30205
+ * @param signature - The user's signature obtained via `signTypedData()`
30206
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30207
+ * @throws {BlockchainError} When contract submission fails
30208
+ * @throws {NetworkError} When blockchain communication fails
30209
+ * @example
30210
+ * ```typescript
30211
+ * const txHandle = await vana.permissions.submitSignedUntrustServer(
30212
+ * typedData,
30213
+ * "0x1234..."
30214
+ * );
30215
+ * const result = await txHandle.waitForEvents();
30216
+ * ```
29976
30217
  */
29977
- submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30218
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
29978
30219
  /**
29979
30220
  * Submits a signed transaction directly to the blockchain.
29980
30221
  *
30222
+ * @remarks
30223
+ * Internal method used when relayer callbacks are not available. Formats the signature
30224
+ * and submits the permission grant directly to the smart contract.
30225
+ *
29981
30226
  * @param typedData - The typed data structure for the permission grant
29982
30227
  * @param signature - The cryptographic signature authorizing the transaction
29983
30228
  * @returns Promise resolving to the transaction hash
30229
+ * @throws {BlockchainError} When contract submission fails
29984
30230
  */
29985
30231
  private submitDirectTransaction;
29986
30232
  /**
@@ -30027,19 +30273,33 @@ declare class PermissionsController {
30027
30273
  * console.log(`Revocation submitted: ${txHash}`);
30028
30274
  * ```
30029
30275
  */
30030
- submitPermissionRevoke(params: RevokePermissionParams): Promise<Hash>;
30276
+ submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30031
30277
  /**
30032
- * Revokes a permission with a signature (gasless transaction).
30278
+ * Revokes a permission with a signature for gasless transactions.
30279
+ *
30280
+ * @remarks
30281
+ * This method creates an EIP-712 signature for permission revocation and submits
30282
+ * it either through relayer callbacks or directly to the blockchain. Provides
30283
+ * gasless revocation when relayer is configured.
30033
30284
  *
30034
30285
  * @param params - Parameters for revoking the permission
30035
- * @returns Promise resolving to transaction hash
30286
+ * @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
30287
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30036
30288
  * @throws {BlockchainError} When chain ID is not available
30037
30289
  * @throws {NonceError} When retrieving user nonce fails
30038
30290
  * @throws {SignatureError} When user rejects the signature request
30039
30291
  * @throws {RelayerError} When gasless submission fails
30040
30292
  * @throws {PermissionError} When revocation fails for any other reason
30293
+ * @example
30294
+ * ```typescript
30295
+ * const txHandle = await vana.permissions.submitRevokeWithSignature({
30296
+ * permissionId: 123n
30297
+ * });
30298
+ * const result = await txHandle.waitForEvents();
30299
+ * console.log(`Permission ${result.permissionId} revoked`);
30300
+ * ```
30041
30301
  */
30042
- submitRevokeWithSignature(params: RevokePermissionParams): Promise<Hash>;
30302
+ submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30043
30303
  /**
30044
30304
  * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30045
30305
  *
@@ -30064,6 +30324,18 @@ declare class PermissionsController {
30064
30324
  * const serversNonce = await this.getServersUserNonce();
30065
30325
  * ```
30066
30326
  */
30327
+ /**
30328
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30329
+ *
30330
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30331
+ *
30332
+ * @remarks
30333
+ * This method is deprecated in favor of more specific nonce methods that target
30334
+ * the appropriate contract for the operation being performed.
30335
+ *
30336
+ * @returns Promise resolving to the user's current nonce as a bigint
30337
+ * @throws {NonceError} When retrieving the nonce fails
30338
+ */
30067
30339
  private getUserNonce;
30068
30340
  /**
30069
30341
  * Retrieves the user's current nonce from the DataPortabilityServers contract.
@@ -30079,6 +30351,16 @@ declare class PermissionsController {
30079
30351
  * console.log(`Current servers nonce: ${nonce}`);
30080
30352
  * ```
30081
30353
  */
30354
+ /**
30355
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30356
+ *
30357
+ * @remarks
30358
+ * Used for server-related operations (trust/untrust) to prevent replay attacks.
30359
+ * The nonce must be incremented with each server operation.
30360
+ *
30361
+ * @returns Promise resolving to the user's current nonce as a bigint
30362
+ * @throws {NonceError} When retrieving the nonce fails
30363
+ */
30082
30364
  private getServersUserNonce;
30083
30365
  /**
30084
30366
  * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
@@ -30094,6 +30376,16 @@ declare class PermissionsController {
30094
30376
  * console.log(`Current permissions nonce: ${nonce}`);
30095
30377
  * ```
30096
30378
  */
30379
+ /**
30380
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30381
+ *
30382
+ * @remarks
30383
+ * Used for permission-related operations (grant/revoke) to prevent replay attacks.
30384
+ * The nonce must be incremented with each permission operation.
30385
+ *
30386
+ * @returns Promise resolving to the user's current nonce as a bigint
30387
+ * @throws {NonceError} When retrieving the nonce fails
30388
+ */
30097
30389
  private getPermissionsUserNonce;
30098
30390
  /**
30099
30391
  * Composes the EIP-712 typed data for PermissionGrant (new simplified format).
@@ -30220,7 +30512,7 @@ declare class PermissionsController {
30220
30512
  * console.log('Now trusting servers:', trustedServers);
30221
30513
  * ```
30222
30514
  */
30223
- addAndTrustServer(params: AddAndTrustServerParams): Promise<Hash>;
30515
+ addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30224
30516
  /**
30225
30517
  * Trusts a server for data processing (legacy method).
30226
30518
  *
@@ -30228,14 +30520,14 @@ declare class PermissionsController {
30228
30520
  * @returns Promise resolving to transaction hash
30229
30521
  * @deprecated Use addAndTrustServer instead
30230
30522
  */
30231
- submitTrustServer(params: TrustServerParams): Promise<Hash>;
30523
+ submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30232
30524
  /**
30233
30525
  * Adds and trusts a server using a signature (gasless transaction).
30234
30526
  *
30235
30527
  * @param params - Parameters for adding and trusting the server
30236
- * @returns Promise resolving to transaction hash
30528
+ * @returns Promise resolving to TransactionHandle with ServerTrustResult event data
30237
30529
  */
30238
- submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<Hash>;
30530
+ submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30239
30531
  /**
30240
30532
  * Trusts a server using a signature (gasless transaction - legacy method).
30241
30533
  *
@@ -30249,13 +30541,24 @@ declare class PermissionsController {
30249
30541
  * @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
30250
30542
  * @throws {BlockchainError} When trust operation fails for any other reason
30251
30543
  */
30252
- submitTrustServerWithSignature(params: TrustServerParams): Promise<Hash>;
30544
+ submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30253
30545
  /**
30254
30546
  * Submits a direct untrust server transaction (without signature).
30255
30547
  *
30256
30548
  * @param params - The untrust server parameters containing server details
30257
30549
  * @returns Promise resolving to the transaction hash
30258
30550
  */
30551
+ /**
30552
+ * Submits an untrust server transaction directly to the blockchain.
30553
+ *
30554
+ * @remarks
30555
+ * Internal method used for direct blockchain submission of untrust server operations
30556
+ * when relayer callbacks are not available.
30557
+ *
30558
+ * @param params - The untrust server parameters
30559
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30560
+ * @throws {BlockchainError} When contract submission fails
30561
+ */
30259
30562
  private submitDirectUntrustTransaction;
30260
30563
  /**
30261
30564
  * Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
@@ -30285,7 +30588,7 @@ declare class PermissionsController {
30285
30588
  * console.log('Still trusting servers:', trustedServers);
30286
30589
  * ```
30287
30590
  */
30288
- submitUntrustServer(params: UntrustServerParams): Promise<Hash>;
30591
+ submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30289
30592
  /**
30290
30593
  * Untrusts a server using a signature (gasless transaction).
30291
30594
  *
@@ -30298,7 +30601,7 @@ declare class PermissionsController {
30298
30601
  * @throws {RelayerError} When gasless submission fails
30299
30602
  * @throws {BlockchainError} When untrust transaction fails
30300
30603
  */
30301
- submitUntrustServerWithSignature(params: UntrustServerParams): Promise<Hash>;
30604
+ submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30302
30605
  /**
30303
30606
  * Retrieves all servers trusted by a user from the DataPortabilityServers contract.
30304
30607
  *
@@ -30349,22 +30652,60 @@ declare class PermissionsController {
30349
30652
  /**
30350
30653
  * Gets server information for multiple servers efficiently.
30351
30654
  *
30352
- * @param serverIds - Array of server IDs to query
30353
- * @returns Promise resolving to batch result with successes and failures
30655
+ * @remarks
30656
+ * This method uses multicall to fetch information for multiple servers in a single
30657
+ * blockchain call, improving performance when querying many servers. Failed lookups
30658
+ * are returned separately for error handling.
30659
+ *
30660
+ * @param serverIds - Array of numeric server IDs to query
30661
+ * @returns Promise resolving to batch result containing successful lookups and failed IDs
30354
30662
  * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30663
+ * @example
30664
+ * ```typescript
30665
+ * const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
30666
+ *
30667
+ * // Process successful lookups
30668
+ * result.servers.forEach((server, id) => {
30669
+ * console.log(`Server ${id}: ${server.url}`);
30670
+ * });
30671
+ *
30672
+ * // Handle failed lookups
30673
+ * if (result.failed.length > 0) {
30674
+ * console.log(`Failed to fetch: ${result.failed.join(', ')}`);
30675
+ * }
30676
+ * ```
30355
30677
  */
30356
30678
  getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
30357
30679
  /**
30358
30680
  * Checks whether a specific server is trusted by a user.
30359
30681
  *
30360
- * @param serverId - Server ID to check (numeric)
30682
+ * @remarks
30683
+ * This method queries the user's trusted server list and checks if the specified
30684
+ * server is present. Returns both the trust status and the index in the trust list
30685
+ * if trusted.
30686
+ *
30687
+ * @param serverId - Numeric server ID to check
30361
30688
  * @param userAddress - Optional user address (defaults to current user)
30362
- * @returns Promise resolving to server trust status
30689
+ * @returns Promise resolving to server trust status with trust index if applicable
30690
+ * @throws {BlockchainError} When reading from contract fails
30691
+ * @example
30692
+ * ```typescript
30693
+ * const status = await vana.permissions.checkServerTrustStatus(1);
30694
+ * if (status.isTrusted) {
30695
+ * console.log(`Server is trusted at index ${status.trustIndex}`);
30696
+ * } else {
30697
+ * console.log('Server is not trusted');
30698
+ * }
30699
+ * ```
30363
30700
  */
30364
30701
  checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
30365
30702
  /**
30366
30703
  * Composes EIP-712 typed data for AddAndTrustServer.
30367
30704
  *
30705
+ * @remarks
30706
+ * Creates the complete typed data structure required for EIP-712 signature generation
30707
+ * when adding and trusting a new server in a single transaction.
30708
+ *
30368
30709
  * @param input - The add and trust server input data containing server details
30369
30710
  * @returns Promise resolving to the typed data structure for server add and trust
30370
30711
  */
@@ -30446,7 +30787,7 @@ declare class PermissionsController {
30446
30787
  * console.log(`Grantee registered in transaction: ${txHash}`);
30447
30788
  * ```
30448
30789
  */
30449
- submitRegisterGrantee(params: RegisterGranteeParams): Promise<Hash>;
30790
+ submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
30450
30791
  /**
30451
30792
  * Registers a grantee with a signature (gasless transaction)
30452
30793
  *
@@ -30462,7 +30803,7 @@ declare class PermissionsController {
30462
30803
  * });
30463
30804
  * ```
30464
30805
  */
30465
- submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<Hash>;
30806
+ submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
30466
30807
  /**
30467
30808
  * Submits a signed register grantee transaction via relayer
30468
30809
  *
@@ -30475,7 +30816,7 @@ declare class PermissionsController {
30475
30816
  * const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
30476
30817
  * ```
30477
30818
  */
30478
- submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<Hash>;
30819
+ submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
30479
30820
  /**
30480
30821
  * Retrieves all registered grantees from the DataPortabilityGrantees contract.
30481
30822
  *
@@ -30762,7 +31103,7 @@ declare class PermissionsController {
30762
31103
  * @param url - New URL for the server
30763
31104
  * @returns Promise resolving to transaction hash
30764
31105
  */
30765
- submitUpdateServer(serverId: bigint, url: string): Promise<Hash>;
31106
+ submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
30766
31107
  /**
30767
31108
  * Get all permission IDs for a user
30768
31109
  *
@@ -30802,19 +31143,19 @@ declare class PermissionsController {
30802
31143
  * @throws {BlockchainError} When permission addition fails
30803
31144
  * @throws {NetworkError} When network communication fails
30804
31145
  */
30805
- submitAddPermission(params: ServerFilesAndPermissionParams): Promise<Hash>;
31146
+ submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
30806
31147
  /**
30807
31148
  * Submits an already-signed add permission transaction to the blockchain.
30808
31149
  * This method supports both relayer-based gasless transactions and direct transactions.
30809
31150
  *
30810
31151
  * @param typedData - The EIP-712 typed data for AddPermission
30811
31152
  * @param signature - The user's signature
30812
- * @returns Promise resolving to the transaction hash
31153
+ * @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
30813
31154
  * @throws {RelayerError} When gasless transaction submission fails
30814
31155
  * @throws {BlockchainError} When permission addition fails
30815
31156
  * @throws {NetworkError} When network communication fails
30816
31157
  */
30817
- submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
31158
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30818
31159
  /**
30819
31160
  * Submit server files and permissions with signature to the blockchain (supports gasless transactions)
30820
31161
  *
@@ -30825,26 +31166,43 @@ declare class PermissionsController {
30825
31166
  * @throws {BlockchainError} When server files and permissions addition fails
30826
31167
  * @throws {NetworkError} When network communication fails
30827
31168
  */
30828
- submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<Hash>;
31169
+ submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
30829
31170
  /**
30830
31171
  * Submits an already-signed add server files and permissions transaction to the blockchain.
30831
- * This method supports both relayer-based gasless transactions and direct transactions.
31172
+ *
31173
+ * @remarks
31174
+ * This method returns a TransactionHandle that provides immediate access to the transaction hash
31175
+ * while allowing lazy-loaded access to parsed event data. Use `waitForEvents()` to retrieve
31176
+ * the permission ID and other event details after transaction confirmation.
30832
31177
  *
30833
31178
  * @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
30834
31179
  * @param signature - The user's signature
30835
- * @returns Promise resolving to the transaction hash
31180
+ * @returns TransactionHandle with immediate hash access and optional event parsing
30836
31181
  * @throws {RelayerError} When gasless transaction submission fails
30837
31182
  * @throws {BlockchainError} When server files and permissions addition fails
30838
31183
  * @throws {NetworkError} When network communication fails
31184
+ *
31185
+ * @example
31186
+ * ```typescript
31187
+ * const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
31188
+ * typedData,
31189
+ * signature
31190
+ * );
31191
+ * console.log(`Transaction submitted: ${tx.hash}`);
31192
+ *
31193
+ * // Wait for confirmation and get the permission ID
31194
+ * const { permissionId } = await tx.waitForEvents();
31195
+ * console.log(`Permission created with ID: ${permissionId}`);
31196
+ * ```
30839
31197
  */
30840
- submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<Hash>;
31198
+ submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30841
31199
  /**
30842
31200
  * Submit permission revocation with signature to the blockchain
30843
31201
  *
30844
31202
  * @param permissionId - Permission ID to revoke
30845
31203
  * @returns Promise resolving to transaction hash
30846
31204
  */
30847
- submitRevokePermission(permissionId: bigint): Promise<Hash>;
31205
+ submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
30848
31206
  /**
30849
31207
  * Submits a signed add permission transaction directly to the blockchain.
30850
31208
  *
@@ -30986,33 +31344,52 @@ declare class SchemaController {
30986
31344
  * Retrieves a schema by its ID.
30987
31345
  *
30988
31346
  * @param schemaId - The ID of the schema to retrieve
31347
+ * @param options - Optional parameters
31348
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
30989
31349
  * @returns Promise resolving to the schema object
30990
31350
  * @throws {Error} When the schema is not found or chain is unavailable
30991
31351
  * @example
30992
31352
  * ```typescript
30993
31353
  * const schema = await vana.schemas.get(1);
30994
31354
  * console.log(`Schema: ${schema.name} (${schema.type})`);
31355
+ *
31356
+ * // With custom subgraph
31357
+ * const schema = await vana.schemas.get(1, {
31358
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31359
+ * });
30995
31360
  * ```
30996
31361
  */
30997
- get(schemaId: number): Promise<Schema>;
31362
+ get(schemaId: number, options?: {
31363
+ subgraphUrl?: string;
31364
+ }): Promise<Schema>;
30998
31365
  /**
30999
31366
  * Gets the total number of schemas registered on the network.
31000
31367
  *
31368
+ * @param options - Optional parameters
31369
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31001
31370
  * @returns Promise resolving to the total schema count
31002
31371
  * @throws {Error} When the count cannot be retrieved
31003
31372
  * @example
31004
31373
  * ```typescript
31005
31374
  * const count = await vana.schemas.count();
31006
31375
  * console.log(`Total schemas: ${count}`);
31376
+ *
31377
+ * // With custom subgraph
31378
+ * const count = await vana.schemas.count({
31379
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31380
+ * });
31007
31381
  * ```
31008
31382
  */
31009
- count(): Promise<number>;
31383
+ count(options?: {
31384
+ subgraphUrl?: string;
31385
+ }): Promise<number>;
31010
31386
  /**
31011
31387
  * Lists all schemas with pagination.
31012
31388
  *
31013
31389
  * @param options - Optional parameters for listing schemas
31014
31390
  * @param options.limit - Maximum number of schemas to return
31015
31391
  * @param options.offset - Number of schemas to skip
31392
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31016
31393
  * @returns Promise resolving to an array of schemas
31017
31394
  * @example
31018
31395
  * ```typescript
@@ -31021,11 +31398,19 @@ declare class SchemaController {
31021
31398
  *
31022
31399
  * // Get schemas with pagination
31023
31400
  * const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
31401
+ *
31402
+ * // With custom subgraph
31403
+ * const schemas = await vana.schemas.list({
31404
+ * limit: 10,
31405
+ * offset: 0,
31406
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31407
+ * });
31024
31408
  * ```
31025
31409
  */
31026
31410
  list(options?: {
31027
31411
  limit?: number;
31028
31412
  offset?: number;
31413
+ subgraphUrl?: string;
31029
31414
  }): Promise<Schema[]>;
31030
31415
  /**
31031
31416
  * Adds a schema using the legacy method (low-level API).
@@ -31035,6 +31420,36 @@ declare class SchemaController {
31035
31420
  * @returns Promise resolving to the add schema result
31036
31421
  */
31037
31422
  addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
31423
+ /**
31424
+ * Internal method: Query schema via subgraph
31425
+ *
31426
+ * @param params - Query parameters
31427
+ * @param params.schemaId - The ID of the schema to retrieve
31428
+ * @param params.subgraphUrl - The subgraph URL to query
31429
+ * @returns Promise resolving to the schema object
31430
+ * @private
31431
+ */
31432
+ private _getSchemaViaSubgraph;
31433
+ /**
31434
+ * Internal method: List schemas via subgraph
31435
+ *
31436
+ * @param params - Query parameters
31437
+ * @param params.limit - Maximum number of schemas to return
31438
+ * @param params.offset - Number of schemas to skip
31439
+ * @param params.subgraphUrl - The subgraph URL to query
31440
+ * @returns Promise resolving to an array of schemas
31441
+ * @private
31442
+ */
31443
+ private _listSchemasViaSubgraph;
31444
+ /**
31445
+ * Internal method: Count schemas via subgraph
31446
+ *
31447
+ * @param params - Query parameters
31448
+ * @param params.subgraphUrl - The subgraph URL to query
31449
+ * @returns Promise resolving to the total schema count
31450
+ * @private
31451
+ */
31452
+ private _countSchemasViaSubgraph;
31038
31453
  /**
31039
31454
  * Gets the user's wallet address.
31040
31455
  *
@@ -33683,19 +34098,18 @@ declare class DataController {
33683
34098
  subgraphUrl?: string;
33684
34099
  }): Promise<UserFile$1[]>;
33685
34100
  /**
33686
- * Retrieves a list of permissions granted by a user using the new subgraph entities.
34101
+ * Retrieves a list of permissions granted by a user.
33687
34102
  *
33688
- * This method queries the Vana subgraph to find permissions directly granted by the user
33689
- * using the new Permission entity. It efficiently handles millions of permissions by:
33690
- * 1. Querying the subgraph for user's directly granted permissions
33691
- * 2. Returning complete permission information from subgraph
33692
- * 3. No need for additional contract calls as all data comes from subgraph
34103
+ * This method supports automatic fallback between subgraph and RPC modes:
34104
+ * - If subgraph URL is available, tries subgraph query first
34105
+ * - Falls back to direct contract queries via RPC if subgraph fails
34106
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
33693
34107
  *
33694
34108
  * @param params - Object containing the user address and optional subgraph URL
33695
34109
  * @param params.user - The wallet address of the user to query permissions for
33696
34110
  * @param params.subgraphUrl - Optional subgraph URL to override the default
33697
34111
  * @returns Promise resolving to an array of permission objects
33698
- * @throws Error if subgraph is unavailable or returns invalid data
34112
+ * @throws Error if both subgraph and RPC queries fail
33699
34113
  */
33700
34114
  getUserPermissions(params: {
33701
34115
  user: Address;
@@ -33711,43 +34125,59 @@ declare class DataController {
33711
34125
  user: Address;
33712
34126
  }>>;
33713
34127
  /**
33714
- * Retrieves a list of trusted servers for a user using the new subgraph entities.
34128
+ * Internal method: Query user permissions via subgraph
33715
34129
  *
33716
- * This method queries the Vana subgraph to find trusted servers directly associated with the user
33717
- * with support for both subgraph and direct RPC queries.
34130
+ * @param params - Query parameters object
34131
+ * @param params.user - The user address to query permissions for
34132
+ * @param params.subgraphUrl - The subgraph URL endpoint to query
34133
+ * @returns Promise resolving to an array of permission objects
34134
+ */
34135
+ private _getUserPermissionsViaSubgraph;
34136
+ /**
34137
+ * Internal method: Query user permissions via direct RPC
33718
34138
  *
33719
- * This method supports multiple query modes:
33720
- * - 'subgraph': Fast query via subgraph (requires subgraphUrl)
33721
- * - 'rpc': Direct contract queries (slower but no external dependencies)
33722
- * - 'auto': Try subgraph first, fallback to RPC if unavailable
34139
+ * @param params - Query parameters object
34140
+ * @param params.user - The user address to query permissions for
34141
+ * @returns Promise resolving to an array of permission objects
34142
+ */
34143
+ private _getUserPermissionsViaRpc;
34144
+ /**
34145
+ * Retrieves a list of trusted servers for a user.
33723
34146
  *
33724
- * @param params - Query parameters including user address and mode selection
33725
- * @returns Promise resolving to trusted servers with metadata about the query
33726
- * @throws Error if query fails in both modes (when using 'auto')
34147
+ * This method supports automatic fallback between subgraph and RPC modes:
34148
+ * - If subgraph URL is available, tries subgraph query first for fast results
34149
+ * - Falls back to direct contract queries via RPC if subgraph fails
34150
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
34151
+ *
34152
+ * @param params - Query parameters including user address and optional pagination
34153
+ * @param params.user - The wallet address of the user to query trusted servers for
34154
+ * @param params.subgraphUrl - Optional subgraph URL to override the default
34155
+ * @param params.limit - Maximum number of results to return (default: 50)
34156
+ * @param params.offset - Number of results to skip for pagination (default: 0)
34157
+ * @returns Promise resolving to an array of trusted server objects
34158
+ * @throws Error if both subgraph and RPC queries fail
33727
34159
  * @example
33728
34160
  * ```typescript
33729
- * // Use subgraph for fast queries
33730
- * const result = await vana.data.getUserTrustedServers({
33731
- * user: '0x...',
33732
- * mode: 'subgraph',
33733
- * subgraphUrl: 'https://...'
34161
+ * // Basic usage with automatic fallback
34162
+ * const servers = await vana.data.getUserTrustedServers({
34163
+ * user: '0x...'
33734
34164
  * });
33735
34165
  *
33736
- * // Use direct RPC (no external dependencies)
33737
- * const result = await vana.data.getUserTrustedServers({
34166
+ * // With pagination
34167
+ * const servers = await vana.data.getUserTrustedServers({
33738
34168
  * user: '0x...',
33739
- * mode: 'rpc',
33740
- * limit: 10
34169
+ * limit: 10,
34170
+ * offset: 20
33741
34171
  * });
33742
34172
  *
33743
- * // Auto-fallback mode
33744
- * const result = await vana.data.getUserTrustedServers({
34173
+ * // With custom subgraph URL
34174
+ * const servers = await vana.data.getUserTrustedServers({
33745
34175
  * user: '0x...',
33746
- * mode: 'auto' // tries subgraph first, falls back to RPC
34176
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
33747
34177
  * });
33748
34178
  * ```
33749
34179
  */
33750
- getUserTrustedServers(params: GetUserTrustedServersParams): Promise<GetUserTrustedServersResult>;
34180
+ getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
33751
34181
  /**
33752
34182
  * Internal method: Query trusted servers via subgraph
33753
34183
  *
@@ -33815,12 +34245,25 @@ declare class DataController {
33815
34245
  /**
33816
34246
  * Registers a file URL directly on the blockchain with a schema ID.
33817
34247
  *
33818
- * @param url - The URL of the file to register
34248
+ * @remarks
34249
+ * This method registers an existing file URL on the DataRegistry contract
34250
+ * with a schema ID, without uploading any data. Useful when you have already
34251
+ * uploaded content to storage and just need to register it on-chain.
34252
+ *
34253
+ * @param url - The URL of the file to register (IPFS or HTTP/HTTPS)
33819
34254
  * @param schemaId - The schema ID to associate with the file
33820
34255
  * @returns Promise resolving to the file ID and transaction hash
33821
- *
33822
- * This method registers an existing file URL on the DataRegistry
33823
- * contract with a schema ID, without uploading any data.
34256
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34257
+ * @throws {Error} When wallet address is unavailable - "No addresses available"
34258
+ * @throws {Error} When transaction fails - "Failed to register file with schema"
34259
+ * @example
34260
+ * ```typescript
34261
+ * const { fileId, transactionHash } = await vana.data.registerFileWithSchema(
34262
+ * "ipfs://QmXxx...",
34263
+ * 1
34264
+ * );
34265
+ * console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
34266
+ * ```
33824
34267
  */
33825
34268
  registerFileWithSchema(url: string, schemaId: number): Promise<{
33826
34269
  fileId: number;
@@ -33880,35 +34323,112 @@ declare class DataController {
33880
34323
  /**
33881
34324
  * Adds a new refiner to the DataRefinerRegistry.
33882
34325
  *
33883
- * @param params - Refiner parameters including DLP ID, name, schema ID, and instruction URL
34326
+ * @remarks
34327
+ * Refiners are data processing templates that define how raw data should be
34328
+ * transformed into structured formats. Each refiner is associated with a DLP
34329
+ * (Data Liquidity Pool), has a specific schema for output, and includes
34330
+ * instructions for the refinement process.
34331
+ *
34332
+ * @param params - Refiner configuration parameters
34333
+ * @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
34334
+ * @param params.name - Human-readable name for the refiner
34335
+ * @param params.schemaId - Schema ID that defines the output format
34336
+ * @param params.refinementInstructionUrl - URL containing processing instructions
33884
34337
  * @returns Promise resolving to the new refiner ID and transaction hash
34338
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34339
+ * @throws {Error} When transaction fails - "Failed to add refiner: {error}"
34340
+ * @example
34341
+ * ```typescript
34342
+ * const result = await vana.data.addRefiner({
34343
+ * dlpId: 1,
34344
+ * name: "Social Media Sentiment Analyzer",
34345
+ * schemaId: 42,
34346
+ * refinementInstructionUrl: "ipfs://QmXxx..."
34347
+ * });
34348
+ * console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
34349
+ * ```
33885
34350
  */
33886
34351
  addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
33887
34352
  /**
33888
34353
  * Retrieves a refiner by its ID.
33889
34354
  *
33890
- * @param refinerId - The refiner ID to retrieve
33891
- * @returns Promise resolving to the refiner information
34355
+ * @remarks
34356
+ * Queries the DataRefinerRegistry contract to get complete information about
34357
+ * a specific refiner including its DLP association, schema, and instructions.
34358
+ *
34359
+ * @param refinerId - The numeric refiner ID to retrieve
34360
+ * @returns Promise resolving to the refiner information object
34361
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34362
+ * @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
34363
+ * @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
34364
+ * @example
34365
+ * ```typescript
34366
+ * const refiner = await vana.data.getRefiner(1);
34367
+ * console.log({
34368
+ * name: refiner.name,
34369
+ * dlp: refiner.dlpId,
34370
+ * schema: refiner.schemaId,
34371
+ * instructions: refiner.refinementInstructionUrl
34372
+ * });
34373
+ * ```
33892
34374
  */
33893
34375
  getRefiner(refinerId: number): Promise<Refiner>;
33894
34376
  /**
33895
34377
  * Validates if a schema ID exists in the registry.
33896
34378
  *
33897
- * @param schemaId - The schema ID to validate
33898
- * @returns Promise resolving to boolean indicating if the schema ID is valid
34379
+ * @remarks
34380
+ * Checks the DataRefinerRegistry contract to determine if a given schema ID
34381
+ * has been registered and is available for use.
34382
+ *
34383
+ * @param schemaId - The numeric schema ID to validate
34384
+ * @returns Promise resolving to true if schema exists, false otherwise
34385
+ * @example
34386
+ * ```typescript
34387
+ * const isValid = await vana.data.isValidSchemaId(42);
34388
+ * if (isValid) {
34389
+ * console.log('Schema 42 is available for use');
34390
+ * } else {
34391
+ * console.log('Schema 42 does not exist');
34392
+ * }
34393
+ * ```
33899
34394
  */
33900
34395
  isValidSchemaId(schemaId: number): Promise<boolean>;
33901
34396
  /**
33902
34397
  * Gets the total number of refiners in the registry.
33903
34398
  *
34399
+ * @remarks
34400
+ * Queries the DataRefinerRegistry contract to get the total count of all
34401
+ * registered refiners across all DLPs.
34402
+ *
33904
34403
  * @returns Promise resolving to the total refiner count
34404
+ * @example
34405
+ * ```typescript
34406
+ * const count = await vana.data.getRefinersCount();
34407
+ * console.log(`Total refiners registered: ${count}`);
34408
+ * ```
33905
34409
  */
33906
34410
  getRefinersCount(): Promise<number>;
33907
34411
  /**
33908
34412
  * Updates the schema ID for an existing refiner.
33909
34413
  *
33910
- * @param params - Parameters including refiner ID and new schema ID
34414
+ * @remarks
34415
+ * Allows the owner of a refiner to update its associated schema ID.
34416
+ * This is useful when refiner output format needs to change.
34417
+ *
34418
+ * @param params - Update parameters
34419
+ * @param params.refinerId - The refiner ID to update
34420
+ * @param params.newSchemaId - The new schema ID to set
33911
34421
  * @returns Promise resolving to the transaction hash
34422
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34423
+ * @throws {Error} When transaction fails - "Failed to update schema ID: {error}"
34424
+ * @example
34425
+ * ```typescript
34426
+ * const result = await vana.data.updateSchemaId({
34427
+ * refinerId: 1,
34428
+ * newSchemaId: 55
34429
+ * });
34430
+ * console.log(`Schema updated in tx ${result.transactionHash}`);
34431
+ * ```
33912
34432
  */
33913
34433
  updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
33914
34434
  /**
@@ -33967,7 +34487,7 @@ declare class DataController {
33967
34487
  * console.log(`Transaction: ${result.transactionHash}`);
33968
34488
  * ```
33969
34489
  */
33970
- addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult>;
34490
+ addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
33971
34491
  /**
33972
34492
  * Submits a file permission transaction and returns the transaction hash immediately.
33973
34493
  *
@@ -33984,7 +34504,7 @@ declare class DataController {
33984
34504
  * console.log(`Transaction submitted: ${txHash}`);
33985
34505
  * ```
33986
34506
  */
33987
- submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<Hash>;
34507
+ submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
33988
34508
  /**
33989
34509
  * Gets the encrypted key for a specific account's permission to access a file.
33990
34510
  *
@@ -34371,6 +34891,31 @@ interface Chains {
34371
34891
  }
34372
34892
  declare const chains: Chains;
34373
34893
 
34894
+ /**
34895
+ * Creates or retrieves a cached public client for blockchain read operations.
34896
+ *
34897
+ * @remarks
34898
+ * This function provides an optimized way to access blockchain data by maintaining
34899
+ * a cached client instance per chain. The client is used for reading contract state,
34900
+ * querying events, and other read-only blockchain operations. It automatically
34901
+ * handles HTTP transport configuration and chain switching.
34902
+ *
34903
+ * @param chainId - The chain ID to connect to (defaults to Moksha testnet)
34904
+ * @returns A public client configured for the specified chain with caching optimization
34905
+ * @throws {Error} When the specified chain ID is not supported by the SDK
34906
+ * @example
34907
+ * ```typescript
34908
+ * // Get client for default chain (Moksha testnet)
34909
+ * const client = createClient();
34910
+ *
34911
+ * // Get client for specific chain
34912
+ * const mainnetClient = createClient(14800);
34913
+ *
34914
+ * // Use client for blockchain reads
34915
+ * const blockNumber = await client.getBlockNumber();
34916
+ * ```
34917
+ * @category Blockchain
34918
+ */
34374
34919
  declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
34375
34920
  chain: Chain;
34376
34921
  };
@@ -35089,51 +35634,157 @@ declare class SerializationError extends VanaError {
35089
35634
  constructor(message: string);
35090
35635
  }
35091
35636
  /**
35092
- * Error thrown when a signature operation fails.
35637
+ * Thrown when a signature operation fails or cannot be completed.
35093
35638
  *
35094
35639
  * @remarks
35095
- * Recovery strategies: Check wallet connection and account unlock status,
35096
- * retry operation with explicit user interaction, or for gasless operations
35097
- * consider switching to direct transactions.
35640
+ * This error occurs when wallet signature operations fail due to disconnection,
35641
+ * locked accounts, or other wallet-related issues. It preserves the original
35642
+ * error for debugging while providing consistent error handling across the SDK.
35643
+ *
35644
+ * Recovery strategies:
35645
+ * - Check wallet connection and account unlock status
35646
+ * - Retry operation with explicit user interaction
35647
+ * - For gasless operations, consider switching to direct transactions
35648
+ *
35649
+ * @example
35650
+ * ```typescript
35651
+ * try {
35652
+ * await vana.permissions.grant({ grantee: '0x...' });
35653
+ * } catch (error) {
35654
+ * if (error instanceof SignatureError) {
35655
+ * // Prompt user to unlock wallet
35656
+ * await promptWalletUnlock();
35657
+ * // Retry operation
35658
+ * }
35659
+ * }
35660
+ * ```
35661
+ * @category Error Handling
35098
35662
  */
35099
35663
  declare class SignatureError extends VanaError {
35100
35664
  readonly originalError?: Error | undefined;
35101
35665
  constructor(message: string, originalError?: Error | undefined);
35102
35666
  }
35103
35667
  /**
35104
- * Error thrown when a network operation fails.
35668
+ * Thrown when network communication fails during API calls or blockchain interactions.
35105
35669
  *
35106
35670
  * @remarks
35107
- * Recovery strategies: Check network connectivity, retry with exponential backoff,
35108
- * verify API endpoints are accessible, or switch to alternative network providers.
35671
+ * This error encompasses network connectivity issues, API unavailability,
35672
+ * timeout errors, and CORS restrictions. It's commonly encountered during
35673
+ * IPFS operations, subgraph queries, or RPC calls.
35674
+ *
35675
+ * Recovery strategies:
35676
+ * - Check network connectivity
35677
+ * - Retry with exponential backoff
35678
+ * - Verify API endpoints are accessible
35679
+ * - Switch to alternative network providers or gateways
35680
+ *
35681
+ * @example
35682
+ * ```typescript
35683
+ * try {
35684
+ * const files = await vana.data.getUserFiles({ owner: '0x...' });
35685
+ * } catch (error) {
35686
+ * if (error instanceof NetworkError) {
35687
+ * // Implement retry with exponential backoff
35688
+ * await retryWithBackoff(() => vana.data.getUserFiles({ owner: '0x...' }));
35689
+ * }
35690
+ * }
35691
+ * ```
35692
+ * @category Error Handling
35109
35693
  */
35110
35694
  declare class NetworkError extends VanaError {
35111
35695
  readonly originalError?: Error | undefined;
35112
35696
  constructor(message: string, originalError?: Error | undefined);
35113
35697
  }
35114
35698
  /**
35115
- * Error thrown when the nonce retrieval fails.
35699
+ * Thrown when transaction nonce retrieval fails during gasless operations.
35116
35700
  *
35117
35701
  * @remarks
35118
- * Recovery strategies: Retry nonce retrieval after brief delay, check wallet connection
35119
- * and account status, or use manual nonce specification if supported by the operation.
35702
+ * This error occurs when the SDK cannot retrieve the user's current nonce from
35703
+ * smart contracts, preventing gasless transaction submission. Nonces are critical
35704
+ * for preventing replay attacks in signed transactions.
35705
+ *
35706
+ * Recovery strategies:
35707
+ * - Retry nonce retrieval after brief delay
35708
+ * - Check wallet connection and account status
35709
+ * - Use manual nonce specification if supported by the operation
35710
+ * - Switch to direct transactions as fallback
35711
+ *
35712
+ * @example
35713
+ * ```typescript
35714
+ * try {
35715
+ * await vana.permissions.grant({ grantee: '0x...' });
35716
+ * } catch (error) {
35717
+ * if (error instanceof NonceError) {
35718
+ * // Wait and retry
35719
+ * await delay(1000);
35720
+ * await vana.permissions.grant({ grantee: '0x...' });
35721
+ * }
35722
+ * }
35723
+ * ```
35724
+ * @category Error Handling
35120
35725
  */
35121
35726
  declare class NonceError extends VanaError {
35122
35727
  constructor(message: string);
35123
35728
  }
35124
35729
  /**
35125
- * Error thrown when a personal server operation fails.
35730
+ * Thrown when personal server operations fail or cannot be completed.
35126
35731
  *
35127
35732
  * @remarks
35128
- * Recovery strategies: Verify server URL accessibility, check server trust status via
35129
- * `vana.permissions.getUserTrustedServers()`, or retry after server becomes available.
35733
+ * This error occurs during interactions with personal servers for computation
35734
+ * requests, identity retrieval, or operation status checks. Common causes include
35735
+ * server unavailability, untrusted server status, or invalid permission grants.
35736
+ *
35737
+ * Recovery strategies:
35738
+ * - Verify server URL accessibility
35739
+ * - Check server trust status via `vana.permissions.getTrustedServers()`
35740
+ * - Ensure valid permissions exist for the operation
35741
+ * - Retry after server becomes available
35742
+ *
35743
+ * @example
35744
+ * ```typescript
35745
+ * try {
35746
+ * const result = await vana.server.createOperation({ permissionId: 123 });
35747
+ * } catch (error) {
35748
+ * if (error instanceof PersonalServerError) {
35749
+ * // Check if server is trusted
35750
+ * const trustedServers = await vana.permissions.getTrustedServers();
35751
+ * if (!trustedServers.includes(serverId)) {
35752
+ * await vana.permissions.trustServer({ serverId });
35753
+ * }
35754
+ * }
35755
+ * }
35756
+ * ```
35757
+ * @category Error Handling
35130
35758
  */
35131
35759
  declare class PersonalServerError extends VanaError {
35132
35760
  readonly originalError?: Error | undefined;
35133
35761
  constructor(message: string, originalError?: Error | undefined);
35134
35762
  }
35135
35763
  /**
35136
- * Error thrown when trying to register a server with a URL that doesn't match the existing registration.
35764
+ * Thrown when attempting to register a server with a URL different from its existing registration.
35765
+ *
35766
+ * @remarks
35767
+ * This error occurs when trying to add or trust a server that's already registered
35768
+ * on-chain with a different URL. Server URLs are immutable once registered to
35769
+ * maintain consistency and security. Applications should use the existing URL
35770
+ * or register a new server with a different ID.
35771
+ *
35772
+ * @example
35773
+ * ```typescript
35774
+ * try {
35775
+ * await vana.permissions.addAndTrustServer({
35776
+ * serverId: 1,
35777
+ * serverUrl: 'https://new-url.com',
35778
+ * publicKey: '0x...'
35779
+ * });
35780
+ * } catch (error) {
35781
+ * if (error instanceof ServerUrlMismatchError) {
35782
+ * console.log(`Server already registered with: ${error.existingUrl}`);
35783
+ * // Use existing URL or register new server
35784
+ * }
35785
+ * }
35786
+ * ```
35787
+ * @category Error Handling
35137
35788
  */
35138
35789
  declare class ServerUrlMismatchError extends VanaError {
35139
35790
  constructor(existingUrl: string, providedUrl: string, serverId: string);
@@ -35142,7 +35793,25 @@ declare class ServerUrlMismatchError extends VanaError {
35142
35793
  readonly serverId: string;
35143
35794
  }
35144
35795
  /**
35145
- * Error thrown when a permission operation fails.
35796
+ * Thrown when permission grant, revoke, or validation operations fail.
35797
+ *
35798
+ * @remarks
35799
+ * This error occurs during permission management operations including grants,
35800
+ * revocations, and permission validation checks. Common causes include invalid
35801
+ * grantee addresses, expired permissions, or insufficient privileges.
35802
+ *
35803
+ * @example
35804
+ * ```typescript
35805
+ * try {
35806
+ * await vana.permissions.revoke({ permissionId: 999999 });
35807
+ * } catch (error) {
35808
+ * if (error instanceof PermissionError) {
35809
+ * console.error('Permission operation failed:', error.message);
35810
+ * // Permission may not exist or user may not be owner
35811
+ * }
35812
+ * }
35813
+ * ```
35814
+ * @category Error Handling
35146
35815
  */
35147
35816
  declare class PermissionError extends VanaError {
35148
35817
  readonly originalError?: Error | undefined;
@@ -36150,21 +36819,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
36150
36819
 
36151
36820
  declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
36152
36821
  /**
36153
- * Retrieves the deployed contract address for a specific contract on a given chain.
36822
+ * Retrieves the deployed contract address for a specific Vana protocol contract on a given chain.
36154
36823
  *
36155
- * @param chainId - The chain ID to look up the contract on
36156
- * @param contract - The contract name to get the address for
36157
- * @returns The contract address as a hex string
36158
- * @throws {Error} When contract address not found for the specified contract and chain
36824
+ * @remarks
36825
+ * This function provides type-safe access to contract addresses across all supported Vana networks.
36826
+ * It automatically searches both current and legacy contract registries to ensure backwards
36827
+ * compatibility while providing clear error messages for unsupported combinations.
36828
+ *
36829
+ * The function validates that both the chain ID and contract name are supported before
36830
+ * attempting address lookup, helping developers identify deployment or configuration issues
36831
+ * early in the development process.
36832
+ *
36833
+ * **Supported Chains:**
36834
+ * - 14800: Vana Mainnet
36835
+ * - 1480: Moksha Testnet
36836
+ *
36837
+ * **Contract Categories:**
36838
+ * - Data Management: DataRegistry, DataRefinerRegistry
36839
+ * - Permissions: DataPortabilityPermissions, DataPortabilityServers, DataPortabilityGrantees
36840
+ * - Computing: TeePoolPhala, TeePoolDedicatedGpu, etc.
36841
+ * - Token & Governance: DATImplementation, VanaPoolStaking, etc.
36842
+ *
36843
+ * @param chainId - The chain ID to look up the contract on (14800 for mainnet, 1480 for testnet)
36844
+ * @param contract - The contract name to get the address for (use TypeScript autocomplete for available options)
36845
+ * @returns The contract address as a checksummed hex string (0x...)
36846
+ * @throws {Error} When contract address not found for the specified contract and chain combination.
36847
+ * This typically indicates the contract is not deployed on the requested network.
36159
36848
  * @example
36160
36849
  * ```typescript
36850
+ * // Get core protocol contract addresses
36851
+ * const dataRegistry = getContractAddress(14800, 'DataRegistry');
36852
+ * const permissions = getContractAddress(14800, 'DataPortabilityPermissions');
36853
+ * const trustedServers = getContractAddress(14800, 'DataPortabilityServers');
36854
+ *
36855
+ * // Handle unsupported combinations gracefully
36161
36856
  * try {
36162
- * const dataRegistryAddress = getContractAddress(1480, 'DataRegistry');
36163
- * console.log('DataRegistry address:', dataRegistryAddress);
36857
+ * const address = getContractAddress(1480, 'DataRegistry');
36858
+ * console.log('DataRegistry testnet address:', address);
36164
36859
  * } catch (error) {
36165
- * console.error('Contract not deployed on this chain:', error.message);
36860
+ * console.error('Contract not available on testnet:', error.message);
36861
+ * // Fallback to mainnet or show user-friendly error
36166
36862
  * }
36863
+ *
36864
+ * // TypeScript provides autocomplete for contract names
36865
+ * const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
36866
+ * // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
36167
36867
  * ```
36868
+ * @category Configuration
36168
36869
  */
36169
36870
  declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
36170
36871
 
@@ -36682,4 +37383,4 @@ declare function Vana(config: VanaConfig): VanaBrowserImpl;
36682
37383
  */
36683
37384
  type VanaInstance = VanaBrowserImpl;
36684
37385
 
36685
- export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, type GetUserTrustedServersResult, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryMode, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, VanaBrowserImpl, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };
37386
+ export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, VanaBrowserImpl, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };