@opendatalabs/vana-sdk 0.1.0-alpha.f35bb9c → 0.1.0-alpha.f48b66e
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/dist/controllers/__tests__/data-consistency-integration.test.d.ts +7 -0
- package/dist/controllers/base.cjs +33 -0
- package/dist/controllers/base.cjs.map +1 -1
- package/dist/controllers/base.d.ts +10 -0
- package/dist/controllers/base.js +33 -0
- package/dist/controllers/base.js.map +1 -1
- package/dist/controllers/data.cjs +210 -147
- package/dist/controllers/data.cjs.map +1 -1
- package/dist/controllers/data.d.ts +15 -12
- package/dist/controllers/data.js +223 -150
- package/dist/controllers/data.js.map +1 -1
- package/dist/controllers/permissions.cjs +203 -94
- package/dist/controllers/permissions.cjs.map +1 -1
- package/dist/controllers/permissions.d.ts +20 -11
- package/dist/controllers/permissions.js +203 -94
- package/dist/controllers/permissions.js.map +1 -1
- package/dist/controllers/schemas.cjs +11 -1
- package/dist/controllers/schemas.cjs.map +1 -1
- package/dist/controllers/schemas.d.ts +2 -0
- package/dist/controllers/schemas.js +11 -1
- package/dist/controllers/schemas.js.map +1 -1
- package/dist/core.cjs +4 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +4 -1
- package/dist/core.js.map +1 -1
- package/dist/generated/subgraph.cjs +797 -32
- package/dist/generated/subgraph.cjs.map +1 -1
- package/dist/generated/subgraph.d.ts +135 -0
- package/dist/generated/subgraph.js +792 -32
- package/dist/generated/subgraph.js.map +1 -1
- package/dist/index.node.cjs +2 -0
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +27 -4
- package/dist/index.node.js +2 -0
- package/dist/index.node.js.map +1 -1
- package/dist/server/relayerHandler.cjs +201 -87
- package/dist/server/relayerHandler.cjs.map +1 -1
- package/dist/server/relayerHandler.d.ts +3 -1
- package/dist/server/relayerHandler.js +201 -87
- package/dist/server/relayerHandler.js.map +1 -1
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.ts +32 -0
- package/dist/types/config.js.map +1 -1
- package/dist/types/controller-context.cjs.map +1 -1
- package/dist/types/controller-context.d.ts +3 -1
- package/dist/types/data.cjs.map +1 -1
- package/dist/types/data.d.ts +0 -4
- package/dist/types/generics.cjs.map +1 -1
- package/dist/types/generics.d.ts +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/operations.cjs.map +1 -1
- package/dist/types/operations.d.ts +33 -0
- package/dist/types/operations.js.map +1 -1
- package/dist/types/options.cjs +17 -0
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.ts +213 -0
- package/dist/types/options.js +1 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/permissions.cjs.map +1 -1
- package/dist/types/permissions.d.ts +2 -0
- package/dist/types/relayer.cjs.map +1 -1
- package/dist/types/relayer.d.ts +19 -8
- package/dist/types/utils.cjs.map +1 -1
- package/dist/types/utils.d.ts +0 -49
- package/dist/utils/__tests__/subgraphConsistency.test.d.ts +4 -0
- package/dist/utils/__tests__/subgraphPagination.test.d.ts +4 -0
- package/dist/utils/chainQuery.cjs +107 -0
- package/dist/utils/chainQuery.cjs.map +1 -0
- package/dist/utils/chainQuery.d.ts +31 -0
- package/dist/utils/chainQuery.js +82 -0
- package/dist/utils/chainQuery.js.map +1 -0
- package/dist/utils/ipfs.cjs +2 -4
- package/dist/utils/ipfs.cjs.map +1 -1
- package/dist/utils/ipfs.d.ts +1 -1
- package/dist/utils/ipfs.js +2 -4
- package/dist/utils/ipfs.js.map +1 -1
- package/dist/utils/subgraphConsistency.cjs +184 -0
- package/dist/utils/subgraphConsistency.cjs.map +1 -0
- package/dist/utils/subgraphConsistency.d.ts +65 -0
- package/dist/utils/subgraphConsistency.js +155 -0
- package/dist/utils/subgraphConsistency.js.map +1 -0
- package/dist/utils/subgraphMetaCache.cjs +101 -0
- package/dist/utils/subgraphMetaCache.cjs.map +1 -0
- package/dist/utils/subgraphMetaCache.d.ts +56 -0
- package/dist/utils/subgraphMetaCache.js +76 -0
- package/dist/utils/subgraphMetaCache.js.map +1 -0
- package/dist/utils/subgraphPagination.cjs +104 -0
- package/dist/utils/subgraphPagination.cjs.map +1 -0
- package/dist/utils/subgraphPagination.d.ts +78 -0
- package/dist/utils/subgraphPagination.js +78 -0
- package/dist/utils/subgraphPagination.js.map +1 -0
- package/package.json +3 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
+
import type { TransactionOptions, TransactionResult } from "../types/operations";
|
|
2
3
|
import type { StorageUploadResult } from "../types/storage";
|
|
3
4
|
import type { UserFile, UploadParams, UploadResult, UploadEncryptedFileResult, Refiner, AddRefinerParams, AddRefinerResult, UpdateSchemaIdParams, UpdateSchemaIdResult, TrustedServer, GetUserTrustedServersParams, EncryptedUploadParams, UnencryptedUploadParams, EncryptFileOptions, EncryptFileResult, DecryptFileOptions, UploadFileWithPermissionsParams, AddFilePermissionParams, DecryptFileWithPermissionOptions } from "../types/index";
|
|
4
|
-
import type { TransactionResult } from "../types/operations";
|
|
5
5
|
import type { ControllerContext } from "./permissions";
|
|
6
6
|
import { BaseController } from "./base";
|
|
7
|
+
import type { ConsistencyOptions, PaginationOptions } from "../types/options";
|
|
7
8
|
import { type DataSchema } from "../utils/schemaValidation";
|
|
8
9
|
/**
|
|
9
10
|
* Manages encrypted user data files and blockchain registration on the Vana network.
|
|
@@ -300,7 +301,7 @@ export declare class DataController extends BaseController {
|
|
|
300
301
|
getUserFiles(params: {
|
|
301
302
|
owner: Address;
|
|
302
303
|
subgraphUrl?: string;
|
|
303
|
-
}): Promise<UserFile[]>;
|
|
304
|
+
}, options?: ConsistencyOptions & PaginationOptions): Promise<UserFile[]>;
|
|
304
305
|
/**
|
|
305
306
|
* Fetches proof data for multiple files from the subgraph.
|
|
306
307
|
*
|
|
@@ -341,6 +342,8 @@ export declare class DataController extends BaseController {
|
|
|
341
342
|
*/
|
|
342
343
|
getDLP(dlpId: number, options?: {
|
|
343
344
|
subgraphUrl?: string;
|
|
345
|
+
minBlock?: number;
|
|
346
|
+
waitForSync?: number;
|
|
344
347
|
}): Promise<{
|
|
345
348
|
id: number;
|
|
346
349
|
name: string;
|
|
@@ -401,7 +404,7 @@ export declare class DataController extends BaseController {
|
|
|
401
404
|
getUserPermissions(params: {
|
|
402
405
|
user: Address;
|
|
403
406
|
subgraphUrl?: string;
|
|
404
|
-
}): Promise<Array<{
|
|
407
|
+
}, options?: ConsistencyOptions & PaginationOptions): Promise<Array<{
|
|
405
408
|
id: string;
|
|
406
409
|
grant: string;
|
|
407
410
|
nonce: bigint;
|
|
@@ -464,7 +467,7 @@ export declare class DataController extends BaseController {
|
|
|
464
467
|
* });
|
|
465
468
|
* ```
|
|
466
469
|
*/
|
|
467
|
-
getUserTrustedServers(params: GetUserTrustedServersParams): Promise<TrustedServer[]>;
|
|
470
|
+
getUserTrustedServers(params: GetUserTrustedServersParams, options?: ConsistencyOptions & PaginationOptions): Promise<TrustedServer[]>;
|
|
468
471
|
/**
|
|
469
472
|
* Internal method: Query trusted servers via subgraph
|
|
470
473
|
*
|
|
@@ -560,7 +563,7 @@ export declare class DataController extends BaseController {
|
|
|
560
563
|
* console.log(`File ${fileId} registered with schema in tx ${transactionHash}`);
|
|
561
564
|
* ```
|
|
562
565
|
*/
|
|
563
|
-
registerFileWithSchema(url: string, schemaId: number): Promise<TransactionResult<"DataRegistry", "addFileWithSchema">>;
|
|
566
|
+
registerFileWithSchema(url: string, schemaId: number, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithSchema">>;
|
|
564
567
|
/**
|
|
565
568
|
* Gets the user's address from the wallet client.
|
|
566
569
|
*
|
|
@@ -586,7 +589,7 @@ export declare class DataController extends BaseController {
|
|
|
586
589
|
addFileWithPermissions(url: string, ownerAddress: Address, permissions?: Array<{
|
|
587
590
|
account: Address;
|
|
588
591
|
key: string;
|
|
589
|
-
}
|
|
592
|
+
}>, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithPermissions">>;
|
|
590
593
|
/**
|
|
591
594
|
* Adds a file to the registry with permissions and schema.
|
|
592
595
|
* This combines the functionality of addFileWithPermissions and schema validation.
|
|
@@ -629,7 +632,7 @@ export declare class DataController extends BaseController {
|
|
|
629
632
|
addFileWithPermissionsAndSchema(url: string, ownerAddress: Address, permissions?: Array<{
|
|
630
633
|
account: Address;
|
|
631
634
|
publicKey: string;
|
|
632
|
-
}>, schemaId?: number): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
|
|
635
|
+
}>, schemaId?: number, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
|
|
633
636
|
/**
|
|
634
637
|
* Adds a file with pre-encrypted permissions and schema to the DataRegistry.
|
|
635
638
|
*
|
|
@@ -671,7 +674,7 @@ export declare class DataController extends BaseController {
|
|
|
671
674
|
addFileWithEncryptedPermissionsAndSchema(url: string, ownerAddress: Address, permissions?: Array<{
|
|
672
675
|
account: Address;
|
|
673
676
|
key: string;
|
|
674
|
-
}>, schemaId?: number): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
|
|
677
|
+
}>, schemaId?: number, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFileWithPermissionsAndSchema">>;
|
|
675
678
|
/**
|
|
676
679
|
* Registers a data refiner for processing templates.
|
|
677
680
|
*
|
|
@@ -704,7 +707,7 @@ export declare class DataController extends BaseController {
|
|
|
704
707
|
* console.log(`Refiner ${result.refinerId} created`);
|
|
705
708
|
* ```
|
|
706
709
|
*/
|
|
707
|
-
addRefiner(params: AddRefinerParams): Promise<AddRefinerResult>;
|
|
710
|
+
addRefiner(params: AddRefinerParams, options?: TransactionOptions): Promise<AddRefinerResult>;
|
|
708
711
|
/**
|
|
709
712
|
* Retrieves refiner configuration by ID.
|
|
710
713
|
*
|
|
@@ -795,7 +798,7 @@ export declare class DataController extends BaseController {
|
|
|
795
798
|
* console.log(`Schema updated in tx ${result.transactionHash}`);
|
|
796
799
|
* ```
|
|
797
800
|
*/
|
|
798
|
-
updateSchemaId(params: UpdateSchemaIdParams): Promise<UpdateSchemaIdResult>;
|
|
801
|
+
updateSchemaId(params: UpdateSchemaIdParams, options?: TransactionOptions): Promise<UpdateSchemaIdResult>;
|
|
799
802
|
/**
|
|
800
803
|
* Uploads an encrypted file and grants permission to a party with a public key.
|
|
801
804
|
*
|
|
@@ -852,7 +855,7 @@ export declare class DataController extends BaseController {
|
|
|
852
855
|
* console.log(`Transaction: ${result.transactionHash}`);
|
|
853
856
|
* ```
|
|
854
857
|
*/
|
|
855
|
-
addPermissionToFile(params: AddFilePermissionParams): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
|
|
858
|
+
addPermissionToFile(params: AddFilePermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
|
|
856
859
|
/**
|
|
857
860
|
* Submits a file permission transaction to the blockchain.
|
|
858
861
|
*
|
|
@@ -881,7 +884,7 @@ export declare class DataController extends BaseController {
|
|
|
881
884
|
* console.log(`Permission granted with ID: ${result.permissionId}`);
|
|
882
885
|
* ```
|
|
883
886
|
*/
|
|
884
|
-
submitFilePermission(fileId: number, account: Address, publicKey: string): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
|
|
887
|
+
submitFilePermission(fileId: number, account: Address, publicKey: string, options?: TransactionOptions): Promise<TransactionResult<"DataRegistry", "addFilePermission">>;
|
|
885
888
|
/**
|
|
886
889
|
* Gets the encrypted key for a specific account's permission to access a file.
|
|
887
890
|
*
|