@opendatalabs/vana-sdk 0.1.0-alpha.82bbb39 → 0.1.0-alpha.899ca9d

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 +1756 -1479
  19. package/dist/index.browser.js +37686 -35103
  20. package/dist/index.browser.js.map +1 -1
  21. package/dist/index.node.cjs +38174 -35582
  22. package/dist/index.node.cjs.map +1 -1
  23. package/dist/index.node.d.cts +1790 -1486
  24. package/dist/index.node.d.ts +1790 -1486
  25. package/dist/index.node.js +38402 -35813
  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.
@@ -1045,6 +1133,30 @@ interface RelayerCallbacks {
1045
1133
  * @returns Promise resolving to the transaction hash
1046
1134
  */
1047
1135
  submitUntrustServer?: (typedData: UntrustServerTypedData, signature: Hash) => Promise<Hash>;
1136
+ /**
1137
+ * Submit a signed add and trust server transaction for relay
1138
+ *
1139
+ * @param typedData - The EIP-712 typed data that was signed
1140
+ * @param signature - The user's signature
1141
+ * @returns Promise resolving to the transaction hash
1142
+ */
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>;
1048
1160
  /**
1049
1161
  * Submit a file addition for relay
1050
1162
  *
@@ -1546,7 +1658,7 @@ interface ConfigValidationResult {
1546
1658
  /**
1547
1659
  * Union type of all canonical Vana contract names
1548
1660
  */
1549
- 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";
1550
1662
  /**
1551
1663
  * Contract information with typed address and ABI
1552
1664
  */
@@ -2051,33 +2163,84 @@ interface BatchUploadResult {
2051
2163
  errors?: string[];
2052
2164
  }
2053
2165
  /**
2054
- * Represents a data schema in the refiner registry.
2166
+ * Schema metadata from the blockchain (without fetched definition).
2167
+ *
2168
+ * This represents the on-chain schema registration data before the
2169
+ * definition has been fetched from the storage URL.
2170
+ *
2171
+ * @category Data Management
2172
+ */
2173
+ interface SchemaMetadata {
2174
+ /** Schema ID */
2175
+ id: number;
2176
+ /** Schema name */
2177
+ name: string;
2178
+ /** Schema dialect ('json' or 'sqlite') */
2179
+ dialect: "json" | "sqlite";
2180
+ /** URL containing the schema definition */
2181
+ definitionUrl: string;
2182
+ }
2183
+ /**
2184
+ * Complete schema with all definition fields populated.
2185
+ * This is what schemas.get() returns - a schema with the definition fetched.
2186
+ */
2187
+ interface CompleteSchema extends SchemaMetadata {
2188
+ /** Version of the schema */
2189
+ version: string;
2190
+ /** Optional description of the schema */
2191
+ description?: string;
2192
+ /** Optional version of the dialect */
2193
+ dialectVersion?: string;
2194
+ /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' */
2195
+ schema: object | string;
2196
+ }
2197
+ /**
2198
+ * Schema with optional definition fields.
2055
2199
  *
2056
2200
  * Schemas define the structure and validation rules for user data processed by refiners.
2057
2201
  * They ensure data quality and consistency across the Vana network by specifying how
2058
2202
  * raw user data should be formatted, validated, and processed.
2059
2203
  *
2204
+ * When the definition has been fetched (via schemas.get() or schemas.list() with includeDefinitions),
2205
+ * the version and schema fields will be populated. Otherwise, only the metadata fields are present.
2206
+ *
2060
2207
  * @category Data Management
2061
2208
  * @example
2062
2209
  * ```typescript
2063
- * const socialMediaSchema: Schema = {
2210
+ * // Complete schema from schemas.get()
2211
+ * const completeSchema: Schema = {
2212
+ * id: 5,
2213
+ * name: 'Social Media Profile',
2214
+ * dialect: 'json',
2215
+ * definitionUrl: 'ipfs://QmSchema...',
2216
+ * version: '1.0.0',
2217
+ * description: 'Schema for validating social media profile data',
2218
+ * schema: { // JSON Schema object
2219
+ * type: 'object',
2220
+ * properties: {
2221
+ * username: { type: 'string' }
2222
+ * }
2223
+ * }
2224
+ * };
2225
+ *
2226
+ * // Metadata-only schema from schemas.list() without includeDefinitions
2227
+ * const metadataSchema: Schema = {
2064
2228
  * id: 5,
2065
2229
  * name: 'Social Media Profile',
2066
- * type: 'JSON',
2067
- * url: 'ipfs://QmSchema...', // Schema definition file
2068
- * description: 'Schema for validating social media profile data'
2230
+ * dialect: 'json',
2231
+ * definitionUrl: 'ipfs://QmSchema...'
2069
2232
  * };
2070
2233
  * ```
2071
2234
  */
2072
- interface Schema {
2073
- /** Schema ID */
2074
- id: number;
2075
- /** Schema name */
2076
- name: string;
2077
- /** Schema type */
2078
- type: string;
2079
- /** URL containing the schema definition */
2080
- definitionUrl: string;
2235
+ interface Schema extends SchemaMetadata {
2236
+ /** Version of the schema (present when definition is fetched) */
2237
+ version?: string;
2238
+ /** Optional description of the schema */
2239
+ description?: string;
2240
+ /** Optional version of the dialect */
2241
+ dialectVersion?: string;
2242
+ /** The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' (present when definition is fetched) */
2243
+ schema?: object | string;
2081
2244
  }
2082
2245
  /**
2083
2246
  * Represents a refiner with schema information
@@ -2106,8 +2269,8 @@ interface Refiner {
2106
2269
  interface AddSchemaParams {
2107
2270
  /** Schema name */
2108
2271
  name: string;
2109
- /** Schema type */
2110
- type: string;
2272
+ /** Schema dialect */
2273
+ dialect: string;
2111
2274
  /** URL containing the schema definition */
2112
2275
  definitionUrl: string;
2113
2276
  }
@@ -2182,13 +2345,7 @@ interface UpdateSchemaIdResult {
2182
2345
  transactionHash: Hash;
2183
2346
  }
2184
2347
  /**
2185
- * Query mode for trusted server retrieval
2186
- *
2187
- * @category Data Management
2188
- */
2189
- type TrustedServerQueryMode = "subgraph" | "rpc" | "auto";
2190
- /**
2191
- * Trusted server data structure (unified format for both subgraph and RPC modes)
2348
+ * Trusted server data structure
2192
2349
  *
2193
2350
  * @category Data Management
2194
2351
  */
@@ -2207,42 +2364,23 @@ interface TrustedServer {
2207
2364
  trustIndex?: number;
2208
2365
  }
2209
2366
  /**
2210
- * Parameters for getUserTrustedServers with dual-mode support
2367
+ * Parameters for getUserTrustedServers method
2211
2368
  *
2212
2369
  * @category Data Management
2213
2370
  */
2214
2371
  interface GetUserTrustedServersParams {
2215
- /** User address to query */
2372
+ /** User address to query trusted servers for */
2216
2373
  user: Address;
2217
- /** Query mode: 'subgraph' (fast, requires subgraph), 'rpc' (direct contract), or 'auto' (tries subgraph first) */
2218
- mode?: TrustedServerQueryMode;
2219
- /** Subgraph URL (required for subgraph mode) */
2374
+ /** Optional subgraph URL to override default */
2220
2375
  subgraphUrl?: string;
2221
- /** Pagination limit (applies to RPC mode) */
2376
+ /** Maximum number of results */
2222
2377
  limit?: number;
2223
- /** Pagination offset (applies to RPC mode) */
2378
+ /** Number of results to skip */
2224
2379
  offset?: number;
2225
2380
  }
2226
- /**
2227
- * Result of getUserTrustedServers query
2228
- *
2229
- * @category Data Management
2230
- */
2231
- interface GetUserTrustedServersResult {
2232
- /** Array of trusted servers */
2233
- servers: TrustedServer[];
2234
- /** Query mode that was actually used */
2235
- usedMode: TrustedServerQueryMode;
2236
- /** Total count (only available in RPC mode) */
2237
- total?: number;
2238
- /** Whether there are more servers (pagination info for RPC mode) */
2239
- hasMore?: boolean;
2240
- /** Any warnings or fallback information */
2241
- warnings?: string[];
2242
- }
2243
2381
 
2244
2382
  declare const contractAbis: {
2245
- readonly DataPermissions: readonly [{
2383
+ readonly DataPortabilityPermissions: readonly [{
2246
2384
  readonly inputs: readonly [];
2247
2385
  readonly stateMutability: "nonpayable";
2248
2386
  readonly type: "constructor";
@@ -2346,6 +2484,30 @@ declare const contractAbis: {
2346
2484
  }];
2347
2485
  readonly name: "InvalidNonce";
2348
2486
  readonly type: "error";
2487
+ }, {
2488
+ readonly inputs: readonly [{
2489
+ readonly internalType: "uint256";
2490
+ readonly name: "filesLength";
2491
+ readonly type: "uint256";
2492
+ }, {
2493
+ readonly internalType: "uint256";
2494
+ readonly name: "permissionsLength";
2495
+ readonly type: "uint256";
2496
+ }];
2497
+ readonly name: "InvalidPermissionsLength";
2498
+ readonly type: "error";
2499
+ }, {
2500
+ readonly inputs: readonly [{
2501
+ readonly internalType: "uint256";
2502
+ readonly name: "filesLength";
2503
+ readonly type: "uint256";
2504
+ }, {
2505
+ readonly internalType: "uint256";
2506
+ readonly name: "schemaIdsLength";
2507
+ readonly type: "uint256";
2508
+ }];
2509
+ readonly name: "InvalidSchemaIdsLength";
2510
+ readonly type: "error";
2349
2511
  }, {
2350
2512
  readonly inputs: readonly [];
2351
2513
  readonly name: "InvalidSignature";
@@ -2604,6 +2766,70 @@ declare const contractAbis: {
2604
2766
  }];
2605
2767
  readonly stateMutability: "nonpayable";
2606
2768
  readonly type: "function";
2769
+ }, {
2770
+ readonly inputs: readonly [{
2771
+ readonly components: readonly [{
2772
+ readonly internalType: "uint256";
2773
+ readonly name: "nonce";
2774
+ readonly type: "uint256";
2775
+ }, {
2776
+ readonly internalType: "uint256";
2777
+ readonly name: "granteeId";
2778
+ readonly type: "uint256";
2779
+ }, {
2780
+ readonly internalType: "string";
2781
+ readonly name: "grant";
2782
+ readonly type: "string";
2783
+ }, {
2784
+ readonly internalType: "string[]";
2785
+ readonly name: "fileUrls";
2786
+ readonly type: "string[]";
2787
+ }, {
2788
+ readonly internalType: "uint256[]";
2789
+ readonly name: "schemaIds";
2790
+ readonly type: "uint256[]";
2791
+ }, {
2792
+ readonly internalType: "address";
2793
+ readonly name: "serverAddress";
2794
+ readonly type: "address";
2795
+ }, {
2796
+ readonly internalType: "string";
2797
+ readonly name: "serverUrl";
2798
+ readonly type: "string";
2799
+ }, {
2800
+ readonly internalType: "string";
2801
+ readonly name: "serverPublicKey";
2802
+ readonly type: "string";
2803
+ }, {
2804
+ readonly components: readonly [{
2805
+ readonly internalType: "address";
2806
+ readonly name: "account";
2807
+ readonly type: "address";
2808
+ }, {
2809
+ readonly internalType: "string";
2810
+ readonly name: "key";
2811
+ readonly type: "string";
2812
+ }];
2813
+ readonly internalType: "struct IDataRegistry.Permission[][]";
2814
+ readonly name: "filePermissions";
2815
+ readonly type: "tuple[][]";
2816
+ }];
2817
+ readonly internalType: "struct IDataPortabilityPermissions.ServerFilesAndPermissionInput";
2818
+ readonly name: "serverFilesAndPermissionInput";
2819
+ readonly type: "tuple";
2820
+ }, {
2821
+ readonly internalType: "bytes";
2822
+ readonly name: "signature";
2823
+ readonly type: "bytes";
2824
+ }];
2825
+ readonly name: "addServerFilesAndPermissions";
2826
+ readonly outputs: readonly [{
2827
+ readonly internalType: "uint256";
2828
+ readonly name: "";
2829
+ readonly type: "uint256";
2830
+ }];
2831
+ readonly stateMutability: "nonpayable";
2832
+ readonly type: "function";
2607
2833
  }, {
2608
2834
  readonly inputs: readonly [];
2609
2835
  readonly name: "dataPortabilityGrantees";
@@ -2768,20 +2994,6 @@ declare const contractAbis: {
2768
2994
  readonly outputs: readonly [];
2769
2995
  readonly stateMutability: "nonpayable";
2770
2996
  readonly type: "function";
2771
- }, {
2772
- readonly inputs: readonly [{
2773
- readonly internalType: "uint256";
2774
- readonly name: "permissionId";
2775
- readonly type: "uint256";
2776
- }];
2777
- readonly name: "isActivePermission";
2778
- readonly outputs: readonly [{
2779
- readonly internalType: "bool";
2780
- readonly name: "";
2781
- readonly type: "bool";
2782
- }];
2783
- readonly stateMutability: "view";
2784
- readonly type: "function";
2785
2997
  }, {
2786
2998
  readonly inputs: readonly [{
2787
2999
  readonly internalType: "address";
@@ -2868,10 +3080,6 @@ declare const contractAbis: {
2868
3080
  readonly internalType: "string";
2869
3081
  readonly name: "grant";
2870
3082
  readonly type: "string";
2871
- }, {
2872
- readonly internalType: "bytes";
2873
- readonly name: "signature";
2874
- readonly type: "bytes";
2875
3083
  }, {
2876
3084
  readonly internalType: "uint256";
2877
3085
  readonly name: "startBlock";
@@ -3159,7 +3367,7 @@ declare const contractAbis: {
3159
3367
  readonly stateMutability: "pure";
3160
3368
  readonly type: "function";
3161
3369
  }];
3162
- readonly DataPortabilityPermissions: readonly [{
3370
+ readonly DataPortabilityServers: readonly [{
3163
3371
  readonly inputs: readonly [];
3164
3372
  readonly stateMutability: "nonpayable";
3165
3373
  readonly type: "constructor";
@@ -3221,31 +3429,23 @@ declare const contractAbis: {
3221
3429
  readonly type: "error";
3222
3430
  }, {
3223
3431
  readonly inputs: readonly [];
3224
- readonly name: "EmptyGrant";
3432
+ readonly name: "EmptyPublicKey";
3225
3433
  readonly type: "error";
3226
3434
  }, {
3227
3435
  readonly inputs: readonly [];
3228
- readonly name: "EnforcedPause";
3436
+ readonly name: "EmptyUrl";
3229
3437
  readonly type: "error";
3230
3438
  }, {
3231
3439
  readonly inputs: readonly [];
3232
- readonly name: "ExpectedPause";
3440
+ readonly name: "EnforcedPause";
3233
3441
  readonly type: "error";
3234
3442
  }, {
3235
3443
  readonly inputs: readonly [];
3236
- readonly name: "FailedInnerCall";
3444
+ readonly name: "ExpectedPause";
3237
3445
  readonly type: "error";
3238
3446
  }, {
3239
3447
  readonly inputs: readonly [];
3240
- readonly name: "GranteeNotFound";
3241
- readonly type: "error";
3242
- }, {
3243
- readonly inputs: readonly [{
3244
- readonly internalType: "uint256";
3245
- readonly name: "permissionId";
3246
- readonly type: "uint256";
3247
- }];
3248
- readonly name: "InactivePermission";
3448
+ readonly name: "FailedInnerCall";
3249
3449
  readonly type: "error";
3250
3450
  }, {
3251
3451
  readonly inputs: readonly [];
@@ -3265,960 +3465,51 @@ declare const contractAbis: {
3265
3465
  readonly type: "error";
3266
3466
  }, {
3267
3467
  readonly inputs: readonly [];
3268
- readonly name: "InvalidSignature";
3468
+ readonly name: "NotInitializing";
3269
3469
  readonly type: "error";
3270
3470
  }, {
3271
3471
  readonly inputs: readonly [{
3272
3472
  readonly internalType: "address";
3273
- readonly name: "fileOwner";
3473
+ readonly name: "serverOwner";
3274
3474
  readonly type: "address";
3275
3475
  }, {
3276
3476
  readonly internalType: "address";
3277
3477
  readonly name: "requestor";
3278
3478
  readonly type: "address";
3279
3479
  }];
3280
- readonly name: "NotFileOwner";
3480
+ readonly name: "NotServerOwner";
3281
3481
  readonly type: "error";
3282
3482
  }, {
3283
3483
  readonly inputs: readonly [];
3284
- readonly name: "NotInitializing";
3484
+ readonly name: "ServerAlreadyRegistered";
3485
+ readonly type: "error";
3486
+ }, {
3487
+ readonly inputs: readonly [];
3488
+ readonly name: "ServerAlreadyTrusted";
3489
+ readonly type: "error";
3490
+ }, {
3491
+ readonly inputs: readonly [];
3492
+ readonly name: "ServerAlreadyUntrusted";
3493
+ readonly type: "error";
3494
+ }, {
3495
+ readonly inputs: readonly [];
3496
+ readonly name: "ServerNotFound";
3497
+ readonly type: "error";
3498
+ }, {
3499
+ readonly inputs: readonly [];
3500
+ readonly name: "ServerNotTrusted";
3285
3501
  readonly type: "error";
3286
3502
  }, {
3287
3503
  readonly inputs: readonly [{
3288
- readonly internalType: "address";
3289
- readonly name: "permissionOwner";
3290
- readonly type: "address";
3504
+ readonly internalType: "string";
3505
+ readonly name: "existingUrl";
3506
+ readonly type: "string";
3291
3507
  }, {
3292
- readonly internalType: "address";
3293
- readonly name: "requestor";
3294
- readonly type: "address";
3508
+ readonly internalType: "string";
3509
+ readonly name: "providedUrl";
3510
+ readonly type: "string";
3295
3511
  }];
3296
- readonly name: "NotPermissionGrantor";
3297
- readonly type: "error";
3298
- }, {
3299
- readonly inputs: readonly [];
3300
- readonly name: "UUPSUnauthorizedCallContext";
3301
- readonly type: "error";
3302
- }, {
3303
- readonly inputs: readonly [{
3304
- readonly internalType: "bytes32";
3305
- readonly name: "slot";
3306
- readonly type: "bytes32";
3307
- }];
3308
- readonly name: "UUPSUnsupportedProxiableUUID";
3309
- readonly type: "error";
3310
- }, {
3311
- readonly inputs: readonly [];
3312
- readonly name: "ZeroAddress";
3313
- readonly type: "error";
3314
- }, {
3315
- readonly anonymous: false;
3316
- readonly inputs: readonly [];
3317
- readonly name: "EIP712DomainChanged";
3318
- readonly type: "event";
3319
- }, {
3320
- readonly anonymous: false;
3321
- readonly inputs: readonly [{
3322
- readonly indexed: false;
3323
- readonly internalType: "uint64";
3324
- readonly name: "version";
3325
- readonly type: "uint64";
3326
- }];
3327
- readonly name: "Initialized";
3328
- readonly type: "event";
3329
- }, {
3330
- readonly anonymous: false;
3331
- readonly inputs: readonly [{
3332
- readonly indexed: false;
3333
- readonly internalType: "address";
3334
- readonly name: "account";
3335
- readonly type: "address";
3336
- }];
3337
- readonly name: "Paused";
3338
- readonly type: "event";
3339
- }, {
3340
- readonly anonymous: false;
3341
- readonly inputs: readonly [{
3342
- readonly indexed: true;
3343
- readonly internalType: "uint256";
3344
- readonly name: "permissionId";
3345
- readonly type: "uint256";
3346
- }, {
3347
- readonly indexed: true;
3348
- readonly internalType: "address";
3349
- readonly name: "user";
3350
- readonly type: "address";
3351
- }, {
3352
- readonly indexed: true;
3353
- readonly internalType: "uint256";
3354
- readonly name: "granteeId";
3355
- readonly type: "uint256";
3356
- }, {
3357
- readonly indexed: false;
3358
- readonly internalType: "string";
3359
- readonly name: "grant";
3360
- readonly type: "string";
3361
- }, {
3362
- readonly indexed: false;
3363
- readonly internalType: "uint256[]";
3364
- readonly name: "fileIds";
3365
- readonly type: "uint256[]";
3366
- }];
3367
- readonly name: "PermissionAdded";
3368
- readonly type: "event";
3369
- }, {
3370
- readonly anonymous: false;
3371
- readonly inputs: readonly [{
3372
- readonly indexed: true;
3373
- readonly internalType: "uint256";
3374
- readonly name: "permissionId";
3375
- readonly type: "uint256";
3376
- }];
3377
- readonly name: "PermissionRevoked";
3378
- readonly type: "event";
3379
- }, {
3380
- readonly anonymous: false;
3381
- readonly inputs: readonly [{
3382
- readonly indexed: true;
3383
- readonly internalType: "bytes32";
3384
- readonly name: "role";
3385
- readonly type: "bytes32";
3386
- }, {
3387
- readonly indexed: true;
3388
- readonly internalType: "bytes32";
3389
- readonly name: "previousAdminRole";
3390
- readonly type: "bytes32";
3391
- }, {
3392
- readonly indexed: true;
3393
- readonly internalType: "bytes32";
3394
- readonly name: "newAdminRole";
3395
- readonly type: "bytes32";
3396
- }];
3397
- readonly name: "RoleAdminChanged";
3398
- readonly type: "event";
3399
- }, {
3400
- readonly anonymous: false;
3401
- readonly inputs: readonly [{
3402
- readonly indexed: true;
3403
- readonly internalType: "bytes32";
3404
- readonly name: "role";
3405
- readonly type: "bytes32";
3406
- }, {
3407
- readonly indexed: true;
3408
- readonly internalType: "address";
3409
- readonly name: "account";
3410
- readonly type: "address";
3411
- }, {
3412
- readonly indexed: true;
3413
- readonly internalType: "address";
3414
- readonly name: "sender";
3415
- readonly type: "address";
3416
- }];
3417
- readonly name: "RoleGranted";
3418
- readonly type: "event";
3419
- }, {
3420
- readonly anonymous: false;
3421
- readonly inputs: readonly [{
3422
- readonly indexed: true;
3423
- readonly internalType: "bytes32";
3424
- readonly name: "role";
3425
- readonly type: "bytes32";
3426
- }, {
3427
- readonly indexed: true;
3428
- readonly internalType: "address";
3429
- readonly name: "account";
3430
- readonly type: "address";
3431
- }, {
3432
- readonly indexed: true;
3433
- readonly internalType: "address";
3434
- readonly name: "sender";
3435
- readonly type: "address";
3436
- }];
3437
- readonly name: "RoleRevoked";
3438
- readonly type: "event";
3439
- }, {
3440
- readonly anonymous: false;
3441
- readonly inputs: readonly [{
3442
- readonly indexed: false;
3443
- readonly internalType: "address";
3444
- readonly name: "account";
3445
- readonly type: "address";
3446
- }];
3447
- readonly name: "Unpaused";
3448
- readonly type: "event";
3449
- }, {
3450
- readonly anonymous: false;
3451
- readonly inputs: readonly [{
3452
- readonly indexed: true;
3453
- readonly internalType: "address";
3454
- readonly name: "implementation";
3455
- readonly type: "address";
3456
- }];
3457
- readonly name: "Upgraded";
3458
- readonly type: "event";
3459
- }, {
3460
- readonly inputs: readonly [];
3461
- readonly name: "DEFAULT_ADMIN_ROLE";
3462
- readonly outputs: readonly [{
3463
- readonly internalType: "bytes32";
3464
- readonly name: "";
3465
- readonly type: "bytes32";
3466
- }];
3467
- readonly stateMutability: "view";
3468
- readonly type: "function";
3469
- }, {
3470
- readonly inputs: readonly [];
3471
- readonly name: "MAINTAINER_ROLE";
3472
- readonly outputs: readonly [{
3473
- readonly internalType: "bytes32";
3474
- readonly name: "";
3475
- readonly type: "bytes32";
3476
- }];
3477
- readonly stateMutability: "view";
3478
- readonly type: "function";
3479
- }, {
3480
- readonly inputs: readonly [];
3481
- readonly name: "UPGRADE_INTERFACE_VERSION";
3482
- readonly outputs: readonly [{
3483
- readonly internalType: "string";
3484
- readonly name: "";
3485
- readonly type: "string";
3486
- }];
3487
- readonly stateMutability: "view";
3488
- readonly type: "function";
3489
- }, {
3490
- readonly inputs: readonly [{
3491
- readonly components: readonly [{
3492
- readonly internalType: "uint256";
3493
- readonly name: "nonce";
3494
- readonly type: "uint256";
3495
- }, {
3496
- readonly internalType: "uint256";
3497
- readonly name: "granteeId";
3498
- readonly type: "uint256";
3499
- }, {
3500
- readonly internalType: "string";
3501
- readonly name: "grant";
3502
- readonly type: "string";
3503
- }, {
3504
- readonly internalType: "uint256[]";
3505
- readonly name: "fileIds";
3506
- readonly type: "uint256[]";
3507
- }];
3508
- readonly internalType: "struct IDataPortabilityPermissions.PermissionInput";
3509
- readonly name: "permissionInput";
3510
- readonly type: "tuple";
3511
- }, {
3512
- readonly internalType: "bytes";
3513
- readonly name: "signature";
3514
- readonly type: "bytes";
3515
- }];
3516
- readonly name: "addPermission";
3517
- readonly outputs: readonly [{
3518
- readonly internalType: "uint256";
3519
- readonly name: "";
3520
- readonly type: "uint256";
3521
- }];
3522
- readonly stateMutability: "nonpayable";
3523
- readonly type: "function";
3524
- }, {
3525
- readonly inputs: readonly [];
3526
- readonly name: "dataPortabilityGrantees";
3527
- readonly outputs: readonly [{
3528
- readonly internalType: "contract IDataPortabilityGrantees";
3529
- readonly name: "";
3530
- readonly type: "address";
3531
- }];
3532
- readonly stateMutability: "view";
3533
- readonly type: "function";
3534
- }, {
3535
- readonly inputs: readonly [];
3536
- readonly name: "dataPortabilityServers";
3537
- readonly outputs: readonly [{
3538
- readonly internalType: "contract IDataPortabilityServers";
3539
- readonly name: "";
3540
- readonly type: "address";
3541
- }];
3542
- readonly stateMutability: "view";
3543
- readonly type: "function";
3544
- }, {
3545
- readonly inputs: readonly [];
3546
- readonly name: "dataRegistry";
3547
- readonly outputs: readonly [{
3548
- readonly internalType: "contract IDataRegistry";
3549
- readonly name: "";
3550
- readonly type: "address";
3551
- }];
3552
- readonly stateMutability: "view";
3553
- readonly type: "function";
3554
- }, {
3555
- readonly inputs: readonly [];
3556
- readonly name: "eip712Domain";
3557
- readonly outputs: readonly [{
3558
- readonly internalType: "bytes1";
3559
- readonly name: "fields";
3560
- readonly type: "bytes1";
3561
- }, {
3562
- readonly internalType: "string";
3563
- readonly name: "name";
3564
- readonly type: "string";
3565
- }, {
3566
- readonly internalType: "string";
3567
- readonly name: "version";
3568
- readonly type: "string";
3569
- }, {
3570
- readonly internalType: "uint256";
3571
- readonly name: "chainId";
3572
- readonly type: "uint256";
3573
- }, {
3574
- readonly internalType: "address";
3575
- readonly name: "verifyingContract";
3576
- readonly type: "address";
3577
- }, {
3578
- readonly internalType: "bytes32";
3579
- readonly name: "salt";
3580
- readonly type: "bytes32";
3581
- }, {
3582
- readonly internalType: "uint256[]";
3583
- readonly name: "extensions";
3584
- readonly type: "uint256[]";
3585
- }];
3586
- readonly stateMutability: "view";
3587
- readonly type: "function";
3588
- }, {
3589
- readonly inputs: readonly [{
3590
- readonly internalType: "uint256";
3591
- readonly name: "fileId";
3592
- readonly type: "uint256";
3593
- }];
3594
- readonly name: "filePermissionIds";
3595
- readonly outputs: readonly [{
3596
- readonly internalType: "uint256[]";
3597
- readonly name: "";
3598
- readonly type: "uint256[]";
3599
- }];
3600
- readonly stateMutability: "view";
3601
- readonly type: "function";
3602
- }, {
3603
- readonly inputs: readonly [{
3604
- readonly internalType: "uint256";
3605
- readonly name: "fileId";
3606
- readonly type: "uint256";
3607
- }];
3608
- readonly name: "filePermissions";
3609
- readonly outputs: readonly [{
3610
- readonly internalType: "uint256[]";
3611
- readonly name: "";
3612
- readonly type: "uint256[]";
3613
- }];
3614
- readonly stateMutability: "view";
3615
- readonly type: "function";
3616
- }, {
3617
- readonly inputs: readonly [{
3618
- readonly internalType: "bytes32";
3619
- readonly name: "role";
3620
- readonly type: "bytes32";
3621
- }];
3622
- readonly name: "getRoleAdmin";
3623
- readonly outputs: readonly [{
3624
- readonly internalType: "bytes32";
3625
- readonly name: "";
3626
- readonly type: "bytes32";
3627
- }];
3628
- readonly stateMutability: "view";
3629
- readonly type: "function";
3630
- }, {
3631
- readonly inputs: readonly [{
3632
- readonly internalType: "bytes32";
3633
- readonly name: "role";
3634
- readonly type: "bytes32";
3635
- }, {
3636
- readonly internalType: "address";
3637
- readonly name: "account";
3638
- readonly type: "address";
3639
- }];
3640
- readonly name: "grantRole";
3641
- readonly outputs: readonly [];
3642
- readonly stateMutability: "nonpayable";
3643
- readonly type: "function";
3644
- }, {
3645
- readonly inputs: readonly [{
3646
- readonly internalType: "bytes32";
3647
- readonly name: "role";
3648
- readonly type: "bytes32";
3649
- }, {
3650
- readonly internalType: "address";
3651
- readonly name: "account";
3652
- readonly type: "address";
3653
- }];
3654
- readonly name: "hasRole";
3655
- readonly outputs: readonly [{
3656
- readonly internalType: "bool";
3657
- readonly name: "";
3658
- readonly type: "bool";
3659
- }];
3660
- readonly stateMutability: "view";
3661
- readonly type: "function";
3662
- }, {
3663
- readonly inputs: readonly [{
3664
- readonly internalType: "address";
3665
- readonly name: "trustedForwarderAddress";
3666
- readonly type: "address";
3667
- }, {
3668
- readonly internalType: "address";
3669
- readonly name: "ownerAddress";
3670
- readonly type: "address";
3671
- }, {
3672
- readonly internalType: "contract IDataRegistry";
3673
- readonly name: "dataRegistryAddress";
3674
- readonly type: "address";
3675
- }, {
3676
- readonly internalType: "contract IDataPortabilityServers";
3677
- readonly name: "serversContractAddr";
3678
- readonly type: "address";
3679
- }, {
3680
- readonly internalType: "contract IDataPortabilityGrantees";
3681
- readonly name: "granteesContractAddr";
3682
- readonly type: "address";
3683
- }];
3684
- readonly name: "initialize";
3685
- readonly outputs: readonly [];
3686
- readonly stateMutability: "nonpayable";
3687
- readonly type: "function";
3688
- }, {
3689
- readonly inputs: readonly [{
3690
- readonly internalType: "uint256";
3691
- readonly name: "permissionId";
3692
- readonly type: "uint256";
3693
- }];
3694
- readonly name: "isActivePermission";
3695
- readonly outputs: readonly [{
3696
- readonly internalType: "bool";
3697
- readonly name: "";
3698
- readonly type: "bool";
3699
- }];
3700
- readonly stateMutability: "view";
3701
- readonly type: "function";
3702
- }, {
3703
- readonly inputs: readonly [{
3704
- readonly internalType: "address";
3705
- readonly name: "forwarder";
3706
- readonly type: "address";
3707
- }];
3708
- readonly name: "isTrustedForwarder";
3709
- readonly outputs: readonly [{
3710
- readonly internalType: "bool";
3711
- readonly name: "";
3712
- readonly type: "bool";
3713
- }];
3714
- readonly stateMutability: "view";
3715
- readonly type: "function";
3716
- }, {
3717
- readonly inputs: readonly [{
3718
- readonly internalType: "bytes[]";
3719
- readonly name: "data";
3720
- readonly type: "bytes[]";
3721
- }];
3722
- readonly name: "multicall";
3723
- readonly outputs: readonly [{
3724
- readonly internalType: "bytes[]";
3725
- readonly name: "results";
3726
- readonly type: "bytes[]";
3727
- }];
3728
- readonly stateMutability: "nonpayable";
3729
- readonly type: "function";
3730
- }, {
3731
- readonly inputs: readonly [];
3732
- readonly name: "pause";
3733
- readonly outputs: readonly [];
3734
- readonly stateMutability: "nonpayable";
3735
- readonly type: "function";
3736
- }, {
3737
- readonly inputs: readonly [];
3738
- readonly name: "paused";
3739
- readonly outputs: readonly [{
3740
- readonly internalType: "bool";
3741
- readonly name: "";
3742
- readonly type: "bool";
3743
- }];
3744
- readonly stateMutability: "view";
3745
- readonly type: "function";
3746
- }, {
3747
- readonly inputs: readonly [{
3748
- readonly internalType: "uint256";
3749
- readonly name: "permissionId";
3750
- readonly type: "uint256";
3751
- }];
3752
- readonly name: "permissionFileIds";
3753
- readonly outputs: readonly [{
3754
- readonly internalType: "uint256[]";
3755
- readonly name: "";
3756
- readonly type: "uint256[]";
3757
- }];
3758
- readonly stateMutability: "view";
3759
- readonly type: "function";
3760
- }, {
3761
- readonly inputs: readonly [{
3762
- readonly internalType: "uint256";
3763
- readonly name: "permissionId";
3764
- readonly type: "uint256";
3765
- }];
3766
- readonly name: "permissions";
3767
- readonly outputs: readonly [{
3768
- readonly components: readonly [{
3769
- readonly internalType: "uint256";
3770
- readonly name: "id";
3771
- readonly type: "uint256";
3772
- }, {
3773
- readonly internalType: "address";
3774
- readonly name: "grantor";
3775
- readonly type: "address";
3776
- }, {
3777
- readonly internalType: "uint256";
3778
- readonly name: "nonce";
3779
- readonly type: "uint256";
3780
- }, {
3781
- readonly internalType: "uint256";
3782
- readonly name: "granteeId";
3783
- readonly type: "uint256";
3784
- }, {
3785
- readonly internalType: "string";
3786
- readonly name: "grant";
3787
- readonly type: "string";
3788
- }, {
3789
- readonly internalType: "bytes";
3790
- readonly name: "signature";
3791
- readonly type: "bytes";
3792
- }, {
3793
- readonly internalType: "uint256";
3794
- readonly name: "startBlock";
3795
- readonly type: "uint256";
3796
- }, {
3797
- readonly internalType: "uint256";
3798
- readonly name: "endBlock";
3799
- readonly type: "uint256";
3800
- }, {
3801
- readonly internalType: "uint256[]";
3802
- readonly name: "fileIds";
3803
- readonly type: "uint256[]";
3804
- }];
3805
- readonly internalType: "struct IDataPortabilityPermissions.PermissionInfo";
3806
- readonly name: "";
3807
- readonly type: "tuple";
3808
- }];
3809
- readonly stateMutability: "view";
3810
- readonly type: "function";
3811
- }, {
3812
- readonly inputs: readonly [];
3813
- readonly name: "permissionsCount";
3814
- readonly outputs: readonly [{
3815
- readonly internalType: "uint256";
3816
- readonly name: "";
3817
- readonly type: "uint256";
3818
- }];
3819
- readonly stateMutability: "view";
3820
- readonly type: "function";
3821
- }, {
3822
- readonly inputs: readonly [];
3823
- readonly name: "proxiableUUID";
3824
- readonly outputs: readonly [{
3825
- readonly internalType: "bytes32";
3826
- readonly name: "";
3827
- readonly type: "bytes32";
3828
- }];
3829
- readonly stateMutability: "view";
3830
- readonly type: "function";
3831
- }, {
3832
- readonly inputs: readonly [{
3833
- readonly internalType: "bytes32";
3834
- readonly name: "role";
3835
- readonly type: "bytes32";
3836
- }, {
3837
- readonly internalType: "address";
3838
- readonly name: "callerConfirmation";
3839
- readonly type: "address";
3840
- }];
3841
- readonly name: "renounceRole";
3842
- readonly outputs: readonly [];
3843
- readonly stateMutability: "nonpayable";
3844
- readonly type: "function";
3845
- }, {
3846
- readonly inputs: readonly [{
3847
- readonly internalType: "uint256";
3848
- readonly name: "permissionId";
3849
- readonly type: "uint256";
3850
- }];
3851
- readonly name: "revokePermission";
3852
- readonly outputs: readonly [];
3853
- readonly stateMutability: "nonpayable";
3854
- readonly type: "function";
3855
- }, {
3856
- readonly inputs: readonly [{
3857
- readonly components: readonly [{
3858
- readonly internalType: "uint256";
3859
- readonly name: "nonce";
3860
- readonly type: "uint256";
3861
- }, {
3862
- readonly internalType: "uint256";
3863
- readonly name: "permissionId";
3864
- readonly type: "uint256";
3865
- }];
3866
- readonly internalType: "struct IDataPortabilityPermissions.RevokePermissionInput";
3867
- readonly name: "revokePermissionInput";
3868
- readonly type: "tuple";
3869
- }, {
3870
- readonly internalType: "bytes";
3871
- readonly name: "signature";
3872
- readonly type: "bytes";
3873
- }];
3874
- readonly name: "revokePermissionWithSignature";
3875
- readonly outputs: readonly [];
3876
- readonly stateMutability: "nonpayable";
3877
- readonly type: "function";
3878
- }, {
3879
- readonly inputs: readonly [{
3880
- readonly internalType: "bytes32";
3881
- readonly name: "role";
3882
- readonly type: "bytes32";
3883
- }, {
3884
- readonly internalType: "address";
3885
- readonly name: "account";
3886
- readonly type: "address";
3887
- }];
3888
- readonly name: "revokeRole";
3889
- readonly outputs: readonly [];
3890
- readonly stateMutability: "nonpayable";
3891
- readonly type: "function";
3892
- }, {
3893
- readonly inputs: readonly [{
3894
- readonly internalType: "bytes32";
3895
- readonly name: "role";
3896
- readonly type: "bytes32";
3897
- }, {
3898
- readonly internalType: "bytes32";
3899
- readonly name: "adminRole";
3900
- readonly type: "bytes32";
3901
- }];
3902
- readonly name: "setRoleAdmin";
3903
- readonly outputs: readonly [];
3904
- readonly stateMutability: "nonpayable";
3905
- readonly type: "function";
3906
- }, {
3907
- readonly inputs: readonly [{
3908
- readonly internalType: "bytes4";
3909
- readonly name: "interfaceId";
3910
- readonly type: "bytes4";
3911
- }];
3912
- readonly name: "supportsInterface";
3913
- readonly outputs: readonly [{
3914
- readonly internalType: "bool";
3915
- readonly name: "";
3916
- readonly type: "bool";
3917
- }];
3918
- readonly stateMutability: "view";
3919
- readonly type: "function";
3920
- }, {
3921
- readonly inputs: readonly [];
3922
- readonly name: "trustedForwarder";
3923
- readonly outputs: readonly [{
3924
- readonly internalType: "address";
3925
- readonly name: "";
3926
- readonly type: "address";
3927
- }];
3928
- readonly stateMutability: "view";
3929
- readonly type: "function";
3930
- }, {
3931
- readonly inputs: readonly [];
3932
- readonly name: "unpause";
3933
- readonly outputs: readonly [];
3934
- readonly stateMutability: "nonpayable";
3935
- readonly type: "function";
3936
- }, {
3937
- readonly inputs: readonly [{
3938
- readonly internalType: "contract IDataRegistry";
3939
- readonly name: "newDataRegistry";
3940
- readonly type: "address";
3941
- }];
3942
- readonly name: "updateDataRegistry";
3943
- readonly outputs: readonly [];
3944
- readonly stateMutability: "nonpayable";
3945
- readonly type: "function";
3946
- }, {
3947
- readonly inputs: readonly [{
3948
- readonly internalType: "contract IDataPortabilityGrantees";
3949
- readonly name: "newGranteesContract";
3950
- readonly type: "address";
3951
- }];
3952
- readonly name: "updateGranteesContract";
3953
- readonly outputs: readonly [];
3954
- readonly stateMutability: "nonpayable";
3955
- readonly type: "function";
3956
- }, {
3957
- readonly inputs: readonly [{
3958
- readonly internalType: "contract IDataPortabilityServers";
3959
- readonly name: "newServersContract";
3960
- readonly type: "address";
3961
- }];
3962
- readonly name: "updateServersContract";
3963
- readonly outputs: readonly [];
3964
- readonly stateMutability: "nonpayable";
3965
- readonly type: "function";
3966
- }, {
3967
- readonly inputs: readonly [{
3968
- readonly internalType: "address";
3969
- readonly name: "trustedForwarderAddress";
3970
- readonly type: "address";
3971
- }];
3972
- readonly name: "updateTrustedForwarder";
3973
- readonly outputs: readonly [];
3974
- readonly stateMutability: "nonpayable";
3975
- readonly type: "function";
3976
- }, {
3977
- readonly inputs: readonly [{
3978
- readonly internalType: "address";
3979
- readonly name: "newImplementation";
3980
- readonly type: "address";
3981
- }, {
3982
- readonly internalType: "bytes";
3983
- readonly name: "data";
3984
- readonly type: "bytes";
3985
- }];
3986
- readonly name: "upgradeToAndCall";
3987
- readonly outputs: readonly [];
3988
- readonly stateMutability: "payable";
3989
- readonly type: "function";
3990
- }, {
3991
- readonly inputs: readonly [{
3992
- readonly internalType: "address";
3993
- readonly name: "userAddress";
3994
- readonly type: "address";
3995
- }];
3996
- readonly name: "userNonce";
3997
- readonly outputs: readonly [{
3998
- readonly internalType: "uint256";
3999
- readonly name: "";
4000
- readonly type: "uint256";
4001
- }];
4002
- readonly stateMutability: "view";
4003
- readonly type: "function";
4004
- }, {
4005
- readonly inputs: readonly [{
4006
- readonly internalType: "address";
4007
- readonly name: "userAddress";
4008
- readonly type: "address";
4009
- }, {
4010
- readonly internalType: "uint256";
4011
- readonly name: "permissionIndex";
4012
- readonly type: "uint256";
4013
- }];
4014
- readonly name: "userPermissionIdsAt";
4015
- readonly outputs: readonly [{
4016
- readonly internalType: "uint256";
4017
- readonly name: "";
4018
- readonly type: "uint256";
4019
- }];
4020
- readonly stateMutability: "view";
4021
- readonly type: "function";
4022
- }, {
4023
- readonly inputs: readonly [{
4024
- readonly internalType: "address";
4025
- readonly name: "userAddress";
4026
- readonly type: "address";
4027
- }];
4028
- readonly name: "userPermissionIdsLength";
4029
- readonly outputs: readonly [{
4030
- readonly internalType: "uint256";
4031
- readonly name: "";
4032
- readonly type: "uint256";
4033
- }];
4034
- readonly stateMutability: "view";
4035
- readonly type: "function";
4036
- }, {
4037
- readonly inputs: readonly [{
4038
- readonly internalType: "address";
4039
- readonly name: "userAddress";
4040
- readonly type: "address";
4041
- }];
4042
- readonly name: "userPermissionIdsValues";
4043
- readonly outputs: readonly [{
4044
- readonly internalType: "uint256[]";
4045
- readonly name: "";
4046
- readonly type: "uint256[]";
4047
- }];
4048
- readonly stateMutability: "view";
4049
- readonly type: "function";
4050
- }, {
4051
- readonly inputs: readonly [{
4052
- readonly internalType: "address";
4053
- readonly name: "userAddress";
4054
- readonly type: "address";
4055
- }];
4056
- readonly name: "users";
4057
- readonly outputs: readonly [{
4058
- readonly internalType: "uint256";
4059
- readonly name: "nonce";
4060
- readonly type: "uint256";
4061
- }, {
4062
- readonly internalType: "uint256[]";
4063
- readonly name: "permissionIds";
4064
- readonly type: "uint256[]";
4065
- }];
4066
- readonly stateMutability: "view";
4067
- readonly type: "function";
4068
- }, {
4069
- readonly inputs: readonly [];
4070
- readonly name: "version";
4071
- readonly outputs: readonly [{
4072
- readonly internalType: "uint256";
4073
- readonly name: "";
4074
- readonly type: "uint256";
4075
- }];
4076
- readonly stateMutability: "pure";
4077
- readonly type: "function";
4078
- }];
4079
- readonly DataPortabilityServers: readonly [{
4080
- readonly inputs: readonly [];
4081
- readonly stateMutability: "nonpayable";
4082
- readonly type: "constructor";
4083
- }, {
4084
- readonly inputs: readonly [];
4085
- readonly name: "AccessControlBadConfirmation";
4086
- readonly type: "error";
4087
- }, {
4088
- readonly inputs: readonly [{
4089
- readonly internalType: "address";
4090
- readonly name: "account";
4091
- readonly type: "address";
4092
- }, {
4093
- readonly internalType: "bytes32";
4094
- readonly name: "neededRole";
4095
- readonly type: "bytes32";
4096
- }];
4097
- readonly name: "AccessControlUnauthorizedAccount";
4098
- readonly type: "error";
4099
- }, {
4100
- readonly inputs: readonly [{
4101
- readonly internalType: "address";
4102
- readonly name: "target";
4103
- readonly type: "address";
4104
- }];
4105
- readonly name: "AddressEmptyCode";
4106
- readonly type: "error";
4107
- }, {
4108
- readonly inputs: readonly [];
4109
- readonly name: "ECDSAInvalidSignature";
4110
- readonly type: "error";
4111
- }, {
4112
- readonly inputs: readonly [{
4113
- readonly internalType: "uint256";
4114
- readonly name: "length";
4115
- readonly type: "uint256";
4116
- }];
4117
- readonly name: "ECDSAInvalidSignatureLength";
4118
- readonly type: "error";
4119
- }, {
4120
- readonly inputs: readonly [{
4121
- readonly internalType: "bytes32";
4122
- readonly name: "s";
4123
- readonly type: "bytes32";
4124
- }];
4125
- readonly name: "ECDSAInvalidSignatureS";
4126
- readonly type: "error";
4127
- }, {
4128
- readonly inputs: readonly [{
4129
- readonly internalType: "address";
4130
- readonly name: "implementation";
4131
- readonly type: "address";
4132
- }];
4133
- readonly name: "ERC1967InvalidImplementation";
4134
- readonly type: "error";
4135
- }, {
4136
- readonly inputs: readonly [];
4137
- readonly name: "ERC1967NonPayable";
4138
- readonly type: "error";
4139
- }, {
4140
- readonly inputs: readonly [];
4141
- readonly name: "EmptyPublicKey";
4142
- readonly type: "error";
4143
- }, {
4144
- readonly inputs: readonly [];
4145
- readonly name: "EmptyUrl";
4146
- readonly type: "error";
4147
- }, {
4148
- readonly inputs: readonly [];
4149
- readonly name: "EnforcedPause";
4150
- readonly type: "error";
4151
- }, {
4152
- readonly inputs: readonly [];
4153
- readonly name: "ExpectedPause";
4154
- readonly type: "error";
4155
- }, {
4156
- readonly inputs: readonly [];
4157
- readonly name: "FailedInnerCall";
4158
- readonly type: "error";
4159
- }, {
4160
- readonly inputs: readonly [];
4161
- readonly name: "InvalidInitialization";
4162
- readonly type: "error";
4163
- }, {
4164
- readonly inputs: readonly [{
4165
- readonly internalType: "uint256";
4166
- readonly name: "expectedNonce";
4167
- readonly type: "uint256";
4168
- }, {
4169
- readonly internalType: "uint256";
4170
- readonly name: "providedNonce";
4171
- readonly type: "uint256";
4172
- }];
4173
- readonly name: "InvalidNonce";
4174
- readonly type: "error";
4175
- }, {
4176
- readonly inputs: readonly [];
4177
- readonly name: "NotInitializing";
4178
- readonly type: "error";
4179
- }, {
4180
- readonly inputs: readonly [{
4181
- readonly internalType: "address";
4182
- readonly name: "serverOwner";
4183
- readonly type: "address";
4184
- }, {
4185
- readonly internalType: "address";
4186
- readonly name: "requestor";
4187
- readonly type: "address";
4188
- }];
4189
- readonly name: "NotServerOwner";
4190
- readonly type: "error";
4191
- }, {
4192
- readonly inputs: readonly [];
4193
- readonly name: "ServerAlreadyRegistered";
4194
- readonly type: "error";
4195
- }, {
4196
- readonly inputs: readonly [];
4197
- readonly name: "ServerAlreadyTrusted";
4198
- readonly type: "error";
4199
- }, {
4200
- readonly inputs: readonly [];
4201
- readonly name: "ServerAlreadyUntrusted";
4202
- readonly type: "error";
4203
- }, {
4204
- readonly inputs: readonly [];
4205
- readonly name: "ServerNotFound";
4206
- readonly type: "error";
4207
- }, {
4208
- readonly inputs: readonly [];
4209
- readonly name: "ServerNotTrusted";
4210
- readonly type: "error";
4211
- }, {
4212
- readonly inputs: readonly [{
4213
- readonly internalType: "string";
4214
- readonly name: "existingUrl";
4215
- readonly type: "string";
4216
- }, {
4217
- readonly internalType: "string";
4218
- readonly name: "providedUrl";
4219
- readonly type: "string";
4220
- }];
4221
- readonly name: "ServerUrlMismatch";
3512
+ readonly name: "ServerUrlMismatch";
4222
3513
  readonly type: "error";
4223
3514
  }, {
4224
3515
  readonly inputs: readonly [];
@@ -4340,9 +3631,9 @@ declare const contractAbis: {
4340
3631
  readonly type: "address";
4341
3632
  }, {
4342
3633
  readonly indexed: false;
4343
- readonly internalType: "bytes";
3634
+ readonly internalType: "string";
4344
3635
  readonly name: "publicKey";
4345
- readonly type: "bytes";
3636
+ readonly type: "string";
4346
3637
  }, {
4347
3638
  readonly indexed: false;
4348
3639
  readonly internalType: "string";
@@ -4436,6 +3727,16 @@ declare const contractAbis: {
4436
3727
  }];
4437
3728
  readonly stateMutability: "view";
4438
3729
  readonly type: "function";
3730
+ }, {
3731
+ readonly inputs: readonly [];
3732
+ readonly name: "PERMISSION_MANAGER_ROLE";
3733
+ readonly outputs: readonly [{
3734
+ readonly internalType: "bytes32";
3735
+ readonly name: "";
3736
+ readonly type: "bytes32";
3737
+ }];
3738
+ readonly stateMutability: "view";
3739
+ readonly type: "function";
4439
3740
  }, {
4440
3741
  readonly inputs: readonly [];
4441
3742
  readonly name: "UPGRADE_INTERFACE_VERSION";
@@ -4448,28 +3749,28 @@ declare const contractAbis: {
4448
3749
  readonly type: "function";
4449
3750
  }, {
4450
3751
  readonly inputs: readonly [{
3752
+ readonly internalType: "address";
3753
+ readonly name: "ownerAddress";
3754
+ readonly type: "address";
3755
+ }, {
4451
3756
  readonly components: readonly [{
4452
- readonly internalType: "address";
4453
- readonly name: "owner";
4454
- readonly type: "address";
4455
- }, {
4456
3757
  readonly internalType: "address";
4457
3758
  readonly name: "serverAddress";
4458
3759
  readonly type: "address";
4459
3760
  }, {
4460
- readonly internalType: "bytes";
3761
+ readonly internalType: "string";
4461
3762
  readonly name: "publicKey";
4462
- readonly type: "bytes";
3763
+ readonly type: "string";
4463
3764
  }, {
4464
3765
  readonly internalType: "string";
4465
3766
  readonly name: "serverUrl";
4466
3767
  readonly type: "string";
4467
3768
  }];
4468
3769
  readonly internalType: "struct IDataPortabilityServers.AddServerInput";
4469
- readonly name: "addAndTrustServerInput";
3770
+ readonly name: "addServerInput";
4470
3771
  readonly type: "tuple";
4471
3772
  }];
4472
- readonly name: "addAndTrustServer";
3773
+ readonly name: "addAndTrustServerByManager";
4473
3774
  readonly outputs: readonly [];
4474
3775
  readonly stateMutability: "nonpayable";
4475
3776
  readonly type: "function";
@@ -4479,25 +3780,21 @@ declare const contractAbis: {
4479
3780
  readonly internalType: "uint256";
4480
3781
  readonly name: "nonce";
4481
3782
  readonly type: "uint256";
4482
- }, {
4483
- readonly internalType: "address";
4484
- readonly name: "owner";
4485
- readonly type: "address";
4486
3783
  }, {
4487
3784
  readonly internalType: "address";
4488
3785
  readonly name: "serverAddress";
4489
3786
  readonly type: "address";
4490
3787
  }, {
4491
- readonly internalType: "bytes";
3788
+ readonly internalType: "string";
4492
3789
  readonly name: "publicKey";
4493
- readonly type: "bytes";
3790
+ readonly type: "string";
4494
3791
  }, {
4495
3792
  readonly internalType: "string";
4496
3793
  readonly name: "serverUrl";
4497
3794
  readonly type: "string";
4498
3795
  }];
4499
- readonly internalType: "struct IDataPortabilityServers.AddAndTrustServerInput";
4500
- readonly name: "addAndTrustServerInput";
3796
+ readonly internalType: "struct IDataPortabilityServers.AddServerWithSignatureInput";
3797
+ readonly name: "addServerInput";
4501
3798
  readonly type: "tuple";
4502
3799
  }, {
4503
3800
  readonly internalType: "bytes";
@@ -4511,27 +3808,31 @@ declare const contractAbis: {
4511
3808
  }, {
4512
3809
  readonly inputs: readonly [{
4513
3810
  readonly components: readonly [{
4514
- readonly internalType: "address";
4515
- readonly name: "owner";
4516
- readonly type: "address";
3811
+ readonly internalType: "uint256";
3812
+ readonly name: "nonce";
3813
+ readonly type: "uint256";
4517
3814
  }, {
4518
3815
  readonly internalType: "address";
4519
3816
  readonly name: "serverAddress";
4520
3817
  readonly type: "address";
4521
3818
  }, {
4522
- readonly internalType: "bytes";
3819
+ readonly internalType: "string";
4523
3820
  readonly name: "publicKey";
4524
- readonly type: "bytes";
3821
+ readonly type: "string";
4525
3822
  }, {
4526
3823
  readonly internalType: "string";
4527
3824
  readonly name: "serverUrl";
4528
3825
  readonly type: "string";
4529
3826
  }];
4530
- readonly internalType: "struct IDataPortabilityServers.AddServerInput";
3827
+ readonly internalType: "struct IDataPortabilityServers.AddServerWithSignatureInput";
4531
3828
  readonly name: "addServerInput";
4532
3829
  readonly type: "tuple";
3830
+ }, {
3831
+ readonly internalType: "bytes";
3832
+ readonly name: "signature";
3833
+ readonly type: "bytes";
4533
3834
  }];
4534
- readonly name: "addServer";
3835
+ readonly name: "addServerWithSignature";
4535
3836
  readonly outputs: readonly [];
4536
3837
  readonly stateMutability: "nonpayable";
4537
3838
  readonly type: "function";
@@ -4629,38 +3930,6 @@ declare const contractAbis: {
4629
3930
  readonly outputs: readonly [];
4630
3931
  readonly stateMutability: "nonpayable";
4631
3932
  readonly type: "function";
4632
- }, {
4633
- readonly inputs: readonly [{
4634
- readonly internalType: "uint256";
4635
- readonly name: "serverId";
4636
- readonly type: "uint256";
4637
- }];
4638
- readonly name: "isActiveServer";
4639
- readonly outputs: readonly [{
4640
- readonly internalType: "bool";
4641
- readonly name: "";
4642
- readonly type: "bool";
4643
- }];
4644
- readonly stateMutability: "view";
4645
- readonly type: "function";
4646
- }, {
4647
- readonly inputs: readonly [{
4648
- readonly internalType: "address";
4649
- readonly name: "userAddress";
4650
- readonly type: "address";
4651
- }, {
4652
- readonly internalType: "uint256";
4653
- readonly name: "serverId";
4654
- readonly type: "uint256";
4655
- }];
4656
- readonly name: "isActiveServerForUser";
4657
- readonly outputs: readonly [{
4658
- readonly internalType: "bool";
4659
- readonly name: "";
4660
- readonly type: "bool";
4661
- }];
4662
- readonly stateMutability: "view";
4663
- readonly type: "function";
4664
3933
  }, {
4665
3934
  readonly inputs: readonly [{
4666
3935
  readonly internalType: "address";
@@ -4778,9 +4047,9 @@ declare const contractAbis: {
4778
4047
  readonly name: "serverAddress";
4779
4048
  readonly type: "address";
4780
4049
  }, {
4781
- readonly internalType: "bytes";
4050
+ readonly internalType: "string";
4782
4051
  readonly name: "publicKey";
4783
- readonly type: "bytes";
4052
+ readonly type: "string";
4784
4053
  }, {
4785
4054
  readonly internalType: "string";
4786
4055
  readonly name: "url";
@@ -4813,9 +4082,9 @@ declare const contractAbis: {
4813
4082
  readonly name: "serverAddress";
4814
4083
  readonly type: "address";
4815
4084
  }, {
4816
- readonly internalType: "bytes";
4085
+ readonly internalType: "string";
4817
4086
  readonly name: "publicKey";
4818
- readonly type: "bytes";
4087
+ readonly type: "string";
4819
4088
  }, {
4820
4089
  readonly internalType: "string";
4821
4090
  readonly name: "url";
@@ -4889,6 +4158,20 @@ declare const contractAbis: {
4889
4158
  readonly outputs: readonly [];
4890
4159
  readonly stateMutability: "nonpayable";
4891
4160
  readonly type: "function";
4161
+ }, {
4162
+ readonly inputs: readonly [{
4163
+ readonly internalType: "address";
4164
+ readonly name: "userAddress";
4165
+ readonly type: "address";
4166
+ }, {
4167
+ readonly internalType: "uint256";
4168
+ readonly name: "serverId";
4169
+ readonly type: "uint256";
4170
+ }];
4171
+ readonly name: "trustServerByManager";
4172
+ readonly outputs: readonly [];
4173
+ readonly stateMutability: "nonpayable";
4174
+ readonly type: "function";
4892
4175
  }, {
4893
4176
  readonly inputs: readonly [{
4894
4177
  readonly components: readonly [{
@@ -5059,6 +4342,96 @@ declare const contractAbis: {
5059
4342
  }];
5060
4343
  readonly stateMutability: "view";
5061
4344
  readonly type: "function";
4345
+ }, {
4346
+ readonly inputs: readonly [{
4347
+ readonly internalType: "address";
4348
+ readonly name: "userAddress";
4349
+ readonly type: "address";
4350
+ }];
4351
+ readonly name: "userServerValues";
4352
+ readonly outputs: readonly [{
4353
+ readonly components: readonly [{
4354
+ readonly internalType: "uint256";
4355
+ readonly name: "id";
4356
+ readonly type: "uint256";
4357
+ }, {
4358
+ readonly internalType: "address";
4359
+ readonly name: "owner";
4360
+ readonly type: "address";
4361
+ }, {
4362
+ readonly internalType: "address";
4363
+ readonly name: "serverAddress";
4364
+ readonly type: "address";
4365
+ }, {
4366
+ readonly internalType: "string";
4367
+ readonly name: "publicKey";
4368
+ readonly type: "string";
4369
+ }, {
4370
+ readonly internalType: "string";
4371
+ readonly name: "url";
4372
+ readonly type: "string";
4373
+ }, {
4374
+ readonly internalType: "uint256";
4375
+ readonly name: "startBlock";
4376
+ readonly type: "uint256";
4377
+ }, {
4378
+ readonly internalType: "uint256";
4379
+ readonly name: "endBlock";
4380
+ readonly type: "uint256";
4381
+ }];
4382
+ readonly internalType: "struct IDataPortabilityServers.TrustedServerInfo[]";
4383
+ readonly name: "serversInfo";
4384
+ readonly type: "tuple[]";
4385
+ }];
4386
+ readonly stateMutability: "view";
4387
+ readonly type: "function";
4388
+ }, {
4389
+ readonly inputs: readonly [{
4390
+ readonly internalType: "address";
4391
+ readonly name: "userAddress";
4392
+ readonly type: "address";
4393
+ }, {
4394
+ readonly internalType: "uint256";
4395
+ readonly name: "serverId";
4396
+ readonly type: "uint256";
4397
+ }];
4398
+ readonly name: "userServers";
4399
+ readonly outputs: readonly [{
4400
+ readonly components: readonly [{
4401
+ readonly internalType: "uint256";
4402
+ readonly name: "id";
4403
+ readonly type: "uint256";
4404
+ }, {
4405
+ readonly internalType: "address";
4406
+ readonly name: "owner";
4407
+ readonly type: "address";
4408
+ }, {
4409
+ readonly internalType: "address";
4410
+ readonly name: "serverAddress";
4411
+ readonly type: "address";
4412
+ }, {
4413
+ readonly internalType: "string";
4414
+ readonly name: "publicKey";
4415
+ readonly type: "string";
4416
+ }, {
4417
+ readonly internalType: "string";
4418
+ readonly name: "url";
4419
+ readonly type: "string";
4420
+ }, {
4421
+ readonly internalType: "uint256";
4422
+ readonly name: "startBlock";
4423
+ readonly type: "uint256";
4424
+ }, {
4425
+ readonly internalType: "uint256";
4426
+ readonly name: "endBlock";
4427
+ readonly type: "uint256";
4428
+ }];
4429
+ readonly internalType: "struct IDataPortabilityServers.TrustedServerInfo";
4430
+ readonly name: "";
4431
+ readonly type: "tuple";
4432
+ }];
4433
+ readonly stateMutability: "view";
4434
+ readonly type: "function";
5062
4435
  }, {
5063
4436
  readonly inputs: readonly [{
5064
4437
  readonly internalType: "address";
@@ -29422,6 +28795,95 @@ type VanaContract = keyof ContractAbis;
29422
28795
  */
29423
28796
  declare function getAbi<T extends VanaContract>(contract: T): ContractAbis[T];
29424
28797
 
28798
+ /**
28799
+ * Comprehensive mapping of SDK transaction operations to blockchain events.
28800
+ * Used by the generic transaction parser to know which contract and event
28801
+ * to look for when parsing transaction results.
28802
+ */
28803
+ declare const EVENT_MAPPINGS: {
28804
+ readonly grant: {
28805
+ readonly contract: "DataPortabilityPermissions";
28806
+ readonly event: "PermissionAdded";
28807
+ };
28808
+ readonly revoke: {
28809
+ readonly contract: "DataPortabilityPermissions";
28810
+ readonly event: "PermissionRevoked";
28811
+ };
28812
+ readonly revokePermission: {
28813
+ readonly contract: "DataPortabilityPermissions";
28814
+ readonly event: "PermissionRevoked";
28815
+ };
28816
+ readonly addServerFilesAndPermissions: {
28817
+ readonly contract: "DataPortabilityPermissions";
28818
+ readonly event: "PermissionAdded";
28819
+ };
28820
+ readonly trustServer: {
28821
+ readonly contract: "DataPortabilityServers";
28822
+ readonly event: "ServerTrusted";
28823
+ };
28824
+ readonly untrustServer: {
28825
+ readonly contract: "DataPortabilityServers";
28826
+ readonly event: "ServerUntrusted";
28827
+ };
28828
+ readonly registerServer: {
28829
+ readonly contract: "DataPortabilityServers";
28830
+ readonly event: "ServerRegistered";
28831
+ };
28832
+ readonly updateServer: {
28833
+ readonly contract: "DataPortabilityServers";
28834
+ readonly event: "ServerUpdated";
28835
+ };
28836
+ readonly addAndTrustServer: {
28837
+ readonly contract: "DataPortabilityServers";
28838
+ readonly event: "ServerTrusted";
28839
+ };
28840
+ readonly addFile: {
28841
+ readonly contract: "DataRegistry";
28842
+ readonly event: "FileAdded";
28843
+ };
28844
+ readonly addFileWithPermissionsAndSchema: {
28845
+ readonly contract: "DataRegistry";
28846
+ readonly event: "FileAdded";
28847
+ };
28848
+ readonly addFileWithSchema: {
28849
+ readonly contract: "DataRegistry";
28850
+ readonly event: "FileAdded";
28851
+ };
28852
+ readonly addFileWithPermissions: {
28853
+ readonly contract: "DataRegistry";
28854
+ readonly event: "FileAdded";
28855
+ };
28856
+ readonly addRefinement: {
28857
+ readonly contract: "DataRegistry";
28858
+ readonly event: "RefinementAdded";
28859
+ };
28860
+ readonly addRefiner: {
28861
+ readonly contract: "DataRefinerRegistry";
28862
+ readonly event: "RefinerAdded";
28863
+ };
28864
+ readonly updateSchemaId: {
28865
+ readonly contract: "DataRefinerRegistry";
28866
+ readonly event: "SchemaAdded";
28867
+ };
28868
+ readonly addSchema: {
28869
+ readonly contract: "DataRefinerRegistry";
28870
+ readonly event: "SchemaAdded";
28871
+ };
28872
+ readonly updateRefinement: {
28873
+ readonly contract: "DataRegistry";
28874
+ readonly event: "RefinementUpdated";
28875
+ };
28876
+ readonly addFilePermission: {
28877
+ readonly contract: "DataRegistry";
28878
+ readonly event: "PermissionGranted";
28879
+ };
28880
+ readonly registerGrantee: {
28881
+ readonly contract: "DataPortabilityGrantees";
28882
+ readonly event: "GranteeRegistered";
28883
+ };
28884
+ };
28885
+ type TransactionOperation = keyof typeof EVENT_MAPPINGS;
28886
+
29425
28887
  /**
29426
28888
  * Base interface for all transaction results.
29427
28889
  * Contains the event data plus transaction metadata.
@@ -29459,6 +28921,62 @@ interface PermissionRevokeResult extends BaseTransactionResult {
29459
28921
  /** ID of the permission that was revoked */
29460
28922
  permissionId: bigint;
29461
28923
  }
28924
+ /**
28925
+ * Result of a successful server trust operation.
28926
+ * Contains data from the ServerTrusted blockchain event.
28927
+ */
28928
+ interface ServerTrustResult extends BaseTransactionResult {
28929
+ /** Address of the user who trusted the server */
28930
+ user: Address;
28931
+ /** Address/ID of the trusted server */
28932
+ serverId: Address;
28933
+ /** URL of the trusted server */
28934
+ serverUrl: string;
28935
+ }
28936
+ /**
28937
+ * Result of a successful server untrust operation.
28938
+ * Contains data from the ServerUntrusted blockchain event.
28939
+ */
28940
+ interface ServerUntrustResult extends BaseTransactionResult {
28941
+ /** Address of the user who untrusted the server */
28942
+ user: Address;
28943
+ /** Address/ID of the untrusted server */
28944
+ serverId: Address;
28945
+ }
28946
+ /**
28947
+ * Result of a successful server update operation.
28948
+ * Contains data from the ServerUpdated blockchain event.
28949
+ */
28950
+ interface ServerUpdateResult extends BaseTransactionResult {
28951
+ /** ID of the server that was updated */
28952
+ serverId: bigint;
28953
+ /** New URL of the server */
28954
+ url: string;
28955
+ }
28956
+ /**
28957
+ * Result of a successful grantee registration operation.
28958
+ * Contains data from the GranteeRegistered blockchain event.
28959
+ */
28960
+ interface GranteeRegisterResult extends BaseTransactionResult {
28961
+ /** Unique grantee ID assigned by the registry */
28962
+ granteeId: bigint;
28963
+ /** Address of the registered grantee */
28964
+ granteeAddress: Address;
28965
+ /** Display name of the grantee */
28966
+ name: string;
28967
+ }
28968
+ /**
28969
+ * Result of a successful file addition operation.
28970
+ * Contains data from the FileAdded blockchain event.
28971
+ */
28972
+ interface FileAddedResult extends BaseTransactionResult {
28973
+ /** Unique file ID assigned by the registry */
28974
+ fileId: bigint;
28975
+ /** Address of the file owner */
28976
+ ownerAddress: Address;
28977
+ /** URL where the file is stored */
28978
+ url: string;
28979
+ }
29462
28980
  /**
29463
28981
  * Result of a successful file permission addition operation.
29464
28982
  * Contains data from the FilePermissionAdded blockchain event.
@@ -29472,6 +28990,80 @@ interface FilePermissionResult extends BaseTransactionResult {
29472
28990
  encryptedKey: string;
29473
28991
  }
29474
28992
 
28993
+ /**
28994
+ * Provides a unified interface for blockchain transaction results with lazy-loaded event parsing.
28995
+ *
28996
+ * @remarks
28997
+ * TransactionHandle enables immediate access to transaction hashes while providing optional
28998
+ * lazy-loaded access to receipts and parsed event data. All transaction-submitting methods
28999
+ * in the SDK return this handle, allowing developers to choose between immediate hash access
29000
+ * or waiting for event data. Results are memoized to prevent redundant network calls.
29001
+ *
29002
+ * @category Transactions
29003
+ * @example
29004
+ * ```typescript
29005
+ * // Immediate hash access
29006
+ * const tx = await sdk.permissions.submitSignedGrant(typedData, signature);
29007
+ * console.log(`Transaction submitted: ${tx.hash}`);
29008
+ *
29009
+ * // Wait for and parse events
29010
+ * const eventData = await tx.waitForEvents();
29011
+ * console.log(`Permission ID: ${eventData.permissionId}`);
29012
+ *
29013
+ * // Check receipt for gas usage
29014
+ * const receipt = await tx.waitForReceipt();
29015
+ * console.log(`Gas used: ${receipt.gasUsed}`);
29016
+ * ```
29017
+ */
29018
+ declare class TransactionHandle<TEventData = unknown> {
29019
+ private readonly context;
29020
+ readonly hash: Hash;
29021
+ private readonly operation?;
29022
+ private _receipt?;
29023
+ private _eventData?;
29024
+ private _receiptPromise?;
29025
+ private _eventPromise?;
29026
+ constructor(context: ControllerContext$1, hash: Hash, operation?: TransactionOperation | undefined);
29027
+ /**
29028
+ * Waits for transaction confirmation and returns the receipt.
29029
+ * Results are memoized - multiple calls return the same promise.
29030
+ *
29031
+ * @param options Optional timeout configuration
29032
+ * @param options.timeout Timeout in milliseconds (default: 30000)
29033
+ * @returns Transaction receipt with gas usage, logs, and status
29034
+ */
29035
+ waitForReceipt(options?: {
29036
+ timeout?: number;
29037
+ }): Promise<TransactionReceipt$1>;
29038
+ /**
29039
+ * Waits for transaction confirmation and parses emitted events.
29040
+ * Results are memoized - multiple calls return the same promise.
29041
+ *
29042
+ * @returns Parsed event data with transaction metadata
29043
+ * @throws {Error} If no operation was specified for event parsing
29044
+ */
29045
+ waitForEvents(): Promise<TEventData>;
29046
+ /**
29047
+ * Enables string coercion for backwards compatibility.
29048
+ * Allows TransactionHandle to be used anywhere a Hash is expected.
29049
+ *
29050
+ * @example
29051
+ * ```typescript
29052
+ * const hash: Hash = tx; // Works via toString()
29053
+ * console.log(`Transaction: ${tx}`); // Prints hash
29054
+ * ```
29055
+ * @returns The transaction hash as a string
29056
+ */
29057
+ toString(): string;
29058
+ /**
29059
+ * JSON serialization support.
29060
+ * Returns the hash when serialized to JSON.
29061
+ *
29062
+ * @returns The transaction hash for JSON serialization
29063
+ */
29064
+ toJSON(): string;
29065
+ }
29066
+
29475
29067
  /**
29476
29068
  * Google Drive Storage Provider for Vana SDK
29477
29069
  *
@@ -30510,30 +30102,31 @@ declare class PermissionsController {
30510
30102
  */
30511
30103
  grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
30512
30104
  /**
30513
- * Submits a permission grant transaction and returns the transaction hash immediately.
30105
+ * Submits a permission grant transaction and returns a handle for flexible result access.
30514
30106
  *
30515
- * This is the lower-level method that provides maximum control over transaction timing.
30516
- * Use this when you want to handle transaction confirmation and event parsing separately,
30517
- * or when submitting multiple transactions in batch.
30107
+ * @remarks
30108
+ * This lower-level method provides maximum control over transaction timing.
30109
+ * Returns a TransactionHandle that allows immediate hash access or optional event parsing.
30110
+ * Use this when handling multiple transactions or when you need granular control.
30518
30111
  *
30519
30112
  * @param params - The permission grant configuration object
30520
- * @returns Promise that resolves to the transaction hash when successfully submitted
30113
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
30521
30114
  * @throws {RelayerError} When gasless transaction submission fails
30522
30115
  * @throws {SignatureError} When user rejects the signature request
30523
30116
  * @throws {SerializationError} When grant data cannot be serialized
30524
30117
  * @throws {BlockchainError} When permission grant preparation fails
30525
30118
  * @example
30526
30119
  * ```typescript
30527
- * // Submit transaction and handle confirmation later
30528
- * const txHash = await vana.permissions.submitPermissionGrant(params);
30529
- * console.log(`Transaction submitted: ${txHash}`);
30120
+ * // Submit transaction and get immediate hash access
30121
+ * const tx = await vana.permissions.submitPermissionGrant(params);
30122
+ * console.log(`Transaction submitted: ${tx.hash}`);
30530
30123
  *
30531
- * // Later, when you need the permission data:
30532
- * const result = await parseTransactionResult(context, txHash, 'grant');
30533
- * console.log(`Permission ID: ${result.permissionId}`);
30124
+ * // Optionally wait for and parse events
30125
+ * const eventData = await tx.waitForEvents();
30126
+ * console.log(`Permission ID: ${eventData.permissionId}`);
30534
30127
  * ```
30535
30128
  */
30536
- submitPermissionGrant(params: GrantPermissionParams$1): Promise<Hash>;
30129
+ submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
30537
30130
  /**
30538
30131
  * Prepares a permission grant with preview before signing.
30539
30132
  *
@@ -30561,15 +30154,21 @@ declare class PermissionsController {
30561
30154
  */
30562
30155
  prepareGrant(params: GrantPermissionParams$1): Promise<{
30563
30156
  preview: GrantFile;
30564
- confirm: () => Promise<Hash>;
30157
+ confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
30565
30158
  }>;
30566
30159
  /**
30567
- * Internal method to complete the grant process after user confirmation.
30568
- * This is called by the confirm() function returned from prepareGrant().
30160
+ * Completes the grant process after user confirmation.
30161
+ *
30162
+ * @remarks
30163
+ * This internal method is called by the confirm() function returned from prepareGrant().
30164
+ * It handles IPFS upload, signature creation, and transaction submission.
30569
30165
  *
30570
30166
  * @param params - The permission grant parameters containing user and operation details
30571
30167
  * @param grantFile - The prepared grant file with permissions and metadata
30572
- * @returns Promise resolving to the transaction hash
30168
+ * @returns Promise resolving to TransactionHandle for flexible result access
30169
+ * @throws {BlockchainError} When permission grant confirmation fails
30170
+ * @throws {NetworkError} When IPFS upload fails
30171
+ * @throws {SignatureError} When user rejects the signature
30573
30172
  */
30574
30173
  private confirmGrantInternal;
30575
30174
  /**
@@ -30625,40 +30224,106 @@ declare class PermissionsController {
30625
30224
  * );
30626
30225
  * ```
30627
30226
  */
30628
- submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<Hash>;
30227
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
30629
30228
  /**
30630
30229
  * Submits an already-signed trust server transaction to the blockchain.
30230
+ *
30231
+ * @remarks
30631
30232
  * This method extracts the trust server input from typed data and submits it directly.
30233
+ * Used internally by trust server methods after signature collection.
30632
30234
  *
30633
30235
  * @param typedData - The EIP-712 typed data for TrustServer
30634
- * @param signature - The user's signature
30635
- * @returns Promise resolving to the transaction hash
30236
+ * @param signature - The user's signature obtained via `signTypedData()`
30237
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30238
+ * @throws {BlockchainError} When contract submission fails
30239
+ * @throws {NetworkError} When blockchain communication fails
30240
+ * @example
30241
+ * ```typescript
30242
+ * const txHandle = await vana.permissions.submitSignedTrustServer(
30243
+ * typedData,
30244
+ * "0x1234..."
30245
+ * );
30246
+ * const result = await txHandle.waitForEvents();
30247
+ * ```
30248
+ */
30249
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
30250
+ /**
30251
+ * Submits an already-signed add and trust server transaction to the blockchain.
30252
+ *
30253
+ * @remarks
30254
+ * This method extracts the add and trust server input from typed data and submits it directly.
30255
+ * Combines server registration and trust operations in a single transaction.
30256
+ *
30257
+ * @param typedData - The EIP-712 typed data for AddAndTrustServer
30258
+ * @param signature - The user's signature obtained via `signTypedData()`
30259
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30260
+ * @throws {BlockchainError} When contract submission fails
30261
+ * @throws {NetworkError} When blockchain communication fails
30262
+ * @example
30263
+ * ```typescript
30264
+ * const txHandle = await vana.permissions.submitSignedAddAndTrustServer(
30265
+ * typedData,
30266
+ * "0x1234..."
30267
+ * );
30268
+ * const result = await txHandle.waitForEvents();
30269
+ * ```
30636
30270
  */
30637
- submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<Hash>;
30271
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
30638
30272
  /**
30639
30273
  * Submits an already-signed permission revoke transaction to the blockchain.
30274
+ *
30275
+ * @remarks
30640
30276
  * This method handles the revocation of previously granted permissions.
30277
+ * Used internally by revocation methods after signature collection.
30641
30278
  *
30642
30279
  * @param typedData - The EIP-712 typed data for PermissionRevoke
30643
- * @param signature - The user's signature
30644
- * @returns Promise resolving to the transaction hash
30280
+ * @param signature - The user's signature obtained via `signTypedData()`
30281
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30282
+ * @throws {BlockchainError} When contract submission fails
30283
+ * @throws {NetworkError} When blockchain communication fails
30284
+ * @example
30285
+ * ```typescript
30286
+ * const txHandle = await vana.permissions.submitSignedRevoke(
30287
+ * typedData,
30288
+ * "0x1234..."
30289
+ * );
30290
+ * const result = await txHandle.waitForEvents();
30291
+ * ```
30645
30292
  */
30646
- submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30293
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
30647
30294
  /**
30648
30295
  * Submits an already-signed untrust server transaction to the blockchain.
30296
+ *
30297
+ * @remarks
30649
30298
  * This method handles the removal of trusted servers.
30299
+ * Used internally by untrust server methods after signature collection.
30650
30300
  *
30651
30301
  * @param typedData - The EIP-712 typed data for UntrustServer
30652
- * @param signature - The user's signature
30653
- * @returns Promise resolving to the transaction hash
30302
+ * @param signature - The user's signature obtained via `signTypedData()`
30303
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30304
+ * @throws {BlockchainError} When contract submission fails
30305
+ * @throws {NetworkError} When blockchain communication fails
30306
+ * @example
30307
+ * ```typescript
30308
+ * const txHandle = await vana.permissions.submitSignedUntrustServer(
30309
+ * typedData,
30310
+ * "0x1234..."
30311
+ * );
30312
+ * const result = await txHandle.waitForEvents();
30313
+ * ```
30654
30314
  */
30655
- submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<Hash>;
30315
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
30656
30316
  /**
30657
30317
  * Submits a signed transaction directly to the blockchain.
30658
30318
  *
30319
+ * @remarks
30320
+ * Internal method used when relayer callbacks are not available. Formats the signature
30321
+ * and submits the permission grant directly to the smart contract.
30322
+ *
30659
30323
  * @param typedData - The typed data structure for the permission grant
30660
30324
  * @param signature - The cryptographic signature authorizing the transaction
30661
30325
  * @returns Promise resolving to the transaction hash
30326
+ * @throws {BlockchainError} When contract submission fails
30662
30327
  */
30663
30328
  private submitDirectTransaction;
30664
30329
  /**
@@ -30705,21 +30370,38 @@ declare class PermissionsController {
30705
30370
  * console.log(`Revocation submitted: ${txHash}`);
30706
30371
  * ```
30707
30372
  */
30708
- submitPermissionRevoke(params: RevokePermissionParams): Promise<Hash>;
30373
+ submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30709
30374
  /**
30710
- * Revokes a permission with a signature (gasless transaction).
30375
+ * Revokes a permission with a signature for gasless transactions.
30376
+ *
30377
+ * @remarks
30378
+ * This method creates an EIP-712 signature for permission revocation and submits
30379
+ * it either through relayer callbacks or directly to the blockchain. Provides
30380
+ * gasless revocation when relayer is configured.
30711
30381
  *
30712
30382
  * @param params - Parameters for revoking the permission
30713
- * @returns Promise resolving to transaction hash
30383
+ * @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
30384
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30714
30385
  * @throws {BlockchainError} When chain ID is not available
30715
30386
  * @throws {NonceError} When retrieving user nonce fails
30716
30387
  * @throws {SignatureError} When user rejects the signature request
30717
30388
  * @throws {RelayerError} When gasless submission fails
30718
30389
  * @throws {PermissionError} When revocation fails for any other reason
30390
+ * @example
30391
+ * ```typescript
30392
+ * const txHandle = await vana.permissions.submitRevokeWithSignature({
30393
+ * permissionId: 123n
30394
+ * });
30395
+ * const result = await txHandle.waitForEvents();
30396
+ * console.log(`Permission ${result.permissionId} revoked`);
30397
+ * ```
30719
30398
  */
30720
- revokeWithSignature(params: RevokePermissionParams): Promise<Hash>;
30399
+ submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
30721
30400
  /**
30401
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30402
+ *
30722
30403
  * Retrieves the user's current nonce from the DataPortabilityServers contract.
30404
+ * This method is deprecated in favor of more specific nonce methods.
30723
30405
  *
30724
30406
  * The nonce is used to prevent replay attacks in signed transactions and must
30725
30407
  * be incremented with each transaction to maintain security.
@@ -30731,11 +30413,77 @@ declare class PermissionsController {
30731
30413
  * @private
30732
30414
  * @example
30733
30415
  * ```typescript
30416
+ * // Deprecated - use specific methods instead
30734
30417
  * const nonce = await this.getUserNonce();
30735
- * console.log(`Current nonce: ${nonce}`);
30418
+ *
30419
+ * // Use these instead:
30420
+ * const permissionsNonce = await this.getPermissionsUserNonce();
30421
+ * const serversNonce = await this.getServersUserNonce();
30736
30422
  * ```
30737
30423
  */
30424
+ /**
30425
+ * @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
30426
+ *
30427
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30428
+ *
30429
+ * @remarks
30430
+ * This method is deprecated in favor of more specific nonce methods that target
30431
+ * the appropriate contract for the operation being performed.
30432
+ *
30433
+ * @returns Promise resolving to the user's current nonce as a bigint
30434
+ * @throws {NonceError} When retrieving the nonce fails
30435
+ */
30738
30436
  private getUserNonce;
30437
+ /**
30438
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30439
+ * This nonce is used for server-related operations (AddAndTrustServer, TrustServer, UntrustServer).
30440
+ *
30441
+ * @returns Promise resolving to the current servers nonce
30442
+ * @throws {NonceError} When reading nonce from contract fails
30443
+ * @private
30444
+ *
30445
+ * @example
30446
+ * ```typescript
30447
+ * const nonce = await this.getServersUserNonce();
30448
+ * console.log(`Current servers nonce: ${nonce}`);
30449
+ * ```
30450
+ */
30451
+ /**
30452
+ * Retrieves the user's current nonce from the DataPortabilityServers contract.
30453
+ *
30454
+ * @remarks
30455
+ * Used for server-related operations (trust/untrust) to prevent replay attacks.
30456
+ * The nonce must be incremented with each server operation.
30457
+ *
30458
+ * @returns Promise resolving to the user's current nonce as a bigint
30459
+ * @throws {NonceError} When retrieving the nonce fails
30460
+ */
30461
+ private getServersUserNonce;
30462
+ /**
30463
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30464
+ * This nonce is used for permission-related operations (addPermission, addServerFilesAndPermissions).
30465
+ *
30466
+ * @returns Promise resolving to the current permissions nonce
30467
+ * @throws {NonceError} When reading nonce from contract fails
30468
+ * @private
30469
+ *
30470
+ * @example
30471
+ * ```typescript
30472
+ * const nonce = await this.getPermissionsUserNonce();
30473
+ * console.log(`Current permissions nonce: ${nonce}`);
30474
+ * ```
30475
+ */
30476
+ /**
30477
+ * Retrieves the user's current nonce from the DataPortabilityPermissions contract.
30478
+ *
30479
+ * @remarks
30480
+ * Used for permission-related operations (grant/revoke) to prevent replay attacks.
30481
+ * The nonce must be incremented with each permission operation.
30482
+ *
30483
+ * @returns Promise resolving to the user's current nonce as a bigint
30484
+ * @throws {NonceError} When retrieving the nonce fails
30485
+ */
30486
+ private getPermissionsUserNonce;
30739
30487
  /**
30740
30488
  * Composes the EIP-712 typed data for PermissionGrant (new simplified format).
30741
30489
  *
@@ -30749,6 +30497,22 @@ declare class PermissionsController {
30749
30497
  * @returns Promise resolving to the typed data structure
30750
30498
  */
30751
30499
  private composePermissionGrantMessage;
30500
+ /**
30501
+ * Creates EIP-712 typed data structure for server files and permissions.
30502
+ *
30503
+ * @param params - Parameters for the server files and permissions message
30504
+ * @param params.granteeId - Grantee ID
30505
+ * @param params.grant - Grant URL or grant data
30506
+ * @param params.fileUrls - Array of file URLs
30507
+ * @param params.schemaIds - Schema IDs for each file
30508
+ * @param params.serverAddress - Server address
30509
+ * @param params.serverUrl - Server URL
30510
+ * @param params.serverPublicKey - Server public key
30511
+ * @param params.filePermissions - File permissions array
30512
+ * @param params.nonce - Unique number to prevent replay attacks
30513
+ * @returns Promise resolving to the typed data structure
30514
+ */
30515
+ private composeServerFilesAndPermissionMessage;
30752
30516
  /**
30753
30517
  * Gets the EIP-712 domain for PermissionGrant signatures.
30754
30518
  *
@@ -30804,38 +30568,6 @@ declare class PermissionsController {
30804
30568
  * ```
30805
30569
  */
30806
30570
  getUserPermissionGrantsOnChain(options?: GetUserPermissionsOptions): Promise<OnChainPermissionGrant[]>;
30807
- /**
30808
- * Gets all permission IDs for a specific file.
30809
- *
30810
- * @param fileId - The file ID to query permissions for
30811
- * @returns Promise resolving to array of permission IDs
30812
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30813
- */
30814
- getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
30815
- /**
30816
- * Gets all file IDs associated with a permission.
30817
- *
30818
- * @param permissionId - The permission ID to query files for
30819
- * @returns Promise resolving to array of file IDs
30820
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30821
- */
30822
- getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
30823
- /**
30824
- * Checks if a permission is active.
30825
- *
30826
- * @param permissionId - The permission ID to check
30827
- * @returns Promise resolving to boolean indicating if permission is active
30828
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30829
- */
30830
- isActivePermission(permissionId: bigint): Promise<boolean>;
30831
- /**
30832
- * Gets permission details from the contract.
30833
- *
30834
- * @param permissionId - The permission ID to query
30835
- * @returns Promise resolving to permission info
30836
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30837
- */
30838
- getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
30839
30571
  /**
30840
30572
  * Normalizes grant ID to hex format.
30841
30573
  * Handles conversion from permission ID (bigint/number/string) to proper hex hash format.
@@ -30878,7 +30610,7 @@ declare class PermissionsController {
30878
30610
  * console.log('Now trusting servers:', trustedServers);
30879
30611
  * ```
30880
30612
  */
30881
- addAndTrustServer(params: AddAndTrustServerParams): Promise<Hash>;
30613
+ addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30882
30614
  /**
30883
30615
  * Trusts a server for data processing (legacy method).
30884
30616
  *
@@ -30886,14 +30618,14 @@ declare class PermissionsController {
30886
30618
  * @returns Promise resolving to transaction hash
30887
30619
  * @deprecated Use addAndTrustServer instead
30888
30620
  */
30889
- trustServer(params: TrustServerParams): Promise<Hash>;
30621
+ submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30890
30622
  /**
30891
30623
  * Adds and trusts a server using a signature (gasless transaction).
30892
30624
  *
30893
30625
  * @param params - Parameters for adding and trusting the server
30894
- * @returns Promise resolving to transaction hash
30626
+ * @returns Promise resolving to TransactionHandle with ServerTrustResult event data
30895
30627
  */
30896
- addAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<Hash>;
30628
+ submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30897
30629
  /**
30898
30630
  * Trusts a server using a signature (gasless transaction - legacy method).
30899
30631
  *
@@ -30907,13 +30639,24 @@ declare class PermissionsController {
30907
30639
  * @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
30908
30640
  * @throws {BlockchainError} When trust operation fails for any other reason
30909
30641
  */
30910
- trustServerWithSignature(params: TrustServerParams): Promise<Hash>;
30642
+ submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
30911
30643
  /**
30912
30644
  * Submits a direct untrust server transaction (without signature).
30913
30645
  *
30914
30646
  * @param params - The untrust server parameters containing server details
30915
30647
  * @returns Promise resolving to the transaction hash
30916
30648
  */
30649
+ /**
30650
+ * Submits an untrust server transaction directly to the blockchain.
30651
+ *
30652
+ * @remarks
30653
+ * Internal method used for direct blockchain submission of untrust server operations
30654
+ * when relayer callbacks are not available.
30655
+ *
30656
+ * @param params - The untrust server parameters
30657
+ * @returns Promise resolving to TransactionHandle for transaction tracking
30658
+ * @throws {BlockchainError} When contract submission fails
30659
+ */
30917
30660
  private submitDirectUntrustTransaction;
30918
30661
  /**
30919
30662
  * Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
@@ -30943,7 +30686,7 @@ declare class PermissionsController {
30943
30686
  * console.log('Still trusting servers:', trustedServers);
30944
30687
  * ```
30945
30688
  */
30946
- untrustServer(params: UntrustServerParams): Promise<Hash>;
30689
+ submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30947
30690
  /**
30948
30691
  * Untrusts a server using a signature (gasless transaction).
30949
30692
  *
@@ -30956,7 +30699,7 @@ declare class PermissionsController {
30956
30699
  * @throws {RelayerError} When gasless submission fails
30957
30700
  * @throws {BlockchainError} When untrust transaction fails
30958
30701
  */
30959
- untrustServerWithSignature(params: UntrustServerParams): Promise<Hash>;
30702
+ submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
30960
30703
  /**
30961
30704
  * Retrieves all servers trusted by a user from the DataPortabilityServers contract.
30962
30705
  *
@@ -30980,61 +30723,6 @@ declare class PermissionsController {
30980
30723
  * ```
30981
30724
  */
30982
30725
  getTrustedServers(userAddress?: Address): Promise<number[]>;
30983
- /**
30984
- * Retrieves detailed information about a specific server from the DataPortabilityServers contract.
30985
- *
30986
- * Returns complete server information including owner, address, public key, and URL.
30987
- * This information is used to establish secure connections and verify server identity.
30988
- *
30989
- * @param serverId - The unique numeric ID of the server to query
30990
- * @returns Promise resolving to complete server information
30991
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30992
- * @throws {NetworkError} When unable to connect to the blockchain network
30993
- * @throws {ServerNotFoundError} When the server ID does not exist
30994
- *
30995
- * @example
30996
- * ```typescript
30997
- * const server = await vana.permissions.getServerInfo(1);
30998
- *
30999
- * console.log(`Server ${server.id}:`);
31000
- * console.log(` Owner: ${server.owner}`);
31001
- * console.log(` Address: ${server.serverAddress}`);
31002
- * console.log(` URL: ${server.url}`);
31003
- * console.log(` Public Key: ${server.publicKey}`);
31004
- * ```
31005
- */
31006
- getServerInfo(serverId: number): Promise<Server>;
31007
- /**
31008
- * Checks if a specific server is active in the DataPortabilityServers contract.
31009
- *
31010
- * An active server is one that is properly registered and operational, meaning
31011
- * it can receive and process data portability requests from users.
31012
- *
31013
- * @param serverId - The unique numeric ID of the server to check
31014
- * @returns Promise resolving to true if server is active, false otherwise
31015
- * @throws {BlockchainError} When reading from contract fails or chain is unavailable
31016
- * @throws {NetworkError} When unable to connect to the blockchain network
31017
- *
31018
- * @example
31019
- * ```typescript
31020
- * const isActive = await vana.permissions.isActiveServer(1);
31021
- *
31022
- * if (isActive) {
31023
- * console.log('Server 1 is active and ready to process requests');
31024
- * } else {
31025
- * console.log('Server 1 is inactive or not found');
31026
- * }
31027
- * ```
31028
- */
31029
- isActiveServer(serverId: number): Promise<boolean>;
31030
- /**
31031
- * Checks if a server is active for a specific user.
31032
- *
31033
- * @param serverId - Server ID (numeric)
31034
- * @param userAddress - Optional user address (defaults to current user)
31035
- * @returns Promise resolving to boolean indicating if server is active for the user
31036
- */
31037
- isActiveServerForUser(serverId: number, userAddress?: Address): Promise<boolean>;
31038
30726
  /**
31039
30727
  * Gets the total count of trusted servers for a user.
31040
30728
  *
@@ -31062,22 +30750,60 @@ declare class PermissionsController {
31062
30750
  /**
31063
30751
  * Gets server information for multiple servers efficiently.
31064
30752
  *
31065
- * @param serverIds - Array of server IDs to query
31066
- * @returns Promise resolving to batch result with successes and failures
30753
+ * @remarks
30754
+ * This method uses multicall to fetch information for multiple servers in a single
30755
+ * blockchain call, improving performance when querying many servers. Failed lookups
30756
+ * are returned separately for error handling.
30757
+ *
30758
+ * @param serverIds - Array of numeric server IDs to query
30759
+ * @returns Promise resolving to batch result containing successful lookups and failed IDs
31067
30760
  * @throws {BlockchainError} When reading from contract fails or chain is unavailable
30761
+ * @example
30762
+ * ```typescript
30763
+ * const result = await vana.permissions.getServerInfoBatch([1, 2, 3, 999]);
30764
+ *
30765
+ * // Process successful lookups
30766
+ * result.servers.forEach((server, id) => {
30767
+ * console.log(`Server ${id}: ${server.url}`);
30768
+ * });
30769
+ *
30770
+ * // Handle failed lookups
30771
+ * if (result.failed.length > 0) {
30772
+ * console.log(`Failed to fetch: ${result.failed.join(', ')}`);
30773
+ * }
30774
+ * ```
31068
30775
  */
31069
30776
  getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
31070
30777
  /**
31071
30778
  * Checks whether a specific server is trusted by a user.
31072
30779
  *
31073
- * @param serverId - Server ID to check (numeric)
30780
+ * @remarks
30781
+ * This method queries the user's trusted server list and checks if the specified
30782
+ * server is present. Returns both the trust status and the index in the trust list
30783
+ * if trusted.
30784
+ *
30785
+ * @param serverId - Numeric server ID to check
31074
30786
  * @param userAddress - Optional user address (defaults to current user)
31075
- * @returns Promise resolving to server trust status
30787
+ * @returns Promise resolving to server trust status with trust index if applicable
30788
+ * @throws {BlockchainError} When reading from contract fails
30789
+ * @example
30790
+ * ```typescript
30791
+ * const status = await vana.permissions.checkServerTrustStatus(1);
30792
+ * if (status.isTrusted) {
30793
+ * console.log(`Server is trusted at index ${status.trustIndex}`);
30794
+ * } else {
30795
+ * console.log('Server is not trusted');
30796
+ * }
30797
+ * ```
31076
30798
  */
31077
30799
  checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
31078
30800
  /**
31079
30801
  * Composes EIP-712 typed data for AddAndTrustServer.
31080
30802
  *
30803
+ * @remarks
30804
+ * Creates the complete typed data structure required for EIP-712 signature generation
30805
+ * when adding and trusting a new server in a single transaction.
30806
+ *
31081
30807
  * @param input - The add and trust server input data containing server details
31082
30808
  * @returns Promise resolving to the typed data structure for server add and trust
31083
30809
  */
@@ -31159,7 +30885,7 @@ declare class PermissionsController {
31159
30885
  * console.log(`Grantee registered in transaction: ${txHash}`);
31160
30886
  * ```
31161
30887
  */
31162
- registerGrantee(params: RegisterGranteeParams): Promise<Hash>;
30888
+ submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
31163
30889
  /**
31164
30890
  * Registers a grantee with a signature (gasless transaction)
31165
30891
  *
@@ -31175,7 +30901,7 @@ declare class PermissionsController {
31175
30901
  * });
31176
30902
  * ```
31177
30903
  */
31178
- registerGranteeWithSignature(params: RegisterGranteeParams): Promise<Hash>;
30904
+ submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
31179
30905
  /**
31180
30906
  * Submits a signed register grantee transaction via relayer
31181
30907
  *
@@ -31188,7 +30914,7 @@ declare class PermissionsController {
31188
30914
  * const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
31189
30915
  * ```
31190
30916
  */
31191
- submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<Hash>;
30917
+ submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
31192
30918
  /**
31193
30919
  * Retrieves all registered grantees from the DataPortabilityGrantees contract.
31194
30920
  *
@@ -31292,6 +31018,345 @@ declare class PermissionsController {
31292
31018
  * @private
31293
31019
  */
31294
31020
  private submitSignedRegisterGranteeTransaction;
31021
+ /**
31022
+ * Get all trusted server IDs for a user
31023
+ *
31024
+ * @param userAddress - User address to query (defaults to current user)
31025
+ * @returns Promise resolving to array of server IDs
31026
+ */
31027
+ getUserServerIds(userAddress?: Address): Promise<bigint[]>;
31028
+ /**
31029
+ * Get server ID at specific index for a user
31030
+ *
31031
+ * @param userAddress - User address to query
31032
+ * @param serverIndex - Index in the user's server list
31033
+ * @returns Promise resolving to server ID
31034
+ */
31035
+ getUserServerIdAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
31036
+ /**
31037
+ * Get the number of trusted servers for a user
31038
+ *
31039
+ * @param userAddress - User address to query (defaults to current user)
31040
+ * @returns Promise resolving to number of trusted servers
31041
+ */
31042
+ getUserServerCount(userAddress?: Address): Promise<bigint>;
31043
+ /**
31044
+ * Get detailed information about trusted servers for a user
31045
+ *
31046
+ * @param userAddress - User address to query (defaults to current user)
31047
+ * @returns Promise resolving to array of trusted server info
31048
+ */
31049
+ getUserTrustedServers(userAddress?: Address): Promise<TrustedServerInfo[]>;
31050
+ /**
31051
+ * Get trusted server info for a specific server ID and user
31052
+ *
31053
+ * @param userAddress - User address to query
31054
+ * @param serverId - Server ID to get info for
31055
+ * @returns Promise resolving to trusted server info
31056
+ */
31057
+ getUserTrustedServer(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
31058
+ /**
31059
+ * Get server information by server ID
31060
+ *
31061
+ * @param serverId - Server ID to get info for
31062
+ * @returns Promise resolving to server info
31063
+ */
31064
+ getServerInfo(serverId: bigint): Promise<ServerInfo>;
31065
+ /**
31066
+ * Get server information by server address
31067
+ *
31068
+ * @param serverAddress - Server address to get info for
31069
+ * @returns Promise resolving to server info
31070
+ */
31071
+ getServerInfoByAddress(serverAddress: Address): Promise<ServerInfo>;
31072
+ /**
31073
+ * Get all permission IDs for a user
31074
+ *
31075
+ * @param userAddress - User address to query (defaults to current user)
31076
+ * @returns Promise resolving to array of permission IDs
31077
+ */
31078
+ getUserPermissionIds(userAddress?: Address): Promise<bigint[]>;
31079
+ /**
31080
+ * Get permission ID at specific index for a user
31081
+ *
31082
+ * @param userAddress - User address to query
31083
+ * @param permissionIndex - Index in the user's permission list
31084
+ * @returns Promise resolving to permission ID
31085
+ */
31086
+ getUserPermissionIdAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
31087
+ /**
31088
+ * Get the number of permissions for a user
31089
+ *
31090
+ * @param userAddress - User address to query (defaults to current user)
31091
+ * @returns Promise resolving to number of permissions
31092
+ */
31093
+ getUserPermissionCount(userAddress?: Address): Promise<bigint>;
31094
+ /**
31095
+ * Get detailed permission information by permission ID
31096
+ *
31097
+ * @param permissionId - Permission ID to get info for
31098
+ * @returns Promise resolving to permission info
31099
+ */
31100
+ getPermissionInfo(permissionId: bigint): Promise<PermissionInfo>;
31101
+ /**
31102
+ * Get all permission IDs for a specific file
31103
+ *
31104
+ * @param fileId - File ID to get permissions for
31105
+ * @returns Promise resolving to array of permission IDs
31106
+ */
31107
+ getFilePermissionIds(fileId: bigint): Promise<bigint[]>;
31108
+ /**
31109
+ * Get all file IDs for a specific permission
31110
+ *
31111
+ * @param permissionId - Permission ID to get files for
31112
+ * @returns Promise resolving to array of file IDs
31113
+ */
31114
+ getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
31115
+ /**
31116
+ * Get all permissions for a specific file (alias for getFilePermissionIds)
31117
+ *
31118
+ * @param fileId - File ID to get permissions for
31119
+ * @returns Promise resolving to array of permission IDs
31120
+ */
31121
+ getFilePermissions(fileId: bigint): Promise<bigint[]>;
31122
+ /**
31123
+ * Get grantee information by grantee ID
31124
+ *
31125
+ * @param granteeId - Grantee ID to get info for
31126
+ * @returns Promise resolving to grantee info
31127
+ */
31128
+ getGranteeInfo(granteeId: bigint): Promise<GranteeInfo>;
31129
+ /**
31130
+ * Get grantee information by grantee address
31131
+ *
31132
+ * @param granteeAddress - Grantee address to get info for
31133
+ * @returns Promise resolving to grantee info
31134
+ */
31135
+ getGranteeInfoByAddress(granteeAddress: Address): Promise<GranteeInfo>;
31136
+ /**
31137
+ * Get all permission IDs for a specific grantee
31138
+ *
31139
+ * @param granteeId - Grantee ID to get permissions for
31140
+ * @returns Promise resolving to array of permission IDs
31141
+ */
31142
+ getGranteePermissionIds(granteeId: bigint): Promise<bigint[]>;
31143
+ /**
31144
+ * Get all permissions for a specific grantee (alias for getGranteePermissionIds)
31145
+ *
31146
+ * @param granteeId - Grantee ID to get permissions for
31147
+ * @returns Promise resolving to array of permission IDs
31148
+ */
31149
+ getGranteePermissions(granteeId: bigint): Promise<bigint[]>;
31150
+ /**
31151
+ * Get all server IDs for a user
31152
+ *
31153
+ * @param userAddress - User address to get server IDs for
31154
+ * @returns Promise resolving to array of server IDs
31155
+ */
31156
+ getUserServerIdsValues(userAddress: Address): Promise<bigint[]>;
31157
+ /**
31158
+ * Get server ID at specific index for a user
31159
+ *
31160
+ * @param userAddress - User address
31161
+ * @param serverIndex - Index of the server ID
31162
+ * @returns Promise resolving to server ID
31163
+ */
31164
+ getUserServerIdsAt(userAddress: Address, serverIndex: bigint): Promise<bigint>;
31165
+ /**
31166
+ * Get the number of servers a user has
31167
+ *
31168
+ * @param userAddress - User address
31169
+ * @returns Promise resolving to number of servers
31170
+ */
31171
+ getUserServerIdsLength(userAddress: Address): Promise<bigint>;
31172
+ /**
31173
+ * Get trusted server info for a specific user and server ID
31174
+ *
31175
+ * @param userAddress - User address
31176
+ * @param serverId - Server ID
31177
+ * @returns Promise resolving to trusted server info
31178
+ */
31179
+ getUserServers(userAddress: Address, serverId: bigint): Promise<TrustedServerInfo>;
31180
+ /**
31181
+ * Get server info by server ID
31182
+ *
31183
+ * @param serverId - Server ID
31184
+ * @returns Promise resolving to server info
31185
+ */
31186
+ getServers(serverId: bigint): Promise<ServerInfo>;
31187
+ /**
31188
+ * Get user info including nonce and trusted server IDs
31189
+ *
31190
+ * @param userAddress - User address
31191
+ * @returns Promise resolving to user info
31192
+ */
31193
+ getUsers(userAddress: Address): Promise<{
31194
+ nonce: bigint;
31195
+ trustedServerIds: bigint[];
31196
+ }>;
31197
+ /**
31198
+ * Update server URL
31199
+ *
31200
+ * @param serverId - Server ID to update
31201
+ * @param url - New URL for the server
31202
+ * @returns Promise resolving to transaction hash
31203
+ */
31204
+ submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
31205
+ /**
31206
+ * Get all permission IDs for a user
31207
+ *
31208
+ * @param userAddress - User address to get permission IDs for
31209
+ * @returns Promise resolving to array of permission IDs
31210
+ */
31211
+ getUserPermissionIdsValues(userAddress: Address): Promise<bigint[]>;
31212
+ /**
31213
+ * Get permission ID at specific index for a user
31214
+ *
31215
+ * @param userAddress - User address
31216
+ * @param permissionIndex - Index of the permission ID
31217
+ * @returns Promise resolving to permission ID
31218
+ */
31219
+ getUserPermissionIdsAt(userAddress: Address, permissionIndex: bigint): Promise<bigint>;
31220
+ /**
31221
+ * Get the number of permissions a user has
31222
+ *
31223
+ * @param userAddress - User address
31224
+ * @returns Promise resolving to number of permissions
31225
+ */
31226
+ getUserPermissionIdsLength(userAddress: Address): Promise<bigint>;
31227
+ /**
31228
+ * Get permission info by permission ID
31229
+ *
31230
+ * @param permissionId - Permission ID
31231
+ * @returns Promise resolving to permission info
31232
+ */
31233
+ getPermissions(permissionId: bigint): Promise<PermissionInfo>;
31234
+ /**
31235
+ * Submit permission with signature to the blockchain (supports gasless transactions)
31236
+ *
31237
+ * @param params - Parameters for adding permission
31238
+ * @returns Promise resolving to transaction hash
31239
+ * @throws {RelayerError} When gasless transaction submission fails
31240
+ * @throws {SignatureError} When user rejects the signature request
31241
+ * @throws {BlockchainError} When permission addition fails
31242
+ * @throws {NetworkError} When network communication fails
31243
+ */
31244
+ submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
31245
+ /**
31246
+ * Submits an already-signed add permission transaction to the blockchain.
31247
+ * This method supports both relayer-based gasless transactions and direct transactions.
31248
+ *
31249
+ * @param typedData - The EIP-712 typed data for AddPermission
31250
+ * @param signature - The user's signature
31251
+ * @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
31252
+ * @throws {RelayerError} When gasless transaction submission fails
31253
+ * @throws {BlockchainError} When permission addition fails
31254
+ * @throws {NetworkError} When network communication fails
31255
+ */
31256
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
31257
+ /**
31258
+ * Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
31259
+ *
31260
+ * @remarks
31261
+ * This method validates files against their specified schemas before submission.
31262
+ * Schema validation ensures data conforms to expected formats before on-chain registration.
31263
+ * Files with schemaId = 0 bypass validation. The method supports atomic batch operations
31264
+ * where all files and permissions are registered in a single transaction.
31265
+ *
31266
+ * @param params - Parameters for adding server files and permissions
31267
+ * @param params.granteeId - The ID of the permission grantee
31268
+ * @param params.grant - Grant URL containing permission parameters (typically IPFS)
31269
+ * @param params.fileUrls - Array of file URLs to register
31270
+ * @param params.schemaIds - Schema IDs for each file. Use 0 for files without schema validation.
31271
+ * Array length must match fileUrls length.
31272
+ * @param params.serverAddress - Server wallet address for decryption permissions
31273
+ * @param params.serverUrl - Server endpoint URL
31274
+ * @param params.serverPublicKey - Server's public key for encryption.
31275
+ * Obtain via `vana.server.getIdentity(userAddress).public_key`.
31276
+ * @param params.filePermissions - Nested array of permissions for each file
31277
+ * @returns TransactionHandle with immediate hash access and event parsing capability
31278
+ * @throws {Error} When schemaIds array length doesn't match fileUrls array length
31279
+ * @throws {SchemaValidationError} When file data doesn't match the specified schema.
31280
+ * Verify data structure matches schema definition from `vana.schemas.get(schemaId)`.
31281
+ * @throws {RelayerError} When gasless transaction submission fails.
31282
+ * Retry without relayer configuration to submit direct transaction.
31283
+ * @throws {SignatureError} When user rejects the signature request
31284
+ * @throws {BlockchainError} When server files and permissions addition fails
31285
+ * @throws {NetworkError} When network communication fails.
31286
+ * Check network connection or configure alternative gateways.
31287
+ *
31288
+ * @example
31289
+ * ```typescript
31290
+ * const result = await vana.permissions.submitAddServerFilesAndPermissions({
31291
+ * granteeId: BigInt(1),
31292
+ * grant: "ipfs://QmXxx...",
31293
+ * fileUrls: ["https://storage.example.com/data.json"],
31294
+ * schemaIds: [123], // LinkedIn profile schema ID
31295
+ * serverAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31296
+ * serverUrl: "https://server.example.com",
31297
+ * serverPublicKey: serverInfo.public_key,
31298
+ * filePermissions: [[{
31299
+ * account: "0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb",
31300
+ * key: encryptedKey
31301
+ * }]]
31302
+ * });
31303
+ * const events = await result.waitForEvents();
31304
+ * console.log(`Permission ID: ${events.permissionId}`);
31305
+ * ```
31306
+ */
31307
+ submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
31308
+ /**
31309
+ * Submits an already-signed add server files and permissions transaction to the blockchain.
31310
+ *
31311
+ * @remarks
31312
+ * This method returns a TransactionHandle that provides immediate access to the transaction hash
31313
+ * while allowing lazy-loaded access to parsed event data. Use `waitForEvents()` to retrieve
31314
+ * the permission ID and other event details after transaction confirmation.
31315
+ *
31316
+ * @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
31317
+ * @param signature - The user's signature
31318
+ * @returns TransactionHandle with immediate hash access and optional event parsing
31319
+ * @throws {RelayerError} When gasless transaction submission fails
31320
+ * @throws {BlockchainError} When server files and permissions addition fails
31321
+ * @throws {NetworkError} When network communication fails
31322
+ *
31323
+ * @example
31324
+ * ```typescript
31325
+ * const tx = await vana.permissions.submitSignedAddServerFilesAndPermissions(
31326
+ * typedData,
31327
+ * signature
31328
+ * );
31329
+ * console.log(`Transaction submitted: ${tx.hash}`);
31330
+ *
31331
+ * // Wait for confirmation and get the permission ID
31332
+ * const { permissionId } = await tx.waitForEvents();
31333
+ * console.log(`Permission created with ID: ${permissionId}`);
31334
+ * ```
31335
+ */
31336
+ submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
31337
+ /**
31338
+ * Submit permission revocation with signature to the blockchain
31339
+ *
31340
+ * @param permissionId - Permission ID to revoke
31341
+ * @returns Promise resolving to transaction hash
31342
+ */
31343
+ submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
31344
+ /**
31345
+ * Submits a signed add permission transaction directly to the blockchain.
31346
+ *
31347
+ * @param typedData - The typed data structure for the permission addition
31348
+ * @param signature - The cryptographic signature authorizing the transaction
31349
+ * @returns Promise resolving to the transaction hash
31350
+ */
31351
+ private submitDirectAddPermissionTransaction;
31352
+ /**
31353
+ * Submits a signed add server files and permissions transaction directly to the blockchain.
31354
+ *
31355
+ * @param typedData - The typed data structure for the server files and permissions addition
31356
+ * @param signature - The cryptographic signature authorizing the transaction
31357
+ * @returns Promise resolving to the transaction hash
31358
+ */
31359
+ private submitDirectAddServerFilesAndPermissionsTransaction;
31295
31360
  }
31296
31361
 
31297
31362
  /**
@@ -31305,10 +31370,10 @@ declare class PermissionsController {
31305
31370
  interface CreateSchemaParams {
31306
31371
  /** The name of the schema */
31307
31372
  name: string;
31308
- /** The type/category of the schema */
31309
- type: string;
31373
+ /** The dialect of the schema (e.g., 'json' or 'sqlite') */
31374
+ dialect: "json" | "sqlite";
31310
31375
  /** The schema definition object or JSON string */
31311
- definition: object | string;
31376
+ schema: object | string;
31312
31377
  }
31313
31378
  /**
31314
31379
  * Result of creating a new schema.
@@ -31353,8 +31418,8 @@ interface CreateSchemaResult {
31353
31418
  * // Create a new schema with automatic IPFS upload
31354
31419
  * const result = await vana.schemas.create({
31355
31420
  * name: "User Profile",
31356
- * type: "personal",
31357
- * definition: {
31421
+ * dialect: "json",
31422
+ * schema: {
31358
31423
  * type: "object",
31359
31424
  * properties: {
31360
31425
  * name: { type: "string" },
@@ -31389,7 +31454,7 @@ declare class SchemaController {
31389
31454
  * - Uploads the definition to IPFS to generate a permanent URL
31390
31455
  * - Registers the schema on the blockchain with the generated URL
31391
31456
  *
31392
- * @param params - Schema creation parameters including name, type, and definition
31457
+ * @param params - Schema creation parameters including name, dialect, and definition
31393
31458
  * @returns Promise resolving to creation results with schema ID and transaction hash
31394
31459
  * @throws {SchemaValidationError} When the schema definition is invalid
31395
31460
  * @throws {Error} When IPFS upload or blockchain registration fails
@@ -31398,8 +31463,8 @@ declare class SchemaController {
31398
31463
  * // Create a JSON schema for user profiles
31399
31464
  * const result = await vana.schemas.create({
31400
31465
  * name: "User Profile",
31401
- * type: "personal",
31402
- * definition: {
31466
+ * dialect: "json",
31467
+ * schema: {
31403
31468
  * type: "object",
31404
31469
  * properties: {
31405
31470
  * name: { type: "string" },
@@ -31414,42 +31479,66 @@ declare class SchemaController {
31414
31479
  */
31415
31480
  create(params: CreateSchemaParams): Promise<CreateSchemaResult>;
31416
31481
  /**
31417
- * Retrieves a schema by its ID.
31482
+ * Retrieves a complete schema by its ID with definition fetched and flattened.
31418
31483
  *
31419
31484
  * @param schemaId - The ID of the schema to retrieve
31420
- * @returns Promise resolving to the schema object
31421
- * @throws {Error} When the schema is not found or chain is unavailable
31485
+ * @param options - Optional parameters
31486
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31487
+ * @returns Promise resolving to the complete schema object with all fields populated
31488
+ * @throws {Error} When the schema is not found, definition cannot be fetched, or chain is unavailable
31422
31489
  * @example
31423
31490
  * ```typescript
31424
31491
  * const schema = await vana.schemas.get(1);
31425
- * console.log(`Schema: ${schema.name} (${schema.type})`);
31492
+ * console.log(`Schema: ${schema.name} (${schema.dialect})`);
31493
+ * console.log(`Version: ${schema.version}`);
31494
+ * console.log(`Description: ${schema.description}`);
31495
+ * console.log('Schema:', schema.schema);
31496
+ *
31497
+ * // Use directly with validator (schema has all required fields)
31498
+ * validator.validateDataAgainstSchema(data, schema);
31426
31499
  * ```
31427
31500
  */
31428
- get(schemaId: number): Promise<Schema>;
31501
+ get(schemaId: number, options?: {
31502
+ subgraphUrl?: string;
31503
+ }): Promise<CompleteSchema>;
31429
31504
  /**
31430
31505
  * Gets the total number of schemas registered on the network.
31431
31506
  *
31507
+ * @param options - Optional parameters
31508
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31432
31509
  * @returns Promise resolving to the total schema count
31433
31510
  * @throws {Error} When the count cannot be retrieved
31434
31511
  * @example
31435
31512
  * ```typescript
31436
31513
  * const count = await vana.schemas.count();
31437
31514
  * console.log(`Total schemas: ${count}`);
31515
+ *
31516
+ * // With custom subgraph
31517
+ * const count = await vana.schemas.count({
31518
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
31519
+ * });
31438
31520
  * ```
31439
31521
  */
31440
- count(): Promise<number>;
31522
+ count(options?: {
31523
+ subgraphUrl?: string;
31524
+ }): Promise<number>;
31441
31525
  /**
31442
31526
  * Lists all schemas with pagination.
31443
31527
  *
31444
31528
  * @param options - Optional parameters for listing schemas
31445
31529
  * @param options.limit - Maximum number of schemas to return
31446
31530
  * @param options.offset - Number of schemas to skip
31531
+ * @param options.subgraphUrl - Custom subgraph URL to use instead of default
31532
+ * @param options.includeDefinitions - Whether to fetch and include schema definitions (default: false for performance)
31447
31533
  * @returns Promise resolving to an array of schemas
31448
31534
  * @example
31449
31535
  * ```typescript
31450
- * // Get all schemas
31536
+ * // Get all schemas (without definitions for performance)
31451
31537
  * const schemas = await vana.schemas.list();
31452
31538
  *
31539
+ * // Get schemas with definitions
31540
+ * const schemas = await vana.schemas.list({ includeDefinitions: true });
31541
+ *
31453
31542
  * // Get schemas with pagination
31454
31543
  * const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
31455
31544
  * ```
@@ -31457,6 +31546,8 @@ declare class SchemaController {
31457
31546
  list(options?: {
31458
31547
  limit?: number;
31459
31548
  offset?: number;
31549
+ subgraphUrl?: string;
31550
+ includeDefinitions?: boolean;
31460
31551
  }): Promise<Schema[]>;
31461
31552
  /**
31462
31553
  * Adds a schema using the legacy method (low-level API).
@@ -31466,6 +31557,36 @@ declare class SchemaController {
31466
31557
  * @returns Promise resolving to the add schema result
31467
31558
  */
31468
31559
  addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
31560
+ /**
31561
+ * Internal method: Query schema via subgraph
31562
+ *
31563
+ * @param params - Query parameters
31564
+ * @param params.schemaId - The ID of the schema to retrieve
31565
+ * @param params.subgraphUrl - The subgraph URL to query
31566
+ * @returns Promise resolving to the schema object
31567
+ * @private
31568
+ */
31569
+ private _getSchemaViaSubgraph;
31570
+ /**
31571
+ * Internal method: List schemas via subgraph
31572
+ *
31573
+ * @param params - Query parameters
31574
+ * @param params.limit - Maximum number of schemas to return
31575
+ * @param params.offset - Number of schemas to skip
31576
+ * @param params.subgraphUrl - The subgraph URL to query
31577
+ * @returns Promise resolving to an array of schemas
31578
+ * @private
31579
+ */
31580
+ private _listSchemasViaSubgraph;
31581
+ /**
31582
+ * Internal method: Count schemas via subgraph
31583
+ *
31584
+ * @param params - Query parameters
31585
+ * @param params.subgraphUrl - The subgraph URL to query
31586
+ * @returns Promise resolving to the total schema count
31587
+ * @private
31588
+ */
31589
+ private _countSchemasViaSubgraph;
31469
31590
  /**
31470
31591
  * Gets the user's wallet address.
31471
31592
  *
@@ -31473,6 +31594,13 @@ declare class SchemaController {
31473
31594
  * @returns Promise resolving to the user's address
31474
31595
  */
31475
31596
  private getUserAddress;
31597
+ /**
31598
+ * Fetches and attaches definitions to an array of schemas.
31599
+ *
31600
+ * @param schemas - Array of schemas to fetch definitions for
31601
+ * @private
31602
+ */
31603
+ private _fetchDefinitionsForSchemas;
31476
31604
  }
31477
31605
 
31478
31606
  /**
@@ -31547,34 +31675,30 @@ declare class SchemaValidator {
31547
31675
  */
31548
31676
  validateDataSchema(schema: unknown): asserts schema is DataSchema;
31549
31677
  /**
31550
- * Validates data against a JSON Schema from a data schema
31678
+ * Validates data against a JSON Schema from a schema
31551
31679
  *
31552
31680
  * @param data - The data to validate
31553
- * @param schema - The data schema containing the schema
31681
+ * @param schema - The schema containing the validation rules (DataSchema or Schema)
31554
31682
  * @throws SchemaValidationError if invalid
31555
31683
  * @example
31556
31684
  * ```typescript
31557
31685
  * const validator = new SchemaValidator();
31558
31686
  *
31559
- * const schema = {
31687
+ * // Works with Schema from schemas.get()
31688
+ * const schema = await vana.schemas.get(1);
31689
+ * validator.validateDataAgainstSchema(userData, schema);
31690
+ *
31691
+ * // Also works with DataSchema object
31692
+ * const dataSchema: DataSchema = {
31560
31693
  * name: "User Profile",
31561
31694
  * version: "1.0.0",
31562
31695
  * dialect: "json",
31563
- * schema: {
31564
- * type: "object",
31565
- * properties: {
31566
- * name: { type: "string" },
31567
- * age: { type: "number" }
31568
- * },
31569
- * required: ["name"]
31570
- * }
31696
+ * schema: { type: "object", properties: { name: { type: "string" } } }
31571
31697
  * };
31572
- *
31573
- * const userData = { name: "Alice", age: 30 };
31574
- * validator.validateDataAgainstSchema(userData, schema);
31698
+ * validator.validateDataAgainstSchema(userData, dataSchema);
31575
31699
  * ```
31576
31700
  */
31577
- validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
31701
+ validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31578
31702
  /**
31579
31703
  * Validates a SQLite DDL string for basic syntax
31580
31704
  * Note: This is a basic validation, full SQL parsing would require a proper SQL parser
@@ -31618,7 +31742,7 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
31618
31742
  * @returns void - Function doesn't return a value
31619
31743
  * @throws SchemaValidationError if invalid
31620
31744
  */
31621
- declare function validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
31745
+ declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
31622
31746
  /**
31623
31747
  * Convenience function to fetch and validate a schema from a URL
31624
31748
  *
@@ -34114,19 +34238,18 @@ declare class DataController {
34114
34238
  subgraphUrl?: string;
34115
34239
  }): Promise<UserFile$1[]>;
34116
34240
  /**
34117
- * Retrieves a list of permissions granted by a user using the new subgraph entities.
34241
+ * Retrieves a list of permissions granted by a user.
34118
34242
  *
34119
- * This method queries the Vana subgraph to find permissions directly granted by the user
34120
- * using the new Permission entity. It efficiently handles millions of permissions by:
34121
- * 1. Querying the subgraph for user's directly granted permissions
34122
- * 2. Returning complete permission information from subgraph
34123
- * 3. No need for additional contract calls as all data comes from subgraph
34243
+ * This method supports automatic fallback between subgraph and RPC modes:
34244
+ * - If subgraph URL is available, tries subgraph query first
34245
+ * - Falls back to direct contract queries via RPC if subgraph fails
34246
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
34124
34247
  *
34125
34248
  * @param params - Object containing the user address and optional subgraph URL
34126
34249
  * @param params.user - The wallet address of the user to query permissions for
34127
34250
  * @param params.subgraphUrl - Optional subgraph URL to override the default
34128
34251
  * @returns Promise resolving to an array of permission objects
34129
- * @throws Error if subgraph is unavailable or returns invalid data
34252
+ * @throws Error if both subgraph and RPC queries fail
34130
34253
  */
34131
34254
  getUserPermissions(params: {
34132
34255
  user: Address;
@@ -34142,43 +34265,59 @@ declare class DataController {
34142
34265
  user: Address;
34143
34266
  }>>;
34144
34267
  /**
34145
- * Retrieves a list of trusted servers for a user using the new subgraph entities.
34268
+ * Internal method: Query user permissions via subgraph
34146
34269
  *
34147
- * This method queries the Vana subgraph to find trusted servers directly associated with the user
34148
- * with support for both subgraph and direct RPC queries.
34270
+ * @param params - Query parameters object
34271
+ * @param params.user - The user address to query permissions for
34272
+ * @param params.subgraphUrl - The subgraph URL endpoint to query
34273
+ * @returns Promise resolving to an array of permission objects
34274
+ */
34275
+ private _getUserPermissionsViaSubgraph;
34276
+ /**
34277
+ * Internal method: Query user permissions via direct RPC
34149
34278
  *
34150
- * This method supports multiple query modes:
34151
- * - 'subgraph': Fast query via subgraph (requires subgraphUrl)
34152
- * - 'rpc': Direct contract queries (slower but no external dependencies)
34153
- * - 'auto': Try subgraph first, fallback to RPC if unavailable
34279
+ * @param params - Query parameters object
34280
+ * @param params.user - The user address to query permissions for
34281
+ * @returns Promise resolving to an array of permission objects
34282
+ */
34283
+ private _getUserPermissionsViaRpc;
34284
+ /**
34285
+ * Retrieves a list of trusted servers for a user.
34286
+ *
34287
+ * This method supports automatic fallback between subgraph and RPC modes:
34288
+ * - If subgraph URL is available, tries subgraph query first for fast results
34289
+ * - Falls back to direct contract queries via RPC if subgraph fails
34290
+ * - RPC mode uses gasAwareMulticall for efficient batch queries
34154
34291
  *
34155
- * @param params - Query parameters including user address and mode selection
34156
- * @returns Promise resolving to trusted servers with metadata about the query
34157
- * @throws Error if query fails in both modes (when using 'auto')
34292
+ * @param params - Query parameters including user address and optional pagination
34293
+ * @param params.user - The wallet address of the user to query trusted servers for
34294
+ * @param params.subgraphUrl - Optional subgraph URL to override the default
34295
+ * @param params.limit - Maximum number of results to return (default: 50)
34296
+ * @param params.offset - Number of results to skip for pagination (default: 0)
34297
+ * @returns Promise resolving to an array of trusted server objects
34298
+ * @throws Error if both subgraph and RPC queries fail
34158
34299
  * @example
34159
34300
  * ```typescript
34160
- * // Use subgraph for fast queries
34161
- * const result = await vana.data.getUserTrustedServers({
34162
- * user: '0x...',
34163
- * mode: 'subgraph',
34164
- * subgraphUrl: 'https://...'
34301
+ * // Basic usage with automatic fallback
34302
+ * const servers = await vana.data.getUserTrustedServers({
34303
+ * user: '0x...'
34165
34304
  * });
34166
34305
  *
34167
- * // Use direct RPC (no external dependencies)
34168
- * const result = await vana.data.getUserTrustedServers({
34306
+ * // With pagination
34307
+ * const servers = await vana.data.getUserTrustedServers({
34169
34308
  * user: '0x...',
34170
- * mode: 'rpc',
34171
- * limit: 10
34309
+ * limit: 10,
34310
+ * offset: 20
34172
34311
  * });
34173
34312
  *
34174
- * // Auto-fallback mode
34175
- * const result = await vana.data.getUserTrustedServers({
34313
+ * // With custom subgraph URL
34314
+ * const servers = await vana.data.getUserTrustedServers({
34176
34315
  * user: '0x...',
34177
- * mode: 'auto' // tries subgraph first, falls back to RPC
34316
+ * subgraphUrl: 'https://custom-subgraph.com/graphql'
34178
34317
  * });
34179
34318
  * ```
34180
34319
  */
34181
- getUserTrustedServers(params: GetUserTrustedServersParams): Promise<GetUserTrustedServersResult>;
34320
+ getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
34182
34321
  /**
34183
34322
  * Internal method: Query trusted servers via subgraph
34184
34323
  *
@@ -34243,75 +34382,28 @@ declare class DataController {
34243
34382
  * for specific files by ID.
34244
34383
  */
34245
34384
  getFileById(fileId: number): Promise<UserFile$1>;
34246
- /**
34247
- * Uploads an encrypted file to storage and registers it on the blockchain.
34248
- *
34249
- * @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption
34250
- *
34251
- * Migration guide:
34252
- * ```typescript
34253
- * // Old way (deprecated):
34254
- * const encrypted = await encryptBlob(data, key);
34255
- * const result = await vana.data.uploadEncryptedFile(encrypted, filename);
34256
- *
34257
- * // New way:
34258
- * const result = await vana.data.upload({
34259
- * content: data,
34260
- * filename: filename,
34261
- * encrypt: true // Handles encryption automatically
34262
- * });
34263
- * ```
34264
- * @param encryptedFile - The encrypted file blob to upload
34265
- * @param filename - Optional filename for the upload
34266
- * @param providerName - Optional storage provider to use
34267
- * @returns Promise resolving to upload result with file ID and storage URL
34268
- *
34269
- * This method handles the complete flow of:
34270
- * 1. Uploading the encrypted file to the specified storage provider
34271
- * 2. Registering the file URL on the DataRegistry contract via relayer
34272
- * 3. Returning the assigned file ID and storage URL
34273
- */
34274
- uploadEncryptedFile(encryptedFile: Blob, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34275
- /**
34276
- * Uploads an encrypted file to storage and registers it on the blockchain with a schema.
34277
- *
34278
- * @deprecated Since v2.0.0 - Use vana.data.upload() instead for the high-level API with automatic encryption and schema validation
34279
- *
34280
- * Migration guide:
34281
- * ```typescript
34282
- * // Old way (deprecated):
34283
- * const encrypted = await encryptBlob(data, key);
34284
- * const result = await vana.data.uploadEncryptedFileWithSchema(encrypted, schemaId, filename);
34285
- *
34286
- * // New way:
34287
- * const result = await vana.data.upload({
34288
- * content: data,
34289
- * filename: filename,
34290
- * schemaId: schemaId, // Automatic validation
34291
- * encrypt: true
34292
- * });
34293
- * ```
34294
- * @param encryptedFile - The encrypted file blob to upload
34295
- * @param schemaId - The schema ID to associate with the file
34296
- * @param filename - Optional filename for the upload
34297
- * @param providerName - Optional storage provider to use
34298
- * @returns Promise resolving to upload result with file ID and storage URL
34299
- *
34300
- * This method handles the complete flow of:
34301
- * 1. Uploading the encrypted file to the specified storage provider
34302
- * 2. Registering the file URL on the DataRegistry contract with a schema ID
34303
- * 3. Returning the assigned file ID and storage URL
34304
- */
34305
- uploadEncryptedFileWithSchema(encryptedFile: Blob, schemaId: number, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34306
34385
  /**
34307
34386
  * Registers a file URL directly on the blockchain with a schema ID.
34308
34387
  *
34309
- * @param url - The URL of the file to register
34388
+ * @remarks
34389
+ * This method registers an existing file URL on the DataRegistry contract
34390
+ * with a schema ID, without uploading any data. Useful when you have already
34391
+ * uploaded content to storage and just need to register it on-chain.
34392
+ *
34393
+ * @param url - The URL of the file to register (IPFS or HTTP/HTTPS)
34310
34394
  * @param schemaId - The schema ID to associate with the file
34311
34395
  * @returns Promise resolving to the file ID and transaction hash
34312
- *
34313
- * This method registers an existing file URL on the DataRegistry
34314
- * contract with a schema ID, without uploading any data.
34396
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34397
+ * @throws {Error} When wallet address is unavailable - "No addresses available"
34398
+ * @throws {Error} When transaction fails - "Failed to register file with schema"
34399
+ * @example
34400
+ * ```typescript
34401
+ * const { fileId, transactionHash } = await vana.data.registerFileWithSchema(
34402
+ * "ipfs://QmXxx...",
34403
+ * 1
34404
+ * );
34405
+ * console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
34406
+ * ```
34315
34407
  */
34316
34408
  registerFileWithSchema(url: string, schemaId: number): Promise<{
34317
34409
  fileId: number;
@@ -34369,95 +34461,114 @@ declare class DataController {
34369
34461
  transactionHash: string;
34370
34462
  }>;
34371
34463
  /**
34372
- * Adds a new schema to the DataRefinerRegistry.
34373
- *
34374
- * @deprecated Since v2.0.0 - Use vana.schemas.create() instead for the high-level API with automatic IPFS upload
34464
+ * Adds a new refiner to the DataRefinerRegistry.
34375
34465
  *
34376
- * Migration guide:
34466
+ * @remarks
34467
+ * Refiners are data processing templates that define how raw data should be
34468
+ * transformed into structured formats. Each refiner is associated with a DLP
34469
+ * (Data Liquidity Pool), has a specific schema for output, and includes
34470
+ * instructions for the refinement process.
34471
+ *
34472
+ * @param params - Refiner configuration parameters
34473
+ * @param params.dlpId - The Data Liquidity Pool ID this refiner belongs to
34474
+ * @param params.name - Human-readable name for the refiner
34475
+ * @param params.schemaId - Schema ID that defines the output format
34476
+ * @param params.refinementInstructionUrl - URL containing processing instructions
34477
+ * @returns Promise resolving to the new refiner ID and transaction hash
34478
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34479
+ * @throws {Error} When transaction fails - "Failed to add refiner: {error}"
34480
+ * @example
34377
34481
  * ```typescript
34378
- * // Old way (deprecated):
34379
- * const result = await vana.data.addSchema({
34380
- * name: "UserProfile",
34381
- * type: "JSON",
34382
- * definitionUrl: "ipfs://..."
34383
- * });
34384
- *
34385
- * // New way:
34386
- * const result = await vana.schemas.create({
34387
- * name: "UserProfile",
34388
- * type: "JSON",
34389
- * definition: schemaObject // Automatically uploads to IPFS
34482
+ * const result = await vana.data.addRefiner({
34483
+ * dlpId: 1,
34484
+ * name: "Social Media Sentiment Analyzer",
34485
+ * schemaId: 42,
34486
+ * refinementInstructionUrl: "ipfs://QmXxx..."
34390
34487
  * });
34488
+ * console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
34391
34489
  * ```
34392
- * @param params - Schema parameters including name, type, and definition URL
34393
- * @returns Promise resolving to the new schema ID and transaction hash
34394
34490
  */
34395
- addSchema(params: AddSchemaParams): Promise<AddSchemaResult>;
34491
+ addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
34396
34492
  /**
34397
- * Retrieves a schema by its ID.
34493
+ * Retrieves a refiner by its ID.
34398
34494
  *
34399
- * @deprecated Since v2.0.0 - Use vana.schemas.get() instead
34495
+ * @remarks
34496
+ * Queries the DataRefinerRegistry contract to get complete information about
34497
+ * a specific refiner including its DLP association, schema, and instructions.
34400
34498
  *
34401
- * Migration guide:
34499
+ * @param refinerId - The numeric refiner ID to retrieve
34500
+ * @returns Promise resolving to the refiner information object
34501
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34502
+ * @throws {Error} When refiner doesn't exist - "Refiner with ID {refinerId} does not exist"
34503
+ * @throws {Error} When contract read fails - "Failed to fetch refiner: {error}"
34504
+ * @example
34402
34505
  * ```typescript
34403
- * // Old way (deprecated):
34404
- * const schema = await vana.data.getSchema(schemaId);
34405
- *
34406
- * // New way:
34407
- * const schema = await vana.schemas.get(schemaId);
34506
+ * const refiner = await vana.data.getRefiner(1);
34507
+ * console.log({
34508
+ * name: refiner.name,
34509
+ * dlp: refiner.dlpId,
34510
+ * schema: refiner.schemaId,
34511
+ * instructions: refiner.refinementInstructionUrl
34512
+ * });
34408
34513
  * ```
34409
- * @param schemaId - The schema ID to retrieve
34410
- * @returns Promise resolving to the schema information
34411
34514
  */
34412
- getSchema(schemaId: number): Promise<Schema>;
34515
+ getRefiner(refinerId: number): Promise<Refiner>;
34413
34516
  /**
34414
- * Gets the total number of schemas in the registry.
34517
+ * Validates if a schema ID exists in the registry.
34415
34518
  *
34416
- * @deprecated Since v2.0.0 - Use vana.schemas.count() instead
34519
+ * @remarks
34520
+ * Checks the DataRefinerRegistry contract to determine if a given schema ID
34521
+ * has been registered and is available for use.
34417
34522
  *
34418
- * Migration guide:
34523
+ * @param schemaId - The numeric schema ID to validate
34524
+ * @returns Promise resolving to true if schema exists, false otherwise
34525
+ * @example
34419
34526
  * ```typescript
34420
- * // Old way (deprecated):
34421
- * const count = await vana.data.getSchemasCount();
34422
- *
34423
- * // New way:
34424
- * const count = await vana.schemas.count();
34527
+ * const isValid = await vana.data.isValidSchemaId(42);
34528
+ * if (isValid) {
34529
+ * console.log('Schema 42 is available for use');
34530
+ * } else {
34531
+ * console.log('Schema 42 does not exist');
34532
+ * }
34425
34533
  * ```
34426
- * @returns Promise resolving to the total schema count
34427
- */
34428
- getSchemasCount(): Promise<number>;
34429
- /**
34430
- * Adds a new refiner to the DataRefinerRegistry.
34431
- *
34432
- * @param params - Refiner parameters including DLP ID, name, schema ID, and instruction URL
34433
- * @returns Promise resolving to the new refiner ID and transaction hash
34434
- */
34435
- addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
34436
- /**
34437
- * Retrieves a refiner by its ID.
34438
- *
34439
- * @param refinerId - The refiner ID to retrieve
34440
- * @returns Promise resolving to the refiner information
34441
- */
34442
- getRefiner(refinerId: number): Promise<Refiner>;
34443
- /**
34444
- * Validates if a schema ID exists in the registry.
34445
- *
34446
- * @param schemaId - The schema ID to validate
34447
- * @returns Promise resolving to boolean indicating if the schema ID is valid
34448
34534
  */
34449
34535
  isValidSchemaId(schemaId: number): Promise<boolean>;
34450
34536
  /**
34451
34537
  * Gets the total number of refiners in the registry.
34452
34538
  *
34539
+ * @remarks
34540
+ * Queries the DataRefinerRegistry contract to get the total count of all
34541
+ * registered refiners across all DLPs.
34542
+ *
34453
34543
  * @returns Promise resolving to the total refiner count
34544
+ * @example
34545
+ * ```typescript
34546
+ * const count = await vana.data.getRefinersCount();
34547
+ * console.log(`Total refiners registered: ${count}`);
34548
+ * ```
34454
34549
  */
34455
34550
  getRefinersCount(): Promise<number>;
34456
34551
  /**
34457
34552
  * Updates the schema ID for an existing refiner.
34458
34553
  *
34459
- * @param params - Parameters including refiner ID and new schema ID
34554
+ * @remarks
34555
+ * Allows the owner of a refiner to update its associated schema ID.
34556
+ * This is useful when refiner output format needs to change.
34557
+ *
34558
+ * @param params - Update parameters
34559
+ * @param params.refinerId - The refiner ID to update
34560
+ * @param params.newSchemaId - The new schema ID to set
34460
34561
  * @returns Promise resolving to the transaction hash
34562
+ * @throws {Error} When chain ID is not available - "Chain ID not available"
34563
+ * @throws {Error} When transaction fails - "Failed to update schema ID: {error}"
34564
+ * @example
34565
+ * ```typescript
34566
+ * const result = await vana.data.updateSchemaId({
34567
+ * refinerId: 1,
34568
+ * newSchemaId: 55
34569
+ * });
34570
+ * console.log(`Schema updated in tx ${result.transactionHash}`);
34571
+ * ```
34461
34572
  */
34462
34573
  updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
34463
34574
  /**
@@ -34479,6 +34590,17 @@ declare class DataController {
34479
34590
  account: Address;
34480
34591
  publicKey: string;
34481
34592
  }>, filename?: string, providerName?: string): Promise<UploadEncryptedFileResult>;
34593
+ /**
34594
+ * Uploads content to storage without registering it on the blockchain.
34595
+ * This method only handles the storage upload and returns the file URL.
34596
+ *
34597
+ * @param content - The content to upload (string, Blob, Buffer, or object - objects will be JSON stringified)
34598
+ * @param filename - Optional filename for the uploaded file (defaults to timestamp-based name)
34599
+ * @param encrypt - Optional flag to encrypt the content before upload
34600
+ * @param providerName - Optional specific storage provider to use
34601
+ * @returns Promise resolving to the storage upload result with url, size, and contentType
34602
+ */
34603
+ uploadToStorage(content: string | Blob | Buffer | object, filename?: string, encrypt?: boolean, providerName?: string): Promise<StorageUploadResult>;
34482
34604
  /**
34483
34605
  * Adds a permission for a party to access an existing file.
34484
34606
  *
@@ -34505,7 +34627,7 @@ declare class DataController {
34505
34627
  * console.log(`Transaction: ${result.transactionHash}`);
34506
34628
  * ```
34507
34629
  */
34508
- addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult>;
34630
+ addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34509
34631
  /**
34510
34632
  * Submits a file permission transaction and returns the transaction hash immediately.
34511
34633
  *
@@ -34522,7 +34644,7 @@ declare class DataController {
34522
34644
  * console.log(`Transaction submitted: ${txHash}`);
34523
34645
  * ```
34524
34646
  */
34525
- submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<Hash>;
34647
+ submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
34526
34648
  /**
34527
34649
  * Gets the encrypted key for a specific account's permission to access a file.
34528
34650
  *
@@ -34689,24 +34811,6 @@ declare class DataController {
34689
34811
  * ```
34690
34812
  */
34691
34813
  fetchAndValidateSchema(url: string): Promise<DataSchema>;
34692
- /**
34693
- * Retrieves a schema by ID and fetches its definition URL to get the full data schema.
34694
- *
34695
- * @param schemaId - The schema ID to retrieve and validate
34696
- * @returns The validated data schema
34697
- * @throws SchemaValidationError if schema is invalid
34698
- * @example
34699
- * ```typescript
34700
- * // Get schema from registry and validate its schema
34701
- * const schema = await vana.data.getValidatedSchema(123);
34702
- *
34703
- * // Use it to validate user data
34704
- * if (schema.dialect === "json") {
34705
- * vana.data.validateDataAgainstSchema(userData, schema);
34706
- * }
34707
- * ```
34708
- */
34709
- getValidatedSchema(schemaId: number): Promise<DataSchema>;
34710
34814
  }
34711
34815
 
34712
34816
  /**
@@ -34909,6 +35013,31 @@ interface Chains {
34909
35013
  }
34910
35014
  declare const chains: Chains;
34911
35015
 
35016
+ /**
35017
+ * Creates or retrieves a cached public client for blockchain read operations.
35018
+ *
35019
+ * @remarks
35020
+ * This function provides an optimized way to access blockchain data by maintaining
35021
+ * a cached client instance per chain. The client is used for reading contract state,
35022
+ * querying events, and other read-only blockchain operations. It automatically
35023
+ * handles HTTP transport configuration and chain switching.
35024
+ *
35025
+ * @param chainId - The chain ID to connect to (defaults to Moksha testnet)
35026
+ * @returns A public client configured for the specified chain with caching optimization
35027
+ * @throws {Error} When the specified chain ID is not supported by the SDK
35028
+ * @example
35029
+ * ```typescript
35030
+ * // Get client for default chain (Moksha testnet)
35031
+ * const client = createClient();
35032
+ *
35033
+ * // Get client for specific chain
35034
+ * const mainnetClient = createClient(14800);
35035
+ *
35036
+ * // Use client for blockchain reads
35037
+ * const blockNumber = await client.getBlockNumber();
35038
+ * ```
35039
+ * @category Blockchain
35040
+ */
34912
35041
  declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
34913
35042
  chain: Chain;
34914
35043
  };
@@ -35627,51 +35756,157 @@ declare class SerializationError extends VanaError {
35627
35756
  constructor(message: string);
35628
35757
  }
35629
35758
  /**
35630
- * Error thrown when a signature operation fails.
35759
+ * Thrown when a signature operation fails or cannot be completed.
35631
35760
  *
35632
35761
  * @remarks
35633
- * Recovery strategies: Check wallet connection and account unlock status,
35634
- * retry operation with explicit user interaction, or for gasless operations
35635
- * consider switching to direct transactions.
35762
+ * This error occurs when wallet signature operations fail due to disconnection,
35763
+ * locked accounts, or other wallet-related issues. It preserves the original
35764
+ * error for debugging while providing consistent error handling across the SDK.
35765
+ *
35766
+ * Recovery strategies:
35767
+ * - Check wallet connection and account unlock status
35768
+ * - Retry operation with explicit user interaction
35769
+ * - For gasless operations, consider switching to direct transactions
35770
+ *
35771
+ * @example
35772
+ * ```typescript
35773
+ * try {
35774
+ * await vana.permissions.grant({ grantee: '0x...' });
35775
+ * } catch (error) {
35776
+ * if (error instanceof SignatureError) {
35777
+ * // Prompt user to unlock wallet
35778
+ * await promptWalletUnlock();
35779
+ * // Retry operation
35780
+ * }
35781
+ * }
35782
+ * ```
35783
+ * @category Error Handling
35636
35784
  */
35637
35785
  declare class SignatureError extends VanaError {
35638
35786
  readonly originalError?: Error | undefined;
35639
35787
  constructor(message: string, originalError?: Error | undefined);
35640
35788
  }
35641
35789
  /**
35642
- * Error thrown when a network operation fails.
35790
+ * Thrown when network communication fails during API calls or blockchain interactions.
35643
35791
  *
35644
35792
  * @remarks
35645
- * Recovery strategies: Check network connectivity, retry with exponential backoff,
35646
- * verify API endpoints are accessible, or switch to alternative network providers.
35793
+ * This error encompasses network connectivity issues, API unavailability,
35794
+ * timeout errors, and CORS restrictions. It's commonly encountered during
35795
+ * IPFS operations, subgraph queries, or RPC calls.
35796
+ *
35797
+ * Recovery strategies:
35798
+ * - Check network connectivity
35799
+ * - Retry with exponential backoff
35800
+ * - Verify API endpoints are accessible
35801
+ * - Switch to alternative network providers or gateways
35802
+ *
35803
+ * @example
35804
+ * ```typescript
35805
+ * try {
35806
+ * const files = await vana.data.getUserFiles({ owner: '0x...' });
35807
+ * } catch (error) {
35808
+ * if (error instanceof NetworkError) {
35809
+ * // Implement retry with exponential backoff
35810
+ * await retryWithBackoff(() => vana.data.getUserFiles({ owner: '0x...' }));
35811
+ * }
35812
+ * }
35813
+ * ```
35814
+ * @category Error Handling
35647
35815
  */
35648
35816
  declare class NetworkError extends VanaError {
35649
35817
  readonly originalError?: Error | undefined;
35650
35818
  constructor(message: string, originalError?: Error | undefined);
35651
35819
  }
35652
35820
  /**
35653
- * Error thrown when the nonce retrieval fails.
35821
+ * Thrown when transaction nonce retrieval fails during gasless operations.
35654
35822
  *
35655
35823
  * @remarks
35656
- * Recovery strategies: Retry nonce retrieval after brief delay, check wallet connection
35657
- * and account status, or use manual nonce specification if supported by the operation.
35824
+ * This error occurs when the SDK cannot retrieve the user's current nonce from
35825
+ * smart contracts, preventing gasless transaction submission. Nonces are critical
35826
+ * for preventing replay attacks in signed transactions.
35827
+ *
35828
+ * Recovery strategies:
35829
+ * - Retry nonce retrieval after brief delay
35830
+ * - Check wallet connection and account status
35831
+ * - Use manual nonce specification if supported by the operation
35832
+ * - Switch to direct transactions as fallback
35833
+ *
35834
+ * @example
35835
+ * ```typescript
35836
+ * try {
35837
+ * await vana.permissions.grant({ grantee: '0x...' });
35838
+ * } catch (error) {
35839
+ * if (error instanceof NonceError) {
35840
+ * // Wait and retry
35841
+ * await delay(1000);
35842
+ * await vana.permissions.grant({ grantee: '0x...' });
35843
+ * }
35844
+ * }
35845
+ * ```
35846
+ * @category Error Handling
35658
35847
  */
35659
35848
  declare class NonceError extends VanaError {
35660
35849
  constructor(message: string);
35661
35850
  }
35662
35851
  /**
35663
- * Error thrown when a personal server operation fails.
35852
+ * Thrown when personal server operations fail or cannot be completed.
35664
35853
  *
35665
35854
  * @remarks
35666
- * Recovery strategies: Verify server URL accessibility, check server trust status via
35667
- * `vana.permissions.getUserTrustedServers()`, or retry after server becomes available.
35855
+ * This error occurs during interactions with personal servers for computation
35856
+ * requests, identity retrieval, or operation status checks. Common causes include
35857
+ * server unavailability, untrusted server status, or invalid permission grants.
35858
+ *
35859
+ * Recovery strategies:
35860
+ * - Verify server URL accessibility
35861
+ * - Check server trust status via `vana.permissions.getTrustedServers()`
35862
+ * - Ensure valid permissions exist for the operation
35863
+ * - Retry after server becomes available
35864
+ *
35865
+ * @example
35866
+ * ```typescript
35867
+ * try {
35868
+ * const result = await vana.server.createOperation({ permissionId: 123 });
35869
+ * } catch (error) {
35870
+ * if (error instanceof PersonalServerError) {
35871
+ * // Check if server is trusted
35872
+ * const trustedServers = await vana.permissions.getTrustedServers();
35873
+ * if (!trustedServers.includes(serverId)) {
35874
+ * await vana.permissions.trustServer({ serverId });
35875
+ * }
35876
+ * }
35877
+ * }
35878
+ * ```
35879
+ * @category Error Handling
35668
35880
  */
35669
35881
  declare class PersonalServerError extends VanaError {
35670
35882
  readonly originalError?: Error | undefined;
35671
35883
  constructor(message: string, originalError?: Error | undefined);
35672
35884
  }
35673
35885
  /**
35674
- * Error thrown when trying to register a server with a URL that doesn't match the existing registration.
35886
+ * Thrown when attempting to register a server with a URL different from its existing registration.
35887
+ *
35888
+ * @remarks
35889
+ * This error occurs when trying to add or trust a server that's already registered
35890
+ * on-chain with a different URL. Server URLs are immutable once registered to
35891
+ * maintain consistency and security. Applications should use the existing URL
35892
+ * or register a new server with a different ID.
35893
+ *
35894
+ * @example
35895
+ * ```typescript
35896
+ * try {
35897
+ * await vana.permissions.addAndTrustServer({
35898
+ * serverId: 1,
35899
+ * serverUrl: 'https://new-url.com',
35900
+ * publicKey: '0x...'
35901
+ * });
35902
+ * } catch (error) {
35903
+ * if (error instanceof ServerUrlMismatchError) {
35904
+ * console.log(`Server already registered with: ${error.existingUrl}`);
35905
+ * // Use existing URL or register new server
35906
+ * }
35907
+ * }
35908
+ * ```
35909
+ * @category Error Handling
35675
35910
  */
35676
35911
  declare class ServerUrlMismatchError extends VanaError {
35677
35912
  constructor(existingUrl: string, providedUrl: string, serverId: string);
@@ -35680,7 +35915,25 @@ declare class ServerUrlMismatchError extends VanaError {
35680
35915
  readonly serverId: string;
35681
35916
  }
35682
35917
  /**
35683
- * Error thrown when a permission operation fails.
35918
+ * Thrown when permission grant, revoke, or validation operations fail.
35919
+ *
35920
+ * @remarks
35921
+ * This error occurs during permission management operations including grants,
35922
+ * revocations, and permission validation checks. Common causes include invalid
35923
+ * grantee addresses, expired permissions, or insufficient privileges.
35924
+ *
35925
+ * @example
35926
+ * ```typescript
35927
+ * try {
35928
+ * await vana.permissions.revoke({ permissionId: 999999 });
35929
+ * } catch (error) {
35930
+ * if (error instanceof PermissionError) {
35931
+ * console.error('Permission operation failed:', error.message);
35932
+ * // Permission may not exist or user may not be owner
35933
+ * }
35934
+ * }
35935
+ * ```
35936
+ * @category Error Handling
35684
35937
  */
35685
35938
  declare class PermissionError extends VanaError {
35686
35939
  readonly originalError?: Error | undefined;
@@ -36688,21 +36941,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
36688
36941
 
36689
36942
  declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
36690
36943
  /**
36691
- * Retrieves the deployed contract address for a specific contract on a given chain.
36944
+ * Retrieves the deployed contract address for a specific Vana protocol contract on a given chain.
36692
36945
  *
36693
- * @param chainId - The chain ID to look up the contract on
36694
- * @param contract - The contract name to get the address for
36695
- * @returns The contract address as a hex string
36696
- * @throws {Error} When contract address not found for the specified contract and chain
36946
+ * @remarks
36947
+ * This function provides type-safe access to contract addresses across all supported Vana networks.
36948
+ * It automatically searches both current and legacy contract registries to ensure backwards
36949
+ * compatibility while providing clear error messages for unsupported combinations.
36950
+ *
36951
+ * The function validates that both the chain ID and contract name are supported before
36952
+ * attempting address lookup, helping developers identify deployment or configuration issues
36953
+ * early in the development process.
36954
+ *
36955
+ * **Supported Chains:**
36956
+ * - 14800: Vana Mainnet
36957
+ * - 1480: Moksha Testnet
36958
+ *
36959
+ * **Contract Categories:**
36960
+ * - Data Management: DataRegistry, DataRefinerRegistry
36961
+ * - Permissions: DataPortabilityPermissions, DataPortabilityServers, DataPortabilityGrantees
36962
+ * - Computing: TeePoolPhala, TeePoolDedicatedGpu, etc.
36963
+ * - Token & Governance: DATImplementation, VanaPoolStaking, etc.
36964
+ *
36965
+ * @param chainId - The chain ID to look up the contract on (14800 for mainnet, 1480 for testnet)
36966
+ * @param contract - The contract name to get the address for (use TypeScript autocomplete for available options)
36967
+ * @returns The contract address as a checksummed hex string (0x...)
36968
+ * @throws {Error} When contract address not found for the specified contract and chain combination.
36969
+ * This typically indicates the contract is not deployed on the requested network.
36697
36970
  * @example
36698
36971
  * ```typescript
36972
+ * // Get core protocol contract addresses
36973
+ * const dataRegistry = getContractAddress(14800, 'DataRegistry');
36974
+ * const permissions = getContractAddress(14800, 'DataPortabilityPermissions');
36975
+ * const trustedServers = getContractAddress(14800, 'DataPortabilityServers');
36976
+ *
36977
+ * // Handle unsupported combinations gracefully
36699
36978
  * try {
36700
- * const dataRegistryAddress = getContractAddress(1480, 'DataRegistry');
36701
- * console.log('DataRegistry address:', dataRegistryAddress);
36979
+ * const address = getContractAddress(1480, 'DataRegistry');
36980
+ * console.log('DataRegistry testnet address:', address);
36702
36981
  * } catch (error) {
36703
- * console.error('Contract not deployed on this chain:', error.message);
36982
+ * console.error('Contract not available on testnet:', error.message);
36983
+ * // Fallback to mainnet or show user-friendly error
36704
36984
  * }
36985
+ *
36986
+ * // TypeScript provides autocomplete for contract names
36987
+ * const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
36988
+ * // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
36705
36989
  * ```
36990
+ * @category Configuration
36706
36991
  */
36707
36992
  declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
36708
36993
 
@@ -36872,6 +37157,8 @@ declare class CircuitBreaker {
36872
37157
  reset(): void;
36873
37158
  }
36874
37159
 
37160
+ /** Union type of all possible transaction results from relayer operations */
37161
+ type RelayerTransactionResult = PermissionGrantResult | PermissionRevokeResult | ServerTrustResult | ServerUntrustResult | GranteeRegisterResult | FileAddedResult;
36875
37162
  /**
36876
37163
  * Payload structure for relayer requests.
36877
37164
  * Contains the EIP-712 typed data, signature, and optional expected user address for security verification.
@@ -36893,17 +37180,20 @@ interface RelayerRequestPayload {
36893
37180
  * 1. Verifies the signature against the typed data
36894
37181
  * 2. Optionally checks the signer matches the expected user address
36895
37182
  * 3. Routes to the appropriate SDK method based on primaryType
36896
- * 4. Returns the resulting transaction hash
37183
+ * 4. Returns the transaction handle with hash and event parsing capability
36897
37184
  *
36898
37185
  * Supported transaction types:
36899
37186
  * - Permission: Permission grants
36900
37187
  * - PermissionRevoke: Permission revocations
36901
37188
  * - TrustServer: Trust server operations
36902
37189
  * - UntrustServer: Untrust server operations
37190
+ * - AddServer: Add and trust server operations
37191
+ * - RegisterGrantee: Register grantee operations
37192
+ * - ServerFilesAndPermission: Batch operation for server, files, and permissions
36903
37193
  *
36904
37194
  * @param sdk - Initialized Vana SDK instance
36905
37195
  * @param payload - Request payload containing typed data, signature, and optional security check
36906
- * @returns Promise resolving to the transaction hash
37196
+ * @returns Promise resolving to TransactionHandle with hash and event parsing capability
36907
37197
  * @throws {SignatureError} When signature verification fails or signer mismatch occurs
36908
37198
  * @throws {Error} When primaryType is unsupported or SDK operations fail
36909
37199
  * @category Server
@@ -36917,15 +37207,24 @@ interface RelayerRequestPayload {
36917
37207
  * const body = await request.json();
36918
37208
  * const vana = await createRelayerVana();
36919
37209
  *
36920
- * const txHash = await handleRelayerRequest(vana, {
37210
+ * const tx = await handleRelayerRequest(vana, {
36921
37211
  * typedData: body.typedData,
36922
37212
  * signature: body.signature,
36923
37213
  * expectedUserAddress: body.expectedUserAddress
36924
37214
  * });
36925
37215
  *
37216
+ * // Option 1: Return just the hash immediately
37217
+ * return NextResponse.json({
37218
+ * success: true,
37219
+ * transactionHash: tx.hash
37220
+ * });
37221
+ *
37222
+ * // Option 2: Wait for transaction confirmation and return event data
37223
+ * const eventData = await tx.waitForEvents();
36926
37224
  * return NextResponse.json({
36927
37225
  * success: true,
36928
- * transactionHash: txHash
37226
+ * transactionHash: tx.hash,
37227
+ * ...eventData // Include parsed event data like permissionId, fileId, etc.
36929
37228
  * });
36930
37229
  * } catch (error) {
36931
37230
  * return NextResponse.json({
@@ -36936,13 +37235,14 @@ interface RelayerRequestPayload {
36936
37235
  * }
36937
37236
  * ```
36938
37237
  */
36939
- declare function handleRelayerRequest(sdk: VanaInstance, payload: RelayerRequestPayload): Promise<Hash>;
37238
+ declare function handleRelayerRequest(sdk: VanaInstance, payload: RelayerRequestPayload): Promise<TransactionHandle<RelayerTransactionResult>>;
36940
37239
 
36941
37240
  /**
36942
37241
  * Node.js implementation of the Vana Platform Adapter
36943
37242
  *
36944
- * This implementation uses Node.js-specific libraries and configurations
36945
- * to provide crypto, PGP, and HTTP functionality.
37243
+ * WARNING: Dependencies that access globals during init
37244
+ * MUST be dynamically imported to support Turbopack.
37245
+ * See: https://github.com/vercel/next.js/issues/82632
36946
37246
  */
36947
37247
 
36948
37248
  /**
@@ -36962,6 +37262,10 @@ declare class NodePlatformAdapter implements VanaPlatformAdapter {
36962
37262
  *
36963
37263
  * This implementation uses browser-compatible libraries and configurations
36964
37264
  * to provide crypto, PGP, and HTTP functionality without Node.js dependencies.
37265
+ *
37266
+ * WARNING: Dependencies that access globals during init
37267
+ * MUST be dynamically imported to support Turbopack.
37268
+ * See: https://github.com/vercel/next.js/issues/82632
36965
37269
  */
36966
37270
 
36967
37271
  /**
@@ -37350,4 +37654,4 @@ declare function Vana(config: VanaConfig): VanaNodeImpl;
37350
37654
  */
37351
37655
  type VanaInstance = VanaNodeImpl;
37352
37656
 
37353
- 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, NodePlatformAdapter, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerRequestPayload, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaController, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryMode, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, VanaNodeImpl, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createNodePlatformAdapter, createPlatformAdapter, createPlatformAdapterFor, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, handleRelayerRequest, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };
37657
+ export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type CompleteSchema, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, NodePlatformAdapter, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerRequestPayload, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaController, type SchemaMetadata, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, TransactionHandle, type TransactionOptions, type TransactionReceipt, type Transformer, type TrustServerInput, type TrustServerParams, type TrustServerTypedData, type TrustedServer, type TrustedServerInfo, type TrustedServerQueryOptions, type UnencryptedUploadParams, type UntrustServerInput, type UntrustServerParams, type UntrustServerTypedData, type UpdateSchemaIdParams, type UpdateSchemaIdResult, type UploadEncryptedFileResult, type UploadFileParams, type UploadFileResult, type UploadParams, type UploadProgress, type UploadResult, type UserFile, UserRejectedRequestError, type ValidationErrorResponse, type ValidationResult, type Validator, Vana, type VanaChain, type VanaChainConfig, type VanaChainId, type VanaConfig, type VanaConfigWithStorage, type VanaContract, type VanaContract as VanaContractAbi, type VanaContractInstance, type VanaContractName, VanaCore, VanaCoreFactory, VanaError, type VanaInstance, VanaNodeImpl, type VanaPlatformAdapter, type WalletConfig, type WalletConfigWithStorage, __contractCache, chains, checkGrantAccess, clearContractCache, type components, convertIpfsUrl, convertIpfsUrlWithFallbacks, createAndStoreGrant, createBrowserPlatformAdapter, createGrantFile, createNodePlatformAdapter, createPlatformAdapter, createPlatformAdapterFor, createPlatformAdapterSafe, createValidatedGrant, decryptBlobWithSignedKey, decryptWithPrivateKey, decryptWithWalletPrivateKey, Vana as default, detectPlatform, encryptBlobWithSignedKey, encryptFileKey, encryptWithWalletPublicKey, extractIpfsHash, fetchAndValidateSchema, fetchWithFallbacks, formatEth, formatNumber, formatToken, generateEncryptionKey, generateEncryptionKeyPair, generatePGPKeyPair, getAbi, getAllChains, getChainConfig, getContractAddress, getContractController, getContractInfo, getEncryptionParameters, getGatewayUrls, getGrantFileHash, getGrantTimeRemaining, getPlatformCapabilities, handleRelayerRequest, hasStorageConfig, isAPIResponse, isChainConfig, isGrantExpired, isIpfsUrl, isPlatformSupported, isReplicateAPIResponse, isVanaChain, isVanaChainId, isWalletConfig, moksha, mokshaTestnet, type operations, parseReplicateOutput, type paths, retrieveAndValidateGrant, retrieveGrantFile, safeParseJSON, schemaValidator, shortenAddress, storeGrantFile, summarizeGrant, validateDataAgainstSchema, validateDataSchema, validateGrant, validateGrantExpiry, validateGrantFile, validateGranteeAccess, validateOperationAccess, vanaMainnet, type webhooks, withSignatureCache };