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

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-DY8XDblx.d.ts +241 -0
  3. package/dist/browser.d.ts +1 -0
  4. package/dist/browser.js +309 -0
  5. package/dist/browser.js.map +1 -0
  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 +1880 -1482
  19. package/dist/index.browser.js +38183 -35235
  20. package/dist/index.browser.js.map +1 -1
  21. package/dist/index.node.cjs +38596 -35644
  22. package/dist/index.node.cjs.map +1 -1
  23. package/dist/index.node.d.cts +1916 -1489
  24. package/dist/index.node.d.ts +1916 -1489
  25. package/dist/index.node.js +38858 -35909
  26. package/dist/index.node.js.map +1 -1
  27. package/dist/node-D9-F9uEP.d.cts +238 -0
  28. package/dist/node-D9-F9uEP.d.ts +238 -0
  29. package/dist/node.cjs +348 -0
  30. package/dist/node.cjs.map +1 -0
  31. package/dist/node.d.cts +1 -0
  32. package/dist/node.d.ts +1 -0
  33. package/dist/node.js +311 -0
  34. package/dist/node.js.map +1 -0
  35. package/dist/platform.browser.d.ts +3 -236
  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 +2 -1
  41. package/dist/platform.d.ts +2 -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 +7 -236
  47. package/dist/platform.node.d.ts +7 -236
  48. package/dist/platform.node.js +72 -62
  49. package/dist/platform.node.js.map +1 -1
  50. package/package.json +17 -12
@@ -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 */
@@ -392,8 +400,8 @@ interface PermissionInfo {
392
400
  granteeId: bigint;
393
401
  /** Grant URL */
394
402
  grant: string;
395
- /** Signature bytes */
396
- signature: `0x${string}`;
403
+ /** Signature bytes (removed in newer contract versions) */
404
+ signature?: `0x${string}`;
397
405
  /** Start block */
398
406
  startBlock: bigint;
399
407
  /** End block */
@@ -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 */
@@ -612,13 +618,28 @@ interface Server {
612
618
  publicKey: string;
613
619
  }
614
620
  /**
615
- * Parameters for adding and trusting a server
621
+ * Contract ServerInfo structure returned from the contract
616
622
  *
617
623
  * @category Permissions
618
624
  */
619
- interface AddAndTrustServerParams {
625
+ interface ServerInfo {
626
+ /** Server ID */
627
+ id: bigint;
620
628
  /** Server owner address */
621
629
  owner: Address;
630
+ /** Server address */
631
+ serverAddress: Address;
632
+ /** Server public key */
633
+ publicKey: string;
634
+ /** Server URL */
635
+ url: string;
636
+ }
637
+ /**
638
+ * Parameters for adding and trusting a server
639
+ *
640
+ * @category Permissions
641
+ */
642
+ interface AddAndTrustServerParams {
622
643
  /** Server address */
623
644
  serverAddress: Address;
624
645
  /** Server URL */
@@ -650,11 +671,9 @@ interface UntrustServerParams {
650
671
  *
651
672
  * @category Permissions
652
673
  */
653
- interface AddAndTrustServerInput {
674
+ interface AddAndTrustServerInput extends RecordCompatible {
654
675
  /** User nonce */
655
676
  nonce: bigint;
656
- /** Server owner address */
657
- owner: Address;
658
677
  /** Server address */
659
678
  serverAddress: Address;
660
679
  /** Server URL */
@@ -668,7 +687,7 @@ interface AddAndTrustServerInput {
668
687
  * @category Permissions
669
688
  * @deprecated Use AddAndTrustServerInput instead
670
689
  */
671
- interface TrustServerInput {
690
+ interface TrustServerInput extends RecordCompatible {
672
691
  /** User nonce */
673
692
  nonce: bigint;
674
693
  /** Server ID (numeric) */
@@ -679,7 +698,7 @@ interface TrustServerInput {
679
698
  *
680
699
  * @category Permissions
681
700
  */
682
- interface UntrustServerInput {
701
+ interface UntrustServerInput extends RecordCompatible {
683
702
  /** User nonce */
684
703
  nonce: bigint;
685
704
  /** Server ID (numeric) */
@@ -690,18 +709,16 @@ interface UntrustServerInput {
690
709
  *
691
710
  * @category Permissions
692
711
  */
693
- interface AddAndTrustServerTypedData {
694
- /** EIP-712 domain */
695
- domain: PermissionGrantDomain;
712
+ interface AddAndTrustServerTypedData extends GenericTypedData {
696
713
  /** EIP-712 types */
697
714
  types: {
698
- AddAndTrustServer: Array<{
715
+ AddServer: Array<{
699
716
  name: string;
700
717
  type: string;
701
718
  }>;
702
719
  };
703
720
  /** Primary type */
704
- primaryType: "AddAndTrustServer";
721
+ primaryType: "AddServer";
705
722
  /** Message to sign */
706
723
  message: AddAndTrustServerInput;
707
724
  }
@@ -711,9 +728,7 @@ interface AddAndTrustServerTypedData {
711
728
  * @category Permissions
712
729
  * @deprecated Use AddAndTrustServerTypedData instead
713
730
  */
714
- interface TrustServerTypedData {
715
- /** EIP-712 domain */
716
- domain: PermissionGrantDomain;
731
+ interface TrustServerTypedData extends GenericTypedData {
717
732
  /** EIP-712 types */
718
733
  types: {
719
734
  TrustServer: Array<{
@@ -731,9 +746,7 @@ interface TrustServerTypedData {
731
746
  *
732
747
  * @category Permissions
733
748
  */
734
- interface UntrustServerTypedData {
735
- /** EIP-712 domain */
736
- domain: PermissionGrantDomain;
749
+ interface UntrustServerTypedData extends GenericTypedData {
737
750
  /** EIP-712 types */
738
751
  types: {
739
752
  UntrustServer: Array<{
@@ -769,20 +782,20 @@ interface PermissionEvent {
769
782
  * @category Permissions
770
783
  */
771
784
  interface TrustedServerInfo {
772
- /** Server ID (numeric) */
773
- serverId: number;
785
+ /** Server ID */
786
+ id: bigint;
774
787
  /** Server owner address */
775
788
  owner: Address;
776
- /** Server URL */
777
- url: string;
778
789
  /** Server address */
779
790
  serverAddress: Address;
780
791
  /** Server public key */
781
792
  publicKey: string;
782
- /** Whether this server is trusted by the user */
783
- isTrusted: boolean;
784
- /** Index in user's trusted server list (if trusted) */
785
- trustIndex?: number;
793
+ /** Server URL */
794
+ url: string;
795
+ /** Start block when trust relationship began */
796
+ startBlock: bigint;
797
+ /** End block when trust relationship ended (0 if still active) */
798
+ endBlock: bigint;
786
799
  }
787
800
  /**
788
801
  * Paginated result for trusted server queries
@@ -857,6 +870,21 @@ interface Grantee {
857
870
  /** Permission IDs associated with this grantee */
858
871
  permissionIds: number[];
859
872
  }
873
+ /**
874
+ * Contract GranteeInfo structure returned from the contract
875
+ *
876
+ * @category Permissions
877
+ */
878
+ interface GranteeInfo {
879
+ /** Grantee owner address */
880
+ owner: Address;
881
+ /** Grantee address */
882
+ granteeAddress: Address;
883
+ /** Grantee public key */
884
+ publicKey: string;
885
+ /** Permission IDs associated with this grantee */
886
+ permissionIds: readonly bigint[];
887
+ }
860
888
  /**
861
889
  * Parameters for registering a grantee
862
890
  *
@@ -875,7 +903,7 @@ interface RegisterGranteeParams {
875
903
  *
876
904
  * @category Permissions
877
905
  */
878
- interface RegisterGranteeInput extends Record<string, unknown> {
906
+ interface RegisterGranteeInput extends RecordCompatible {
879
907
  /** User nonce */
880
908
  nonce: bigint;
881
909
  /** Grantee owner address */
@@ -890,9 +918,7 @@ interface RegisterGranteeInput extends Record<string, unknown> {
890
918
  *
891
919
  * @category Permissions
892
920
  */
893
- interface RegisterGranteeTypedData {
894
- /** EIP-712 domain */
895
- domain: PermissionGrantDomain;
921
+ interface RegisterGranteeTypedData extends GenericTypedData {
896
922
  /** EIP-712 types */
897
923
  types: {
898
924
  RegisterGrantee: Array<{
@@ -935,6 +961,68 @@ interface PaginatedGrantees {
935
961
  /** Whether there are more grantees beyond this page */
936
962
  hasMore: boolean;
937
963
  }
964
+ /**
965
+ * Contract Permission structure as used in ServerFilesAndPermissionInput
966
+ *
967
+ * @category Permissions
968
+ */
969
+ interface Permission {
970
+ /** Account address for the permission */
971
+ account: Address;
972
+ /** Permission key */
973
+ key: string;
974
+ }
975
+ /**
976
+ * Parameters for server files and permissions operations
977
+ *
978
+ * @category Permissions
979
+ */
980
+ interface ServerFilesAndPermissionParams {
981
+ /** Grantee ID */
982
+ granteeId: bigint;
983
+ /** Grant URL or grant data */
984
+ grant: string;
985
+ /** File URLs */
986
+ fileUrls: string[];
987
+ /** Schema IDs for each file - use 0 for files without schema validation */
988
+ schemaIds: number[];
989
+ /** Server address */
990
+ serverAddress: Address;
991
+ /** Server URL */
992
+ serverUrl: string;
993
+ /** Server public key */
994
+ serverPublicKey: string;
995
+ /** File permissions array - permissions for each file */
996
+ filePermissions: Permission[][];
997
+ }
998
+ /**
999
+ * EIP-712 typed data for server files and permissions messages
1000
+ *
1001
+ * @category Permissions
1002
+ */
1003
+ interface ServerFilesAndPermissionTypedData extends GenericTypedData {
1004
+ /** Message data structure */
1005
+ message: {
1006
+ /** User nonce */
1007
+ nonce: bigint;
1008
+ /** Grantee ID */
1009
+ granteeId: bigint;
1010
+ /** Grant URL */
1011
+ grant: string;
1012
+ /** File URLs */
1013
+ fileUrls: string[];
1014
+ /** Schema IDs for each file - use 0 for files without schema validation */
1015
+ schemaIds: bigint[];
1016
+ /** Server address */
1017
+ serverAddress: Address;
1018
+ /** Server URL */
1019
+ serverUrl: string;
1020
+ /** Server public key */
1021
+ serverPublicKey: string;
1022
+ /** File permissions array - permissions for each file */
1023
+ filePermissions: Permission[][];
1024
+ };
1025
+ }
938
1026
 
939
1027
  /**
940
1028
  * Marker interface to indicate that a Vana instance has storage configured.
@@ -1053,6 +1141,22 @@ interface RelayerCallbacks {
1053
1141
  * @returns Promise resolving to the transaction hash
1054
1142
  */
1055
1143
  submitAddAndTrustServer?: (typedData: AddAndTrustServerTypedData, signature: Hash) => Promise<Hash>;
1144
+ /**
1145
+ * Submit a signed permission addition transaction for relay
1146
+ *
1147
+ * @param typedData - The EIP-712 typed data that was signed
1148
+ * @param signature - The user's signature
1149
+ * @returns Promise resolving to the transaction hash
1150
+ */
1151
+ submitAddPermission?: (typedData: GenericTypedData, signature: Hash) => Promise<Hash>;
1152
+ /**
1153
+ * Submit a signed server files and permissions transaction for relay
1154
+ *
1155
+ * @param typedData - The EIP-712 typed data that was signed
1156
+ * @param signature - The user's signature
1157
+ * @returns Promise resolving to the transaction hash
1158
+ */
1159
+ submitAddServerFilesAndPermissions?: (typedData: ServerFilesAndPermissionTypedData, signature: Hash) => Promise<Hash>;
1056
1160
  /**
1057
1161
  * Submit a file addition for relay
1058
1162
  *
@@ -1554,7 +1658,7 @@ interface ConfigValidationResult {
1554
1658
  /**
1555
1659
  * Union type of all canonical Vana contract names
1556
1660
  */
1557
- type VanaContractName = "DataPermissions" | "DataPortabilityPermissions" | "DataPortabilityServers" | "DataPortabilityGrantees" | "DataRegistry" | "TeePool" | "ComputeEngine" | "TeePoolPhala" | "DataRefinerRegistry" | "QueryEngine" | "ComputeInstructionRegistry" | "TeePoolEphemeralStandard" | "TeePoolPersistentStandard" | "TeePoolPersistentGpu" | "TeePoolDedicatedStandard" | "TeePoolDedicatedGpu" | "VanaEpoch" | "DLPRegistry" | "DLPRegistryTreasury" | "DLPPerformance" | "DLPRewardDeployer" | "DLPRewardDeployerTreasury" | "DLPRewardSwap" | "SwapHelper" | "VanaPoolStaking" | "VanaPoolEntity" | "VanaPoolTreasury" | "DAT" | "DATFactory" | "DATPausable" | "DATVotes" | "DataLiquidityPool" | "DLPRoot";
1661
+ type VanaContractName = "DataPortabilityPermissions" | "DataPortabilityServers" | "DataPortabilityGrantees" | "DataRegistry" | "TeePool" | "ComputeEngine" | "TeePoolPhala" | "DataRefinerRegistry" | "QueryEngine" | "ComputeInstructionRegistry" | "TeePoolEphemeralStandard" | "TeePoolPersistentStandard" | "TeePoolPersistentGpu" | "TeePoolDedicatedStandard" | "TeePoolDedicatedGpu" | "VanaEpoch" | "DLPRegistry" | "DLPRegistryTreasury" | "DLPPerformance" | "DLPRewardDeployer" | "DLPRewardDeployerTreasury" | "DLPRewardSwap" | "SwapHelper" | "VanaPoolStaking" | "VanaPoolEntity" | "VanaPoolTreasury" | "DAT" | "DATFactory" | "DATPausable" | "DATVotes" | "DataLiquidityPool" | "DLPRoot";
1558
1662
  /**
1559
1663
  * Contract information with typed address and ABI
1560
1664
  */
@@ -1648,6 +1752,12 @@ interface UserFile$1 {
1648
1752
  transactionHash?: Address;
1649
1753
  /** Additional file properties and custom application data. */
1650
1754
  metadata?: FileMetadata;
1755
+ /**
1756
+ * Array of DLP IDs that have submitted proofs for this file.
1757
+ * Each proof represents verification or processing by a Data Liquidity Pool.
1758
+ * Obtain DLP details via `vana.data.getDLP(dlpId)`.
1759
+ */
1760
+ dlpIds?: number[];
1651
1761
  }
1652
1762
  /**
1653
1763
  * Provides optional metadata for uploaded files and content description.
@@ -2059,33 +2169,84 @@ interface BatchUploadResult {
2059
2169
  errors?: string[];
2060
2170
  }
2061
2171
  /**
2062
- * Represents a data schema in the refiner registry.
2172
+ * Schema metadata from the blockchain (without fetched definition).
2173
+ *
2174
+ * This represents the on-chain schema registration data before the
2175
+ * definition has been fetched from the storage URL.
2176
+ *
2177
+ * @category Data Management
2178
+ */
2179
+ interface SchemaMetadata {
2180
+ /** Schema ID */
2181
+ id: number;
2182
+ /** Schema name */
2183
+ name: string;
2184
+ /** Schema dialect ('json' or 'sqlite') */
2185
+ dialect: "json" | "sqlite";
2186
+ /** URL containing the schema definition */
2187
+ definitionUrl: string;
2188
+ }
2189
+ /**
2190
+ * Complete schema with all definition fields populated.
2191
+ * This is what schemas.get() returns - a schema with the definition fetched.
2192
+ */
2193
+ interface CompleteSchema extends SchemaMetadata {
2194
+ /** Version of the schema */
2195
+ version: string;
2196
+ /** Optional description of the schema */
2197
+ description?: string;
2198
+ /** Optional version of the dialect */
2199
+ dialectVersion?: string;
2200
+ /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' */
2201
+ schema: object | string;
2202
+ }
2203
+ /**
2204
+ * Schema with optional definition fields.
2063
2205
  *
2064
2206
  * Schemas define the structure and validation rules for user data processed by refiners.
2065
2207
  * They ensure data quality and consistency across the Vana network by specifying how
2066
2208
  * raw user data should be formatted, validated, and processed.
2067
2209
  *
2210
+ * When the definition has been fetched (via schemas.get() or schemas.list() with includeDefinitions),
2211
+ * the version and schema fields will be populated. Otherwise, only the metadata fields are present.
2212
+ *
2068
2213
  * @category Data Management
2069
2214
  * @example
2070
2215
  * ```typescript
2071
- * const socialMediaSchema: Schema = {
2216
+ * // Complete schema from schemas.get()
2217
+ * const completeSchema: Schema = {
2072
2218
  * id: 5,
2073
2219
  * name: 'Social Media Profile',
2074
- * type: 'JSON',
2075
- * url: 'ipfs://QmSchema...', // Schema definition file
2076
- * description: 'Schema for validating social media profile data'
2220
+ * dialect: 'json',
2221
+ * definitionUrl: 'ipfs://QmSchema...',
2222
+ * version: '1.0.0',
2223
+ * description: 'Schema for validating social media profile data',
2224
+ * schema: { // JSON Schema object
2225
+ * type: 'object',
2226
+ * properties: {
2227
+ * username: { type: 'string' }
2228
+ * }
2229
+ * }
2230
+ * };
2231
+ *
2232
+ * // Metadata-only schema from schemas.list() without includeDefinitions
2233
+ * const metadataSchema: Schema = {
2234
+ * id: 5,
2235
+ * name: 'Social Media Profile',
2236
+ * dialect: 'json',
2237
+ * definitionUrl: 'ipfs://QmSchema...'
2077
2238
  * };
2078
2239
  * ```
2079
2240
  */
2080
- interface Schema {
2081
- /** Schema ID */
2082
- id: number;
2083
- /** Schema name */
2084
- name: string;
2085
- /** Schema type */
2086
- type: string;
2087
- /** URL containing the schema definition */
2088
- definitionUrl: string;
2241
+ interface Schema extends SchemaMetadata {
2242
+ /** Version of the schema (present when definition is fetched) */
2243
+ version?: string;
2244
+ /** Optional description of the schema */
2245
+ description?: string;
2246
+ /** Optional version of the dialect */
2247
+ dialectVersion?: string;
2248
+ /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' (present when definition is fetched) */
2249
+ schema?: object | string;
2089
2250
  }
2090
2251
  /**
2091
2252
  * Represents a refiner with schema information
@@ -2114,8 +2275,8 @@ interface Refiner {
2114
2275
  interface AddSchemaParams {
2115
2276
  /** Schema name */
2116
2277
  name: string;
2117
- /** Schema type */
2118
- type: string;
2278
+ /** Schema dialect */
2279
+ dialect: string;
2119
2280
  /** URL containing the schema definition */
2120
2281
  definitionUrl: string;
2121
2282
  }
@@ -2190,13 +2351,7 @@ interface UpdateSchemaIdResult {
2190
2351
  transactionHash: Hash;
2191
2352
  }
2192
2353
  /**
2193
- * Query mode for trusted server retrieval
2194
- *
2195
- * @category Data Management
2196
- */
2197
- type TrustedServerQueryMode = "subgraph" | "rpc" | "auto";
2198
- /**
2199
- * Trusted server data structure (unified format for both subgraph and RPC modes)
2354
+ * Trusted server data structure
2200
2355
  *
2201
2356
  * @category Data Management
2202
2357
  */
@@ -2215,42 +2370,23 @@ interface TrustedServer {
2215
2370
  trustIndex?: number;
2216
2371
  }
2217
2372
  /**
2218
- * Parameters for getUserTrustedServers with dual-mode support
2373
+ * Parameters for getUserTrustedServers method
2219
2374
  *
2220
2375
  * @category Data Management
2221
2376
  */
2222
2377
  interface GetUserTrustedServersParams {
2223
- /** User address to query */
2378
+ /** User address to query trusted servers for */
2224
2379
  user: Address;
2225
- /** Query mode: 'subgraph' (fast, requires subgraph), 'rpc' (direct contract), or 'auto' (tries subgraph first) */
2226
- mode?: TrustedServerQueryMode;
2227
- /** Subgraph URL (required for subgraph mode) */
2380
+ /** Optional subgraph URL to override default */
2228
2381
  subgraphUrl?: string;
2229
- /** Pagination limit (applies to RPC mode) */
2382
+ /** Maximum number of results */
2230
2383
  limit?: number;
2231
- /** Pagination offset (applies to RPC mode) */
2384
+ /** Number of results to skip */
2232
2385
  offset?: number;
2233
2386
  }
2234
- /**
2235
- * Result of getUserTrustedServers query
2236
- *
2237
- * @category Data Management
2238
- */
2239
- interface GetUserTrustedServersResult {
2240
- /** Array of trusted servers */
2241
- servers: TrustedServer[];
2242
- /** Query mode that was actually used */
2243
- usedMode: TrustedServerQueryMode;
2244
- /** Total count (only available in RPC mode) */
2245
- total?: number;
2246
- /** Whether there are more servers (pagination info for RPC mode) */
2247
- hasMore?: boolean;
2248
- /** Any warnings or fallback information */
2249
- warnings?: string[];
2250
- }
2251
2387
 
2252
2388
  declare const contractAbis: {
2253
- readonly DataPermissions: readonly [{
2389
+ readonly DataPortabilityPermissions: readonly [{
2254
2390
  readonly inputs: readonly [];
2255
2391
  readonly stateMutability: "nonpayable";
2256
2392
  readonly type: "constructor";
@@ -2354,6 +2490,30 @@ declare const contractAbis: {
2354
2490
  }];
2355
2491
  readonly name: "InvalidNonce";
2356
2492
  readonly type: "error";
2493
+ }, {
2494
+ readonly inputs: readonly [{
2495
+ readonly internalType: "uint256";
2496
+ readonly name: "filesLength";
2497
+ readonly type: "uint256";
2498
+ }, {
2499
+ readonly internalType: "uint256";
2500
+ readonly name: "permissionsLength";
2501
+ readonly type: "uint256";
2502
+ }];
2503
+ readonly name: "InvalidPermissionsLength";
2504
+ readonly type: "error";
2505
+ }, {
2506
+ readonly inputs: readonly [{
2507
+ readonly internalType: "uint256";
2508
+ readonly name: "filesLength";
2509
+ readonly type: "uint256";
2510
+ }, {
2511
+ readonly internalType: "uint256";
2512
+ readonly name: "schemaIdsLength";
2513
+ readonly type: "uint256";
2514
+ }];
2515
+ readonly name: "InvalidSchemaIdsLength";
2516
+ readonly type: "error";
2357
2517
  }, {
2358
2518
  readonly inputs: readonly [];
2359
2519
  readonly name: "InvalidSignature";
@@ -2612,6 +2772,70 @@ declare const contractAbis: {
2612
2772
  }];
2613
2773
  readonly stateMutability: "nonpayable";
2614
2774
  readonly type: "function";
2775
+ }, {
2776
+ readonly inputs: readonly [{
2777
+ readonly components: readonly [{
2778
+ readonly internalType: "uint256";
2779
+ readonly name: "nonce";
2780
+ readonly type: "uint256";
2781
+ }, {
2782
+ readonly internalType: "uint256";
2783
+ readonly name: "granteeId";
2784
+ readonly type: "uint256";
2785
+ }, {
2786
+ readonly internalType: "string";
2787
+ readonly name: "grant";
2788
+ readonly type: "string";
2789
+ }, {
2790
+ readonly internalType: "string[]";
2791
+ readonly name: "fileUrls";
2792
+ readonly type: "string[]";
2793
+ }, {
2794
+ readonly internalType: "uint256[]";
2795
+ readonly name: "schemaIds";
2796
+ readonly type: "uint256[]";
2797
+ }, {
2798
+ readonly internalType: "address";
2799
+ readonly name: "serverAddress";
2800
+ readonly type: "address";
2801
+ }, {
2802
+ readonly internalType: "string";
2803
+ readonly name: "serverUrl";
2804
+ readonly type: "string";
2805
+ }, {
2806
+ readonly internalType: "string";
2807
+ readonly name: "serverPublicKey";
2808
+ readonly type: "string";
2809
+ }, {
2810
+ readonly components: readonly [{
2811
+ readonly internalType: "address";
2812
+ readonly name: "account";
2813
+ readonly type: "address";
2814
+ }, {
2815
+ readonly internalType: "string";
2816
+ readonly name: "key";
2817
+ readonly type: "string";
2818
+ }];
2819
+ readonly internalType: "struct IDataRegistry.Permission[][]";
2820
+ readonly name: "filePermissions";
2821
+ readonly type: "tuple[][]";
2822
+ }];
2823
+ readonly internalType: "struct IDataPortabilityPermissions.ServerFilesAndPermissionInput";
2824
+ readonly name: "serverFilesAndPermissionInput";
2825
+ readonly type: "tuple";
2826
+ }, {
2827
+ readonly internalType: "bytes";
2828
+ readonly name: "signature";
2829
+ readonly type: "bytes";
2830
+ }];
2831
+ readonly name: "addServerFilesAndPermissions";
2832
+ readonly outputs: readonly [{
2833
+ readonly internalType: "uint256";
2834
+ readonly name: "";
2835
+ readonly type: "uint256";
2836
+ }];
2837
+ readonly stateMutability: "nonpayable";
2838
+ readonly type: "function";
2615
2839
  }, {
2616
2840
  readonly inputs: readonly [];
2617
2841
  readonly name: "dataPortabilityGrantees";
@@ -2776,20 +3000,6 @@ declare const contractAbis: {
2776
3000
  readonly outputs: readonly [];
2777
3001
  readonly stateMutability: "nonpayable";
2778
3002
  readonly type: "function";
2779
- }, {
2780
- readonly inputs: readonly [{
2781
- readonly internalType: "uint256";
2782
- readonly name: "permissionId";
2783
- readonly type: "uint256";
2784
- }];
2785
- readonly name: "isActivePermission";
2786
- readonly outputs: readonly [{
2787
- readonly internalType: "bool";
2788
- readonly name: "";
2789
- readonly type: "bool";
2790
- }];
2791
- readonly stateMutability: "view";
2792
- readonly type: "function";
2793
3003
  }, {
2794
3004
  readonly inputs: readonly [{
2795
3005
  readonly internalType: "address";
@@ -2876,10 +3086,6 @@ declare const contractAbis: {
2876
3086
  readonly internalType: "string";
2877
3087
  readonly name: "grant";
2878
3088
  readonly type: "string";
2879
- }, {
2880
- readonly internalType: "bytes";
2881
- readonly name: "signature";
2882
- readonly type: "bytes";
2883
3089
  }, {
2884
3090
  readonly internalType: "uint256";
2885
3091
  readonly name: "startBlock";
@@ -3167,7 +3373,7 @@ declare const contractAbis: {
3167
3373
  readonly stateMutability: "pure";
3168
3374
  readonly type: "function";
3169
3375
  }];
3170
- readonly DataPortabilityPermissions: readonly [{
3376
+ readonly DataPortabilityServers: readonly [{
3171
3377
  readonly inputs: readonly [];
3172
3378
  readonly stateMutability: "nonpayable";
3173
3379
  readonly type: "constructor";
@@ -3229,31 +3435,23 @@ declare const contractAbis: {
3229
3435
  readonly type: "error";
3230
3436
  }, {
3231
3437
  readonly inputs: readonly [];
3232
- readonly name: "EmptyGrant";
3438
+ readonly name: "EmptyPublicKey";
3233
3439
  readonly type: "error";
3234
3440
  }, {
3235
3441
  readonly inputs: readonly [];
3236
- readonly name: "EnforcedPause";
3442
+ readonly name: "EmptyUrl";
3237
3443
  readonly type: "error";
3238
3444
  }, {
3239
3445
  readonly inputs: readonly [];
3240
- readonly name: "ExpectedPause";
3446
+ readonly name: "EnforcedPause";
3241
3447
  readonly type: "error";
3242
3448
  }, {
3243
3449
  readonly inputs: readonly [];
3244
- readonly name: "FailedInnerCall";
3450
+ readonly name: "ExpectedPause";
3245
3451
  readonly type: "error";
3246
3452
  }, {
3247
3453
  readonly inputs: readonly [];
3248
- readonly name: "GranteeNotFound";
3249
- readonly type: "error";
3250
- }, {
3251
- readonly inputs: readonly [{
3252
- readonly internalType: "uint256";
3253
- readonly name: "permissionId";
3254
- readonly type: "uint256";
3255
- }];
3256
- readonly name: "InactivePermission";
3454
+ readonly name: "FailedInnerCall";
3257
3455
  readonly type: "error";
3258
3456
  }, {
3259
3457
  readonly inputs: readonly [];
@@ -3273,960 +3471,51 @@ declare const contractAbis: {
3273
3471
  readonly type: "error";
3274
3472
  }, {
3275
3473
  readonly inputs: readonly [];
3276
- readonly name: "InvalidSignature";
3474
+ readonly name: "NotInitializing";
3277
3475
  readonly type: "error";
3278
3476
  }, {
3279
3477
  readonly inputs: readonly [{
3280
3478
  readonly internalType: "address";
3281
- readonly name: "fileOwner";
3479
+ readonly name: "serverOwner";
3282
3480
  readonly type: "address";
3283
3481
  }, {
3284
3482
  readonly internalType: "address";
3285
3483
  readonly name: "requestor";
3286
3484
  readonly type: "address";
3287
3485
  }];
3288
- readonly name: "NotFileOwner";
3486
+ readonly name: "NotServerOwner";
3289
3487
  readonly type: "error";
3290
3488
  }, {
3291
3489
  readonly inputs: readonly [];
3292
- readonly name: "NotInitializing";
3490
+ readonly name: "ServerAlreadyRegistered";
3491
+ readonly type: "error";
3492
+ }, {
3493
+ readonly inputs: readonly [];
3494
+ readonly name: "ServerAlreadyTrusted";
3495
+ readonly type: "error";
3496
+ }, {
3497
+ readonly inputs: readonly [];
3498
+ readonly name: "ServerAlreadyUntrusted";
3499
+ readonly type: "error";
3500
+ }, {
3501
+ readonly inputs: readonly [];
3502
+ readonly name: "ServerNotFound";
3503
+ readonly type: "error";
3504
+ }, {
3505
+ readonly inputs: readonly [];
3506
+ readonly name: "ServerNotTrusted";
3293
3507
  readonly type: "error";
3294
3508
  }, {
3295
3509
  readonly inputs: readonly [{
3296
- readonly internalType: "address";
3297
- readonly name: "permissionOwner";
3298
- readonly type: "address";
3510
+ readonly internalType: "string";
3511
+ readonly name: "existingUrl";
3512
+ readonly type: "string";
3299
3513
  }, {
3300
- readonly internalType: "address";
3301
- readonly name: "requestor";
3302
- readonly type: "address";
3514
+ readonly internalType: "string";
3515
+ readonly name: "providedUrl";
3516
+ readonly type: "string";
3303
3517
  }];
3304
- readonly name: "NotPermissionGrantor";
3305
- readonly type: "error";
3306
- }, {
3307
- readonly inputs: readonly [];
3308
- readonly name: "UUPSUnauthorizedCallContext";
3309
- readonly type: "error";
3310
- }, {
3311
- readonly inputs: readonly [{
3312
- readonly internalType: "bytes32";
3313
- readonly name: "slot";
3314
- readonly type: "bytes32";
3315
- }];
3316
- readonly name: "UUPSUnsupportedProxiableUUID";
3317
- readonly type: "error";
3318
- }, {
3319
- readonly inputs: readonly [];
3320
- readonly name: "ZeroAddress";
3321
- readonly type: "error";
3322
- }, {
3323
- readonly anonymous: false;
3324
- readonly inputs: readonly [];
3325
- readonly name: "EIP712DomainChanged";
3326
- readonly type: "event";
3327
- }, {
3328
- readonly anonymous: false;
3329
- readonly inputs: readonly [{
3330
- readonly indexed: false;
3331
- readonly internalType: "uint64";
3332
- readonly name: "version";
3333
- readonly type: "uint64";
3334
- }];
3335
- readonly name: "Initialized";
3336
- readonly type: "event";
3337
- }, {
3338
- readonly anonymous: false;
3339
- readonly inputs: readonly [{
3340
- readonly indexed: false;
3341
- readonly internalType: "address";
3342
- readonly name: "account";
3343
- readonly type: "address";
3344
- }];
3345
- readonly name: "Paused";
3346
- readonly type: "event";
3347
- }, {
3348
- readonly anonymous: false;
3349
- readonly inputs: readonly [{
3350
- readonly indexed: true;
3351
- readonly internalType: "uint256";
3352
- readonly name: "permissionId";
3353
- readonly type: "uint256";
3354
- }, {
3355
- readonly indexed: true;
3356
- readonly internalType: "address";
3357
- readonly name: "user";
3358
- readonly type: "address";
3359
- }, {
3360
- readonly indexed: true;
3361
- readonly internalType: "uint256";
3362
- readonly name: "granteeId";
3363
- readonly type: "uint256";
3364
- }, {
3365
- readonly indexed: false;
3366
- readonly internalType: "string";
3367
- readonly name: "grant";
3368
- readonly type: "string";
3369
- }, {
3370
- readonly indexed: false;
3371
- readonly internalType: "uint256[]";
3372
- readonly name: "fileIds";
3373
- readonly type: "uint256[]";
3374
- }];
3375
- readonly name: "PermissionAdded";
3376
- readonly type: "event";
3377
- }, {
3378
- readonly anonymous: false;
3379
- readonly inputs: readonly [{
3380
- readonly indexed: true;
3381
- readonly internalType: "uint256";
3382
- readonly name: "permissionId";
3383
- readonly type: "uint256";
3384
- }];
3385
- readonly name: "PermissionRevoked";
3386
- readonly type: "event";
3387
- }, {
3388
- readonly anonymous: false;
3389
- readonly inputs: readonly [{
3390
- readonly indexed: true;
3391
- readonly internalType: "bytes32";
3392
- readonly name: "role";
3393
- readonly type: "bytes32";
3394
- }, {
3395
- readonly indexed: true;
3396
- readonly internalType: "bytes32";
3397
- readonly name: "previousAdminRole";
3398
- readonly type: "bytes32";
3399
- }, {
3400
- readonly indexed: true;
3401
- readonly internalType: "bytes32";
3402
- readonly name: "newAdminRole";
3403
- readonly type: "bytes32";
3404
- }];
3405
- readonly name: "RoleAdminChanged";
3406
- readonly type: "event";
3407
- }, {
3408
- readonly anonymous: false;
3409
- readonly inputs: readonly [{
3410
- readonly indexed: true;
3411
- readonly internalType: "bytes32";
3412
- readonly name: "role";
3413
- readonly type: "bytes32";
3414
- }, {
3415
- readonly indexed: true;
3416
- readonly internalType: "address";
3417
- readonly name: "account";
3418
- readonly type: "address";
3419
- }, {
3420
- readonly indexed: true;
3421
- readonly internalType: "address";
3422
- readonly name: "sender";
3423
- readonly type: "address";
3424
- }];
3425
- readonly name: "RoleGranted";
3426
- readonly type: "event";
3427
- }, {
3428
- readonly anonymous: false;
3429
- readonly inputs: readonly [{
3430
- readonly indexed: true;
3431
- readonly internalType: "bytes32";
3432
- readonly name: "role";
3433
- readonly type: "bytes32";
3434
- }, {
3435
- readonly indexed: true;
3436
- readonly internalType: "address";
3437
- readonly name: "account";
3438
- readonly type: "address";
3439
- }, {
3440
- readonly indexed: true;
3441
- readonly internalType: "address";
3442
- readonly name: "sender";
3443
- readonly type: "address";
3444
- }];
3445
- readonly name: "RoleRevoked";
3446
- readonly type: "event";
3447
- }, {
3448
- readonly anonymous: false;
3449
- readonly inputs: readonly [{
3450
- readonly indexed: false;
3451
- readonly internalType: "address";
3452
- readonly name: "account";
3453
- readonly type: "address";
3454
- }];
3455
- readonly name: "Unpaused";
3456
- readonly type: "event";
3457
- }, {
3458
- readonly anonymous: false;
3459
- readonly inputs: readonly [{
3460
- readonly indexed: true;
3461
- readonly internalType: "address";
3462
- readonly name: "implementation";
3463
- readonly type: "address";
3464
- }];
3465
- readonly name: "Upgraded";
3466
- readonly type: "event";
3467
- }, {
3468
- readonly inputs: readonly [];
3469
- readonly name: "DEFAULT_ADMIN_ROLE";
3470
- readonly outputs: readonly [{
3471
- readonly internalType: "bytes32";
3472
- readonly name: "";
3473
- readonly type: "bytes32";
3474
- }];
3475
- readonly stateMutability: "view";
3476
- readonly type: "function";
3477
- }, {
3478
- readonly inputs: readonly [];
3479
- readonly name: "MAINTAINER_ROLE";
3480
- readonly outputs: readonly [{
3481
- readonly internalType: "bytes32";
3482
- readonly name: "";
3483
- readonly type: "bytes32";
3484
- }];
3485
- readonly stateMutability: "view";
3486
- readonly type: "function";
3487
- }, {
3488
- readonly inputs: readonly [];
3489
- readonly name: "UPGRADE_INTERFACE_VERSION";
3490
- readonly outputs: readonly [{
3491
- readonly internalType: "string";
3492
- readonly name: "";
3493
- readonly type: "string";
3494
- }];
3495
- readonly stateMutability: "view";
3496
- readonly type: "function";
3497
- }, {
3498
- readonly inputs: readonly [{
3499
- readonly components: readonly [{
3500
- readonly internalType: "uint256";
3501
- readonly name: "nonce";
3502
- readonly type: "uint256";
3503
- }, {
3504
- readonly internalType: "uint256";
3505
- readonly name: "granteeId";
3506
- readonly type: "uint256";
3507
- }, {
3508
- readonly internalType: "string";
3509
- readonly name: "grant";
3510
- readonly type: "string";
3511
- }, {
3512
- readonly internalType: "uint256[]";
3513
- readonly name: "fileIds";
3514
- readonly type: "uint256[]";
3515
- }];
3516
- readonly internalType: "struct IDataPortabilityPermissions.PermissionInput";
3517
- readonly name: "permissionInput";
3518
- readonly type: "tuple";
3519
- }, {
3520
- readonly internalType: "bytes";
3521
- readonly name: "signature";
3522
- readonly type: "bytes";
3523
- }];
3524
- readonly name: "addPermission";
3525
- readonly outputs: readonly [{
3526
- readonly internalType: "uint256";
3527
- readonly name: "";
3528
- readonly type: "uint256";
3529
- }];
3530
- readonly stateMutability: "nonpayable";
3531
- readonly type: "function";
3532
- }, {
3533
- readonly inputs: readonly [];
3534
- readonly name: "dataPortabilityGrantees";
3535
- readonly outputs: readonly [{
3536
- readonly internalType: "contract IDataPortabilityGrantees";
3537
- readonly name: "";
3538
- readonly type: "address";
3539
- }];
3540
- readonly stateMutability: "view";
3541
- readonly type: "function";
3542
- }, {
3543
- readonly inputs: readonly [];
3544
- readonly name: "dataPortabilityServers";
3545
- readonly outputs: readonly [{
3546
- readonly internalType: "contract IDataPortabilityServers";
3547
- readonly name: "";
3548
- readonly type: "address";
3549
- }];
3550
- readonly stateMutability: "view";
3551
- readonly type: "function";
3552
- }, {
3553
- readonly inputs: readonly [];
3554
- readonly name: "dataRegistry";
3555
- readonly outputs: readonly [{
3556
- readonly internalType: "contract IDataRegistry";
3557
- readonly name: "";
3558
- readonly type: "address";
3559
- }];
3560
- readonly stateMutability: "view";
3561
- readonly type: "function";
3562
- }, {
3563
- readonly inputs: readonly [];
3564
- readonly name: "eip712Domain";
3565
- readonly outputs: readonly [{
3566
- readonly internalType: "bytes1";
3567
- readonly name: "fields";
3568
- readonly type: "bytes1";
3569
- }, {
3570
- readonly internalType: "string";
3571
- readonly name: "name";
3572
- readonly type: "string";
3573
- }, {
3574
- readonly internalType: "string";
3575
- readonly name: "version";
3576
- readonly type: "string";
3577
- }, {
3578
- readonly internalType: "uint256";
3579
- readonly name: "chainId";
3580
- readonly type: "uint256";
3581
- }, {
3582
- readonly internalType: "address";
3583
- readonly name: "verifyingContract";
3584
- readonly type: "address";
3585
- }, {
3586
- readonly internalType: "bytes32";
3587
- readonly name: "salt";
3588
- readonly type: "bytes32";
3589
- }, {
3590
- readonly internalType: "uint256[]";
3591
- readonly name: "extensions";
3592
- readonly type: "uint256[]";
3593
- }];
3594
- readonly stateMutability: "view";
3595
- readonly type: "function";
3596
- }, {
3597
- readonly inputs: readonly [{
3598
- readonly internalType: "uint256";
3599
- readonly name: "fileId";
3600
- readonly type: "uint256";
3601
- }];
3602
- readonly name: "filePermissionIds";
3603
- readonly outputs: readonly [{
3604
- readonly internalType: "uint256[]";
3605
- readonly name: "";
3606
- readonly type: "uint256[]";
3607
- }];
3608
- readonly stateMutability: "view";
3609
- readonly type: "function";
3610
- }, {
3611
- readonly inputs: readonly [{
3612
- readonly internalType: "uint256";
3613
- readonly name: "fileId";
3614
- readonly type: "uint256";
3615
- }];
3616
- readonly name: "filePermissions";
3617
- readonly outputs: readonly [{
3618
- readonly internalType: "uint256[]";
3619
- readonly name: "";
3620
- readonly type: "uint256[]";
3621
- }];
3622
- readonly stateMutability: "view";
3623
- readonly type: "function";
3624
- }, {
3625
- readonly inputs: readonly [{
3626
- readonly internalType: "bytes32";
3627
- readonly name: "role";
3628
- readonly type: "bytes32";
3629
- }];
3630
- readonly name: "getRoleAdmin";
3631
- readonly outputs: readonly [{
3632
- readonly internalType: "bytes32";
3633
- readonly name: "";
3634
- readonly type: "bytes32";
3635
- }];
3636
- readonly stateMutability: "view";
3637
- readonly type: "function";
3638
- }, {
3639
- readonly inputs: readonly [{
3640
- readonly internalType: "bytes32";
3641
- readonly name: "role";
3642
- readonly type: "bytes32";
3643
- }, {
3644
- readonly internalType: "address";
3645
- readonly name: "account";
3646
- readonly type: "address";
3647
- }];
3648
- readonly name: "grantRole";
3649
- readonly outputs: readonly [];
3650
- readonly stateMutability: "nonpayable";
3651
- readonly type: "function";
3652
- }, {
3653
- readonly inputs: readonly [{
3654
- readonly internalType: "bytes32";
3655
- readonly name: "role";
3656
- readonly type: "bytes32";
3657
- }, {
3658
- readonly internalType: "address";
3659
- readonly name: "account";
3660
- readonly type: "address";
3661
- }];
3662
- readonly name: "hasRole";
3663
- readonly outputs: readonly [{
3664
- readonly internalType: "bool";
3665
- readonly name: "";
3666
- readonly type: "bool";
3667
- }];
3668
- readonly stateMutability: "view";
3669
- readonly type: "function";
3670
- }, {
3671
- readonly inputs: readonly [{
3672
- readonly internalType: "address";
3673
- readonly name: "trustedForwarderAddress";
3674
- readonly type: "address";
3675
- }, {
3676
- readonly internalType: "address";
3677
- readonly name: "ownerAddress";
3678
- readonly type: "address";
3679
- }, {
3680
- readonly internalType: "contract IDataRegistry";
3681
- readonly name: "dataRegistryAddress";
3682
- readonly type: "address";
3683
- }, {
3684
- readonly internalType: "contract IDataPortabilityServers";
3685
- readonly name: "serversContractAddr";
3686
- readonly type: "address";
3687
- }, {
3688
- readonly internalType: "contract IDataPortabilityGrantees";
3689
- readonly name: "granteesContractAddr";
3690
- readonly type: "address";
3691
- }];
3692
- readonly name: "initialize";
3693
- readonly outputs: readonly [];
3694
- readonly stateMutability: "nonpayable";
3695
- readonly type: "function";
3696
- }, {
3697
- readonly inputs: readonly [{
3698
- readonly internalType: "uint256";
3699
- readonly name: "permissionId";
3700
- readonly type: "uint256";
3701
- }];
3702
- readonly name: "isActivePermission";
3703
- readonly outputs: readonly [{
3704
- readonly internalType: "bool";
3705
- readonly name: "";
3706
- readonly type: "bool";
3707
- }];
3708
- readonly stateMutability: "view";
3709
- readonly type: "function";
3710
- }, {
3711
- readonly inputs: readonly [{
3712
- readonly internalType: "address";
3713
- readonly name: "forwarder";
3714
- readonly type: "address";
3715
- }];
3716
- readonly name: "isTrustedForwarder";
3717
- readonly outputs: readonly [{
3718
- readonly internalType: "bool";
3719
- readonly name: "";
3720
- readonly type: "bool";
3721
- }];
3722
- readonly stateMutability: "view";
3723
- readonly type: "function";
3724
- }, {
3725
- readonly inputs: readonly [{
3726
- readonly internalType: "bytes[]";
3727
- readonly name: "data";
3728
- readonly type: "bytes[]";
3729
- }];
3730
- readonly name: "multicall";
3731
- readonly outputs: readonly [{
3732
- readonly internalType: "bytes[]";
3733
- readonly name: "results";
3734
- readonly type: "bytes[]";
3735
- }];
3736
- readonly stateMutability: "nonpayable";
3737
- readonly type: "function";
3738
- }, {
3739
- readonly inputs: readonly [];
3740
- readonly name: "pause";
3741
- readonly outputs: readonly [];
3742
- readonly stateMutability: "nonpayable";
3743
- readonly type: "function";
3744
- }, {
3745
- readonly inputs: readonly [];
3746
- readonly name: "paused";
3747
- readonly outputs: readonly [{
3748
- readonly internalType: "bool";
3749
- readonly name: "";
3750
- readonly type: "bool";
3751
- }];
3752
- readonly stateMutability: "view";
3753
- readonly type: "function";
3754
- }, {
3755
- readonly inputs: readonly [{
3756
- readonly internalType: "uint256";
3757
- readonly name: "permissionId";
3758
- readonly type: "uint256";
3759
- }];
3760
- readonly name: "permissionFileIds";
3761
- readonly outputs: readonly [{
3762
- readonly internalType: "uint256[]";
3763
- readonly name: "";
3764
- readonly type: "uint256[]";
3765
- }];
3766
- readonly stateMutability: "view";
3767
- readonly type: "function";
3768
- }, {
3769
- readonly inputs: readonly [{
3770
- readonly internalType: "uint256";
3771
- readonly name: "permissionId";
3772
- readonly type: "uint256";
3773
- }];
3774
- readonly name: "permissions";
3775
- readonly outputs: readonly [{
3776
- readonly components: readonly [{
3777
- readonly internalType: "uint256";
3778
- readonly name: "id";
3779
- readonly type: "uint256";
3780
- }, {
3781
- readonly internalType: "address";
3782
- readonly name: "grantor";
3783
- readonly type: "address";
3784
- }, {
3785
- readonly internalType: "uint256";
3786
- readonly name: "nonce";
3787
- readonly type: "uint256";
3788
- }, {
3789
- readonly internalType: "uint256";
3790
- readonly name: "granteeId";
3791
- readonly type: "uint256";
3792
- }, {
3793
- readonly internalType: "string";
3794
- readonly name: "grant";
3795
- readonly type: "string";
3796
- }, {
3797
- readonly internalType: "bytes";
3798
- readonly name: "signature";
3799
- readonly type: "bytes";
3800
- }, {
3801
- readonly internalType: "uint256";
3802
- readonly name: "startBlock";
3803
- readonly type: "uint256";
3804
- }, {
3805
- readonly internalType: "uint256";
3806
- readonly name: "endBlock";
3807
- readonly type: "uint256";
3808
- }, {
3809
- readonly internalType: "uint256[]";
3810
- readonly name: "fileIds";
3811
- readonly type: "uint256[]";
3812
- }];
3813
- readonly internalType: "struct IDataPortabilityPermissions.PermissionInfo";
3814
- readonly name: "";
3815
- readonly type: "tuple";
3816
- }];
3817
- readonly stateMutability: "view";
3818
- readonly type: "function";
3819
- }, {
3820
- readonly inputs: readonly [];
3821
- readonly name: "permissionsCount";
3822
- readonly outputs: readonly [{
3823
- readonly internalType: "uint256";
3824
- readonly name: "";
3825
- readonly type: "uint256";
3826
- }];
3827
- readonly stateMutability: "view";
3828
- readonly type: "function";
3829
- }, {
3830
- readonly inputs: readonly [];
3831
- readonly name: "proxiableUUID";
3832
- readonly outputs: readonly [{
3833
- readonly internalType: "bytes32";
3834
- readonly name: "";
3835
- readonly type: "bytes32";
3836
- }];
3837
- readonly stateMutability: "view";
3838
- readonly type: "function";
3839
- }, {
3840
- readonly inputs: readonly [{
3841
- readonly internalType: "bytes32";
3842
- readonly name: "role";
3843
- readonly type: "bytes32";
3844
- }, {
3845
- readonly internalType: "address";
3846
- readonly name: "callerConfirmation";
3847
- readonly type: "address";
3848
- }];
3849
- readonly name: "renounceRole";
3850
- readonly outputs: readonly [];
3851
- readonly stateMutability: "nonpayable";
3852
- readonly type: "function";
3853
- }, {
3854
- readonly inputs: readonly [{
3855
- readonly internalType: "uint256";
3856
- readonly name: "permissionId";
3857
- readonly type: "uint256";
3858
- }];
3859
- readonly name: "revokePermission";
3860
- readonly outputs: readonly [];
3861
- readonly stateMutability: "nonpayable";
3862
- readonly type: "function";
3863
- }, {
3864
- readonly inputs: readonly [{
3865
- readonly components: readonly [{
3866
- readonly internalType: "uint256";
3867
- readonly name: "nonce";
3868
- readonly type: "uint256";
3869
- }, {
3870
- readonly internalType: "uint256";
3871
- readonly name: "permissionId";
3872
- readonly type: "uint256";
3873
- }];
3874
- readonly internalType: "struct IDataPortabilityPermissions.RevokePermissionInput";
3875
- readonly name: "revokePermissionInput";
3876
- readonly type: "tuple";
3877
- }, {
3878
- readonly internalType: "bytes";
3879
- readonly name: "signature";
3880
- readonly type: "bytes";
3881
- }];
3882
- readonly name: "revokePermissionWithSignature";
3883
- readonly outputs: readonly [];
3884
- readonly stateMutability: "nonpayable";
3885
- readonly type: "function";
3886
- }, {
3887
- readonly inputs: readonly [{
3888
- readonly internalType: "bytes32";
3889
- readonly name: "role";
3890
- readonly type: "bytes32";
3891
- }, {
3892
- readonly internalType: "address";
3893
- readonly name: "account";
3894
- readonly type: "address";
3895
- }];
3896
- readonly name: "revokeRole";
3897
- readonly outputs: readonly [];
3898
- readonly stateMutability: "nonpayable";
3899
- readonly type: "function";
3900
- }, {
3901
- readonly inputs: readonly [{
3902
- readonly internalType: "bytes32";
3903
- readonly name: "role";
3904
- readonly type: "bytes32";
3905
- }, {
3906
- readonly internalType: "bytes32";
3907
- readonly name: "adminRole";
3908
- readonly type: "bytes32";
3909
- }];
3910
- readonly name: "setRoleAdmin";
3911
- readonly outputs: readonly [];
3912
- readonly stateMutability: "nonpayable";
3913
- readonly type: "function";
3914
- }, {
3915
- readonly inputs: readonly [{
3916
- readonly internalType: "bytes4";
3917
- readonly name: "interfaceId";
3918
- readonly type: "bytes4";
3919
- }];
3920
- readonly name: "supportsInterface";
3921
- readonly outputs: readonly [{
3922
- readonly internalType: "bool";
3923
- readonly name: "";
3924
- readonly type: "bool";
3925
- }];
3926
- readonly stateMutability: "view";
3927
- readonly type: "function";
3928
- }, {
3929
- readonly inputs: readonly [];
3930
- readonly name: "trustedForwarder";
3931
- readonly outputs: readonly [{
3932
- readonly internalType: "address";
3933
- readonly name: "";
3934
- readonly type: "address";
3935
- }];
3936
- readonly stateMutability: "view";
3937
- readonly type: "function";
3938
- }, {
3939
- readonly inputs: readonly [];
3940
- readonly name: "unpause";
3941
- readonly outputs: readonly [];
3942
- readonly stateMutability: "nonpayable";
3943
- readonly type: "function";
3944
- }, {
3945
- readonly inputs: readonly [{
3946
- readonly internalType: "contract IDataRegistry";
3947
- readonly name: "newDataRegistry";
3948
- readonly type: "address";
3949
- }];
3950
- readonly name: "updateDataRegistry";
3951
- readonly outputs: readonly [];
3952
- readonly stateMutability: "nonpayable";
3953
- readonly type: "function";
3954
- }, {
3955
- readonly inputs: readonly [{
3956
- readonly internalType: "contract IDataPortabilityGrantees";
3957
- readonly name: "newGranteesContract";
3958
- readonly type: "address";
3959
- }];
3960
- readonly name: "updateGranteesContract";
3961
- readonly outputs: readonly [];
3962
- readonly stateMutability: "nonpayable";
3963
- readonly type: "function";
3964
- }, {
3965
- readonly inputs: readonly [{
3966
- readonly internalType: "contract IDataPortabilityServers";
3967
- readonly name: "newServersContract";
3968
- readonly type: "address";
3969
- }];
3970
- readonly name: "updateServersContract";
3971
- readonly outputs: readonly [];
3972
- readonly stateMutability: "nonpayable";
3973
- readonly type: "function";
3974
- }, {
3975
- readonly inputs: readonly [{
3976
- readonly internalType: "address";
3977
- readonly name: "trustedForwarderAddress";
3978
- readonly type: "address";
3979
- }];
3980
- readonly name: "updateTrustedForwarder";
3981
- readonly outputs: readonly [];
3982
- readonly stateMutability: "nonpayable";
3983
- readonly type: "function";
3984
- }, {
3985
- readonly inputs: readonly [{
3986
- readonly internalType: "address";
3987
- readonly name: "newImplementation";
3988
- readonly type: "address";
3989
- }, {
3990
- readonly internalType: "bytes";
3991
- readonly name: "data";
3992
- readonly type: "bytes";
3993
- }];
3994
- readonly name: "upgradeToAndCall";
3995
- readonly outputs: readonly [];
3996
- readonly stateMutability: "payable";
3997
- readonly type: "function";
3998
- }, {
3999
- readonly inputs: readonly [{
4000
- readonly internalType: "address";
4001
- readonly name: "userAddress";
4002
- readonly type: "address";
4003
- }];
4004
- readonly name: "userNonce";
4005
- readonly outputs: readonly [{
4006
- readonly internalType: "uint256";
4007
- readonly name: "";
4008
- readonly type: "uint256";
4009
- }];
4010
- readonly stateMutability: "view";
4011
- readonly type: "function";
4012
- }, {
4013
- readonly inputs: readonly [{
4014
- readonly internalType: "address";
4015
- readonly name: "userAddress";
4016
- readonly type: "address";
4017
- }, {
4018
- readonly internalType: "uint256";
4019
- readonly name: "permissionIndex";
4020
- readonly type: "uint256";
4021
- }];
4022
- readonly name: "userPermissionIdsAt";
4023
- readonly outputs: readonly [{
4024
- readonly internalType: "uint256";
4025
- readonly name: "";
4026
- readonly type: "uint256";
4027
- }];
4028
- readonly stateMutability: "view";
4029
- readonly type: "function";
4030
- }, {
4031
- readonly inputs: readonly [{
4032
- readonly internalType: "address";
4033
- readonly name: "userAddress";
4034
- readonly type: "address";
4035
- }];
4036
- readonly name: "userPermissionIdsLength";
4037
- readonly outputs: readonly [{
4038
- readonly internalType: "uint256";
4039
- readonly name: "";
4040
- readonly type: "uint256";
4041
- }];
4042
- readonly stateMutability: "view";
4043
- readonly type: "function";
4044
- }, {
4045
- readonly inputs: readonly [{
4046
- readonly internalType: "address";
4047
- readonly name: "userAddress";
4048
- readonly type: "address";
4049
- }];
4050
- readonly name: "userPermissionIdsValues";
4051
- readonly outputs: readonly [{
4052
- readonly internalType: "uint256[]";
4053
- readonly name: "";
4054
- readonly type: "uint256[]";
4055
- }];
4056
- readonly stateMutability: "view";
4057
- readonly type: "function";
4058
- }, {
4059
- readonly inputs: readonly [{
4060
- readonly internalType: "address";
4061
- readonly name: "userAddress";
4062
- readonly type: "address";
4063
- }];
4064
- readonly name: "users";
4065
- readonly outputs: readonly [{
4066
- readonly internalType: "uint256";
4067
- readonly name: "nonce";
4068
- readonly type: "uint256";
4069
- }, {
4070
- readonly internalType: "uint256[]";
4071
- readonly name: "permissionIds";
4072
- readonly type: "uint256[]";
4073
- }];
4074
- readonly stateMutability: "view";
4075
- readonly type: "function";
4076
- }, {
4077
- readonly inputs: readonly [];
4078
- readonly name: "version";
4079
- readonly outputs: readonly [{
4080
- readonly internalType: "uint256";
4081
- readonly name: "";
4082
- readonly type: "uint256";
4083
- }];
4084
- readonly stateMutability: "pure";
4085
- readonly type: "function";
4086
- }];
4087
- readonly DataPortabilityServers: readonly [{
4088
- readonly inputs: readonly [];
4089
- readonly stateMutability: "nonpayable";
4090
- readonly type: "constructor";
4091
- }, {
4092
- readonly inputs: readonly [];
4093
- readonly name: "AccessControlBadConfirmation";
4094
- readonly type: "error";
4095
- }, {
4096
- readonly inputs: readonly [{
4097
- readonly internalType: "address";
4098
- readonly name: "account";
4099
- readonly type: "address";
4100
- }, {
4101
- readonly internalType: "bytes32";
4102
- readonly name: "neededRole";
4103
- readonly type: "bytes32";
4104
- }];
4105
- readonly name: "AccessControlUnauthorizedAccount";
4106
- readonly type: "error";
4107
- }, {
4108
- readonly inputs: readonly [{
4109
- readonly internalType: "address";
4110
- readonly name: "target";
4111
- readonly type: "address";
4112
- }];
4113
- readonly name: "AddressEmptyCode";
4114
- readonly type: "error";
4115
- }, {
4116
- readonly inputs: readonly [];
4117
- readonly name: "ECDSAInvalidSignature";
4118
- readonly type: "error";
4119
- }, {
4120
- readonly inputs: readonly [{
4121
- readonly internalType: "uint256";
4122
- readonly name: "length";
4123
- readonly type: "uint256";
4124
- }];
4125
- readonly name: "ECDSAInvalidSignatureLength";
4126
- readonly type: "error";
4127
- }, {
4128
- readonly inputs: readonly [{
4129
- readonly internalType: "bytes32";
4130
- readonly name: "s";
4131
- readonly type: "bytes32";
4132
- }];
4133
- readonly name: "ECDSAInvalidSignatureS";
4134
- readonly type: "error";
4135
- }, {
4136
- readonly inputs: readonly [{
4137
- readonly internalType: "address";
4138
- readonly name: "implementation";
4139
- readonly type: "address";
4140
- }];
4141
- readonly name: "ERC1967InvalidImplementation";
4142
- readonly type: "error";
4143
- }, {
4144
- readonly inputs: readonly [];
4145
- readonly name: "ERC1967NonPayable";
4146
- readonly type: "error";
4147
- }, {
4148
- readonly inputs: readonly [];
4149
- readonly name: "EmptyPublicKey";
4150
- readonly type: "error";
4151
- }, {
4152
- readonly inputs: readonly [];
4153
- readonly name: "EmptyUrl";
4154
- readonly type: "error";
4155
- }, {
4156
- readonly inputs: readonly [];
4157
- readonly name: "EnforcedPause";
4158
- readonly type: "error";
4159
- }, {
4160
- readonly inputs: readonly [];
4161
- readonly name: "ExpectedPause";
4162
- readonly type: "error";
4163
- }, {
4164
- readonly inputs: readonly [];
4165
- readonly name: "FailedInnerCall";
4166
- readonly type: "error";
4167
- }, {
4168
- readonly inputs: readonly [];
4169
- readonly name: "InvalidInitialization";
4170
- readonly type: "error";
4171
- }, {
4172
- readonly inputs: readonly [{
4173
- readonly internalType: "uint256";
4174
- readonly name: "expectedNonce";
4175
- readonly type: "uint256";
4176
- }, {
4177
- readonly internalType: "uint256";
4178
- readonly name: "providedNonce";
4179
- readonly type: "uint256";
4180
- }];
4181
- readonly name: "InvalidNonce";
4182
- readonly type: "error";
4183
- }, {
4184
- readonly inputs: readonly [];
4185
- readonly name: "NotInitializing";
4186
- readonly type: "error";
4187
- }, {
4188
- readonly inputs: readonly [{
4189
- readonly internalType: "address";
4190
- readonly name: "serverOwner";
4191
- readonly type: "address";
4192
- }, {
4193
- readonly internalType: "address";
4194
- readonly name: "requestor";
4195
- readonly type: "address";
4196
- }];
4197
- readonly name: "NotServerOwner";
4198
- readonly type: "error";
4199
- }, {
4200
- readonly inputs: readonly [];
4201
- readonly name: "ServerAlreadyRegistered";
4202
- readonly type: "error";
4203
- }, {
4204
- readonly inputs: readonly [];
4205
- readonly name: "ServerAlreadyTrusted";
4206
- readonly type: "error";
4207
- }, {
4208
- readonly inputs: readonly [];
4209
- readonly name: "ServerAlreadyUntrusted";
4210
- readonly type: "error";
4211
- }, {
4212
- readonly inputs: readonly [];
4213
- readonly name: "ServerNotFound";
4214
- readonly type: "error";
4215
- }, {
4216
- readonly inputs: readonly [];
4217
- readonly name: "ServerNotTrusted";
4218
- readonly type: "error";
4219
- }, {
4220
- readonly inputs: readonly [{
4221
- readonly internalType: "string";
4222
- readonly name: "existingUrl";
4223
- readonly type: "string";
4224
- }, {
4225
- readonly internalType: "string";
4226
- readonly name: "providedUrl";
4227
- readonly type: "string";
4228
- }];
4229
- readonly name: "ServerUrlMismatch";
3518
+ readonly name: "ServerUrlMismatch";
4230
3519
  readonly type: "error";
4231
3520
  }, {
4232
3521
  readonly inputs: readonly [];
@@ -4348,9 +3637,9 @@ declare const contractAbis: {
4348
3637
  readonly type: "address";
4349
3638
  }, {
4350
3639
  readonly indexed: false;
4351
- readonly internalType: "bytes";
3640
+ readonly internalType: "string";
4352
3641
  readonly name: "publicKey";
4353
- readonly type: "bytes";
3642
+ readonly type: "string";
4354
3643
  }, {
4355
3644
  readonly indexed: false;
4356
3645
  readonly internalType: "string";
@@ -4444,6 +3733,16 @@ declare const contractAbis: {
4444
3733
  }];
4445
3734
  readonly stateMutability: "view";
4446
3735
  readonly type: "function";
3736
+ }, {
3737
+ readonly inputs: readonly [];
3738
+ readonly name: "PERMISSION_MANAGER_ROLE";
3739
+ readonly outputs: readonly [{
3740
+ readonly internalType: "bytes32";
3741
+ readonly name: "";
3742
+ readonly type: "bytes32";
3743
+ }];
3744
+ readonly stateMutability: "view";
3745
+ readonly type: "function";
4447
3746
  }, {
4448
3747
  readonly inputs: readonly [];
4449
3748
  readonly name: "UPGRADE_INTERFACE_VERSION";
@@ -4456,28 +3755,28 @@ declare const contractAbis: {
4456
3755
  readonly type: "function";
4457
3756
  }, {
4458
3757
  readonly inputs: readonly [{
3758
+ readonly internalType: "address";
3759
+ readonly name: "ownerAddress";
3760
+ readonly type: "address";
3761
+ }, {
4459
3762
  readonly components: readonly [{
4460
- readonly internalType: "address";
4461
- readonly name: "owner";
4462
- readonly type: "address";
4463
- }, {
4464
3763
  readonly internalType: "address";
4465
3764
  readonly name: "serverAddress";
4466
3765
  readonly type: "address";
4467
3766
  }, {
4468
- readonly internalType: "bytes";
3767
+ readonly internalType: "string";
4469
3768
  readonly name: "publicKey";
4470
- readonly type: "bytes";
3769
+ readonly type: "string";
4471
3770
  }, {
4472
3771
  readonly internalType: "string";
4473
3772
  readonly name: "serverUrl";
4474
3773
  readonly type: "string";
4475
3774
  }];
4476
3775
  readonly internalType: "struct IDataPortabilityServers.AddServerInput";
4477
- readonly name: "addAndTrustServerInput";
3776
+ readonly name: "addServerInput";
4478
3777
  readonly type: "tuple";
4479
3778
  }];
4480
- readonly name: "addAndTrustServer";
3779
+ readonly name: "addAndTrustServerByManager";
4481
3780
  readonly outputs: readonly [];
4482
3781
  readonly stateMutability: "nonpayable";
4483
3782
  readonly type: "function";
@@ -4487,25 +3786,21 @@ declare const contractAbis: {
4487
3786
  readonly internalType: "uint256";
4488
3787
  readonly name: "nonce";
4489
3788
  readonly type: "uint256";
4490
- }, {
4491
- readonly internalType: "address";
4492
- readonly name: "owner";
4493
- readonly type: "address";
4494
3789
  }, {
4495
3790
  readonly internalType: "address";
4496
3791
  readonly name: "serverAddress";
4497
3792
  readonly type: "address";
4498
3793
  }, {
4499
- readonly internalType: "bytes";
3794
+ readonly internalType: "string";
4500
3795
  readonly name: "publicKey";
4501
- readonly type: "bytes";
3796
+ readonly type: "string";
4502
3797
  }, {
4503
3798
  readonly internalType: "string";
4504
3799
  readonly name: "serverUrl";
4505
3800
  readonly type: "string";
4506
3801
  }];
4507
- readonly internalType: "struct IDataPortabilityServers.AddAndTrustServerInput";
4508
- readonly name: "addAndTrustServerInput";
3802
+ readonly internalType: "struct IDataPortabilityServers.AddServerWithSignatureInput";
3803
+ readonly name: "addServerInput";
4509
3804
  readonly type: "tuple";
4510
3805
  }, {
4511
3806
  readonly internalType: "bytes";
@@ -4519,27 +3814,31 @@ declare const contractAbis: {
4519
3814
  }, {
4520
3815
  readonly inputs: readonly [{
4521
3816
  readonly components: readonly [{
4522
- readonly internalType: "address";
4523
- readonly name: "owner";
4524
- readonly type: "address";
3817
+ readonly internalType: "uint256";
3818
+ readonly name: "nonce";
3819
+ readonly type: "uint256";
4525
3820
  }, {
4526
3821
  readonly internalType: "address";
4527
3822
  readonly name: "serverAddress";
4528
3823
  readonly type: "address";
4529
3824
  }, {
4530
- readonly internalType: "bytes";
3825
+ readonly internalType: "string";
4531
3826
  readonly name: "publicKey";
4532
- readonly type: "bytes";
3827
+ readonly type: "string";
4533
3828
  }, {
4534
3829
  readonly internalType: "string";
4535
3830
  readonly name: "serverUrl";
4536
3831
  readonly type: "string";
4537
3832
  }];
4538
- readonly internalType: "struct IDataPortabilityServers.AddServerInput";
3833
+ readonly internalType: "struct IDataPortabilityServers.AddServerWithSignatureInput";
4539
3834
  readonly name: "addServerInput";
4540
3835
  readonly type: "tuple";
3836
+ }, {
3837
+ readonly internalType: "bytes";
3838
+ readonly name: "signature";
3839
+ readonly type: "bytes";
4541
3840
  }];
4542
- readonly name: "addServer";
3841
+ readonly name: "addServerWithSignature";
4543
3842
  readonly outputs: readonly [];
4544
3843
  readonly stateMutability: "nonpayable";
4545
3844
  readonly type: "function";
@@ -4637,38 +3936,6 @@ declare const contractAbis: {
4637
3936
  readonly outputs: readonly [];
4638
3937
  readonly stateMutability: "nonpayable";
4639
3938
  readonly type: "function";
4640
- }, {
4641
- readonly inputs: readonly [{
4642
- readonly internalType: "uint256";
4643
- readonly name: "serverId";
4644
- readonly type: "uint256";
4645
- }];
4646
- readonly name: "isActiveServer";
4647
- readonly outputs: readonly [{
4648
- readonly internalType: "bool";
4649
- readonly name: "";
4650
- readonly type: "bool";
4651
- }];
4652
- readonly stateMutability: "view";
4653
- readonly type: "function";
4654
- }, {
4655
- readonly inputs: readonly [{
4656
- readonly internalType: "address";
4657
- readonly name: "userAddress";
4658
- readonly type: "address";
4659
- }, {
4660
- readonly internalType: "uint256";
4661
- readonly name: "serverId";
4662
- readonly type: "uint256";
4663
- }];
4664
- readonly name: "isActiveServerForUser";
4665
- readonly outputs: readonly [{
4666
- readonly internalType: "bool";
4667
- readonly name: "";
4668
- readonly type: "bool";
4669
- }];
4670
- readonly stateMutability: "view";
4671
- readonly type: "function";
4672
3939
  }, {
4673
3940
  readonly inputs: readonly [{
4674
3941
  readonly internalType: "address";
@@ -4786,9 +4053,9 @@ declare const contractAbis: {
4786
4053
  readonly name: "serverAddress";
4787
4054
  readonly type: "address";
4788
4055
  }, {
4789
- readonly internalType: "bytes";
4056
+ readonly internalType: "string";
4790
4057
  readonly name: "publicKey";
4791
- readonly type: "bytes";
4058
+ readonly type: "string";
4792
4059
  }, {
4793
4060
  readonly internalType: "string";
4794
4061
  readonly name: "url";
@@ -4821,9 +4088,9 @@ declare const contractAbis: {
4821
4088
  readonly name: "serverAddress";
4822
4089
  readonly type: "address";
4823
4090
  }, {
4824
- readonly internalType: "bytes";
4091
+ readonly internalType: "string";
4825
4092
  readonly name: "publicKey";
4826
- readonly type: "bytes";
4093
+ readonly type: "string";
4827
4094
  }, {
4828
4095
  readonly internalType: "string";
4829
4096
  readonly name: "url";
@@ -4897,6 +4164,20 @@ declare const contractAbis: {
4897
4164
  readonly outputs: readonly [];
4898
4165
  readonly stateMutability: "nonpayable";
4899
4166
  readonly type: "function";
4167
+ }, {
4168
+ readonly inputs: readonly [{
4169
+ readonly internalType: "address";
4170
+ readonly name: "userAddress";
4171
+ readonly type: "address";
4172
+ }, {
4173
+ readonly internalType: "uint256";
4174
+ readonly name: "serverId";
4175
+ readonly type: "uint256";
4176
+ }];
4177
+ readonly name: "trustServerByManager";
4178
+ readonly outputs: readonly [];
4179
+ readonly stateMutability: "nonpayable";
4180
+ readonly type: "function";
4900
4181
  }, {
4901
4182
  readonly inputs: readonly [{
4902
4183
  readonly components: readonly [{
@@ -5067,6 +4348,96 @@ declare const contractAbis: {
5067
4348
  }];
5068
4349
  readonly stateMutability: "view";
5069
4350
  readonly type: "function";
4351
+ }, {
4352
+ readonly inputs: readonly [{
4353
+ readonly internalType: "address";
4354
+ readonly name: "userAddress";
4355
+ readonly type: "address";
4356
+ }];
4357
+ readonly name: "userServerValues";
4358
+ readonly outputs: readonly [{
4359
+ readonly components: readonly [{
4360
+ readonly internalType: "uint256";
4361
+ readonly name: "id";
4362
+ readonly type: "uint256";
4363
+ }, {
4364
+ readonly internalType: "address";
4365
+ readonly name: "owner";
4366
+ readonly type: "address";
4367
+ }, {
4368
+ readonly internalType: "address";
4369
+ readonly name: "serverAddress";
4370
+ readonly type: "address";
4371
+ }, {
4372
+ readonly internalType: "string";
4373
+ readonly name: "publicKey";
4374
+ readonly type: "string";
4375
+ }, {
4376
+ readonly internalType: "string";
4377
+ readonly name: "url";
4378
+ readonly type: "string";
4379
+ }, {
4380
+ readonly internalType: "uint256";
4381
+ readonly name: "startBlock";
4382
+ readonly type: "uint256";
4383
+ }, {
4384
+ readonly internalType: "uint256";
4385
+ readonly name: "endBlock";
4386
+ readonly type: "uint256";
4387
+ }];
4388
+ readonly internalType: "struct IDataPortabilityServers.TrustedServerInfo[]";
4389
+ readonly name: "serversInfo";
4390
+ readonly type: "tuple[]";
4391
+ }];
4392
+ readonly stateMutability: "view";
4393
+ readonly type: "function";
4394
+ }, {
4395
+ readonly inputs: readonly [{
4396
+ readonly internalType: "address";
4397
+ readonly name: "userAddress";
4398
+ readonly type: "address";
4399
+ }, {
4400
+ readonly internalType: "uint256";
4401
+ readonly name: "serverId";
4402
+ readonly type: "uint256";
4403
+ }];
4404
+ readonly name: "userServers";
4405
+ readonly outputs: readonly [{
4406
+ readonly components: readonly [{
4407
+ readonly internalType: "uint256";
4408
+ readonly name: "id";
4409
+ readonly type: "uint256";
4410
+ }, {
4411
+ readonly internalType: "address";
4412
+ readonly name: "owner";
4413
+ readonly type: "address";
4414
+ }, {
4415
+ readonly internalType: "address";
4416
+ readonly name: "serverAddress";
4417
+ readonly type: "address";
4418
+ }, {
4419
+ readonly internalType: "string";
4420
+ readonly name: "publicKey";
4421
+ readonly type: "string";
4422
+ }, {
4423
+ readonly internalType: "string";
4424
+ readonly name: "url";
4425
+ readonly type: "string";
4426
+ }, {
4427
+ readonly internalType: "uint256";
4428
+ readonly name: "startBlock";
4429
+ readonly type: "uint256";
4430
+ }, {
4431
+ readonly internalType: "uint256";
4432
+ readonly name: "endBlock";
4433
+ readonly type: "uint256";
4434
+ }];
4435
+ readonly internalType: "struct IDataPortabilityServers.TrustedServerInfo";
4436
+ readonly name: "";
4437
+ readonly type: "tuple";
4438
+ }];
4439
+ readonly stateMutability: "view";
4440
+ readonly type: "function";
5070
4441
  }, {
5071
4442
  readonly inputs: readonly [{
5072
4443
  readonly internalType: "address";
@@ -5865,6 +5236,31 @@ declare const contractAbis: {
5865
5236
  }];
5866
5237
  readonly name: "FileAdded";
5867
5238
  readonly type: "event";
5239
+ }, {
5240
+ readonly anonymous: false;
5241
+ readonly inputs: readonly [{
5242
+ readonly indexed: true;
5243
+ readonly internalType: "uint256";
5244
+ readonly name: "fileId";
5245
+ readonly type: "uint256";
5246
+ }, {
5247
+ readonly indexed: true;
5248
+ readonly internalType: "address";
5249
+ readonly name: "ownerAddress";
5250
+ readonly type: "address";
5251
+ }, {
5252
+ readonly indexed: false;
5253
+ readonly internalType: "string";
5254
+ readonly name: "url";
5255
+ readonly type: "string";
5256
+ }, {
5257
+ readonly indexed: false;
5258
+ readonly internalType: "uint256";
5259
+ readonly name: "schemaId";
5260
+ readonly type: "uint256";
5261
+ }];
5262
+ readonly name: "FileAddedV2";
5263
+ readonly type: "event";
5868
5264
  }, {
5869
5265
  readonly anonymous: false;
5870
5266
  readonly inputs: readonly [{
@@ -6291,6 +5687,16 @@ declare const contractAbis: {
6291
5687
  }];
6292
5688
  readonly stateMutability: "view";
6293
5689
  readonly type: "function";
5690
+ }, {
5691
+ readonly inputs: readonly [];
5692
+ readonly name: "emitLegacyEvents";
5693
+ readonly outputs: readonly [{
5694
+ readonly internalType: "bool";
5695
+ readonly name: "";
5696
+ readonly type: "bool";
5697
+ }];
5698
+ readonly stateMutability: "view";
5699
+ readonly type: "function";
6294
5700
  }, {
6295
5701
  readonly inputs: readonly [{
6296
5702
  readonly internalType: "string";
@@ -6409,6 +5815,10 @@ declare const contractAbis: {
6409
5815
  readonly internalType: "string";
6410
5816
  readonly name: "url";
6411
5817
  readonly type: "string";
5818
+ }, {
5819
+ readonly internalType: "uint256";
5820
+ readonly name: "schemaId";
5821
+ readonly type: "uint256";
6412
5822
  }, {
6413
5823
  readonly internalType: "uint256";
6414
5824
  readonly name: "addedAtBlock";
@@ -6626,6 +6036,16 @@ declare const contractAbis: {
6626
6036
  readonly outputs: readonly [];
6627
6037
  readonly stateMutability: "nonpayable";
6628
6038
  readonly type: "function";
6039
+ }, {
6040
+ readonly inputs: readonly [{
6041
+ readonly internalType: "bool";
6042
+ readonly name: "newEmitLegacyEvents";
6043
+ readonly type: "bool";
6044
+ }];
6045
+ readonly name: "updateEmitLegacyEvents";
6046
+ readonly outputs: readonly [];
6047
+ readonly stateMutability: "nonpayable";
6048
+ readonly type: "function";
6629
6049
  }, {
6630
6050
  readonly inputs: readonly [{
6631
6051
  readonly internalType: "address";
@@ -29430,6 +28850,95 @@ type VanaContract = keyof ContractAbis;
29430
28850
  */
29431
28851
  declare function getAbi<T extends VanaContract>(contract: T): ContractAbis[T];
29432
28852
 
28853
+ /**
28854
+ * Comprehensive mapping of SDK transaction operations to blockchain events.
28855
+ * Used by the generic transaction parser to know which contract and event
28856
+ * to look for when parsing transaction results.
28857
+ */
28858
+ declare const EVENT_MAPPINGS: {
28859
+ readonly grant: {
28860
+ readonly contract: "DataPortabilityPermissions";
28861
+ readonly event: "PermissionAdded";
28862
+ };
28863
+ readonly revoke: {
28864
+ readonly contract: "DataPortabilityPermissions";
28865
+ readonly event: "PermissionRevoked";
28866
+ };
28867
+ readonly revokePermission: {
28868
+ readonly contract: "DataPortabilityPermissions";
28869
+ readonly event: "PermissionRevoked";
28870
+ };
28871
+ readonly addServerFilesAndPermissions: {
28872
+ readonly contract: "DataPortabilityPermissions";
28873
+ readonly event: "PermissionAdded";
28874
+ };
28875
+ readonly trustServer: {
28876
+ readonly contract: "DataPortabilityServers";
28877
+ readonly event: "ServerTrusted";
28878
+ };
28879
+ readonly untrustServer: {
28880
+ readonly contract: "DataPortabilityServers";
28881
+ readonly event: "ServerUntrusted";
28882
+ };
28883
+ readonly registerServer: {
28884
+ readonly contract: "DataPortabilityServers";
28885
+ readonly event: "ServerRegistered";
28886
+ };
28887
+ readonly updateServer: {
28888
+ readonly contract: "DataPortabilityServers";
28889
+ readonly event: "ServerUpdated";
28890
+ };
28891
+ readonly addAndTrustServer: {
28892
+ readonly contract: "DataPortabilityServers";
28893
+ readonly event: "ServerTrusted";
28894
+ };
28895
+ readonly addFile: {
28896
+ readonly contract: "DataRegistry";
28897
+ readonly event: "FileAddedV2";
28898
+ };
28899
+ readonly addFileWithPermissionsAndSchema: {
28900
+ readonly contract: "DataRegistry";
28901
+ readonly event: "FileAddedV2";
28902
+ };
28903
+ readonly addFileWithSchema: {
28904
+ readonly contract: "DataRegistry";
28905
+ readonly event: "FileAddedV2";
28906
+ };
28907
+ readonly addFileWithPermissions: {
28908
+ readonly contract: "DataRegistry";
28909
+ readonly event: "FileAddedV2";
28910
+ };
28911
+ readonly addRefinement: {
28912
+ readonly contract: "DataRegistry";
28913
+ readonly event: "RefinementAdded";
28914
+ };
28915
+ readonly addRefiner: {
28916
+ readonly contract: "DataRefinerRegistry";
28917
+ readonly event: "RefinerAdded";
28918
+ };
28919
+ readonly updateSchemaId: {
28920
+ readonly contract: "DataRefinerRegistry";
28921
+ readonly event: "SchemaAdded";
28922
+ };
28923
+ readonly addSchema: {
28924
+ readonly contract: "DataRefinerRegistry";
28925
+ readonly event: "SchemaAdded";
28926
+ };
28927
+ readonly updateRefinement: {
28928
+ readonly contract: "DataRegistry";
28929
+ readonly event: "RefinementUpdated";
28930
+ };
28931
+ readonly addFilePermission: {
28932
+ readonly contract: "DataRegistry";
28933
+ readonly event: "PermissionGranted";
28934
+ };
28935
+ readonly registerGrantee: {
28936
+ readonly contract: "DataPortabilityGrantees";
28937
+ readonly event: "GranteeRegistered";
28938
+ };
28939
+ };
28940
+ type TransactionOperation = keyof typeof EVENT_MAPPINGS;
28941
+
29433
28942
  /**
29434
28943
  * Base interface for all transaction results.
29435
28944
  * Contains the event data plus transaction metadata.
@@ -29467,6 +28976,50 @@ interface PermissionRevokeResult extends BaseTransactionResult {
29467
28976
  /** ID of the permission that was revoked */
29468
28977
  permissionId: bigint;
29469
28978
  }
28979
+ /**
28980
+ * Result of a successful server trust operation.
28981
+ * Contains data from the ServerTrusted blockchain event.
28982
+ */
28983
+ interface ServerTrustResult extends BaseTransactionResult {
28984
+ /** Address of the user who trusted the server */
28985
+ user: Address;
28986
+ /** Address/ID of the trusted server */
28987
+ serverId: Address;
28988
+ /** URL of the trusted server */
28989
+ serverUrl: string;
28990
+ }
28991
+ /**
28992
+ * Result of a successful server untrust operation.
28993
+ * Contains data from the ServerUntrusted blockchain event.
28994
+ */
28995
+ interface ServerUntrustResult extends BaseTransactionResult {
28996
+ /** Address of the user who untrusted the server */
28997
+ user: Address;
28998
+ /** Address/ID of the untrusted server */
28999
+ serverId: Address;
29000
+ }
29001
+ /**
29002
+ * Result of a successful server update operation.
29003
+ * Contains data from the ServerUpdated blockchain event.
29004
+ */
29005
+ interface ServerUpdateResult extends BaseTransactionResult {
29006
+ /** ID of the server that was updated */
29007
+ serverId: bigint;
29008
+ /** New URL of the server */
29009
+ url: string;
29010
+ }
29011
+ /**
29012
+ * Result of a successful grantee registration operation.
29013
+ * Contains data from the GranteeRegistered blockchain event.
29014
+ */
29015
+ interface GranteeRegisterResult extends BaseTransactionResult {
29016
+ /** Unique grantee ID assigned by the registry */
29017
+ granteeId: bigint;
29018
+ /** Address of the registered grantee */
29019
+ granteeAddress: Address;
29020
+ /** Display name of the grantee */
29021
+ name: string;
29022
+ }
29470
29023
  /**
29471
29024
  * Result of a successful file permission addition operation.
29472
29025
  * Contains data from the FilePermissionAdded blockchain event.
@@ -29480,6 +29033,80 @@ interface FilePermissionResult extends BaseTransactionResult {
29480
29033
  encryptedKey: string;
29481
29034
  }
29482
29035
 
29036
+ /**
29037
+ * Provides a unified interface for blockchain transaction results with lazy-loaded event parsing.
29038
+ *
29039
+ * @remarks
29040
+ * TransactionHandle enables immediate access to transaction hashes while providing optional
29041
+ * lazy-loaded access to receipts and parsed event data. All transaction-submitting methods
29042
+ * in the SDK return this handle, allowing developers to choose between immediate hash access
29043
+ * or waiting for event data. Results are memoized to prevent redundant network calls.
29044
+ *
29045
+ * @category Transactions
29046
+ * @example
29047
+ * ```typescript
29048
+ * // Immediate hash access
29049
+ * const tx = await sdk.permissions.submitSignedGrant(typedData, signature);
29050
+ * console.log(`Transaction submitted: ${tx.hash}`);
29051
+ *
29052
+ * // Wait for and parse events
29053
+ * const eventData = await tx.waitForEvents();
29054
+ * console.log(`Permission ID: ${eventData.permissionId}`);
29055
+ *
29056
+ * // Check receipt for gas usage
29057
+ * const receipt = await tx.waitForReceipt();
29058
+ * console.log(`Gas used: ${receipt.gasUsed}`);
29059
+ * ```
29060
+ */
29061
+ declare class TransactionHandle<TEventData = unknown> {
29062
+ private readonly context;
29063
+ readonly hash: Hash;
29064
+ private readonly operation?;
29065
+ private _receipt?;
29066
+ private _eventData?;
29067
+ private _receiptPromise?;
29068
+ private _eventPromise?;
29069
+ constructor(context: ControllerContext$1, hash: Hash, operation?: TransactionOperation | undefined);
29070
+ /**
29071
+ * Waits for transaction confirmation and returns the receipt.
29072
+ * Results are memoized - multiple calls return the same promise.
29073
+ *
29074
+ * @param options Optional timeout configuration
29075
+ * @param options.timeout Timeout in milliseconds (default: 30000)
29076
+ * @returns Transaction receipt with gas usage, logs, and status
29077
+ */
29078
+ waitForReceipt(options?: {
29079
+ timeout?: number;
29080
+ }): Promise<TransactionReceipt$1>;
29081
+ /**
29082
+ * Waits for transaction confirmation and parses emitted events.
29083
+ * Results are memoized - multiple calls return the same promise.
29084
+ *
29085
+ * @returns Parsed event data with transaction metadata
29086
+ * @throws {Error} If no operation was specified for event parsing
29087
+ */
29088
+ waitForEvents(): Promise<TEventData>;
29089
+ /**
29090
+ * Enables string coercion for backwards compatibility.
29091
+ * Allows TransactionHandle to be used anywhere a Hash is expected.
29092
+ *
29093
+ * @example
29094
+ * ```typescript
29095
+ * const hash: Hash = tx; // Works via toString()
29096
+ * console.log(`Transaction: ${tx}`); // Prints hash
29097
+ * ```
29098
+ * @returns The transaction hash as a string
29099
+ */
29100
+ toString(): string;
29101
+ /**
29102
+ * JSON serialization support.
29103
+ * Returns the hash when serialized to JSON.
29104
+ *
29105
+ * @returns The transaction hash for JSON serialization
29106
+ */
29107
+ toJSON(): string;
29108
+ }
29109
+
29483
29110
  /**
29484
29111
  * Google Drive Storage Provider for Vana SDK
29485
29112
  *
@@ -30518,30 +30145,31 @@ declare class PermissionsController {
30518
30145
  */
30519
30146
  grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
30520
30147
  /**
30521
- * Submits a permission grant transaction and returns the transaction hash immediately.
30148
+ * Submits a permission grant transaction and returns a handle for flexible result access.
30522
30149
  *
30523
- * This is the lower-level method that provides maximum control over transaction timing.
30524
- * Use this when you want to handle transaction confirmation and event parsing separately,
30525
- * or when submitting multiple transactions in batch.
30150
+ * @remarks
30151
+ * This lower-level method provides maximum control over transaction timing.
30152
+ * Returns a TransactionHandle that allows immediate hash access or optional event parsing.
30153
+ * Use this when handling multiple transactions or when you need granular control.
30526
30154
  *
30527
30155
  * @param params - The permission grant configuration object
30528
- * @returns Promise that resolves to the transaction hash when successfully submitted
30156
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
30529
30157
  * @throws {RelayerError} When gasless transaction submission fails
30530
30158
  * @throws {SignatureError} When user rejects the signature request
30531
30159
  * @throws {SerializationError} When grant data cannot be serialized
30532
30160
  * @throws {BlockchainError} When permission grant preparation fails
30533
30161
  * @example
30534
30162
  * ```typescript
30535
- * // Submit transaction and handle confirmation later
30536
- * const txHash = await vana.permissions.submitPermissionGrant(params);
30537
- * console.log(`Transaction submitted: ${txHash}`);
30163
+ * // Submit transaction and get immediate hash access
30164
+ * const tx = await vana.permissions.submitPermissionGrant(params);
30165
+ * console.log(`Transaction submitted: ${tx.hash}`);
30538
30166
  *
30539
- * // Later, when you need the permission data:
30540
- * const result = await parseTransactionResult(context, txHash, 'grant');
30541
- * console.log(`Permission ID: ${result.permissionId}`);
30167
+ * // Optionally wait for and parse events
30168
+ * const eventData = await tx.waitForEvents();
30169
+ * console.log(`Permission ID: ${eventData.permissionId}`);
30542
30170
  * ```
30543
30171
  */
30544
- submitPermissionGrant(params: GrantPermissionParams$1): Promise<Hash>;
30172
+ submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
30545
30173
  /**
30546
30174
  * Prepares a permission grant with preview before signing.
30547
30175
  *
@@ -30569,15 +30197,21 @@ declare class PermissionsController {
30569
30197
  */
30570
30198
  prepareGrant(params: GrantPermissionParams$1): Promise<{
30571
30199
  preview: GrantFile;
30572
- confirm: () => Promise<Hash>;
30200
+ confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
30573
30201
  }>;
30574
30202
  /**
30575
- * Internal method to complete the grant process after user confirmation.
30576
- * This is called by the confirm() function returned from prepareGrant().
30203
+ * Completes the grant process after user confirmation.
30204
+ *
30205
+ * @remarks
30206
+ * This internal method is called by the confirm() function returned from prepareGrant().
30207
+ * It handles IPFS upload, signature creation, and transaction submission.
30577
30208
  *
30578
30209
  * @param params - The permission grant parameters containing user and operation details
30579
30210
  * @param grantFile - The prepared grant file with permissions and metadata
30580
- * @returns Promise resolving to the transaction hash
30211
+ * @returns Promise resolving to TransactionHandle for flexible result access
30212
+ * @throws {BlockchainError} When permission grant confirmation fails
30213
+ * @throws {NetworkError} When IPFS upload fails
30214
+ * @throws {SignatureError} When user rejects the signature
30581
30215
  */
30582
30216
  private confirmGrantInternal;
30583
30217
  /**
@@ -30633,49 +30267,106 @@ declare class PermissionsController {
30633
30267
  * );
30634
30268
  * ```
30635
30269
  */
30636
- submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<Hash>;
30270
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30637
30271
  /**
30638
30272
  * Submits an already-signed trust server transaction to the blockchain.
30273
+ *
30274
+ * @remarks
30639
30275
  * This method extracts the trust server input from typed data and submits it directly.
30276
+ * Used internally by trust server methods after signature collection.
30640
30277
  *
30641
30278
  * @param typedData - The EIP-712 typed data for TrustServer
30642
- * @param signature - The user's signature
30643
- * @returns Promise resolving to the transaction hash
30279
+ * @param signature - The user's signature obtained via `signTypedData()`
30280
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30281
+ * @throws {BlockchainError} When contract submission fails
30282
+ * @throws {NetworkError} When blockchain communication fails
30283
+ * @example
30284
+ * ```typescript
30285
+ * const txHandle = await vana.permissions.submitSignedTrustServer(
30286
+ * typedData,
30287
+ * "0x1234..."
30288
+ * );
30289
+ * const result = await txHandle.waitForEvents();
30290
+ * ```
30644
30291
  */
30645
- submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<Hash>;
30292
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
30646
30293
  /**
30647
30294
  * Submits an already-signed add and trust server transaction to the blockchain.
30295
+ *
30296
+ * @remarks
30648
30297
  * This method extracts the add and trust server input from typed data and submits it directly.
30298
+ * Combines server registration and trust operations in a single transaction.
30649
30299
  *
30650
30300
  * @param typedData - The EIP-712 typed data for AddAndTrustServer
30651
- * @param signature - The user's signature
30652
- * @returns Promise resolving to the transaction hash
30301
+ * @param signature - The user's signature obtained via `signTypedData()`
30302
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30303
+ * @throws {BlockchainError} When contract submission fails
30304
+ * @throws {NetworkError} When blockchain communication fails
30305
+ * @example
30306
+ * ```typescript
30307
+ * const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
30308
+ * typedData,
30309
+ * "0x1234..."
30310
+ * );
30311
+ * const result = await txHandle.waitForEvents();
30312
+ * ```
30653
30313
  */
30654
- submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<Hash>;
30314
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
30655
30315
  /**
30656
30316
  * Submits an already-signed permission revoke transaction to the blockchain.
30317
+ *
30318
+ * @remarks
30657
30319
  * This method handles the revocation of previously granted permissions.
30320
+ * Used internally by revocation methods after signature collection.
30658
30321
  *
30659
30322
  * @param typedData - The EIP-712 typed data for PermissionRevoke
30660
- * @param signature - The user's signature
30661
- * @returns Promise resolving to the transaction hash
30323
+ * @param signature - The user's signature obtained via `signTypedData()`
30324
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30325
+ * @throws {BlockchainError} When contract submission fails
30326
+ * @throws {NetworkError} When blockchain communication fails
30327
+ * @example
30328
+ * ```typescript
30329
+ * const txHandle = await vana.permissions.submitSignedRevoke(
30330
+ * typedData,
30331
+ * "0x1234..."
30332
+ * );
30333
+ * const result = await txHandle.waitForEvents();
30334
+ * ```
30662
30335
  */
30663
- submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30336
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
30664
30337
  /**
30665
30338
  * Submits an already-signed untrust server transaction to the blockchain.
30339
+ *
30340
+ * @remarks
30666
30341
  * This method handles the removal of trusted servers.
30342
+ * Used internally by untrust server methods after signature collection.
30667
30343
  *
30668
30344
  * @param typedData - The EIP-712 typed data for UntrustServer
30669
- * @param signature - The user's signature
30670
- * @returns Promise resolving to the transaction hash
30345
+ * @param signature - The user's signature obtained via `signTypedData()`
30346
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30347
+ * @throws {BlockchainError} When contract submission fails
30348
+ * @throws {NetworkError} When blockchain communication fails
30349
+ * @example
30350
+ * ```typescript
30351
+ * const txHandle = await vana.permissions.submitSignedUntrustServer(
30352
+ * typedData,
30353
+ * "0x1234..."
30354
+ * );
30355
+ * const result = await txHandle.waitForEvents();
30356
+ * ```
30671
30357
  */
30672
- submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30358
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
30673
30359
  /**
30674
30360
  * Submits a signed transaction directly to the blockchain.
30675
30361
  *
30362
+ * @remarks
30363
+ * Internal method used when relayer callbacks are not available. Formats the signature
30364
+ * and submits the permission grant directly to the smart contract.
30365
+ *
30676
30366
  * @param typedData - The typed data structure for the permission grant
30677
30367
  * @param signature - The cryptographic signature authorizing the transaction
30678
30368
  * @returns Promise resolving to the transaction hash
30369
+ * @throws {BlockchainError} When contract submission fails
30679
30370
  */
30680
30371
  private submitDirectTransaction;
30681
30372
  /**
@@ -30722,21 +30413,38 @@ declare class PermissionsController {
30722
30413
  * console.log(`Revocation submitted: ${txHash}`);
30723
30414
  * ```
30724
30415
  */
30725
- submitPermissionRevoke(params: RevokePermissionParams): Promise<Hash>;
30416
+ submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30726
30417
  /**
30727
- * Revokes a permission with a signature (gasless transaction).
30418
+ * Revokes a permission with a signature for gasless transactions.
30419
+ *
30420
+ * @remarks
30421
+ * This method creates an EIP-712 signature for permission revocation and submits
30422
+ * it either through relayer callbacks or directly to the blockchain. Provides
30423
+ * gasless revocation when relayer is configured.
30728
30424
  *
30729
30425
  * @param params - Parameters for revoking the permission
30730
- * @returns Promise resolving to transaction hash
30426
+ * @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
30427
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30731
30428
  * @throws {BlockchainError} When chain ID is not available
30732
30429
  * @throws {NonceError} When retrieving user nonce fails
30733
30430
  * @throws {SignatureError} When user rejects the signature request
30734
30431
  * @throws {RelayerError} When gasless submission fails
30735
30432
  * @throws {PermissionError} When revocation fails for any other reason
30433
+ * @example
30434
+ * ```typescript
30435
+ * const txHandle = await vana.permissions.submitRevokeWithSignature({
30436
+ * permissionId: 123n
30437
+ * });
30438
+ * const result = await txHandle.waitForEvents();
30439
+ * console.log(`Permission ${result.permissionId} revoked`);
30440
+ * ```
30736
30441
  */
30737
- revokeWithSignature(params: RevokePermissionParams): Promise<Hash>;
30442
+ submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30738
30443
  /**
30444
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30445
+ *
30739
30446
  * Retrieves the user's current nonce from the DataPortabilityServers contract.
30447
+ * This method is deprecated in favor of more specific nonce methods.
30740
30448
  *
30741
30449
  * The nonce is used to prevent replay attacks in signed transactions and must
30742
30450
  * be incremented with each transaction to maintain security.
@@ -30748,11 +30456,77 @@ declare class PermissionsController {
30748
30456
  * @private
30749
30457
  * @example
30750
30458
  * ```typescript
30459
+ * // Deprecated - use specific methods instead
30751
30460
  * const nonce = await this.getUserNonce();
30752
- * console.log(`Current nonce: ${nonce}`);
30461
+ *
30462
+ * // Use these instead:
30463
+ * const permissionsNonce = await this.getPermissionsUserNonce();
30464
+ * const serversNonce = await this.getServersUserNonce();
30753
30465
  * ```
30754
30466
  */
30467
+ /**
30468
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30469
+ *
30470
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30471
+ *
30472
+ * @remarks
30473
+ * This method is deprecated in favor of more specific nonce methods that target
30474
+ * the appropriate contract for the operation being performed.
30475
+ *
30476
+ * @returns Promise resolving to the user's current nonce as a bigint
30477
+ * @throws {NonceError} When retrieving the nonce fails
30478
+ */
30755
30479
  private getUserNonce;
30480
+ /**
30481
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30482
+ * This nonce is used for server-related operations (AddAndTrustServer, TrustServer, UntrustServer).
30483
+ *
30484
+ * @returns Promise resolving to the current servers nonce
30485
+ * @throws {NonceError} When reading nonce from contract fails
30486
+ * @private
30487
+ *
30488
+ * @example
30489
+ * ```typescript
30490
+ * const nonce = await this.getServersUserNonce();
30491
+ * console.log(`Current servers nonce: ${nonce}`);
30492
+ * ```
30493
+ */
30494
+ /**
30495
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30496
+ *
30497
+ * @remarks
30498
+ * Used for server-related operations (trust/untrust) to prevent replay attacks.
30499
+ * The nonce must be incremented with each server operation.
30500
+ *
30501
+ * @returns Promise resolving to the user's current nonce as a bigint
30502
+ * @throws {NonceError} When retrieving the nonce fails
30503
+ */
30504
+ private getServersUserNonce;
30505
+ /**
30506
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30507
+ * This nonce is used for permission-related operations (addPermission, addServerFilesAndPermissions).
30508
+ *
30509
+ * @returns Promise resolving to the current permissions nonce
30510
+ * @throws {NonceError} When reading nonce from contract fails
30511
+ * @private
30512
+ *
30513
+ * @example
30514
+ * ```typescript
30515
+ * const nonce = await this.getPermissionsUserNonce();
30516
+ * console.log(`Current permissions nonce: ${nonce}`);
30517
+ * ```
30518
+ */
30519
+ /**
30520
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30521
+ *
30522
+ * @remarks
30523
+ * Used for permission-related operations (grant/revoke) to prevent replay attacks.
30524
+ * The nonce must be incremented with each permission operation.
30525
+ *
30526
+ * @returns Promise resolving to the user's current nonce as a bigint
30527
+ * @throws {NonceError} When retrieving the nonce fails
30528
+ */
30529
+ private getPermissionsUserNonce;
30756
30530
  /**
30757
30531
  * Composes the EIP-712 typed data for PermissionGrant (new simplified format).
30758
30532
  *
@@ -30766,6 +30540,22 @@ declare class PermissionsController {
30766
30540
  * @returns Promise resolving to the typed data structure
30767
30541
  */
30768
30542
  private composePermissionGrantMessage;
30543
+ /**
30544
+ * Creates EIP-712 typed data structure for server files and permissions.
30545
+ *
30546
+ * @param params - Parameters for the server files and permissions message
30547
+ * @param params.granteeId - Grantee ID
30548
+ * @param params.grant - Grant URL or grant data
30549
+ * @param params.fileUrls - Array of file URLs
30550
+ * @param params.schemaIds - Schema IDs for each file
30551
+ * @param params.serverAddress - Server address
30552
+ * @param params.serverUrl - Server URL
30553
+ * @param params.serverPublicKey - Server public key
30554
+ * @param params.filePermissions - File permissions array
30555
+ * @param params.nonce - Unique number to prevent replay attacks
30556
+ * @returns Promise resolving to the typed data structure
30557
+ */
30558
+ private composeServerFilesAndPermissionMessage;
30769
30559
  /**
30770
30560
  * Gets the EIP-712 domain for PermissionGrant signatures.
30771
30561
  *
@@ -30821,38 +30611,6 @@ declare class PermissionsController {
30821
30611
  * ```
30822
30612
  */
30823
30613
  getUserPermissionGrantsOnChain(options?: GetUserPermissionsOptions): Promise<OnChainPermissionGrant[]>;
30824
- /**
30825
- * Gets all permission IDs for a specific file.
30826
- *
30827
- * @param fileId - The file ID to query permissions for
30828
- * @returns Promise resolving to array of permission IDs
30829
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30830
- */
30831
- getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
30832
- /**
30833
- * Gets all file IDs associated with a permission.
30834
- *
30835
- * @param permissionId - The permission ID to query files for
30836
- * @returns Promise resolving to array of file IDs
30837
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30838
- */
30839
- getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
30840
- /**
30841
- * Checks if a permission is active.
30842
- *
30843
- * @param permissionId - The permission ID to check
30844
- * @returns Promise resolving to boolean indicating if permission is active
30845
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30846
- */
30847
- isActivePermission(permissionId: bigint): Promise<boolean>;
30848
- /**
30849
- * Gets permission details from the contract.
30850
- *
30851
- * @param permissionId - The permission ID to query
30852
- * @returns Promise resolving to permission info
30853
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30854
- */
30855
- getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
30856
30614
  /**
30857
30615
  * Normalizes grant ID to hex format.
30858
30616
  * Handles conversion from permission ID (bigint/number/string) to proper hex hash format.
@@ -30895,7 +30653,7 @@ declare class PermissionsController {
30895
30653
  * console.log('Now trusting servers:', trustedServers);
30896
30654
  * ```
30897
30655
  */
30898
- addAndTrustServer(params: AddAndTrustServerParams): Promise<Hash>;
30656
+ addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30899
30657
  /**
30900
30658
  * Trusts a server for data processing (legacy method).
30901
30659
  *
@@ -30903,14 +30661,14 @@ declare class PermissionsController {
30903
30661
  * @returns Promise resolving to transaction hash
30904
30662
  * @deprecated Use addAndTrustServer instead
30905
30663
  */
30906
- trustServer(params: TrustServerParams): Promise<Hash>;
30664
+ submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30907
30665
  /**
30908
30666
  * Adds and trusts a server using a signature (gasless transaction).
30909
30667
  *
30910
30668
  * @param params - Parameters for adding and trusting the server
30911
- * @returns Promise resolving to transaction hash
30669
+ * @returns Promise resolving to TransactionHandle with ServerTrustResult event data
30912
30670
  */
30913
- addAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<Hash>;
30671
+ submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30914
30672
  /**
30915
30673
  * Trusts a server using a signature (gasless transaction - legacy method).
30916
30674
  *
@@ -30924,13 +30682,24 @@ declare class PermissionsController {
30924
30682
  * @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
30925
30683
  * @throws {BlockchainError} When trust operation fails for any other reason
30926
30684
  */
30927
- trustServerWithSignature(params: TrustServerParams): Promise<Hash>;
30685
+ submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30928
30686
  /**
30929
30687
  * Submits a direct untrust server transaction (without signature).
30930
30688
  *
30931
30689
  * @param params - The untrust server parameters containing server details
30932
30690
  * @returns Promise resolving to the transaction hash
30933
30691
  */
30692
+ /**
30693
+ * Submits an untrust server transaction directly to the blockchain.
30694
+ *
30695
+ * @remarks
30696
+ * Internal method used for direct blockchain submission of untrust server operations
30697
+ * when relayer callbacks are not available.
30698
+ *
30699
+ * @param params - The untrust server parameters
30700
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30701
+ * @throws {BlockchainError} When contract submission fails
30702
+ */
30934
30703
  private submitDirectUntrustTransaction;
30935
30704
  /**
30936
30705
  * Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
@@ -30960,7 +30729,7 @@ declare class PermissionsController {
30960
30729
  * console.log('Still trusting servers:', trustedServers);
30961
30730
  * ```
30962
30731
  */
30963
- untrustServer(params: UntrustServerParams): Promise<Hash>;
30732
+ submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30964
30733
  /**
30965
30734
  * Untrusts a server using a signature (gasless transaction).
30966
30735
  *
@@ -30973,7 +30742,7 @@ declare class PermissionsController {
30973
30742
  * @throws {RelayerError} When gasless submission fails
30974
30743
  * @throws {BlockchainError} When untrust transaction fails
30975
30744
  */
30976
- untrustServerWithSignature(params: UntrustServerParams): Promise<Hash>;
30745
+ submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30977
30746
  /**
30978
30747
  * Retrieves all servers trusted by a user from the DataPortabilityServers contract.
30979
30748
  *
@@ -30997,61 +30766,6 @@ declare class PermissionsController {
30997
30766
  * ```
30998
30767
  */
30999
30768
  getTrustedServers(userAddress?: Address): Promise<number[]>;
31000
- /**
31001
- * Retrieves detailed information about a specific server from the DataPortabilityServers contract.
31002
- *
31003
- * Returns complete server information including owner, address, public key, and URL.
31004
- * This information is used to establish secure connections and verify server identity.
31005
- *
31006
- * @param serverId - The unique numeric ID of the server to query
31007
- * @returns Promise resolving to complete server information
31008
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
31009
- * @throws {NetworkError} When unable to connect to the blockchain network
31010
- * @throws {ServerNotFoundError} When the server ID does not exist
31011
- *
31012
- * @example
31013
- * ```typescript
31014
- * const server = await vana.permissions.getServerInfo(1);
31015
- *
31016
- * console.log(`Server ${server.id}:`);
31017
- * console.log(` Owner: ${server.owner}`);
31018
- * console.log(` Address: ${server.serverAddress}`);
31019
- * console.log(` URL: ${server.url}`);
31020
- * console.log(` Public Key: ${server.publicKey}`);
31021
- * ```
31022
- */
31023
- getServerInfo(serverId: number): Promise<Server>;
31024
- /**
31025
- * Checks if a specific server is active in the DataPortabilityServers contract.
31026
- *
31027
- * An active server is one that is properly registered and operational, meaning
31028
- * it can receive and process data portability requests from users.
31029
- *
31030
- * @param serverId - The unique numeric ID of the server to check
31031
- * @returns Promise resolving to true if server is active, false otherwise
31032
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
31033
- * @throws {NetworkError} When unable to connect to the blockchain network
31034
- *
31035
- * @example
31036
- * ```typescript
31037
- * const isActive = await vana.permissions.isActiveServer(1);
31038
- *
31039
- * if (isActive) {
31040
- * console.log('Server 1 is active and ready to process requests');
31041
- * } else {
31042
- * console.log('Server 1 is inactive or not found');
31043
- * }
31044
- * ```
31045
- */
31046
- isActiveServer(serverId: number): Promise<boolean>;
31047
- /**
31048
- * Checks if a server is active for a specific user.
31049
- *
31050
- * @param serverId - Server ID (numeric)
31051
- * @param userAddress - Optional user address (defaults to current user)
31052
- * @returns Promise resolving to boolean indicating if server is active for the user
31053
- */
31054
- isActiveServerForUser(serverId: number, userAddress?: Address): Promise<boolean>;
31055
30769
  /**
31056
30770
  * Gets the total count of trusted servers for a user.
31057
30771
  *
@@ -31079,22 +30793,60 @@ declare class PermissionsController {
31079
30793
  /**
31080
30794
  * Gets server information for multiple servers efficiently.
31081
30795
  *
31082
- * @param serverIds - Array of server IDs to query
31083
- * @returns Promise resolving to batch result with successes and failures
30796
+ * @remarks
30797
+ * This method uses multicall to fetch information for multiple servers in a single
30798
+ * blockchain call, improving performance when querying many servers. Failed lookups
30799
+ * are returned separately for error handling.
30800
+ *
30801
+ * @param serverIds - Array of numeric server IDs to query
30802
+ * @returns Promise resolving to batch result containing successful lookups and failed IDs
31084
30803
  * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30804
+ * @example
30805
+ * ```typescript
30806
+ * const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
30807
+ *
30808
+ * // Process successful lookups
30809
+ * result.servers.forEach((server, id) => {
30810
+ * console.log(`Server ${id}: ${server.url}`);
30811
+ * });
30812
+ *
30813
+ * // Handle failed lookups
30814
+ * if (result.failed.length > 0) {
30815
+ * console.log(`Failed to fetch: ${result.failed.join(', ')}`);
30816
+ * }
30817
+ * ```
31085
30818
  */
31086
30819
  getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
31087
30820
  /**
31088
30821
  * Checks whether a specific server is trusted by a user.
31089
30822
  *
31090
- * @param serverId - Server ID to check (numeric)
30823
+ * @remarks
30824
+ * This method queries the user's trusted server list and checks if the specified
30825
+ * server is present. Returns both the trust status and the index in the trust list
30826
+ * if trusted.
30827
+ *
30828
+ * @param serverId - Numeric server ID to check
31091
30829
  * @param userAddress - Optional user address (defaults to current user)
31092
- * @returns Promise resolving to server trust status
30830
+ * @returns Promise resolving to server trust status with trust index if applicable
30831
+ * @throws {BlockchainError} When reading from contract fails
30832
+ * @example
30833
+ * ```typescript
30834
+ * const status = await vana.permissions.checkServerTrustStatus(1);
30835
+ * if (status.isTrusted) {
30836
+ * console.log(`Server is trusted at index ${status.trustIndex}`);
30837
+ * } else {
30838
+ * console.log('Server is not trusted');
30839
+ * }
30840
+ * ```
31093
30841
  */
31094
30842
  checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
31095
30843
  /**
31096
30844
  * Composes EIP-712 typed data for AddAndTrustServer.
31097
30845
  *
30846
+ * @remarks
30847
+ * Creates the complete typed data structure required for EIP-712 signature generation
30848
+ * when adding and trusting a new server in a single transaction.
30849
+ *
31098
30850
  * @param input - The add and trust server input data containing server details
31099
30851
  * @returns Promise resolving to the typed data structure for server add and trust
31100
30852
  */
@@ -31176,7 +30928,7 @@ declare class PermissionsController {
31176
30928
  * console.log(`Grantee registered in transaction: ${txHash}`);
31177
30929
  * ```
31178
30930
  */
31179
- registerGrantee(params: RegisterGranteeParams): Promise<Hash>;
30931
+ submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
31180
30932
  /**
31181
30933
  * Registers a grantee with a signature (gasless transaction)
31182
30934
  *
@@ -31192,7 +30944,7 @@ declare class PermissionsController {
31192
30944
  * });
31193
30945
  * ```
31194
30946
  */
31195
- registerGranteeWithSignature(params: RegisterGranteeParams): Promise<Hash>;
30947
+ submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
31196
30948
  /**
31197
30949
  * Submits a signed register grantee transaction via relayer
31198
30950
  *
@@ -31205,7 +30957,7 @@ declare class PermissionsController {
31205
30957
  * const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
31206
30958
  * ```
31207
30959
  */
31208
- submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<Hash>;
30960
+ submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
31209
30961
  /**
31210
30962
  * Retrieves all registered grantees from the DataPortabilityGrantees contract.
31211
30963
  *
@@ -31309,6 +31061,345 @@ declare class PermissionsController {
31309
31061
  * @private
31310
31062
  */
31311
31063
  private submitSignedRegisterGranteeTransaction;
31064
+ /**
31065
+ * Get all trusted server IDs for a user
31066
+ *
31067
+ * @param userAddress - User address to query (defaults to current user)
31068
+ * @returns Promise resolving to array of server IDs
31069
+ */
31070
+ getUserServerIds(userAddress?: Address): Promise<bigint[]>;
31071
+ /**
31072
+ * Get server ID at specific index for a user
31073
+ *
31074
+ * @param userAddress - User address to query
31075
+ * @param serverIndex - Index in the user's server list
31076
+ * @returns Promise resolving to server ID
31077
+ */
31078
+ getUserServerIdAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
31079
+ /**
31080
+ * Get the number of trusted servers for a user
31081
+ *
31082
+ * @param userAddress - User address to query (defaults to current user)
31083
+ * @returns Promise resolving to number of trusted servers
31084
+ */
31085
+ getUserServerCount(userAddress?: Address): Promise<bigint>;
31086
+ /**
31087
+ * Get detailed information about trusted servers for a user
31088
+ *
31089
+ * @param userAddress - User address to query (defaults to current user)
31090
+ * @returns Promise resolving to array of trusted server info
31091
+ */
31092
+ getUserTrustedServers(userAddress?: Address): Promise<TrustedServerInfo[]>;
31093
+ /**
31094
+ * Get trusted server info for a specific server ID and user
31095
+ *
31096
+ * @param userAddress - User address to query
31097
+ * @param serverId - Server ID to get info for
31098
+ * @returns Promise resolving to trusted server info
31099
+ */
31100
+ getUserTrustedServer(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
31101
+ /**
31102
+ * Get server information by server ID
31103
+ *
31104
+ * @param serverId - Server ID to get info for
31105
+ * @returns Promise resolving to server info
31106
+ */
31107
+ getServerInfo(serverId: bigint): Promise<ServerInfo>;
31108
+ /**
31109
+ * Get server information by server address
31110
+ *
31111
+ * @param serverAddress - Server address to get info for
31112
+ * @returns Promise resolving to server info
31113
+ */
31114
+ getServerInfoByAddress(serverAddress: Address): Promise<ServerInfo>;
31115
+ /**
31116
+ * Get all permission IDs for a user
31117
+ *
31118
+ * @param userAddress - User address to query (defaults to current user)
31119
+ * @returns Promise resolving to array of permission IDs
31120
+ */
31121
+ getUserPermissionIds(userAddress?: Address): Promise<bigint[]>;
31122
+ /**
31123
+ * Get permission ID at specific index for a user
31124
+ *
31125
+ * @param userAddress - User address to query
31126
+ * @param permissionIndex - Index in the user's permission list
31127
+ * @returns Promise resolving to permission ID
31128
+ */
31129
+ getUserPermissionIdAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
31130
+ /**
31131
+ * Get the number of permissions for a user
31132
+ *
31133
+ * @param userAddress - User address to query (defaults to current user)
31134
+ * @returns Promise resolving to number of permissions
31135
+ */
31136
+ getUserPermissionCount(userAddress?: Address): Promise<bigint>;
31137
+ /**
31138
+ * Get detailed permission information by permission ID
31139
+ *
31140
+ * @param permissionId - Permission ID to get info for
31141
+ * @returns Promise resolving to permission info
31142
+ */
31143
+ getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
31144
+ /**
31145
+ * Get all permission IDs for a specific file
31146
+ *
31147
+ * @param fileId - File ID to get permissions for
31148
+ * @returns Promise resolving to array of permission IDs
31149
+ */
31150
+ getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
31151
+ /**
31152
+ * Get all file IDs for a specific permission
31153
+ *
31154
+ * @param permissionId - Permission ID to get files for
31155
+ * @returns Promise resolving to array of file IDs
31156
+ */
31157
+ getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
31158
+ /**
31159
+ * Get all permissions for a specific file (alias for getFilePermissionIds)
31160
+ *
31161
+ * @param fileId - File ID to get permissions for
31162
+ * @returns Promise resolving to array of permission IDs
31163
+ */
31164
+ getFilePermissions(fileId: bigint): Promise<bigint[]>;
31165
+ /**
31166
+ * Get grantee information by grantee ID
31167
+ *
31168
+ * @param granteeId - Grantee ID to get info for
31169
+ * @returns Promise resolving to grantee info
31170
+ */
31171
+ getGranteeInfo(granteeId: bigint): Promise<GranteeInfo>;
31172
+ /**
31173
+ * Get grantee information by grantee address
31174
+ *
31175
+ * @param granteeAddress - Grantee address to get info for
31176
+ * @returns Promise resolving to grantee info
31177
+ */
31178
+ getGranteeInfoByAddress(granteeAddress: Address): Promise<GranteeInfo>;
31179
+ /**
31180
+ * Get all permission IDs for a specific grantee
31181
+ *
31182
+ * @param granteeId - Grantee ID to get permissions for
31183
+ * @returns Promise resolving to array of permission IDs
31184
+ */
31185
+ getGranteePermissionIds(granteeId: bigint): Promise<bigint[]>;
31186
+ /**
31187
+ * Get all permissions for a specific grantee (alias for getGranteePermissionIds)
31188
+ *
31189
+ * @param granteeId - Grantee ID to get permissions for
31190
+ * @returns Promise resolving to array of permission IDs
31191
+ */
31192
+ getGranteePermissions(granteeId: bigint): Promise<bigint[]>;
31193
+ /**
31194
+ * Get all server IDs for a user
31195
+ *
31196
+ * @param userAddress - User address to get server IDs for
31197
+ * @returns Promise resolving to array of server IDs
31198
+ */
31199
+ getUserServerIdsValues(userAddress: Address): Promise<bigint[]>;
31200
+ /**
31201
+ * Get server ID at specific index for a user
31202
+ *
31203
+ * @param userAddress - User address
31204
+ * @param serverIndex - Index of the server ID
31205
+ * @returns Promise resolving to server ID
31206
+ */
31207
+ getUserServerIdsAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
31208
+ /**
31209
+ * Get the number of servers a user has
31210
+ *
31211
+ * @param userAddress - User address
31212
+ * @returns Promise resolving to number of servers
31213
+ */
31214
+ getUserServerIdsLength(userAddress: Address): Promise<bigint>;
31215
+ /**
31216
+ * Get trusted server info for a specific user and server ID
31217
+ *
31218
+ * @param userAddress - User address
31219
+ * @param serverId - Server ID
31220
+ * @returns Promise resolving to trusted server info
31221
+ */
31222
+ getUserServers(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
31223
+ /**
31224
+ * Get server info by server ID
31225
+ *
31226
+ * @param serverId - Server ID
31227
+ * @returns Promise resolving to server info
31228
+ */
31229
+ getServers(serverId: bigint): Promise<ServerInfo>;
31230
+ /**
31231
+ * Get user info including nonce and trusted server IDs
31232
+ *
31233
+ * @param userAddress - User address
31234
+ * @returns Promise resolving to user info
31235
+ */
31236
+ getUsers(userAddress: Address): Promise<{
31237
+ nonce: bigint;
31238
+ trustedServerIds: bigint[];
31239
+ }>;
31240
+ /**
31241
+ * Update server URL
31242
+ *
31243
+ * @param serverId - Server ID to update
31244
+ * @param url - New URL for the server
31245
+ * @returns Promise resolving to transaction hash
31246
+ */
31247
+ submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
31248
+ /**
31249
+ * Get all permission IDs for a user
31250
+ *
31251
+ * @param userAddress - User address to get permission IDs for
31252
+ * @returns Promise resolving to array of permission IDs
31253
+ */
31254
+ getUserPermissionIdsValues(userAddress: Address): Promise<bigint[]>;
31255
+ /**
31256
+ * Get permission ID at specific index for a user
31257
+ *
31258
+ * @param userAddress - User address
31259
+ * @param permissionIndex - Index of the permission ID
31260
+ * @returns Promise resolving to permission ID
31261
+ */
31262
+ getUserPermissionIdsAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
31263
+ /**
31264
+ * Get the number of permissions a user has
31265
+ *
31266
+ * @param userAddress - User address
31267
+ * @returns Promise resolving to number of permissions
31268
+ */
31269
+ getUserPermissionIdsLength(userAddress: Address): Promise<bigint>;
31270
+ /**
31271
+ * Get permission info by permission ID
31272
+ *
31273
+ * @param permissionId - Permission ID
31274
+ * @returns Promise resolving to permission info
31275
+ */
31276
+ getPermissions(permissionId: bigint): Promise<PermissionInfo>;
31277
+ /**
31278
+ * Submit permission with signature to the blockchain (supports gasless transactions)
31279
+ *
31280
+ * @param params - Parameters for adding permission
31281
+ * @returns Promise resolving to transaction hash
31282
+ * @throws {RelayerError} When gasless transaction submission fails
31283
+ * @throws {SignatureError} When user rejects the signature request
31284
+ * @throws {BlockchainError} When permission addition fails
31285
+ * @throws {NetworkError} When network communication fails
31286
+ */
31287
+ submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
31288
+ /**
31289
+ * Submits an already-signed add permission transaction to the blockchain.
31290
+ * This method supports both relayer-based gasless transactions and direct transactions.
31291
+ *
31292
+ * @param typedData - The EIP-712 typed data for AddPermission
31293
+ * @param signature - The user's signature
31294
+ * @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
31295
+ * @throws {RelayerError} When gasless transaction submission fails
31296
+ * @throws {BlockchainError} When permission addition fails
31297
+ * @throws {NetworkError} When network communication fails
31298
+ */
31299
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
31300
+ /**
31301
+ * Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
31302
+ *
31303
+ * @remarks
31304
+ * This method validates files against their specified schemas before submission.
31305
+ * Schema validation ensures data conforms to expected formats before on-chain registration.
31306
+ * Files with schemaId = 0 bypass validation. The method supports atomic batch operations
31307
+ * where all files and permissions are registered in a single transaction.
31308
+ *
31309
+ * @param params - Parameters for adding server files and permissions
31310
+ * @param params.granteeId - The ID of the permission grantee
31311
+ * @param params.grant - Grant URL containing permission parameters (typically IPFS)
31312
+ * @param params.fileUrls - Array of file URLs to register
31313
+ * @param params.schemaIds - Schema IDs for each file. Use 0 for files without schema validation.
31314
+ * Array length must match fileUrls length.
31315
+ * @param params.serverAddress - Server wallet address for decryption permissions
31316
+ * @param params.serverUrl - Server endpoint URL
31317
+ * @param params.serverPublicKey - Server's public key for encryption.
31318
+ * Obtain via `vana.server.getIdentity(userAddress).public_key`.
31319
+ * @param params.filePermissions - Nested array of permissions for each file
31320
+ * @returns TransactionHandle with immediate hash access and event parsing capability
31321
+ * @throws {Error} When schemaIds array length doesn't match fileUrls array length
31322
+ * @throws {SchemaValidationError} When file data doesn't match the specified schema.
31323
+ * Verify data structure matches schema definition from `vana.schemas.get(schemaId)`.
31324
+ * @throws {RelayerError} When gasless transaction submission fails.
31325
+ * Retry without relayer configuration to submit direct transaction.
31326
+ * @throws {SignatureError} When user rejects the signature request
31327
+ * @throws {BlockchainError} When server files and permissions addition fails
31328
+ * @throws {NetworkError} When network communication fails.
31329
+ * Check network connection or configure alternative gateways.
31330
+ *
31331
+ * @example
31332
+ * ```typescript
31333
+ * const result = await vana.permissions.submitAddServerFilesAndPermissions({
31334
+ * granteeId: BigInt(1),
31335
+ * grant: "ipfs://QmXxx...",
31336
+ * fileUrls: ["https://storage.example.com/data.json"],
31337
+ * schemaIds: [123], // LinkedIn profile schema ID
31338
+ * serverAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31339
+ * serverUrl: "https://server.example.com",
31340
+ * serverPublicKey: serverInfo.public_key,
31341
+ * filePermissions: [[{
31342
+ * account: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31343
+ * key: encryptedKey
31344
+ * }]]
31345
+ * });
31346
+ * const events = await result.waitForEvents();
31347
+ * console.log(`Permission ID: ${events.permissionId}`);
31348
+ * ```
31349
+ */
31350
+ submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
31351
+ /**
31352
+ * Submits an already-signed add server files and permissions transaction to the blockchain.
31353
+ *
31354
+ * @remarks
31355
+ * This method returns a TransactionHandle that provides immediate access to the transaction hash
31356
+ * while allowing lazy-loaded access to parsed event data. Use `waitForEvents()` to retrieve
31357
+ * the permission ID and other event details after transaction confirmation.
31358
+ *
31359
+ * @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
31360
+ * @param signature - The user's signature
31361
+ * @returns TransactionHandle with immediate hash access and optional event parsing
31362
+ * @throws {RelayerError} When gasless transaction submission fails
31363
+ * @throws {BlockchainError} When server files and permissions addition fails
31364
+ * @throws {NetworkError} When network communication fails
31365
+ *
31366
+ * @example
31367
+ * ```typescript
31368
+ * const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
31369
+ * typedData,
31370
+ * signature
31371
+ * );
31372
+ * console.log(`Transaction submitted: ${tx.hash}`);
31373
+ *
31374
+ * // Wait for confirmation and get the permission ID
31375
+ * const { permissionId } = await tx.waitForEvents();
31376
+ * console.log(`Permission created with ID: ${permissionId}`);
31377
+ * ```
31378
+ */
31379
+ submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
31380
+ /**
31381
+ * Submit permission revocation with signature to the blockchain
31382
+ *
31383
+ * @param permissionId - Permission ID to revoke
31384
+ * @returns Promise resolving to transaction hash
31385
+ */
31386
+ submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
31387
+ /**
31388
+ * Submits a signed add permission transaction directly to the blockchain.
31389
+ *
31390
+ * @param typedData - The typed data structure for the permission addition
31391
+ * @param signature - The cryptographic signature authorizing the transaction
31392
+ * @returns Promise resolving to the transaction hash
31393
+ */
31394
+ private submitDirectAddPermissionTransaction;
31395
+ /**
31396
+ * Submits a signed add server files and permissions transaction directly to the blockchain.
31397
+ *
31398
+ * @param typedData - The typed data structure for the server files and permissions addition
31399
+ * @param signature - The cryptographic signature authorizing the transaction
31400
+ * @returns Promise resolving to the transaction hash
31401
+ */
31402
+ private submitDirectAddServerFilesAndPermissionsTransaction;
31312
31403
  }
31313
31404
 
31314
31405
  /**
@@ -31322,10 +31413,10 @@ declare class PermissionsController {
31322
31413
  interface CreateSchemaParams {
31323
31414
  /** The name of the schema */
31324
31415
  name: string;
31325
- /** The type/category of the schema */
31326
- type: string;
31416
+ /** The dialect of the schema (e.g., 'json' or 'sqlite') */
31417
+ dialect: "json" | "sqlite";
31327
31418
  /** The schema definition object or JSON string */
31328
- definition: object | string;
31419
+ schema: object | string;
31329
31420
  }
31330
31421
  /**
31331
31422
  * Result of creating a new schema.
@@ -31370,8 +31461,8 @@ interface CreateSchemaResult {
31370
31461
  * // Create a new schema with automatic IPFS upload
31371
31462
  * const result = await vana.schemas.create({
31372
31463
  * name: "User Profile",
31373
- * type: "personal",
31374
- * definition: {
31464
+ * dialect: "json",
31465
+ * schema: {
31375
31466
  * type: "object",
31376
31467
  * properties: {
31377
31468
  * name: { type: "string" },
@@ -31406,7 +31497,7 @@ declare class SchemaController {
31406
31497
  * - Uploads the definition to IPFS to generate a permanent URL
31407
31498
  * - Registers the schema on the blockchain with the generated URL
31408
31499
  *
31409
- * @param params - Schema creation parameters including name, type, and definition
31500
+ * @param params - Schema creation parameters including name, dialect, and definition
31410
31501
  * @returns Promise resolving to creation results with schema ID and transaction hash
31411
31502
  * @throws {SchemaValidationError} When the schema definition is invalid
31412
31503
  * @throws {Error} When IPFS upload or blockchain registration fails
@@ -31415,8 +31506,8 @@ declare class SchemaController {
31415
31506
  * // Create a JSON schema for user profiles
31416
31507
  * const result = await vana.schemas.create({
31417
31508
  * name: "User Profile",
31418
- * type: "personal",
31419
- * definition: {
31509
+ * dialect: "json",
31510
+ * schema: {
31420
31511
  * type: "object",
31421
31512
  * properties: {
31422
31513
  * name: { type: "string" },
@@ -31431,42 +31522,66 @@ declare class SchemaController {
31431
31522
  */
31432
31523
  create(params: CreateSchemaParams): Promise<CreateSchemaResult>;
31433
31524
  /**
31434
- * Retrieves a schema by its ID.
31525
+ * Retrieves a complete schema by its ID with definition fetched and flattened.
31435
31526
  *
31436
31527
  * @param schemaId - The ID of the schema to retrieve
31437
- * @returns Promise resolving to the schema object
31438
- * @throws {Error} When the schema is not found or chain is unavailable
31528
+ * @param options - Optional parameters
31529
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31530
+ * @returns Promise resolving to the complete schema object with all fields populated
31531
+ * @throws {Error} When the schema is not found, definition cannot be fetched, or chain is unavailable
31439
31532
  * @example
31440
31533
  * ```typescript
31441
31534
  * const schema = await vana.schemas.get(1);
31442
- * console.log(`Schema: ${schema.name} (${schema.type})`);
31535
+ * console.log(`Schema: ${schema.name} (${schema.dialect})`);
31536
+ * console.log(`Version: ${schema.version}`);
31537
+ * console.log(`Description: ${schema.description}`);
31538
+ * console.log('Schema:', schema.schema);
31539
+ *
31540
+ * // Use directly with validator (schema has all required fields)
31541
+ * validator.validateDataAgainstSchema(data, schema);
31443
31542
  * ```
31444
31543
  */
31445
- get(schemaId: number): Promise<Schema>;
31544
+ get(schemaId: number, options?: {
31545
+ subgraphUrl?: string;
31546
+ }): Promise<CompleteSchema>;
31446
31547
  /**
31447
31548
  * Gets the total number of schemas registered on the network.
31448
31549
  *
31550
+ * @param options - Optional parameters
31551
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31449
31552
  * @returns Promise resolving to the total schema count
31450
31553
  * @throws {Error} When the count cannot be retrieved
31451
31554
  * @example
31452
31555
  * ```typescript
31453
31556
  * const count = await vana.schemas.count();
31454
31557
  * console.log(`Total schemas: ${count}`);
31558
+ *
31559
+ * // With custom subgraph
31560
+ * const count = await vana.schemas.count({
31561
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31562
+ * });
31455
31563
  * ```
31456
31564
  */
31457
- count(): Promise<number>;
31565
+ count(options?: {
31566
+ subgraphUrl?: string;
31567
+ }): Promise<number>;
31458
31568
  /**
31459
31569
  * Lists all schemas with pagination.
31460
31570
  *
31461
31571
  * @param options - Optional parameters for listing schemas
31462
31572
  * @param options.limit - Maximum number of schemas to return
31463
31573
  * @param options.offset - Number of schemas to skip
31574
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31575
+ * @param options.includeDefinitions - Whether to fetch and include schema definitions (default: false for performance)
31464
31576
  * @returns Promise resolving to an array of schemas
31465
31577
  * @example
31466
31578
  * ```typescript
31467
- * // Get all schemas
31579
+ * // Get all schemas (without definitions for performance)
31468
31580
  * const schemas = await vana.schemas.list();
31469
31581
  *
31582
+ * // Get schemas with definitions
31583
+ * const schemas = await vana.schemas.list({ includeDefinitions: true });
31584
+ *
31470
31585
  * // Get schemas with pagination
31471
31586
  * const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
31472
31587
  * ```
@@ -31474,6 +31589,8 @@ declare class SchemaController {
31474
31589
  list(options?: {
31475
31590
  limit?: number;
31476
31591
  offset?: number;
31592
+ subgraphUrl?: string;
31593
+ includeDefinitions?: boolean;
31477
31594
  }): Promise<Schema[]>;
31478
31595
  /**
31479
31596
  * Adds a schema using the legacy method (low-level API).
@@ -31483,6 +31600,36 @@ declare class SchemaController {
31483
31600
  * @returns Promise resolving to the add schema result
31484
31601
  */
31485
31602
  addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
31603
+ /**
31604
+ * Internal method: Query schema via subgraph
31605
+ *
31606
+ * @param params - Query parameters
31607
+ * @param params.schemaId - The ID of the schema to retrieve
31608
+ * @param params.subgraphUrl - The subgraph URL to query
31609
+ * @returns Promise resolving to the schema object
31610
+ * @private
31611
+ */
31612
+ private _getSchemaViaSubgraph;
31613
+ /**
31614
+ * Internal method: List schemas via subgraph
31615
+ *
31616
+ * @param params - Query parameters
31617
+ * @param params.limit - Maximum number of schemas to return
31618
+ * @param params.offset - Number of schemas to skip
31619
+ * @param params.subgraphUrl - The subgraph URL to query
31620
+ * @returns Promise resolving to an array of schemas
31621
+ * @private
31622
+ */
31623
+ private _listSchemasViaSubgraph;
31624
+ /**
31625
+ * Internal method: Count schemas via subgraph
31626
+ *
31627
+ * @param params - Query parameters
31628
+ * @param params.subgraphUrl - The subgraph URL to query
31629
+ * @returns Promise resolving to the total schema count
31630
+ * @private
31631
+ */
31632
+ private _countSchemasViaSubgraph;
31486
31633
  /**
31487
31634
  * Gets the user's wallet address.
31488
31635
  *
@@ -31490,6 +31637,13 @@ declare class SchemaController {
31490
31637
  * @returns Promise resolving to the user's address
31491
31638
  */
31492
31639
  private getUserAddress;
31640
+ /**
31641
+ * Fetches and attaches definitions to an array of schemas.
31642
+ *
31643
+ * @param schemas - Array of schemas to fetch definitions for
31644
+ * @private
31645
+ */
31646
+ private _fetchDefinitionsForSchemas;
31493
31647
  }
31494
31648
 
31495
31649
  /**
@@ -31564,34 +31718,30 @@ declare class SchemaValidator {
31564
31718
  */
31565
31719
  validateDataSchema(schema: unknown): asserts schema is DataSchema;
31566
31720
  /**
31567
- * Validates data against a JSON Schema from a data schema
31721
+ * Validates data against a JSON Schema from a schema
31568
31722
  *
31569
31723
  * @param data - The data to validate
31570
- * @param schema - The data schema containing the schema
31724
+ * @param schema - The schema containing the validation rules (DataSchema or Schema)
31571
31725
  * @throws SchemaValidationError if invalid
31572
31726
  * @example
31573
31727
  * ```typescript
31574
31728
  * const validator = new SchemaValidator();
31575
31729
  *
31576
- * const schema = {
31730
+ * // Works with Schema from schemas.get()
31731
+ * const schema = await vana.schemas.get(1);
31732
+ * validator.validateDataAgainstSchema(userData, schema);
31733
+ *
31734
+ * // Also works with DataSchema object
31735
+ * const dataSchema: DataSchema = {
31577
31736
  * name: "User Profile",
31578
31737
  * version: "1.0.0",
31579
31738
  * dialect: "json",
31580
- * schema: {
31581
- * type: "object",
31582
- * properties: {
31583
- * name: { type: "string" },
31584
- * age: { type: "number" }
31585
- * },
31586
- * required: ["name"]
31587
- * }
31739
+ * schema: { type: "object", properties: { name: { type: "string" } } }
31588
31740
  * };
31589
- *
31590
- * const userData = { name: "Alice", age: 30 };
31591
- * validator.validateDataAgainstSchema(userData, schema);
31741
+ * validator.validateDataAgainstSchema(userData, dataSchema);
31592
31742
  * ```
31593
31743
  */
31594
- validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
31744
+ validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31595
31745
  /**
31596
31746
  * Validates a SQLite DDL string for basic syntax
31597
31747
  * Note: This is a basic validation, full SQL parsing would require a proper SQL parser
@@ -31635,7 +31785,7 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
31635
31785
  * @returns void - Function doesn't return a value
31636
31786
  * @throws SchemaValidationError if invalid
31637
31787
  */
31638
- declare function validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
31788
+ declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31639
31789
  /**
31640
31790
  * Convenience function to fetch and validate a schema from a URL
31641
31791
  *
@@ -34131,19 +34281,101 @@ declare class DataController {
34131
34281
  subgraphUrl?: string;
34132
34282
  }): Promise<UserFile$1[]>;
34133
34283
  /**
34134
- * Retrieves a list of permissions granted by a user using the new subgraph entities.
34284
+ * Fetches proof data for multiple files from the subgraph.
34135
34285
  *
34136
- * This method queries the Vana subgraph to find permissions directly granted by the user
34137
- * using the new Permission entity. It efficiently handles millions of permissions by:
34138
- * 1. Querying the subgraph for user's directly granted permissions
34139
- * 2. Returning complete permission information from subgraph
34140
- * 3. No need for additional contract calls as all data comes from subgraph
34286
+ * @private
34287
+ * @param fileIds - Array of file IDs to fetch proofs for
34288
+ * @param subgraphUrl - The subgraph endpoint URL
34289
+ * @returns Map of file IDs to their associated DLP IDs
34290
+ */
34291
+ private _fetchProofsFromSubgraph;
34292
+ /**
34293
+ * Fetches proof data for multiple files from the blockchain.
34294
+ * Falls back to this when subgraph is unavailable.
34295
+ *
34296
+ * @private
34297
+ * @param fileIds - Array of file IDs to fetch proofs for
34298
+ * @returns Map of file IDs to their associated DLP IDs
34299
+ */
34300
+ private _fetchProofsFromChain;
34301
+ /**
34302
+ * Retrieves information about a specific Data Liquidity Pool (DLP).
34303
+ *
34304
+ * @remarks
34305
+ * DLPs are entities that process and verify data files in the Vana network.
34306
+ * This method fetches DLP metadata including name, status, and performance rating.
34307
+ * Uses subgraph first for efficiency, falls back to chain if unavailable.
34308
+ *
34309
+ * @param dlpId - The unique identifier of the DLP
34310
+ * @param options - Optional parameters
34311
+ * @param options.subgraphUrl - Custom subgraph URL to override default
34312
+ * @returns Promise resolving to DLP information
34313
+ * @throws {Error} When DLP cannot be found - "DLP not found: {dlpId}"
34314
+ * @throws {Error} When query fails - "Failed to fetch DLP: {error}"
34315
+ * @example
34316
+ * ```typescript
34317
+ * const dlp = await vana.data.getDLP(26);
34318
+ * console.log(`DLP ${dlp.name}: ${dlp.status}`);
34319
+ * ```
34320
+ */
34321
+ getDLP(dlpId: number, options?: {
34322
+ subgraphUrl?: string;
34323
+ }): Promise<{
34324
+ id: number;
34325
+ name: string;
34326
+ metadata?: string;
34327
+ status?: number;
34328
+ address?: Address;
34329
+ owner?: Address;
34330
+ }>;
34331
+ /**
34332
+ * Lists all Data Liquidity Pools (DLPs) with optional pagination.
34333
+ *
34334
+ * @remarks
34335
+ * Fetches a paginated list of all DLPs registered in the network.
34336
+ * Uses subgraph for efficient querying with fallback to chain multicall.
34337
+ *
34338
+ * @param options - Optional parameters for pagination and filtering
34339
+ * @param options.limit - Maximum number of DLPs to return (default: 100)
34340
+ * @param options.offset - Number of DLPs to skip (default: 0)
34341
+ * @param options.subgraphUrl - Custom subgraph URL to override default
34342
+ * @returns Promise resolving to array of DLP information
34343
+ * @throws {Error} When query fails - "Failed to list DLPs: {error}"
34344
+ * @example
34345
+ * ```typescript
34346
+ * // Get first 10 DLPs
34347
+ * const dlps = await vana.data.listDLPs({ limit: 10 });
34348
+ * dlps.forEach(dlp => console.log(`${dlp.id}: ${dlp.name}`));
34349
+ *
34350
+ * // Get next page
34351
+ * const nextPage = await vana.data.listDLPs({ limit: 10, offset: 10 });
34352
+ * ```
34353
+ */
34354
+ listDLPs(options?: {
34355
+ limit?: number;
34356
+ offset?: number;
34357
+ subgraphUrl?: string;
34358
+ }): Promise<Array<{
34359
+ id: number;
34360
+ name: string;
34361
+ metadata?: string;
34362
+ status?: number;
34363
+ address?: Address;
34364
+ owner?: Address;
34365
+ }>>;
34366
+ /**
34367
+ * Retrieves a list of permissions granted by a user.
34368
+ *
34369
+ * This method supports automatic fallback between subgraph and RPC modes:
34370
+ * - If subgraph URL is available, tries subgraph query first
34371
+ * - Falls back to direct contract queries via RPC if subgraph fails
34372
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
34141
34373
  *
34142
34374
  * @param params - Object containing the user address and optional subgraph URL
34143
34375
  * @param params.user - The wallet address of the user to query permissions for
34144
34376
  * @param params.subgraphUrl - Optional subgraph URL to override the default
34145
34377
  * @returns Promise resolving to an array of permission objects
34146
- * @throws Error if subgraph is unavailable or returns invalid data
34378
+ * @throws Error if both subgraph and RPC queries fail
34147
34379
  */
34148
34380
  getUserPermissions(params: {
34149
34381
  user: Address;
@@ -34159,43 +34391,59 @@ declare class DataController {
34159
34391
  user: Address;
34160
34392
  }>>;
34161
34393
  /**
34162
- * Retrieves a list of trusted servers for a user using the new subgraph entities.
34394
+ * Internal method: Query user permissions via subgraph
34163
34395
  *
34164
- * This method queries the Vana subgraph to find trusted servers directly associated with the user
34165
- * with support for both subgraph and direct RPC queries.
34396
+ * @param params - Query parameters object
34397
+ * @param params.user - The user address to query permissions for
34398
+ * @param params.subgraphUrl - The subgraph URL endpoint to query
34399
+ * @returns Promise resolving to an array of permission objects
34400
+ */
34401
+ private _getUserPermissionsViaSubgraph;
34402
+ /**
34403
+ * Internal method: Query user permissions via direct RPC
34166
34404
  *
34167
- * This method supports multiple query modes:
34168
- * - 'subgraph': Fast query via subgraph (requires subgraphUrl)
34169
- * - 'rpc': Direct contract queries (slower but no external dependencies)
34170
- * - 'auto': Try subgraph first, fallback to RPC if unavailable
34405
+ * @param params - Query parameters object
34406
+ * @param params.user - The user address to query permissions for
34407
+ * @returns Promise resolving to an array of permission objects
34408
+ */
34409
+ private _getUserPermissionsViaRpc;
34410
+ /**
34411
+ * Retrieves a list of trusted servers for a user.
34171
34412
  *
34172
- * @param params - Query parameters including user address and mode selection
34173
- * @returns Promise resolving to trusted servers with metadata about the query
34174
- * @throws Error if query fails in both modes (when using 'auto')
34413
+ * This method supports automatic fallback between subgraph and RPC modes:
34414
+ * - If subgraph URL is available, tries subgraph query first for fast results
34415
+ * - Falls back to direct contract queries via RPC if subgraph fails
34416
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
34417
+ *
34418
+ * @param params - Query parameters including user address and optional pagination
34419
+ * @param params.user - The wallet address of the user to query trusted servers for
34420
+ * @param params.subgraphUrl - Optional subgraph URL to override the default
34421
+ * @param params.limit - Maximum number of results to return (default: 50)
34422
+ * @param params.offset - Number of results to skip for pagination (default: 0)
34423
+ * @returns Promise resolving to an array of trusted server objects
34424
+ * @throws Error if both subgraph and RPC queries fail
34175
34425
  * @example
34176
34426
  * ```typescript
34177
- * // Use subgraph for fast queries
34178
- * const result = await vana.data.getUserTrustedServers({
34179
- * user: '0x...',
34180
- * mode: 'subgraph',
34181
- * subgraphUrl: 'https://...'
34427
+ * // Basic usage with automatic fallback
34428
+ * const servers = await vana.data.getUserTrustedServers({
34429
+ * user: '0x...'
34182
34430
  * });
34183
34431
  *
34184
- * // Use direct RPC (no external dependencies)
34185
- * const result = await vana.data.getUserTrustedServers({
34432
+ * // With pagination
34433
+ * const servers = await vana.data.getUserTrustedServers({
34186
34434
  * user: '0x...',
34187
- * mode: 'rpc',
34188
- * limit: 10
34435
+ * limit: 10,
34436
+ * offset: 20
34189
34437
  * });
34190
34438
  *
34191
- * // Auto-fallback mode
34192
- * const result = await vana.data.getUserTrustedServers({
34439
+ * // With custom subgraph URL
34440
+ * const servers = await vana.data.getUserTrustedServers({
34193
34441
  * user: '0x...',
34194
- * mode: 'auto' // tries subgraph first, falls back to RPC
34442
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
34195
34443
  * });
34196
34444
  * ```
34197
34445
  */
34198
- getUserTrustedServers(params: GetUserTrustedServersParams): Promise<GetUserTrustedServersResult>;
34446
+ getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
34199
34447
  /**
34200
34448
  * Internal method: Query trusted servers via subgraph
34201
34449
  *
@@ -34260,75 +34508,28 @@ declare class DataController {
34260
34508
  * for specific files by ID.
34261
34509
  */
34262
34510
  getFileById(fileId: number): Promise<UserFile$1>;
34263
- /**
34264
- * Uploads an encrypted file to storage and registers it on the blockchain.
34265
- *
34266
- * @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption
34267
- *
34268
- * Migration guide:
34269
- * ```typescript
34270
- * // Old way (deprecated):
34271
- * const encrypted = await encryptBlob(data, key);
34272
- * const result = await vana.data.uploadEncryptedFile(encrypted, filename);
34273
- *
34274
- * // New way:
34275
- * const result = await vana.data.upload({
34276
- * content: data,
34277
- * filename: filename,
34278
- * encrypt: true // Handles encryption automatically
34279
- * });
34280
- * ```
34281
- * @param encryptedFile - The encrypted file blob to upload
34282
- * @param filename - Optional filename for the upload
34283
- * @param providerName - Optional storage provider to use
34284
- * @returns Promise resolving to upload result with file ID and storage URL
34285
- *
34286
- * This method handles the complete flow of:
34287
- * 1. Uploading the encrypted file to the specified storage provider
34288
- * 2. Registering the file URL on the DataRegistry contract via relayer
34289
- * 3. Returning the assigned file ID and storage URL
34290
- */
34291
- uploadEncryptedFile(encryptedFile: Blob, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34292
- /**
34293
- * Uploads an encrypted file to storage and registers it on the blockchain with a schema.
34294
- *
34295
- * @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption and schema validation
34296
- *
34297
- * Migration guide:
34298
- * ```typescript
34299
- * // Old way (deprecated):
34300
- * const encrypted = await encryptBlob(data, key);
34301
- * const result = await vana.data.uploadEncryptedFileWithSchema(encrypted, schemaId, filename);
34302
- *
34303
- * // New way:
34304
- * const result = await vana.data.upload({
34305
- * content: data,
34306
- * filename: filename,
34307
- * schemaId: schemaId, // Automatic validation
34308
- * encrypt: true
34309
- * });
34310
- * ```
34311
- * @param encryptedFile - The encrypted file blob to upload
34312
- * @param schemaId - The schema ID to associate with the file
34313
- * @param filename - Optional filename for the upload
34314
- * @param providerName - Optional storage provider to use
34315
- * @returns Promise resolving to upload result with file ID and storage URL
34316
- *
34317
- * This method handles the complete flow of:
34318
- * 1. Uploading the encrypted file to the specified storage provider
34319
- * 2. Registering the file URL on the DataRegistry contract with a schema ID
34320
- * 3. Returning the assigned file ID and storage URL
34321
- */
34322
- uploadEncryptedFileWithSchema(encryptedFile: Blob, schemaId: number, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34323
34511
  /**
34324
34512
  * Registers a file URL directly on the blockchain with a schema ID.
34325
34513
  *
34326
- * @param url - The URL of the file to register
34514
+ * @remarks
34515
+ * This method registers an existing file URL on the DataRegistry contract
34516
+ * with a schema ID, without uploading any data. Useful when you have already
34517
+ * uploaded content to storage and just need to register it on-chain.
34518
+ *
34519
+ * @param url - The URL of the file to register (IPFS or HTTP/HTTPS)
34327
34520
  * @param schemaId - The schema ID to associate with the file
34328
34521
  * @returns Promise resolving to the file ID and transaction hash
34329
- *
34330
- * This method registers an existing file URL on the DataRegistry
34331
- * contract with a schema ID, without uploading any data.
34522
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34523
+ * @throws {Error} When wallet address is unavailable - "No addresses available"
34524
+ * @throws {Error} When transaction fails - "Failed to register file with schema"
34525
+ * @example
34526
+ * ```typescript
34527
+ * const { fileId, transactionHash } = await vana.data.registerFileWithSchema(
34528
+ * "ipfs://QmXxx...",
34529
+ * 1
34530
+ * );
34531
+ * console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
34532
+ * ```
34332
34533
  */
34333
34534
  registerFileWithSchema(url: string, schemaId: number): Promise<{
34334
34535
  fileId: number;
@@ -34386,95 +34587,114 @@ declare class DataController {
34386
34587
  transactionHash: string;
34387
34588
  }>;
34388
34589
  /**
34389
- * Adds a new schema to the DataRefinerRegistry.
34390
- *
34391
- * @deprecated Since v2.0.0 - Use vana.schemas.create() instead for the high-level API with automatic IPFS upload
34590
+ * Adds a new refiner to the DataRefinerRegistry.
34392
34591
  *
34393
- * Migration guide:
34592
+ * @remarks
34593
+ * Refiners are data processing templates that define how raw data should be
34594
+ * transformed into structured formats. Each refiner is associated with a DLP
34595
+ * (Data Liquidity Pool), has a specific schema for output, and includes
34596
+ * instructions for the refinement process.
34597
+ *
34598
+ * @param params - Refiner configuration parameters
34599
+ * @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
34600
+ * @param params.name - Human-readable name for the refiner
34601
+ * @param params.schemaId - Schema ID that defines the output format
34602
+ * @param params.refinementInstructionUrl - URL containing processing instructions
34603
+ * @returns Promise resolving to the new refiner ID and transaction hash
34604
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34605
+ * @throws {Error} When transaction fails - "Failed to add refiner: {error}"
34606
+ * @example
34394
34607
  * ```typescript
34395
- * // Old way (deprecated):
34396
- * const result = await vana.data.addSchema({
34397
- * name: "UserProfile",
34398
- * type: "JSON",
34399
- * definitionUrl: "ipfs://..."
34400
- * });
34401
- *
34402
- * // New way:
34403
- * const result = await vana.schemas.create({
34404
- * name: "UserProfile",
34405
- * type: "JSON",
34406
- * definition: schemaObject // Automatically uploads to IPFS
34608
+ * const result = await vana.data.addRefiner({
34609
+ * dlpId: 1,
34610
+ * name: "Social Media Sentiment Analyzer",
34611
+ * schemaId: 42,
34612
+ * refinementInstructionUrl: "ipfs://QmXxx..."
34407
34613
  * });
34614
+ * console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
34408
34615
  * ```
34409
- * @param params - Schema parameters including name, type, and definition URL
34410
- * @returns Promise resolving to the new schema ID and transaction hash
34411
34616
  */
34412
- addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
34617
+ addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
34413
34618
  /**
34414
- * Retrieves a schema by its ID.
34619
+ * Retrieves a refiner by its ID.
34415
34620
  *
34416
- * @deprecated Since v2.0.0 - Use vana.schemas.get() instead
34621
+ * @remarks
34622
+ * Queries the DataRefinerRegistry contract to get complete information about
34623
+ * a specific refiner including its DLP association, schema, and instructions.
34417
34624
  *
34418
- * Migration guide:
34625
+ * @param refinerId - The numeric refiner ID to retrieve
34626
+ * @returns Promise resolving to the refiner information object
34627
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34628
+ * @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
34629
+ * @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
34630
+ * @example
34419
34631
  * ```typescript
34420
- * // Old way (deprecated):
34421
- * const schema = await vana.data.getSchema(schemaId);
34422
- *
34423
- * // New way:
34424
- * const schema = await vana.schemas.get(schemaId);
34632
+ * const refiner = await vana.data.getRefiner(1);
34633
+ * console.log({
34634
+ * name: refiner.name,
34635
+ * dlp: refiner.dlpId,
34636
+ * schema: refiner.schemaId,
34637
+ * instructions: refiner.refinementInstructionUrl
34638
+ * });
34425
34639
  * ```
34426
- * @param schemaId - The schema ID to retrieve
34427
- * @returns Promise resolving to the schema information
34428
34640
  */
34429
- getSchema(schemaId: number): Promise<Schema>;
34641
+ getRefiner(refinerId: number): Promise<Refiner>;
34430
34642
  /**
34431
- * Gets the total number of schemas in the registry.
34643
+ * Validates if a schema ID exists in the registry.
34432
34644
  *
34433
- * @deprecated Since v2.0.0 - Use vana.schemas.count() instead
34645
+ * @remarks
34646
+ * Checks the DataRefinerRegistry contract to determine if a given schema ID
34647
+ * has been registered and is available for use.
34434
34648
  *
34435
- * Migration guide:
34649
+ * @param schemaId - The numeric schema ID to validate
34650
+ * @returns Promise resolving to true if schema exists, false otherwise
34651
+ * @example
34436
34652
  * ```typescript
34437
- * // Old way (deprecated):
34438
- * const count = await vana.data.getSchemasCount();
34439
- *
34440
- * // New way:
34441
- * const count = await vana.schemas.count();
34653
+ * const isValid = await vana.data.isValidSchemaId(42);
34654
+ * if (isValid) {
34655
+ * console.log('Schema 42 is available for use');
34656
+ * } else {
34657
+ * console.log('Schema 42 does not exist');
34658
+ * }
34442
34659
  * ```
34443
- * @returns Promise resolving to the total schema count
34444
- */
34445
- getSchemasCount(): Promise<number>;
34446
- /**
34447
- * Adds a new refiner to the DataRefinerRegistry.
34448
- *
34449
- * @param params - Refiner parameters including DLP ID, name, schema ID, and instruction URL
34450
- * @returns Promise resolving to the new refiner ID and transaction hash
34451
- */
34452
- addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
34453
- /**
34454
- * Retrieves a refiner by its ID.
34455
- *
34456
- * @param refinerId - The refiner ID to retrieve
34457
- * @returns Promise resolving to the refiner information
34458
- */
34459
- getRefiner(refinerId: number): Promise<Refiner>;
34460
- /**
34461
- * Validates if a schema ID exists in the registry.
34462
- *
34463
- * @param schemaId - The schema ID to validate
34464
- * @returns Promise resolving to boolean indicating if the schema ID is valid
34465
34660
  */
34466
34661
  isValidSchemaId(schemaId: number): Promise<boolean>;
34467
34662
  /**
34468
34663
  * Gets the total number of refiners in the registry.
34469
34664
  *
34665
+ * @remarks
34666
+ * Queries the DataRefinerRegistry contract to get the total count of all
34667
+ * registered refiners across all DLPs.
34668
+ *
34470
34669
  * @returns Promise resolving to the total refiner count
34670
+ * @example
34671
+ * ```typescript
34672
+ * const count = await vana.data.getRefinersCount();
34673
+ * console.log(`Total refiners registered: ${count}`);
34674
+ * ```
34471
34675
  */
34472
34676
  getRefinersCount(): Promise<number>;
34473
34677
  /**
34474
34678
  * Updates the schema ID for an existing refiner.
34475
34679
  *
34476
- * @param params - Parameters including refiner ID and new schema ID
34680
+ * @remarks
34681
+ * Allows the owner of a refiner to update its associated schema ID.
34682
+ * This is useful when refiner output format needs to change.
34683
+ *
34684
+ * @param params - Update parameters
34685
+ * @param params.refinerId - The refiner ID to update
34686
+ * @param params.newSchemaId - The new schema ID to set
34477
34687
  * @returns Promise resolving to the transaction hash
34688
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34689
+ * @throws {Error} When transaction fails - "Failed to update schema ID: {error}"
34690
+ * @example
34691
+ * ```typescript
34692
+ * const result = await vana.data.updateSchemaId({
34693
+ * refinerId: 1,
34694
+ * newSchemaId: 55
34695
+ * });
34696
+ * console.log(`Schema updated in tx ${result.transactionHash}`);
34697
+ * ```
34478
34698
  */
34479
34699
  updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
34480
34700
  /**
@@ -34496,6 +34716,17 @@ declare class DataController {
34496
34716
  account: Address;
34497
34717
  publicKey: string;
34498
34718
  }>, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34719
+ /**
34720
+ * Uploads content to storage without registering it on the blockchain.
34721
+ * This method only handles the storage upload and returns the file URL.
34722
+ *
34723
+ * @param content - The content to upload (string, Blob, Buffer, or object - objects will be JSON stringified)
34724
+ * @param filename - Optional filename for the uploaded file (defaults to timestamp-based name)
34725
+ * @param encrypt - Optional flag to encrypt the content before upload
34726
+ * @param providerName - Optional specific storage provider to use
34727
+ * @returns Promise resolving to the storage upload result with url, size, and contentType
34728
+ */
34729
+ uploadToStorage(content: string | Blob | Buffer | object, filename?: string, encrypt?: boolean, providerName?: string): Promise<StorageUploadResult>;
34499
34730
  /**
34500
34731
  * Adds a permission for a party to access an existing file.
34501
34732
  *
@@ -34522,7 +34753,7 @@ declare class DataController {
34522
34753
  * console.log(`Transaction: ${result.transactionHash}`);
34523
34754
  * ```
34524
34755
  */
34525
- addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult>;
34756
+ addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34526
34757
  /**
34527
34758
  * Submits a file permission transaction and returns the transaction hash immediately.
34528
34759
  *
@@ -34539,7 +34770,7 @@ declare class DataController {
34539
34770
  * console.log(`Transaction submitted: ${txHash}`);
34540
34771
  * ```
34541
34772
  */
34542
- submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<Hash>;
34773
+ submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34543
34774
  /**
34544
34775
  * Gets the encrypted key for a specific account's permission to access a file.
34545
34776
  *
@@ -34706,24 +34937,6 @@ declare class DataController {
34706
34937
  * ```
34707
34938
  */
34708
34939
  fetchAndValidateSchema(url: string): Promise<DataSchema>;
34709
- /**
34710
- * Retrieves a schema by ID and fetches its definition URL to get the full data schema.
34711
- *
34712
- * @param schemaId - The schema ID to retrieve and validate
34713
- * @returns The validated data schema
34714
- * @throws SchemaValidationError if schema is invalid
34715
- * @example
34716
- * ```typescript
34717
- * // Get schema from registry and validate its schema
34718
- * const schema = await vana.data.getValidatedSchema(123);
34719
- *
34720
- * // Use it to validate user data
34721
- * if (schema.dialect === "json") {
34722
- * vana.data.validateDataAgainstSchema(userData, schema);
34723
- * }
34724
- * ```
34725
- */
34726
- getValidatedSchema(schemaId: number): Promise<DataSchema>;
34727
34940
  }
34728
34941
 
34729
34942
  /**
@@ -34926,6 +35139,31 @@ interface Chains {
34926
35139
  }
34927
35140
  declare const chains: Chains;
34928
35141
 
35142
+ /**
35143
+ * Creates or retrieves a cached public client for blockchain read operations.
35144
+ *
35145
+ * @remarks
35146
+ * This function provides an optimized way to access blockchain data by maintaining
35147
+ * a cached client instance per chain. The client is used for reading contract state,
35148
+ * querying events, and other read-only blockchain operations. It automatically
35149
+ * handles HTTP transport configuration and chain switching.
35150
+ *
35151
+ * @param chainId - The chain ID to connect to (defaults to Moksha testnet)
35152
+ * @returns A public client configured for the specified chain with caching optimization
35153
+ * @throws {Error} When the specified chain ID is not supported by the SDK
35154
+ * @example
35155
+ * ```typescript
35156
+ * // Get client for default chain (Moksha testnet)
35157
+ * const client = createClient();
35158
+ *
35159
+ * // Get client for specific chain
35160
+ * const mainnetClient = createClient(14800);
35161
+ *
35162
+ * // Use client for blockchain reads
35163
+ * const blockNumber = await client.getBlockNumber();
35164
+ * ```
35165
+ * @category Blockchain
35166
+ */
34929
35167
  declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
34930
35168
  chain: Chain;
34931
35169
  };
@@ -35644,51 +35882,157 @@ declare class SerializationError extends VanaError {
35644
35882
  constructor(message: string);
35645
35883
  }
35646
35884
  /**
35647
- * Error thrown when a signature operation fails.
35885
+ * Thrown when a signature operation fails or cannot be completed.
35648
35886
  *
35649
35887
  * @remarks
35650
- * Recovery strategies: Check wallet connection and account unlock status,
35651
- * retry operation with explicit user interaction, or for gasless operations
35652
- * consider switching to direct transactions.
35888
+ * This error occurs when wallet signature operations fail due to disconnection,
35889
+ * locked accounts, or other wallet-related issues. It preserves the original
35890
+ * error for debugging while providing consistent error handling across the SDK.
35891
+ *
35892
+ * Recovery strategies:
35893
+ * - Check wallet connection and account unlock status
35894
+ * - Retry operation with explicit user interaction
35895
+ * - For gasless operations, consider switching to direct transactions
35896
+ *
35897
+ * @example
35898
+ * ```typescript
35899
+ * try {
35900
+ * await vana.permissions.grant({ grantee: '0x...' });
35901
+ * } catch (error) {
35902
+ * if (error instanceof SignatureError) {
35903
+ * // Prompt user to unlock wallet
35904
+ * await promptWalletUnlock();
35905
+ * // Retry operation
35906
+ * }
35907
+ * }
35908
+ * ```
35909
+ * @category Error Handling
35653
35910
  */
35654
35911
  declare class SignatureError extends VanaError {
35655
35912
  readonly originalError?: Error | undefined;
35656
35913
  constructor(message: string, originalError?: Error | undefined);
35657
35914
  }
35658
35915
  /**
35659
- * Error thrown when a network operation fails.
35916
+ * Thrown when network communication fails during API calls or blockchain interactions.
35660
35917
  *
35661
35918
  * @remarks
35662
- * Recovery strategies: Check network connectivity, retry with exponential backoff,
35663
- * verify API endpoints are accessible, or switch to alternative network providers.
35919
+ * This error encompasses network connectivity issues, API unavailability,
35920
+ * timeout errors, and CORS restrictions. It's commonly encountered during
35921
+ * IPFS operations, subgraph queries, or RPC calls.
35922
+ *
35923
+ * Recovery strategies:
35924
+ * - Check network connectivity
35925
+ * - Retry with exponential backoff
35926
+ * - Verify API endpoints are accessible
35927
+ * - Switch to alternative network providers or gateways
35928
+ *
35929
+ * @example
35930
+ * ```typescript
35931
+ * try {
35932
+ * const files = await vana.data.getUserFiles({ owner: '0x...' });
35933
+ * } catch (error) {
35934
+ * if (error instanceof NetworkError) {
35935
+ * // Implement retry with exponential backoff
35936
+ * await retryWithBackoff(() => vana.data.getUserFiles({ owner: '0x...' }));
35937
+ * }
35938
+ * }
35939
+ * ```
35940
+ * @category Error Handling
35664
35941
  */
35665
35942
  declare class NetworkError extends VanaError {
35666
35943
  readonly originalError?: Error | undefined;
35667
35944
  constructor(message: string, originalError?: Error | undefined);
35668
35945
  }
35669
35946
  /**
35670
- * Error thrown when the nonce retrieval fails.
35947
+ * Thrown when transaction nonce retrieval fails during gasless operations.
35671
35948
  *
35672
35949
  * @remarks
35673
- * Recovery strategies: Retry nonce retrieval after brief delay, check wallet connection
35674
- * and account status, or use manual nonce specification if supported by the operation.
35950
+ * This error occurs when the SDK cannot retrieve the user's current nonce from
35951
+ * smart contracts, preventing gasless transaction submission. Nonces are critical
35952
+ * for preventing replay attacks in signed transactions.
35953
+ *
35954
+ * Recovery strategies:
35955
+ * - Retry nonce retrieval after brief delay
35956
+ * - Check wallet connection and account status
35957
+ * - Use manual nonce specification if supported by the operation
35958
+ * - Switch to direct transactions as fallback
35959
+ *
35960
+ * @example
35961
+ * ```typescript
35962
+ * try {
35963
+ * await vana.permissions.grant({ grantee: '0x...' });
35964
+ * } catch (error) {
35965
+ * if (error instanceof NonceError) {
35966
+ * // Wait and retry
35967
+ * await delay(1000);
35968
+ * await vana.permissions.grant({ grantee: '0x...' });
35969
+ * }
35970
+ * }
35971
+ * ```
35972
+ * @category Error Handling
35675
35973
  */
35676
35974
  declare class NonceError extends VanaError {
35677
35975
  constructor(message: string);
35678
35976
  }
35679
35977
  /**
35680
- * Error thrown when a personal server operation fails.
35978
+ * Thrown when personal server operations fail or cannot be completed.
35681
35979
  *
35682
35980
  * @remarks
35683
- * Recovery strategies: Verify server URL accessibility, check server trust status via
35684
- * `vana.permissions.getUserTrustedServers()`, or retry after server becomes available.
35981
+ * This error occurs during interactions with personal servers for computation
35982
+ * requests, identity retrieval, or operation status checks. Common causes include
35983
+ * server unavailability, untrusted server status, or invalid permission grants.
35984
+ *
35985
+ * Recovery strategies:
35986
+ * - Verify server URL accessibility
35987
+ * - Check server trust status via `vana.permissions.getTrustedServers()`
35988
+ * - Ensure valid permissions exist for the operation
35989
+ * - Retry after server becomes available
35990
+ *
35991
+ * @example
35992
+ * ```typescript
35993
+ * try {
35994
+ * const result = await vana.server.createOperation({ permissionId: 123 });
35995
+ * } catch (error) {
35996
+ * if (error instanceof PersonalServerError) {
35997
+ * // Check if server is trusted
35998
+ * const trustedServers = await vana.permissions.getTrustedServers();
35999
+ * if (!trustedServers.includes(serverId)) {
36000
+ * await vana.permissions.trustServer({ serverId });
36001
+ * }
36002
+ * }
36003
+ * }
36004
+ * ```
36005
+ * @category Error Handling
35685
36006
  */
35686
36007
  declare class PersonalServerError extends VanaError {
35687
36008
  readonly originalError?: Error | undefined;
35688
36009
  constructor(message: string, originalError?: Error | undefined);
35689
36010
  }
35690
36011
  /**
35691
- * Error thrown when trying to register a server with a URL that doesn't match the existing registration.
36012
+ * Thrown when attempting to register a server with a URL different from its existing registration.
36013
+ *
36014
+ * @remarks
36015
+ * This error occurs when trying to add or trust a server that's already registered
36016
+ * on-chain with a different URL. Server URLs are immutable once registered to
36017
+ * maintain consistency and security. Applications should use the existing URL
36018
+ * or register a new server with a different ID.
36019
+ *
36020
+ * @example
36021
+ * ```typescript
36022
+ * try {
36023
+ * await vana.permissions.addAndTrustServer({
36024
+ * serverId: 1,
36025
+ * serverUrl: 'https://new-url.com',
36026
+ * publicKey: '0x...'
36027
+ * });
36028
+ * } catch (error) {
36029
+ * if (error instanceof ServerUrlMismatchError) {
36030
+ * console.log(`Server already registered with: ${error.existingUrl}`);
36031
+ * // Use existing URL or register new server
36032
+ * }
36033
+ * }
36034
+ * ```
36035
+ * @category Error Handling
35692
36036
  */
35693
36037
  declare class ServerUrlMismatchError extends VanaError {
35694
36038
  constructor(existingUrl: string, providedUrl: string, serverId: string);
@@ -35697,7 +36041,25 @@ declare class ServerUrlMismatchError extends VanaError {
35697
36041
  readonly serverId: string;
35698
36042
  }
35699
36043
  /**
35700
- * Error thrown when a permission operation fails.
36044
+ * Thrown when permission grant, revoke, or validation operations fail.
36045
+ *
36046
+ * @remarks
36047
+ * This error occurs during permission management operations including grants,
36048
+ * revocations, and permission validation checks. Common causes include invalid
36049
+ * grantee addresses, expired permissions, or insufficient privileges.
36050
+ *
36051
+ * @example
36052
+ * ```typescript
36053
+ * try {
36054
+ * await vana.permissions.revoke({ permissionId: 999999 });
36055
+ * } catch (error) {
36056
+ * if (error instanceof PermissionError) {
36057
+ * console.error('Permission operation failed:', error.message);
36058
+ * // Permission may not exist or user may not be owner
36059
+ * }
36060
+ * }
36061
+ * ```
36062
+ * @category Error Handling
35701
36063
  */
35702
36064
  declare class PermissionError extends VanaError {
35703
36065
  readonly originalError?: Error | undefined;
@@ -36705,21 +37067,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
36705
37067
 
36706
37068
  declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
36707
37069
  /**
36708
- * Retrieves the deployed contract address for a specific contract on a given chain.
37070
+ * Retrieves the deployed contract address for a specific Vana protocol contract on a given chain.
36709
37071
  *
36710
- * @param chainId - The chain ID to look up the contract on
36711
- * @param contract - The contract name to get the address for
36712
- * @returns The contract address as a hex string
36713
- * @throws {Error} When contract address not found for the specified contract and chain
37072
+ * @remarks
37073
+ * This function provides type-safe access to contract addresses across all supported Vana networks.
37074
+ * It automatically searches both current and legacy contract registries to ensure backwards
37075
+ * compatibility while providing clear error messages for unsupported combinations.
37076
+ *
37077
+ * The function validates that both the chain ID and contract name are supported before
37078
+ * attempting address lookup, helping developers identify deployment or configuration issues
37079
+ * early in the development process.
37080
+ *
37081
+ * **Supported Chains:**
37082
+ * - 14800: Vana Mainnet
37083
+ * - 1480: Moksha Testnet
37084
+ *
37085
+ * **Contract Categories:**
37086
+ * - Data Management: DataRegistry, DataRefinerRegistry
37087
+ * - Permissions: DataPortabilityPermissions, DataPortabilityServers, DataPortabilityGrantees
37088
+ * - Computing: TeePoolPhala, TeePoolDedicatedGpu, etc.
37089
+ * - Token & Governance: DATImplementation, VanaPoolStaking, etc.
37090
+ *
37091
+ * @param chainId - The chain ID to look up the contract on (14800 for mainnet, 1480 for testnet)
37092
+ * @param contract - The contract name to get the address for (use TypeScript autocomplete for available options)
37093
+ * @returns The contract address as a checksummed hex string (0x...)
37094
+ * @throws {Error} When contract address not found for the specified contract and chain combination.
37095
+ * This typically indicates the contract is not deployed on the requested network.
36714
37096
  * @example
36715
37097
  * ```typescript
37098
+ * // Get core protocol contract addresses
37099
+ * const dataRegistry = getContractAddress(14800, 'DataRegistry');
37100
+ * const permissions = getContractAddress(14800, 'DataPortabilityPermissions');
37101
+ * const trustedServers = getContractAddress(14800, 'DataPortabilityServers');
37102
+ *
37103
+ * // Handle unsupported combinations gracefully
36716
37104
  * try {
36717
- * const dataRegistryAddress = getContractAddress(1480, 'DataRegistry');
36718
- * console.log('DataRegistry address:', dataRegistryAddress);
37105
+ * const address = getContractAddress(1480, 'DataRegistry');
37106
+ * console.log('DataRegistry testnet address:', address);
36719
37107
  * } catch (error) {
36720
- * console.error('Contract not deployed on this chain:', error.message);
37108
+ * console.error('Contract not available on testnet:', error.message);
37109
+ * // Fallback to mainnet or show user-friendly error
36721
37110
  * }
37111
+ *
37112
+ * // TypeScript provides autocomplete for contract names
37113
+ * const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
37114
+ * // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
36722
37115
  * ```
37116
+ * @category Configuration
36723
37117
  */
36724
37118
  declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
36725
37119
 
@@ -36894,6 +37288,10 @@ declare class CircuitBreaker {
36894
37288
  *
36895
37289
  * This implementation uses browser-compatible libraries and configurations
36896
37290
  * to provide crypto, PGP, and HTTP functionality without Node.js dependencies.
37291
+ *
37292
+ * WARNING: Dependencies that access globals during init
37293
+ * MUST be dynamically imported to support Turbopack.
37294
+ * See: https://github.com/vercel/next.js/issues/82632
36897
37295
  */
36898
37296
 
36899
37297
  /**
@@ -37233,4 +37631,4 @@ declare function Vana(config: VanaConfig): VanaBrowserImpl;
37233
37631
  */
37234
37632
  type VanaInstance = VanaBrowserImpl;
37235
37633
 
37236
- 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, 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 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 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 };
37634
+ export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type CompleteSchema, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, type SchemaMetadata, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, VanaBrowserImpl, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };