@opendatalabs/vana-sdk 0.1.0-alpha.603cc4b → 0.1.0-alpha.606fa2d
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.
- package/README.md +13 -4
- package/dist/{browser-DY8XDblx.d.ts → browser-Bb8gLWHp.d.ts} +61 -14
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +723 -106
- package/dist/browser.js.map +1 -1
- package/dist/index.browser.d.ts +1247 -193
- package/dist/index.browser.js +39392 -37767
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +35775 -34034
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.cts +1033 -199
- package/dist/index.node.d.ts +1033 -199
- package/dist/index.node.js +39577 -37827
- package/dist/index.node.js.map +1 -1
- package/dist/node.cjs +692 -53
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +704 -52
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.d.ts +2 -2
- package/dist/platform.browser.js +780 -116
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.cjs +933 -156
- package/dist/platform.cjs.map +1 -1
- package/dist/platform.js +945 -156
- package/dist/platform.js.map +1 -1
- package/dist/platform.node.cjs +933 -156
- package/dist/platform.node.cjs.map +1 -1
- package/dist/platform.node.d.cts +61 -14
- package/dist/platform.node.d.ts +61 -14
- package/dist/platform.node.js +945 -156
- package/dist/platform.node.js.map +1 -1
- package/package.json +31 -15
package/dist/index.node.d.cts
CHANGED
|
@@ -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
|
|
|
@@ -984,6 +984,8 @@ interface ServerFilesAndPermissionParams {
|
|
|
984
984
|
grant: string;
|
|
985
985
|
/** File URLs */
|
|
986
986
|
fileUrls: string[];
|
|
987
|
+
/** Schema IDs for each file - use 0 for files without schema validation */
|
|
988
|
+
schemaIds: number[];
|
|
987
989
|
/** Server address */
|
|
988
990
|
serverAddress: Address;
|
|
989
991
|
/** Server URL */
|
|
@@ -1009,6 +1011,8 @@ interface ServerFilesAndPermissionTypedData extends GenericTypedData {
|
|
|
1009
1011
|
grant: string;
|
|
1010
1012
|
/** File URLs */
|
|
1011
1013
|
fileUrls: string[];
|
|
1014
|
+
/** Schema IDs for each file - use 0 for files without schema validation */
|
|
1015
|
+
schemaIds: bigint[];
|
|
1012
1016
|
/** Server address */
|
|
1013
1017
|
serverAddress: Address;
|
|
1014
1018
|
/** Server URL */
|
|
@@ -2159,33 +2163,84 @@ interface BatchUploadResult {
|
|
|
2159
2163
|
errors?: string[];
|
|
2160
2164
|
}
|
|
2161
2165
|
/**
|
|
2162
|
-
*
|
|
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.
|
|
2163
2199
|
*
|
|
2164
2200
|
* Schemas define the structure and validation rules for user data processed by refiners.
|
|
2165
2201
|
* They ensure data quality and consistency across the Vana network by specifying how
|
|
2166
2202
|
* raw user data should be formatted, validated, and processed.
|
|
2167
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
|
+
*
|
|
2168
2207
|
* @category Data Management
|
|
2169
2208
|
* @example
|
|
2170
2209
|
* ```typescript
|
|
2171
|
-
*
|
|
2210
|
+
* // Complete schema from schemas.get()
|
|
2211
|
+
* const completeSchema: Schema = {
|
|
2172
2212
|
* id: 5,
|
|
2173
2213
|
* name: 'Social Media Profile',
|
|
2174
|
-
*
|
|
2175
|
-
*
|
|
2176
|
-
*
|
|
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 = {
|
|
2228
|
+
* id: 5,
|
|
2229
|
+
* name: 'Social Media Profile',
|
|
2230
|
+
* dialect: 'json',
|
|
2231
|
+
* definitionUrl: 'ipfs://QmSchema...'
|
|
2177
2232
|
* };
|
|
2178
2233
|
* ```
|
|
2179
2234
|
*/
|
|
2180
|
-
interface Schema {
|
|
2181
|
-
/**
|
|
2182
|
-
|
|
2183
|
-
/**
|
|
2184
|
-
|
|
2185
|
-
/**
|
|
2186
|
-
|
|
2187
|
-
/**
|
|
2188
|
-
|
|
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;
|
|
2189
2244
|
}
|
|
2190
2245
|
/**
|
|
2191
2246
|
* Represents a refiner with schema information
|
|
@@ -2441,6 +2496,18 @@ declare const contractAbis: {
|
|
|
2441
2496
|
}];
|
|
2442
2497
|
readonly name: "InvalidPermissionsLength";
|
|
2443
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";
|
|
2444
2511
|
}, {
|
|
2445
2512
|
readonly inputs: readonly [];
|
|
2446
2513
|
readonly name: "InvalidSignature";
|
|
@@ -2717,6 +2784,10 @@ declare const contractAbis: {
|
|
|
2717
2784
|
readonly internalType: "string[]";
|
|
2718
2785
|
readonly name: "fileUrls";
|
|
2719
2786
|
readonly type: "string[]";
|
|
2787
|
+
}, {
|
|
2788
|
+
readonly internalType: "uint256[]";
|
|
2789
|
+
readonly name: "schemaIds";
|
|
2790
|
+
readonly type: "uint256[]";
|
|
2720
2791
|
}, {
|
|
2721
2792
|
readonly internalType: "address";
|
|
2722
2793
|
readonly name: "serverAddress";
|
|
@@ -3699,7 +3770,7 @@ declare const contractAbis: {
|
|
|
3699
3770
|
readonly name: "addServerInput";
|
|
3700
3771
|
readonly type: "tuple";
|
|
3701
3772
|
}];
|
|
3702
|
-
readonly name: "
|
|
3773
|
+
readonly name: "addAndTrustServerByManager";
|
|
3703
3774
|
readonly outputs: readonly [];
|
|
3704
3775
|
readonly stateMutability: "nonpayable";
|
|
3705
3776
|
readonly type: "function";
|
|
@@ -4087,6 +4158,20 @@ declare const contractAbis: {
|
|
|
4087
4158
|
readonly outputs: readonly [];
|
|
4088
4159
|
readonly stateMutability: "nonpayable";
|
|
4089
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";
|
|
4090
4175
|
}, {
|
|
4091
4176
|
readonly inputs: readonly [{
|
|
4092
4177
|
readonly components: readonly [{
|
|
@@ -28710,6 +28795,95 @@ type VanaContract = keyof ContractAbis;
|
|
|
28710
28795
|
*/
|
|
28711
28796
|
declare function getAbi<T extends VanaContract>(contract: T): ContractAbis[T];
|
|
28712
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
|
+
|
|
28713
28887
|
/**
|
|
28714
28888
|
* Base interface for all transaction results.
|
|
28715
28889
|
* Contains the event data plus transaction metadata.
|
|
@@ -28747,6 +28921,62 @@ interface PermissionRevokeResult extends BaseTransactionResult {
|
|
|
28747
28921
|
/** ID of the permission that was revoked */
|
|
28748
28922
|
permissionId: bigint;
|
|
28749
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
|
+
}
|
|
28750
28980
|
/**
|
|
28751
28981
|
* Result of a successful file permission addition operation.
|
|
28752
28982
|
* Contains data from the FilePermissionAdded blockchain event.
|
|
@@ -28760,6 +28990,80 @@ interface FilePermissionResult extends BaseTransactionResult {
|
|
|
28760
28990
|
encryptedKey: string;
|
|
28761
28991
|
}
|
|
28762
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
|
+
|
|
28763
29067
|
/**
|
|
28764
29068
|
* Google Drive Storage Provider for Vana SDK
|
|
28765
29069
|
*
|
|
@@ -29798,30 +30102,31 @@ declare class PermissionsController {
|
|
|
29798
30102
|
*/
|
|
29799
30103
|
grant(params: GrantPermissionParams$1): Promise<PermissionGrantResult>;
|
|
29800
30104
|
/**
|
|
29801
|
-
* Submits a permission grant transaction and returns
|
|
30105
|
+
* Submits a permission grant transaction and returns a handle for flexible result access.
|
|
29802
30106
|
*
|
|
29803
|
-
*
|
|
29804
|
-
*
|
|
29805
|
-
*
|
|
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.
|
|
29806
30111
|
*
|
|
29807
30112
|
* @param params - The permission grant configuration object
|
|
29808
|
-
* @returns Promise
|
|
30113
|
+
* @returns Promise resolving to TransactionHandle with hash and event parsing capabilities
|
|
29809
30114
|
* @throws {RelayerError} When gasless transaction submission fails
|
|
29810
30115
|
* @throws {SignatureError} When user rejects the signature request
|
|
29811
30116
|
* @throws {SerializationError} When grant data cannot be serialized
|
|
29812
30117
|
* @throws {BlockchainError} When permission grant preparation fails
|
|
29813
30118
|
* @example
|
|
29814
30119
|
* ```typescript
|
|
29815
|
-
* // Submit transaction and
|
|
29816
|
-
* const
|
|
29817
|
-
* console.log(`Transaction submitted: ${
|
|
30120
|
+
* // Submit transaction and get immediate hash access
|
|
30121
|
+
* const tx = await vana.permissions.submitPermissionGrant(params);
|
|
30122
|
+
* console.log(`Transaction submitted: ${tx.hash}`);
|
|
29818
30123
|
*
|
|
29819
|
-
* //
|
|
29820
|
-
* const
|
|
29821
|
-
* console.log(`Permission ID: ${
|
|
30124
|
+
* // Optionally wait for and parse events
|
|
30125
|
+
* const eventData = await tx.waitForEvents();
|
|
30126
|
+
* console.log(`Permission ID: ${eventData.permissionId}`);
|
|
29822
30127
|
* ```
|
|
29823
30128
|
*/
|
|
29824
|
-
submitPermissionGrant(params: GrantPermissionParams$1): Promise<
|
|
30129
|
+
submitPermissionGrant(params: GrantPermissionParams$1): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
29825
30130
|
/**
|
|
29826
30131
|
* Prepares a permission grant with preview before signing.
|
|
29827
30132
|
*
|
|
@@ -29849,15 +30154,21 @@ declare class PermissionsController {
|
|
|
29849
30154
|
*/
|
|
29850
30155
|
prepareGrant(params: GrantPermissionParams$1): Promise<{
|
|
29851
30156
|
preview: GrantFile;
|
|
29852
|
-
confirm: () => Promise<
|
|
30157
|
+
confirm: () => Promise<TransactionHandle<PermissionGrantResult>>;
|
|
29853
30158
|
}>;
|
|
29854
30159
|
/**
|
|
29855
|
-
*
|
|
29856
|
-
*
|
|
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.
|
|
29857
30165
|
*
|
|
29858
30166
|
* @param params - The permission grant parameters containing user and operation details
|
|
29859
30167
|
* @param grantFile - The prepared grant file with permissions and metadata
|
|
29860
|
-
* @returns Promise resolving to
|
|
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
|
|
29861
30172
|
*/
|
|
29862
30173
|
private confirmGrantInternal;
|
|
29863
30174
|
/**
|
|
@@ -29913,49 +30224,106 @@ declare class PermissionsController {
|
|
|
29913
30224
|
* );
|
|
29914
30225
|
* ```
|
|
29915
30226
|
*/
|
|
29916
|
-
submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<
|
|
30227
|
+
submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
29917
30228
|
/**
|
|
29918
30229
|
* Submits an already-signed trust server transaction to the blockchain.
|
|
30230
|
+
*
|
|
30231
|
+
* @remarks
|
|
29919
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.
|
|
29920
30234
|
*
|
|
29921
30235
|
* @param typedData - The EIP-712 typed data for TrustServer
|
|
29922
|
-
* @param signature - The user's signature
|
|
29923
|
-
* @returns Promise resolving to
|
|
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
|
+
* ```
|
|
29924
30248
|
*/
|
|
29925
|
-
submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<
|
|
30249
|
+
submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
|
|
29926
30250
|
/**
|
|
29927
30251
|
* Submits an already-signed add and trust server transaction to the blockchain.
|
|
30252
|
+
*
|
|
30253
|
+
* @remarks
|
|
29928
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.
|
|
29929
30256
|
*
|
|
29930
30257
|
* @param typedData - The EIP-712 typed data for AddAndTrustServer
|
|
29931
|
-
* @param signature - The user's signature
|
|
29932
|
-
* @returns Promise resolving to
|
|
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
|
+
* ```
|
|
29933
30270
|
*/
|
|
29934
|
-
submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<
|
|
30271
|
+
submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionHandle<ServerTrustResult>>;
|
|
29935
30272
|
/**
|
|
29936
30273
|
* Submits an already-signed permission revoke transaction to the blockchain.
|
|
30274
|
+
*
|
|
30275
|
+
* @remarks
|
|
29937
30276
|
* This method handles the revocation of previously granted permissions.
|
|
30277
|
+
* Used internally by revocation methods after signature collection.
|
|
29938
30278
|
*
|
|
29939
30279
|
* @param typedData - The EIP-712 typed data for PermissionRevoke
|
|
29940
|
-
* @param signature - The user's signature
|
|
29941
|
-
* @returns Promise resolving to
|
|
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
|
+
* ```
|
|
29942
30292
|
*/
|
|
29943
|
-
submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<
|
|
30293
|
+
submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
29944
30294
|
/**
|
|
29945
30295
|
* Submits an already-signed untrust server transaction to the blockchain.
|
|
30296
|
+
*
|
|
30297
|
+
* @remarks
|
|
29946
30298
|
* This method handles the removal of trusted servers.
|
|
30299
|
+
* Used internally by untrust server methods after signature collection.
|
|
29947
30300
|
*
|
|
29948
30301
|
* @param typedData - The EIP-712 typed data for UntrustServer
|
|
29949
|
-
* @param signature - The user's signature
|
|
29950
|
-
* @returns Promise resolving to
|
|
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
|
+
* ```
|
|
29951
30314
|
*/
|
|
29952
|
-
submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<
|
|
30315
|
+
submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<ServerUntrustResult>>;
|
|
29953
30316
|
/**
|
|
29954
30317
|
* Submits a signed transaction directly to the blockchain.
|
|
29955
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
|
+
*
|
|
29956
30323
|
* @param typedData - The typed data structure for the permission grant
|
|
29957
30324
|
* @param signature - The cryptographic signature authorizing the transaction
|
|
29958
30325
|
* @returns Promise resolving to the transaction hash
|
|
30326
|
+
* @throws {BlockchainError} When contract submission fails
|
|
29959
30327
|
*/
|
|
29960
30328
|
private submitDirectTransaction;
|
|
29961
30329
|
/**
|
|
@@ -30002,19 +30370,33 @@ declare class PermissionsController {
|
|
|
30002
30370
|
* console.log(`Revocation submitted: ${txHash}`);
|
|
30003
30371
|
* ```
|
|
30004
30372
|
*/
|
|
30005
|
-
submitPermissionRevoke(params: RevokePermissionParams): Promise<
|
|
30373
|
+
submitPermissionRevoke(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
30006
30374
|
/**
|
|
30007
|
-
* Revokes a permission with a signature
|
|
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.
|
|
30008
30381
|
*
|
|
30009
30382
|
* @param params - Parameters for revoking the permission
|
|
30010
|
-
* @
|
|
30383
|
+
* @param params.permissionId - Permission identifier to revoke (accepts bigint, number, or string)
|
|
30384
|
+
* @returns Promise resolving to TransactionHandle for transaction tracking
|
|
30011
30385
|
* @throws {BlockchainError} When chain ID is not available
|
|
30012
30386
|
* @throws {NonceError} When retrieving user nonce fails
|
|
30013
30387
|
* @throws {SignatureError} When user rejects the signature request
|
|
30014
30388
|
* @throws {RelayerError} When gasless submission fails
|
|
30015
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
|
+
* ```
|
|
30016
30398
|
*/
|
|
30017
|
-
submitRevokeWithSignature(params: RevokePermissionParams): Promise<
|
|
30399
|
+
submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
30018
30400
|
/**
|
|
30019
30401
|
* @deprecated Use getPermissionsUserNonce() for permission operations or getServersUserNonce() for server operations
|
|
30020
30402
|
*
|
|
@@ -30039,6 +30421,18 @@ declare class PermissionsController {
|
|
|
30039
30421
|
* const serversNonce = await this.getServersUserNonce();
|
|
30040
30422
|
* ```
|
|
30041
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
|
+
*/
|
|
30042
30436
|
private getUserNonce;
|
|
30043
30437
|
/**
|
|
30044
30438
|
* Retrieves the user's current nonce from the DataPortabilityServers contract.
|
|
@@ -30054,6 +30448,16 @@ declare class PermissionsController {
|
|
|
30054
30448
|
* console.log(`Current servers nonce: ${nonce}`);
|
|
30055
30449
|
* ```
|
|
30056
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
|
+
*/
|
|
30057
30461
|
private getServersUserNonce;
|
|
30058
30462
|
/**
|
|
30059
30463
|
* Retrieves the user's current nonce from the DataPortabilityPermissions contract.
|
|
@@ -30069,6 +30473,16 @@ declare class PermissionsController {
|
|
|
30069
30473
|
* console.log(`Current permissions nonce: ${nonce}`);
|
|
30070
30474
|
* ```
|
|
30071
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
|
+
*/
|
|
30072
30486
|
private getPermissionsUserNonce;
|
|
30073
30487
|
/**
|
|
30074
30488
|
* Composes the EIP-712 typed data for PermissionGrant (new simplified format).
|
|
@@ -30090,6 +30504,7 @@ declare class PermissionsController {
|
|
|
30090
30504
|
* @param params.granteeId - Grantee ID
|
|
30091
30505
|
* @param params.grant - Grant URL or grant data
|
|
30092
30506
|
* @param params.fileUrls - Array of file URLs
|
|
30507
|
+
* @param params.schemaIds - Schema IDs for each file
|
|
30093
30508
|
* @param params.serverAddress - Server address
|
|
30094
30509
|
* @param params.serverUrl - Server URL
|
|
30095
30510
|
* @param params.serverPublicKey - Server public key
|
|
@@ -30195,7 +30610,7 @@ declare class PermissionsController {
|
|
|
30195
30610
|
* console.log('Now trusting servers:', trustedServers);
|
|
30196
30611
|
* ```
|
|
30197
30612
|
*/
|
|
30198
|
-
addAndTrustServer(params: AddAndTrustServerParams): Promise<
|
|
30613
|
+
addAndTrustServer(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30199
30614
|
/**
|
|
30200
30615
|
* Trusts a server for data processing (legacy method).
|
|
30201
30616
|
*
|
|
@@ -30203,14 +30618,14 @@ declare class PermissionsController {
|
|
|
30203
30618
|
* @returns Promise resolving to transaction hash
|
|
30204
30619
|
* @deprecated Use addAndTrustServer instead
|
|
30205
30620
|
*/
|
|
30206
|
-
submitTrustServer(params: TrustServerParams): Promise<
|
|
30621
|
+
submitTrustServer(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30207
30622
|
/**
|
|
30208
30623
|
* Adds and trusts a server using a signature (gasless transaction).
|
|
30209
30624
|
*
|
|
30210
30625
|
* @param params - Parameters for adding and trusting the server
|
|
30211
|
-
* @returns Promise resolving to
|
|
30626
|
+
* @returns Promise resolving to TransactionHandle with ServerTrustResult event data
|
|
30212
30627
|
*/
|
|
30213
|
-
submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<
|
|
30628
|
+
submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30214
30629
|
/**
|
|
30215
30630
|
* Trusts a server using a signature (gasless transaction - legacy method).
|
|
30216
30631
|
*
|
|
@@ -30224,13 +30639,24 @@ declare class PermissionsController {
|
|
|
30224
30639
|
* @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
|
|
30225
30640
|
* @throws {BlockchainError} When trust operation fails for any other reason
|
|
30226
30641
|
*/
|
|
30227
|
-
submitTrustServerWithSignature(params: TrustServerParams): Promise<
|
|
30642
|
+
submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionHandle<ServerTrustResult>>;
|
|
30228
30643
|
/**
|
|
30229
30644
|
* Submits a direct untrust server transaction (without signature).
|
|
30230
30645
|
*
|
|
30231
30646
|
* @param params - The untrust server parameters containing server details
|
|
30232
30647
|
* @returns Promise resolving to the transaction hash
|
|
30233
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
|
+
*/
|
|
30234
30660
|
private submitDirectUntrustTransaction;
|
|
30235
30661
|
/**
|
|
30236
30662
|
* Removes a server from the user's trusted servers list in the DataPortabilityServers contract.
|
|
@@ -30260,7 +30686,7 @@ declare class PermissionsController {
|
|
|
30260
30686
|
* console.log('Still trusting servers:', trustedServers);
|
|
30261
30687
|
* ```
|
|
30262
30688
|
*/
|
|
30263
|
-
submitUntrustServer(params: UntrustServerParams): Promise<
|
|
30689
|
+
submitUntrustServer(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
|
|
30264
30690
|
/**
|
|
30265
30691
|
* Untrusts a server using a signature (gasless transaction).
|
|
30266
30692
|
*
|
|
@@ -30273,7 +30699,7 @@ declare class PermissionsController {
|
|
|
30273
30699
|
* @throws {RelayerError} When gasless submission fails
|
|
30274
30700
|
* @throws {BlockchainError} When untrust transaction fails
|
|
30275
30701
|
*/
|
|
30276
|
-
submitUntrustServerWithSignature(params: UntrustServerParams): Promise<
|
|
30702
|
+
submitUntrustServerWithSignature(params: UntrustServerParams): Promise<TransactionHandle<ServerUntrustResult>>;
|
|
30277
30703
|
/**
|
|
30278
30704
|
* Retrieves all servers trusted by a user from the DataPortabilityServers contract.
|
|
30279
30705
|
*
|
|
@@ -30324,22 +30750,60 @@ declare class PermissionsController {
|
|
|
30324
30750
|
/**
|
|
30325
30751
|
* Gets server information for multiple servers efficiently.
|
|
30326
30752
|
*
|
|
30327
|
-
* @
|
|
30328
|
-
*
|
|
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
|
|
30329
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
|
+
* ```
|
|
30330
30775
|
*/
|
|
30331
30776
|
getServerInfoBatch(serverIds: number[]): Promise<BatchServerInfoResult>;
|
|
30332
30777
|
/**
|
|
30333
30778
|
* Checks whether a specific server is trusted by a user.
|
|
30334
30779
|
*
|
|
30335
|
-
* @
|
|
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
|
|
30336
30786
|
* @param userAddress - Optional user address (defaults to current user)
|
|
30337
|
-
* @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
|
+
* ```
|
|
30338
30798
|
*/
|
|
30339
30799
|
checkServerTrustStatus(serverId: number, userAddress?: Address): Promise<ServerTrustStatus>;
|
|
30340
30800
|
/**
|
|
30341
30801
|
* Composes EIP-712 typed data for AddAndTrustServer.
|
|
30342
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
|
+
*
|
|
30343
30807
|
* @param input - The add and trust server input data containing server details
|
|
30344
30808
|
* @returns Promise resolving to the typed data structure for server add and trust
|
|
30345
30809
|
*/
|
|
@@ -30421,7 +30885,7 @@ declare class PermissionsController {
|
|
|
30421
30885
|
* console.log(`Grantee registered in transaction: ${txHash}`);
|
|
30422
30886
|
* ```
|
|
30423
30887
|
*/
|
|
30424
|
-
submitRegisterGrantee(params: RegisterGranteeParams): Promise<
|
|
30888
|
+
submitRegisterGrantee(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
|
|
30425
30889
|
/**
|
|
30426
30890
|
* Registers a grantee with a signature (gasless transaction)
|
|
30427
30891
|
*
|
|
@@ -30437,7 +30901,7 @@ declare class PermissionsController {
|
|
|
30437
30901
|
* });
|
|
30438
30902
|
* ```
|
|
30439
30903
|
*/
|
|
30440
|
-
submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<
|
|
30904
|
+
submitRegisterGranteeWithSignature(params: RegisterGranteeParams): Promise<TransactionHandle<GranteeRegisterResult>>;
|
|
30441
30905
|
/**
|
|
30442
30906
|
* Submits a signed register grantee transaction via relayer
|
|
30443
30907
|
*
|
|
@@ -30450,7 +30914,7 @@ declare class PermissionsController {
|
|
|
30450
30914
|
* const result = await vana.permissions.submitSignedRegisterGrantee(typedData, signature);
|
|
30451
30915
|
* ```
|
|
30452
30916
|
*/
|
|
30453
|
-
submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<
|
|
30917
|
+
submitSignedRegisterGrantee(typedData: RegisterGranteeTypedData, signature: Hash): Promise<TransactionHandle<GranteeRegisterResult>>;
|
|
30454
30918
|
/**
|
|
30455
30919
|
* Retrieves all registered grantees from the DataPortabilityGrantees contract.
|
|
30456
30920
|
*
|
|
@@ -30737,7 +31201,7 @@ declare class PermissionsController {
|
|
|
30737
31201
|
* @param url - New URL for the server
|
|
30738
31202
|
* @returns Promise resolving to transaction hash
|
|
30739
31203
|
*/
|
|
30740
|
-
submitUpdateServer(serverId: bigint, url: string): Promise<
|
|
31204
|
+
submitUpdateServer(serverId: bigint, url: string): Promise<TransactionHandle<ServerUpdateResult>>;
|
|
30741
31205
|
/**
|
|
30742
31206
|
* Get all permission IDs for a user
|
|
30743
31207
|
*
|
|
@@ -30777,49 +31241,106 @@ declare class PermissionsController {
|
|
|
30777
31241
|
* @throws {BlockchainError} When permission addition fails
|
|
30778
31242
|
* @throws {NetworkError} When network communication fails
|
|
30779
31243
|
*/
|
|
30780
|
-
submitAddPermission(params: ServerFilesAndPermissionParams): Promise<
|
|
31244
|
+
submitAddPermission(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30781
31245
|
/**
|
|
30782
31246
|
* Submits an already-signed add permission transaction to the blockchain.
|
|
30783
31247
|
* This method supports both relayer-based gasless transactions and direct transactions.
|
|
30784
31248
|
*
|
|
30785
31249
|
* @param typedData - The EIP-712 typed data for AddPermission
|
|
30786
31250
|
* @param signature - The user's signature
|
|
30787
|
-
* @returns Promise resolving to
|
|
31251
|
+
* @returns Promise resolving to TransactionHandle with PermissionGrantResult event data
|
|
30788
31252
|
* @throws {RelayerError} When gasless transaction submission fails
|
|
30789
31253
|
* @throws {BlockchainError} When permission addition fails
|
|
30790
31254
|
* @throws {NetworkError} When network communication fails
|
|
30791
31255
|
*/
|
|
30792
|
-
submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<
|
|
31256
|
+
submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30793
31257
|
/**
|
|
30794
|
-
*
|
|
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.
|
|
30795
31265
|
*
|
|
30796
31266
|
* @param params - Parameters for adding server files and permissions
|
|
30797
|
-
* @
|
|
30798
|
-
* @
|
|
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.
|
|
30799
31283
|
* @throws {SignatureError} When user rejects the signature request
|
|
30800
31284
|
* @throws {BlockchainError} When server files and permissions addition fails
|
|
30801
|
-
* @throws {NetworkError} When network communication 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
|
+
* ```
|
|
30802
31306
|
*/
|
|
30803
|
-
submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<
|
|
31307
|
+
submitAddServerFilesAndPermissions(params: ServerFilesAndPermissionParams): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30804
31308
|
/**
|
|
30805
31309
|
* Submits an already-signed add server files and permissions transaction to the blockchain.
|
|
30806
|
-
*
|
|
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.
|
|
30807
31315
|
*
|
|
30808
31316
|
* @param typedData - The EIP-712 typed data for AddServerFilesAndPermissions
|
|
30809
31317
|
* @param signature - The user's signature
|
|
30810
|
-
* @returns
|
|
31318
|
+
* @returns TransactionHandle with immediate hash access and optional event parsing
|
|
30811
31319
|
* @throws {RelayerError} When gasless transaction submission fails
|
|
30812
31320
|
* @throws {BlockchainError} When server files and permissions addition fails
|
|
30813
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
|
+
* ```
|
|
30814
31335
|
*/
|
|
30815
|
-
submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<
|
|
31336
|
+
submitSignedAddServerFilesAndPermissions(typedData: ServerFilesAndPermissionTypedData, signature: Hash): Promise<TransactionHandle<PermissionGrantResult>>;
|
|
30816
31337
|
/**
|
|
30817
31338
|
* Submit permission revocation with signature to the blockchain
|
|
30818
31339
|
*
|
|
30819
31340
|
* @param permissionId - Permission ID to revoke
|
|
30820
31341
|
* @returns Promise resolving to transaction hash
|
|
30821
31342
|
*/
|
|
30822
|
-
submitRevokePermission(permissionId: bigint): Promise<
|
|
31343
|
+
submitRevokePermission(permissionId: bigint): Promise<TransactionHandle<PermissionRevokeResult>>;
|
|
30823
31344
|
/**
|
|
30824
31345
|
* Submits a signed add permission transaction directly to the blockchain.
|
|
30825
31346
|
*
|
|
@@ -30849,10 +31370,10 @@ declare class PermissionsController {
|
|
|
30849
31370
|
interface CreateSchemaParams {
|
|
30850
31371
|
/** The name of the schema */
|
|
30851
31372
|
name: string;
|
|
30852
|
-
/** The
|
|
30853
|
-
|
|
31373
|
+
/** The dialect of the schema (e.g., 'json' or 'sqlite') */
|
|
31374
|
+
dialect: "json" | "sqlite";
|
|
30854
31375
|
/** The schema definition object or JSON string */
|
|
30855
|
-
|
|
31376
|
+
schema: object | string;
|
|
30856
31377
|
}
|
|
30857
31378
|
/**
|
|
30858
31379
|
* Result of creating a new schema.
|
|
@@ -30897,8 +31418,8 @@ interface CreateSchemaResult {
|
|
|
30897
31418
|
* // Create a new schema with automatic IPFS upload
|
|
30898
31419
|
* const result = await vana.schemas.create({
|
|
30899
31420
|
* name: "User Profile",
|
|
30900
|
-
*
|
|
30901
|
-
*
|
|
31421
|
+
* dialect: "json",
|
|
31422
|
+
* schema: {
|
|
30902
31423
|
* type: "object",
|
|
30903
31424
|
* properties: {
|
|
30904
31425
|
* name: { type: "string" },
|
|
@@ -30933,7 +31454,7 @@ declare class SchemaController {
|
|
|
30933
31454
|
* - Uploads the definition to IPFS to generate a permanent URL
|
|
30934
31455
|
* - Registers the schema on the blockchain with the generated URL
|
|
30935
31456
|
*
|
|
30936
|
-
* @param params - Schema creation parameters including name,
|
|
31457
|
+
* @param params - Schema creation parameters including name, dialect, and definition
|
|
30937
31458
|
* @returns Promise resolving to creation results with schema ID and transaction hash
|
|
30938
31459
|
* @throws {SchemaValidationError} When the schema definition is invalid
|
|
30939
31460
|
* @throws {Error} When IPFS upload or blockchain registration fails
|
|
@@ -30942,8 +31463,8 @@ declare class SchemaController {
|
|
|
30942
31463
|
* // Create a JSON schema for user profiles
|
|
30943
31464
|
* const result = await vana.schemas.create({
|
|
30944
31465
|
* name: "User Profile",
|
|
30945
|
-
*
|
|
30946
|
-
*
|
|
31466
|
+
* dialect: "json",
|
|
31467
|
+
* schema: {
|
|
30947
31468
|
* type: "object",
|
|
30948
31469
|
* properties: {
|
|
30949
31470
|
* name: { type: "string" },
|
|
@@ -30958,27 +31479,28 @@ declare class SchemaController {
|
|
|
30958
31479
|
*/
|
|
30959
31480
|
create(params: CreateSchemaParams): Promise<CreateSchemaResult>;
|
|
30960
31481
|
/**
|
|
30961
|
-
* Retrieves a schema by its ID.
|
|
31482
|
+
* Retrieves a complete schema by its ID with definition fetched and flattened.
|
|
30962
31483
|
*
|
|
30963
31484
|
* @param schemaId - The ID of the schema to retrieve
|
|
30964
31485
|
* @param options - Optional parameters
|
|
30965
31486
|
* @param options.subgraphUrl - Custom subgraph URL to use instead of default
|
|
30966
|
-
* @returns Promise resolving to the schema object
|
|
30967
|
-
* @throws {Error} When the schema is not found or chain is unavailable
|
|
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
|
|
30968
31489
|
* @example
|
|
30969
31490
|
* ```typescript
|
|
30970
31491
|
* const schema = await vana.schemas.get(1);
|
|
30971
|
-
* console.log(`Schema: ${schema.name} (${schema.
|
|
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);
|
|
30972
31496
|
*
|
|
30973
|
-
* //
|
|
30974
|
-
*
|
|
30975
|
-
* subgraphUrl: 'https://custom-subgraph.com/graphql'
|
|
30976
|
-
* });
|
|
31497
|
+
* // Use directly with validator (schema has all required fields)
|
|
31498
|
+
* validator.validateDataAgainstSchema(data, schema);
|
|
30977
31499
|
* ```
|
|
30978
31500
|
*/
|
|
30979
31501
|
get(schemaId: number, options?: {
|
|
30980
31502
|
subgraphUrl?: string;
|
|
30981
|
-
}): Promise<
|
|
31503
|
+
}): Promise<CompleteSchema>;
|
|
30982
31504
|
/**
|
|
30983
31505
|
* Gets the total number of schemas registered on the network.
|
|
30984
31506
|
*
|
|
@@ -31007,27 +31529,25 @@ declare class SchemaController {
|
|
|
31007
31529
|
* @param options.limit - Maximum number of schemas to return
|
|
31008
31530
|
* @param options.offset - Number of schemas to skip
|
|
31009
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)
|
|
31010
31533
|
* @returns Promise resolving to an array of schemas
|
|
31011
31534
|
* @example
|
|
31012
31535
|
* ```typescript
|
|
31013
|
-
* // Get all schemas
|
|
31536
|
+
* // Get all schemas (without definitions for performance)
|
|
31014
31537
|
* const schemas = await vana.schemas.list();
|
|
31015
31538
|
*
|
|
31539
|
+
* // Get schemas with definitions
|
|
31540
|
+
* const schemas = await vana.schemas.list({ includeDefinitions: true });
|
|
31541
|
+
*
|
|
31016
31542
|
* // Get schemas with pagination
|
|
31017
31543
|
* const schemas = await vana.schemas.list({ limit: 10, offset: 0 });
|
|
31018
|
-
*
|
|
31019
|
-
* // With custom subgraph
|
|
31020
|
-
* const schemas = await vana.schemas.list({
|
|
31021
|
-
* limit: 10,
|
|
31022
|
-
* offset: 0,
|
|
31023
|
-
* subgraphUrl: 'https://custom-subgraph.com/graphql'
|
|
31024
|
-
* });
|
|
31025
31544
|
* ```
|
|
31026
31545
|
*/
|
|
31027
31546
|
list(options?: {
|
|
31028
31547
|
limit?: number;
|
|
31029
31548
|
offset?: number;
|
|
31030
31549
|
subgraphUrl?: string;
|
|
31550
|
+
includeDefinitions?: boolean;
|
|
31031
31551
|
}): Promise<Schema[]>;
|
|
31032
31552
|
/**
|
|
31033
31553
|
* Adds a schema using the legacy method (low-level API).
|
|
@@ -31074,6 +31594,13 @@ declare class SchemaController {
|
|
|
31074
31594
|
* @returns Promise resolving to the user's address
|
|
31075
31595
|
*/
|
|
31076
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;
|
|
31077
31604
|
}
|
|
31078
31605
|
|
|
31079
31606
|
/**
|
|
@@ -31148,34 +31675,30 @@ declare class SchemaValidator {
|
|
|
31148
31675
|
*/
|
|
31149
31676
|
validateDataSchema(schema: unknown): asserts schema is DataSchema;
|
|
31150
31677
|
/**
|
|
31151
|
-
* Validates data against a JSON Schema from a
|
|
31678
|
+
* Validates data against a JSON Schema from a schema
|
|
31152
31679
|
*
|
|
31153
31680
|
* @param data - The data to validate
|
|
31154
|
-
* @param schema - The
|
|
31681
|
+
* @param schema - The schema containing the validation rules (DataSchema or Schema)
|
|
31155
31682
|
* @throws SchemaValidationError if invalid
|
|
31156
31683
|
* @example
|
|
31157
31684
|
* ```typescript
|
|
31158
31685
|
* const validator = new SchemaValidator();
|
|
31159
31686
|
*
|
|
31160
|
-
*
|
|
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 = {
|
|
31161
31693
|
* name: "User Profile",
|
|
31162
31694
|
* version: "1.0.0",
|
|
31163
31695
|
* dialect: "json",
|
|
31164
|
-
* schema: {
|
|
31165
|
-
* type: "object",
|
|
31166
|
-
* properties: {
|
|
31167
|
-
* name: { type: "string" },
|
|
31168
|
-
* age: { type: "number" }
|
|
31169
|
-
* },
|
|
31170
|
-
* required: ["name"]
|
|
31171
|
-
* }
|
|
31696
|
+
* schema: { type: "object", properties: { name: { type: "string" } } }
|
|
31172
31697
|
* };
|
|
31173
|
-
*
|
|
31174
|
-
* const userData = { name: "Alice", age: 30 };
|
|
31175
|
-
* validator.validateDataAgainstSchema(userData, schema);
|
|
31698
|
+
* validator.validateDataAgainstSchema(userData, dataSchema);
|
|
31176
31699
|
* ```
|
|
31177
31700
|
*/
|
|
31178
|
-
validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
|
|
31701
|
+
validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
|
|
31179
31702
|
/**
|
|
31180
31703
|
* Validates a SQLite DDL string for basic syntax
|
|
31181
31704
|
* Note: This is a basic validation, full SQL parsing would require a proper SQL parser
|
|
@@ -31219,7 +31742,7 @@ declare function validateDataSchema(schema: unknown): asserts schema is DataSche
|
|
|
31219
31742
|
* @returns void - Function doesn't return a value
|
|
31220
31743
|
* @throws SchemaValidationError if invalid
|
|
31221
31744
|
*/
|
|
31222
|
-
declare function validateDataAgainstSchema(data: unknown, schema: DataSchema): void;
|
|
31745
|
+
declare function validateDataAgainstSchema(data: unknown, schema: DataSchema | Schema): void;
|
|
31223
31746
|
/**
|
|
31224
31747
|
* Convenience function to fetch and validate a schema from a URL
|
|
31225
31748
|
*
|
|
@@ -33862,12 +34385,25 @@ declare class DataController {
|
|
|
33862
34385
|
/**
|
|
33863
34386
|
* Registers a file URL directly on the blockchain with a schema ID.
|
|
33864
34387
|
*
|
|
33865
|
-
* @
|
|
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)
|
|
33866
34394
|
* @param schemaId - The schema ID to associate with the file
|
|
33867
34395
|
* @returns Promise resolving to the file ID and transaction hash
|
|
33868
|
-
*
|
|
33869
|
-
*
|
|
33870
|
-
*
|
|
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
|
+
* ```
|
|
33871
34407
|
*/
|
|
33872
34408
|
registerFileWithSchema(url: string, schemaId: number): Promise<{
|
|
33873
34409
|
fileId: number;
|
|
@@ -33927,35 +34463,112 @@ declare class DataController {
|
|
|
33927
34463
|
/**
|
|
33928
34464
|
* Adds a new refiner to the DataRefinerRegistry.
|
|
33929
34465
|
*
|
|
33930
|
-
* @
|
|
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
|
|
33931
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
|
|
34481
|
+
* ```typescript
|
|
34482
|
+
* const result = await vana.data.addRefiner({
|
|
34483
|
+
* dlpId: 1,
|
|
34484
|
+
* name: "Social Media Sentiment Analyzer",
|
|
34485
|
+
* schemaId: 42,
|
|
34486
|
+
* refinementInstructionUrl: "ipfs://QmXxx..."
|
|
34487
|
+
* });
|
|
34488
|
+
* console.log(`Created refiner ${result.refinerId} in tx ${result.transactionHash}`);
|
|
34489
|
+
* ```
|
|
33932
34490
|
*/
|
|
33933
34491
|
addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
|
|
33934
34492
|
/**
|
|
33935
34493
|
* Retrieves a refiner by its ID.
|
|
33936
34494
|
*
|
|
33937
|
-
* @
|
|
33938
|
-
*
|
|
34495
|
+
* @remarks
|
|
34496
|
+
* Queries the DataRefinerRegistry contract to get complete information about
|
|
34497
|
+
* a specific refiner including its DLP association, schema, and instructions.
|
|
34498
|
+
*
|
|
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
|
|
34505
|
+
* ```typescript
|
|
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
|
+
* });
|
|
34513
|
+
* ```
|
|
33939
34514
|
*/
|
|
33940
34515
|
getRefiner(refinerId: number): Promise<Refiner>;
|
|
33941
34516
|
/**
|
|
33942
34517
|
* Validates if a schema ID exists in the registry.
|
|
33943
34518
|
*
|
|
33944
|
-
* @
|
|
33945
|
-
*
|
|
34519
|
+
* @remarks
|
|
34520
|
+
* Checks the DataRefinerRegistry contract to determine if a given schema ID
|
|
34521
|
+
* has been registered and is available for use.
|
|
34522
|
+
*
|
|
34523
|
+
* @param schemaId - The numeric schema ID to validate
|
|
34524
|
+
* @returns Promise resolving to true if schema exists, false otherwise
|
|
34525
|
+
* @example
|
|
34526
|
+
* ```typescript
|
|
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
|
+
* }
|
|
34533
|
+
* ```
|
|
33946
34534
|
*/
|
|
33947
34535
|
isValidSchemaId(schemaId: number): Promise<boolean>;
|
|
33948
34536
|
/**
|
|
33949
34537
|
* Gets the total number of refiners in the registry.
|
|
33950
34538
|
*
|
|
34539
|
+
* @remarks
|
|
34540
|
+
* Queries the DataRefinerRegistry contract to get the total count of all
|
|
34541
|
+
* registered refiners across all DLPs.
|
|
34542
|
+
*
|
|
33951
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
|
+
* ```
|
|
33952
34549
|
*/
|
|
33953
34550
|
getRefinersCount(): Promise<number>;
|
|
33954
34551
|
/**
|
|
33955
34552
|
* Updates the schema ID for an existing refiner.
|
|
33956
34553
|
*
|
|
33957
|
-
* @
|
|
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
|
|
33958
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
|
+
* ```
|
|
33959
34572
|
*/
|
|
33960
34573
|
updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
|
|
33961
34574
|
/**
|
|
@@ -34014,7 +34627,7 @@ declare class DataController {
|
|
|
34014
34627
|
* console.log(`Transaction: ${result.transactionHash}`);
|
|
34015
34628
|
* ```
|
|
34016
34629
|
*/
|
|
34017
|
-
addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<FilePermissionResult
|
|
34630
|
+
addPermissionToFile(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
|
|
34018
34631
|
/**
|
|
34019
34632
|
* Submits a file permission transaction and returns the transaction hash immediately.
|
|
34020
34633
|
*
|
|
@@ -34031,7 +34644,7 @@ declare class DataController {
|
|
|
34031
34644
|
* console.log(`Transaction submitted: ${txHash}`);
|
|
34032
34645
|
* ```
|
|
34033
34646
|
*/
|
|
34034
|
-
submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<
|
|
34647
|
+
submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionHandle<FilePermissionResult>>;
|
|
34035
34648
|
/**
|
|
34036
34649
|
* Gets the encrypted key for a specific account's permission to access a file.
|
|
34037
34650
|
*
|
|
@@ -34198,24 +34811,6 @@ declare class DataController {
|
|
|
34198
34811
|
* ```
|
|
34199
34812
|
*/
|
|
34200
34813
|
fetchAndValidateSchema(url: string): Promise<DataSchema>;
|
|
34201
|
-
/**
|
|
34202
|
-
* Retrieves a schema by ID and fetches its definition URL to get the full data schema.
|
|
34203
|
-
*
|
|
34204
|
-
* @param schemaId - The schema ID to retrieve and validate
|
|
34205
|
-
* @returns The validated data schema
|
|
34206
|
-
* @throws SchemaValidationError if schema is invalid
|
|
34207
|
-
* @example
|
|
34208
|
-
* ```typescript
|
|
34209
|
-
* // Get schema from registry and validate its schema
|
|
34210
|
-
* const schema = await vana.data.getValidatedSchema(123);
|
|
34211
|
-
*
|
|
34212
|
-
* // Use it to validate user data
|
|
34213
|
-
* if (schema.dialect === "json") {
|
|
34214
|
-
* vana.data.validateDataAgainstSchema(userData, schema);
|
|
34215
|
-
* }
|
|
34216
|
-
* ```
|
|
34217
|
-
*/
|
|
34218
|
-
getValidatedSchema(schemaId: number): Promise<DataSchema>;
|
|
34219
34814
|
}
|
|
34220
34815
|
|
|
34221
34816
|
/**
|
|
@@ -34418,6 +35013,31 @@ interface Chains {
|
|
|
34418
35013
|
}
|
|
34419
35014
|
declare const chains: Chains;
|
|
34420
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
|
+
*/
|
|
34421
35041
|
declare const createClient: (chainId?: keyof typeof chains) => PublicClient & {
|
|
34422
35042
|
chain: Chain;
|
|
34423
35043
|
};
|
|
@@ -35136,51 +35756,157 @@ declare class SerializationError extends VanaError {
|
|
|
35136
35756
|
constructor(message: string);
|
|
35137
35757
|
}
|
|
35138
35758
|
/**
|
|
35139
|
-
*
|
|
35759
|
+
* Thrown when a signature operation fails or cannot be completed.
|
|
35140
35760
|
*
|
|
35141
35761
|
* @remarks
|
|
35142
|
-
*
|
|
35143
|
-
*
|
|
35144
|
-
*
|
|
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
|
|
35145
35784
|
*/
|
|
35146
35785
|
declare class SignatureError extends VanaError {
|
|
35147
35786
|
readonly originalError?: Error | undefined;
|
|
35148
35787
|
constructor(message: string, originalError?: Error | undefined);
|
|
35149
35788
|
}
|
|
35150
35789
|
/**
|
|
35151
|
-
*
|
|
35790
|
+
* Thrown when network communication fails during API calls or blockchain interactions.
|
|
35152
35791
|
*
|
|
35153
35792
|
* @remarks
|
|
35154
|
-
*
|
|
35155
|
-
*
|
|
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
|
|
35156
35815
|
*/
|
|
35157
35816
|
declare class NetworkError extends VanaError {
|
|
35158
35817
|
readonly originalError?: Error | undefined;
|
|
35159
35818
|
constructor(message: string, originalError?: Error | undefined);
|
|
35160
35819
|
}
|
|
35161
35820
|
/**
|
|
35162
|
-
*
|
|
35821
|
+
* Thrown when transaction nonce retrieval fails during gasless operations.
|
|
35163
35822
|
*
|
|
35164
35823
|
* @remarks
|
|
35165
|
-
*
|
|
35166
|
-
*
|
|
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
|
|
35167
35847
|
*/
|
|
35168
35848
|
declare class NonceError extends VanaError {
|
|
35169
35849
|
constructor(message: string);
|
|
35170
35850
|
}
|
|
35171
35851
|
/**
|
|
35172
|
-
*
|
|
35852
|
+
* Thrown when personal server operations fail or cannot be completed.
|
|
35173
35853
|
*
|
|
35174
35854
|
* @remarks
|
|
35175
|
-
*
|
|
35176
|
-
*
|
|
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
|
|
35177
35880
|
*/
|
|
35178
35881
|
declare class PersonalServerError extends VanaError {
|
|
35179
35882
|
readonly originalError?: Error | undefined;
|
|
35180
35883
|
constructor(message: string, originalError?: Error | undefined);
|
|
35181
35884
|
}
|
|
35182
35885
|
/**
|
|
35183
|
-
*
|
|
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
|
|
35184
35910
|
*/
|
|
35185
35911
|
declare class ServerUrlMismatchError extends VanaError {
|
|
35186
35912
|
constructor(existingUrl: string, providedUrl: string, serverId: string);
|
|
@@ -35189,7 +35915,25 @@ declare class ServerUrlMismatchError extends VanaError {
|
|
|
35189
35915
|
readonly serverId: string;
|
|
35190
35916
|
}
|
|
35191
35917
|
/**
|
|
35192
|
-
*
|
|
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
|
|
35193
35937
|
*/
|
|
35194
35938
|
declare class PermissionError extends VanaError {
|
|
35195
35939
|
readonly originalError?: Error | undefined;
|
|
@@ -36155,12 +36899,12 @@ declare class SignatureCache {
|
|
|
36155
36899
|
* Generate a deterministic hash of a message object for cache key generation
|
|
36156
36900
|
*
|
|
36157
36901
|
* @remarks
|
|
36158
|
-
* Creates a
|
|
36159
|
-
*
|
|
36160
|
-
*
|
|
36902
|
+
* Creates a cryptographically secure hash from complex objects including EIP-712 typed data.
|
|
36903
|
+
* Uses SHA-256 for collision resistance and deterministic key generation.
|
|
36904
|
+
* Handles BigInt serialization and sorts object keys for consistency.
|
|
36161
36905
|
*
|
|
36162
36906
|
* @param message - The message object to hash (typically EIP-712 typed data)
|
|
36163
|
-
* @returns A
|
|
36907
|
+
* @returns A hex string hash (SHA-256) suitable for cache keys
|
|
36164
36908
|
* @example
|
|
36165
36909
|
* ```typescript
|
|
36166
36910
|
* const typedData = {
|
|
@@ -36169,19 +36913,19 @@ declare class SignatureCache {
|
|
|
36169
36913
|
* };
|
|
36170
36914
|
*
|
|
36171
36915
|
* const hash = SignatureCache.hashMessage(typedData);
|
|
36172
|
-
* // Returns
|
|
36916
|
+
* // Returns SHA-256 hash like: "a1b2c3d4e5f6..."
|
|
36173
36917
|
* ```
|
|
36174
36918
|
*/
|
|
36175
36919
|
static hashMessage(message: object): string;
|
|
36176
36920
|
/**
|
|
36177
|
-
*
|
|
36178
|
-
* This ensures
|
|
36921
|
+
* Deterministic JSON replacer that handles BigInt values and sorts object keys
|
|
36922
|
+
* This ensures consistent cache key generation for EIP-712 typed data
|
|
36179
36923
|
*
|
|
36180
36924
|
* @param _key - The object key being serialized (unused)
|
|
36181
36925
|
* @param value - The value to serialize
|
|
36182
|
-
* @returns The serialized value
|
|
36926
|
+
* @returns The serialized value with sorted keys for objects
|
|
36183
36927
|
*/
|
|
36184
|
-
private static
|
|
36928
|
+
private static deterministicReplacer;
|
|
36185
36929
|
}
|
|
36186
36930
|
/**
|
|
36187
36931
|
* Wrapper function to cache signature operations
|
|
@@ -36197,21 +36941,53 @@ declare function withSignatureCache(cache: VanaCacheAdapter, walletAddress: stri
|
|
|
36197
36941
|
|
|
36198
36942
|
declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
|
|
36199
36943
|
/**
|
|
36200
|
-
* 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.
|
|
36201
36945
|
*
|
|
36202
|
-
* @
|
|
36203
|
-
*
|
|
36204
|
-
*
|
|
36205
|
-
*
|
|
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.
|
|
36206
36970
|
* @example
|
|
36207
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
|
|
36208
36978
|
* try {
|
|
36209
|
-
* const
|
|
36210
|
-
* console.log('DataRegistry address:',
|
|
36979
|
+
* const address = getContractAddress(1480, 'DataRegistry');
|
|
36980
|
+
* console.log('DataRegistry testnet address:', address);
|
|
36211
36981
|
* } catch (error) {
|
|
36212
|
-
* console.error('Contract not
|
|
36982
|
+
* console.error('Contract not available on testnet:', error.message);
|
|
36983
|
+
* // Fallback to mainnet or show user-friendly error
|
|
36213
36984
|
* }
|
|
36985
|
+
*
|
|
36986
|
+
* // TypeScript provides autocomplete for contract names
|
|
36987
|
+
* const poolAddress = getContractAddress(14800, 'TeePoolPhala'); // ✅ Valid
|
|
36988
|
+
* // const invalid = getContractAddress(14800, 'InvalidContract'); // ❌ TypeScript error
|
|
36214
36989
|
* ```
|
|
36990
|
+
* @category Configuration
|
|
36215
36991
|
*/
|
|
36216
36992
|
declare const getContractAddress: (chainId: keyof typeof CONTRACT_ADDRESSES, contract: VanaContract) => `0x${string}`;
|
|
36217
36993
|
|
|
@@ -36381,6 +37157,8 @@ declare class CircuitBreaker {
|
|
|
36381
37157
|
reset(): void;
|
|
36382
37158
|
}
|
|
36383
37159
|
|
|
37160
|
+
/** Union type of all possible transaction results from relayer operations */
|
|
37161
|
+
type RelayerTransactionResult = PermissionGrantResult | PermissionRevokeResult | ServerTrustResult | ServerUntrustResult | GranteeRegisterResult | FileAddedResult;
|
|
36384
37162
|
/**
|
|
36385
37163
|
* Payload structure for relayer requests.
|
|
36386
37164
|
* Contains the EIP-712 typed data, signature, and optional expected user address for security verification.
|
|
@@ -36402,7 +37180,7 @@ interface RelayerRequestPayload {
|
|
|
36402
37180
|
* 1. Verifies the signature against the typed data
|
|
36403
37181
|
* 2. Optionally checks the signer matches the expected user address
|
|
36404
37182
|
* 3. Routes to the appropriate SDK method based on primaryType
|
|
36405
|
-
* 4. Returns the
|
|
37183
|
+
* 4. Returns the transaction handle with hash and event parsing capability
|
|
36406
37184
|
*
|
|
36407
37185
|
* Supported transaction types:
|
|
36408
37186
|
* - Permission: Permission grants
|
|
@@ -36415,7 +37193,7 @@ interface RelayerRequestPayload {
|
|
|
36415
37193
|
*
|
|
36416
37194
|
* @param sdk - Initialized Vana SDK instance
|
|
36417
37195
|
* @param payload - Request payload containing typed data, signature, and optional security check
|
|
36418
|
-
* @returns Promise resolving to
|
|
37196
|
+
* @returns Promise resolving to TransactionHandle with hash and event parsing capability
|
|
36419
37197
|
* @throws {SignatureError} When signature verification fails or signer mismatch occurs
|
|
36420
37198
|
* @throws {Error} When primaryType is unsupported or SDK operations fail
|
|
36421
37199
|
* @category Server
|
|
@@ -36429,15 +37207,24 @@ interface RelayerRequestPayload {
|
|
|
36429
37207
|
* const body = await request.json();
|
|
36430
37208
|
* const vana = await createRelayerVana();
|
|
36431
37209
|
*
|
|
36432
|
-
* const
|
|
37210
|
+
* const tx = await handleRelayerRequest(vana, {
|
|
36433
37211
|
* typedData: body.typedData,
|
|
36434
37212
|
* signature: body.signature,
|
|
36435
37213
|
* expectedUserAddress: body.expectedUserAddress
|
|
36436
37214
|
* });
|
|
36437
37215
|
*
|
|
37216
|
+
* // Option 1: Return just the hash immediately
|
|
36438
37217
|
* return NextResponse.json({
|
|
36439
37218
|
* success: true,
|
|
36440
|
-
* transactionHash:
|
|
37219
|
+
* transactionHash: tx.hash
|
|
37220
|
+
* });
|
|
37221
|
+
*
|
|
37222
|
+
* // Option 2: Wait for transaction confirmation and return event data
|
|
37223
|
+
* const eventData = await tx.waitForEvents();
|
|
37224
|
+
* return NextResponse.json({
|
|
37225
|
+
* success: true,
|
|
37226
|
+
* transactionHash: tx.hash,
|
|
37227
|
+
* ...eventData // Include parsed event data like permissionId, fileId, etc.
|
|
36441
37228
|
* });
|
|
36442
37229
|
* } catch (error) {
|
|
36443
37230
|
* return NextResponse.json({
|
|
@@ -36448,7 +37235,7 @@ interface RelayerRequestPayload {
|
|
|
36448
37235
|
* }
|
|
36449
37236
|
* ```
|
|
36450
37237
|
*/
|
|
36451
|
-
declare function handleRelayerRequest(sdk: VanaInstance, payload: RelayerRequestPayload): Promise<
|
|
37238
|
+
declare function handleRelayerRequest(sdk: VanaInstance, payload: RelayerRequestPayload): Promise<TransactionHandle<RelayerTransactionResult>>;
|
|
36452
37239
|
|
|
36453
37240
|
/**
|
|
36454
37241
|
* Node.js implementation of the Vana Platform Adapter
|
|
@@ -36471,26 +37258,73 @@ declare class NodePlatformAdapter implements VanaPlatformAdapter {
|
|
|
36471
37258
|
}
|
|
36472
37259
|
|
|
36473
37260
|
/**
|
|
36474
|
-
* Browser implementation of the Vana Platform Adapter
|
|
37261
|
+
* Browser implementation of the Vana Platform Adapter using Uint8Array
|
|
36475
37262
|
*
|
|
36476
|
-
* This implementation uses browser-compatible libraries and
|
|
36477
|
-
*
|
|
36478
|
-
*
|
|
36479
|
-
* WARNING: Dependencies that access globals during init
|
|
36480
|
-
* MUST be dynamically imported to support Turbopack.
|
|
36481
|
-
* See: https://github.com/vercel/next.js/issues/82632
|
|
37263
|
+
* This implementation uses browser-compatible libraries and native APIs
|
|
37264
|
+
* without requiring Buffer or other Node.js polyfills.
|
|
36482
37265
|
*/
|
|
36483
37266
|
|
|
36484
37267
|
/**
|
|
36485
|
-
*
|
|
37268
|
+
* Browser implementation of crypto operations using Uint8Array
|
|
37269
|
+
*/
|
|
37270
|
+
declare class BrowserCryptoAdapter implements VanaCryptoAdapter {
|
|
37271
|
+
private eciesProvider;
|
|
37272
|
+
private walletKeyEncryptionService;
|
|
37273
|
+
encryptWithPublicKey(data: string, publicKeyHex: string): Promise<string>;
|
|
37274
|
+
decryptWithPrivateKey(encryptedData: string, privateKeyHex: string): Promise<string>;
|
|
37275
|
+
encryptWithWalletPublicKey(data: string, publicKey: string): Promise<string>;
|
|
37276
|
+
decryptWithWalletPrivateKey(encryptedData: string, privateKey: string): Promise<string>;
|
|
37277
|
+
generateKeyPair(): Promise<{
|
|
37278
|
+
privateKey: string;
|
|
37279
|
+
publicKey: string;
|
|
37280
|
+
}>;
|
|
37281
|
+
encryptWithPassword(data: Uint8Array, password: string): Promise<Uint8Array>;
|
|
37282
|
+
decryptWithPassword(encryptedData: Uint8Array, password: string): Promise<Uint8Array>;
|
|
37283
|
+
}
|
|
37284
|
+
/**
|
|
37285
|
+
* Browser implementation of PGP operations
|
|
37286
|
+
*/
|
|
37287
|
+
declare class BrowserPGPAdapter implements VanaPGPAdapter {
|
|
37288
|
+
encrypt(data: string, publicKeyArmored: string): Promise<string>;
|
|
37289
|
+
decrypt(encryptedData: string, privateKeyArmored: string): Promise<string>;
|
|
37290
|
+
generateKeyPair(options?: {
|
|
37291
|
+
name?: string;
|
|
37292
|
+
email?: string;
|
|
37293
|
+
passphrase?: string;
|
|
37294
|
+
}): Promise<{
|
|
37295
|
+
publicKey: string;
|
|
37296
|
+
privateKey: string;
|
|
37297
|
+
}>;
|
|
37298
|
+
}
|
|
37299
|
+
/**
|
|
37300
|
+
* Browser implementation of HTTP operations using Fetch API
|
|
37301
|
+
*/
|
|
37302
|
+
declare class BrowserHttpAdapter implements VanaHttpAdapter {
|
|
37303
|
+
fetch(url: string, options?: RequestInit): Promise<Response>;
|
|
37304
|
+
}
|
|
37305
|
+
/**
|
|
37306
|
+
* Browser implementation of caching using sessionStorage for security
|
|
37307
|
+
* SessionStorage is cleared when the tab closes, making it more secure for signature caching
|
|
37308
|
+
*/
|
|
37309
|
+
declare class BrowserCacheAdapter implements VanaCacheAdapter {
|
|
37310
|
+
private readonly prefix;
|
|
37311
|
+
get(key: string): string | null;
|
|
37312
|
+
set(key: string, value: string): void;
|
|
37313
|
+
delete(key: string): void;
|
|
37314
|
+
clear(): void;
|
|
37315
|
+
}
|
|
37316
|
+
/**
|
|
37317
|
+
* Browser implementation of the Vana Platform Adapter
|
|
37318
|
+
*
|
|
37319
|
+
* This adapter provides all platform-specific functionality for browser environments
|
|
37320
|
+
* without requiring any Node.js polyfills.
|
|
36486
37321
|
*/
|
|
36487
37322
|
declare class BrowserPlatformAdapter implements VanaPlatformAdapter {
|
|
36488
|
-
crypto:
|
|
36489
|
-
pgp:
|
|
36490
|
-
http:
|
|
36491
|
-
cache:
|
|
36492
|
-
platform: "browser";
|
|
36493
|
-
constructor();
|
|
37323
|
+
readonly crypto: BrowserCryptoAdapter;
|
|
37324
|
+
readonly pgp: BrowserPGPAdapter;
|
|
37325
|
+
readonly http: BrowserHttpAdapter;
|
|
37326
|
+
readonly cache: BrowserCacheAdapter;
|
|
37327
|
+
readonly platform: "browser";
|
|
36494
37328
|
}
|
|
36495
37329
|
|
|
36496
37330
|
/**
|
|
@@ -36867,4 +37701,4 @@ declare function Vana(config: VanaConfig): VanaNodeImpl;
|
|
|
36867
37701
|
*/
|
|
36868
37702
|
type VanaInstance = VanaNodeImpl;
|
|
36869
37703
|
|
|
36870
|
-
export { type $defs, type APIResponse, type AddAndTrustServerInput, type AddAndTrustServerParams, type AddAndTrustServerTypedData, type AddRefinerParams, type AddRefinerResult, type AddSchemaParams, type AddSchemaResult, type AllKeys, ApiClient, type ApiClientConfig, type ApiResponse, AsyncQueue, type AsyncResult, type AuthenticationErrorResponse, type Awaited, type BaseConfig, type BaseConfigWithStorage, BaseController, type BatchServerInfoResult, type BatchUploadParams, type BatchUploadResult, type BlockRange, BlockchainError, type BlockchainErrorResponse, type Brand, BrowserPlatformAdapter, type Cache, type CacheConfig, CallbackStorage, type ChainConfig, type ChainConfigWithStorage, type CheckPermissionParams, CircuitBreaker, type ComputeErrorResponse, type ConditionalOptional, type ConfigValidationOptions, type ConfigValidationResult, type ContractAddresses, type ContractCall, type ContractDeployment, ContractFactory, type ContractInfo, type ContractMethodParams, type ContractMethodReturnType, ContractNotFoundError, type Controller, type ControllerContext, type CreateOperationParams, type CreateOperationRequest, type CreateOperationResponse, type CreateSchemaParams, type CreateSchemaResult, DEFAULT_ENCRYPTION_SEED, DEFAULT_IPFS_GATEWAY, DataController, type DataSchema, type DecryptionErrorResponse, type DeepPartial, type DeepReadonly, type DeleteFileParams, type DeleteFileResult, type DownloadFileParams, type DownloadFileResult, type EncryptedUploadParams, type EncryptionInfo, type ErrorResponse, EventEmitter, type EventFilter, type EventLog, type Factory, type FileAccessErrorResponse, type FileAccessPermissions, type FileMetadata, type FilePermissionParams, type FileSharingConfig, type GasEstimate, type GenericRequest, type GenericResponse, type GenericTypedData, type GetFileParams, type GetOperationResponse, type GetUserFilesParams, type GetUserPermissionsOptions, type GetUserTrustedServersParams, GoogleDriveStorage, GrantExpiredError, type GrantFile, type GrantPermissionParams, GrantSchemaError, GrantValidationError, type GrantValidationErrorResponse, type GrantValidationOptions, type GrantValidationResult, type GrantedPermission, type Grantee, type GranteeInfo, GranteeMismatchError, type GranteeQueryOptions, type HttpMethod, IPFS_GATEWAYS, type IdentityResponseModel, type InitPersonalServerParams, type InternalServerErrorResponse, InvalidConfigurationError, IpfsStorage, type LegacyPermissionParams, type MaybeArray, type MaybePromise, MemoryCache, type Middleware, MiddlewarePipeline, NetworkError, type NetworkInfo, NodePlatformAdapter, type Nominal, type NonNullable, NonceError, type NotFoundErrorResponse, type Observable, type Observer, type OmitByType, type OnChainPermissionGrant, type OperationErrorResponse, OperationNotAllowedError, type OptionalKeys, type PaginatedGrantees, type PaginatedTrustedServers, type PaginationParams, type PaginationResult, type PartialExcept, type Permission, type PermissionAnalytics, type PermissionCheckResult, PermissionError, type PermissionEvent, type PermissionGrantDomain, type PermissionGrantMessage, type PermissionGrantTypedData, type PermissionInfo, type PermissionInputMessage, type PermissionOperation, type PermissionQueryResult, type PermissionStatus, PermissionsController, PersonalServerError, type PersonalServerIdentity, type PersonalServerModel, type PickByType, type PinataListResponse, type PinataPin, PinataStorage, type PinataUploadResponse, type Plugin, type PostRequestParams, type PromiseResult, ProtocolController, type QueryPermissionsParams, type RateLimitInfo, RateLimiter, type RateLimiterConfig, type Refiner, type RegisterGranteeInput, type RegisterGranteeParams, type RegisterGranteeTypedData, type RelayerCallbacks, type RelayerConfig, RelayerError, type RelayerErrorResponse, type RelayerMetrics, type RelayerQueueInfo, type RelayerRequestOptions, type RelayerRequestPayload, type RelayerStatus, type RelayerStorageResponse, type RelayerStoreParams, type RelayerSubmitParams, type RelayerTransactionResponse, type RelayerTransactionStatus, type RelayerWebhookConfig, type RelayerWebhookPayload, type ReplicateAPIResponse, type ReplicateStatus, type Repository, type RequestOptions, type RequireKeys, type RequiredExcept, type RetryConfig, RetryUtility, type RevokePermissionInput, type RevokePermissionParams, type RuntimeConfig, type Schema, SchemaController, SchemaValidationError, SchemaValidator, SerializationError, type Server, type components as ServerComponents, ServerController, type $defs as ServerDefs, type ServerFilesAndPermissionParams, type ServerFilesAndPermissionTypedData, type ServerInfo, type operations as ServerOperations, type paths as ServerPaths, type ServerTrustStatus, ServerUrlMismatchError, type webhooks as ServerWebhooks, type Service, SignatureCache, SignatureError, type SimplifiedPermissionMessage, type StateMachine, type StatusInfo, type StorageCallbacks, type StorageConfig, type StorageDownloadOptions, StorageError, type StorageFile, type StorageListOptions, type StorageListResult, StorageManager, type StorageProvider, type StorageProviderConfig, type StorageRequiredMarker, type StorageUploadResult, type TimeRange, 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 };
|
|
37704
|
+
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 };
|