@opendatalabs/vana-sdk 0.1.0-alpha.a6b60fc → 0.1.0-alpha.a78ce5c
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/client/__tests__/enhancedResponse.test.d.ts +1 -0
- package/dist/client/enhancedResponse.cjs +164 -0
- package/dist/client/enhancedResponse.cjs.map +1 -0
- package/dist/client/enhancedResponse.d.ts +120 -0
- package/dist/client/enhancedResponse.js +138 -0
- package/dist/client/enhancedResponse.js.map +1 -0
- package/dist/controllers/__tests__/data-consistency-integration.test.d.ts +7 -0
- package/dist/controllers/__tests__/operations.processQueue.test.d.ts +1 -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 +278 -159
- package/dist/controllers/data.cjs.map +1 -1
- package/dist/controllers/data.d.ts +34 -19
- package/dist/controllers/data.js +291 -162
- package/dist/controllers/data.js.map +1 -1
- package/dist/controllers/operations.cjs +430 -0
- package/dist/controllers/operations.cjs.map +1 -0
- package/dist/controllers/operations.d.ts +229 -0
- package/dist/controllers/operations.js +406 -0
- package/dist/controllers/operations.js.map +1 -0
- package/dist/controllers/permissions.cjs +605 -213
- package/dist/controllers/permissions.cjs.map +1 -1
- package/dist/controllers/permissions.d.ts +141 -34
- package/dist/controllers/permissions.js +605 -213
- package/dist/controllers/permissions.js.map +1 -1
- package/dist/controllers/schemas.cjs +81 -4
- package/dist/controllers/schemas.cjs.map +1 -1
- package/dist/controllers/schemas.d.ts +41 -0
- package/dist/controllers/schemas.js +81 -4
- package/dist/controllers/schemas.js.map +1 -1
- package/dist/controllers/server.cjs +251 -42
- package/dist/controllers/server.cjs.map +1 -1
- package/dist/controllers/server.d.ts +111 -14
- package/dist/controllers/server.js +251 -42
- package/dist/controllers/server.js.map +1 -1
- package/dist/core/__tests__/health.test.d.ts +1 -0
- package/dist/core/__tests__/inMemoryNonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/nonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/pollingManager.test.d.ts +4 -0
- package/dist/core/health.cjs +289 -0
- package/dist/core/health.cjs.map +1 -0
- package/dist/core/health.d.ts +143 -0
- package/dist/core/health.js +265 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/inMemoryNonceManager.cjs +138 -0
- package/dist/core/inMemoryNonceManager.cjs.map +1 -0
- package/dist/core/inMemoryNonceManager.d.ts +69 -0
- package/dist/core/inMemoryNonceManager.js +114 -0
- package/dist/core/inMemoryNonceManager.js.map +1 -0
- package/dist/core/nonceManager.cjs +304 -0
- package/dist/core/nonceManager.cjs.map +1 -0
- package/dist/core/nonceManager.d.ts +116 -0
- package/dist/core/nonceManager.js +280 -0
- package/dist/core/nonceManager.js.map +1 -0
- package/dist/core/pollingManager.cjs +292 -0
- package/dist/core/pollingManager.cjs.map +1 -0
- package/dist/core/pollingManager.d.ts +120 -0
- package/dist/core/pollingManager.js +268 -0
- package/dist/core/pollingManager.js.map +1 -0
- package/dist/core.cjs +55 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +54 -3
- package/dist/core.js +55 -1
- package/dist/core.js.map +1 -1
- package/dist/crypto/ecies/base.cjs +16 -3
- package/dist/crypto/ecies/base.cjs.map +1 -1
- package/dist/crypto/ecies/base.js +16 -3
- package/dist/crypto/ecies/base.js.map +1 -1
- package/dist/errors.cjs +29 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +64 -0
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -1
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DLPPerformanceImplementation.cjs +42 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +32 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js +42 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRegistryImplementation.cjs +5 -5
- package/dist/generated/abi/DLPRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRegistryImplementation.d.ts +4 -4
- package/dist/generated/abi/DLPRegistryImplementation.js +5 -5
- package/dist/generated/abi/DLPRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +166 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +129 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.js +166 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs +167 -19
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +127 -14
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js +167 -19
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs +0 -19
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +0 -14
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js +0 -19
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs +0 -19
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +0 -14
- package/dist/generated/abi/DataPortabilityServersImplementation.js +0 -19
- package/dist/generated/abi/DataPortabilityServersImplementation.js.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.cjs +0 -13
- package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.d.ts +0 -10
- package/dist/generated/abi/DataRegistryImplementation.js +0 -13
- package/dist/generated/abi/DataRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/SwapHelperImplementation.cjs +0 -43
- package/dist/generated/abi/SwapHelperImplementation.cjs.map +1 -1
- package/dist/generated/abi/SwapHelperImplementation.d.ts +0 -35
- package/dist/generated/abi/SwapHelperImplementation.js +0 -43
- package/dist/generated/abi/SwapHelperImplementation.js.map +1 -1
- package/dist/generated/abi/VanaEpochImplementation.cjs +195 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaEpochImplementation.d.ts +151 -0
- package/dist/generated/abi/VanaEpochImplementation.js +195 -0
- package/dist/generated/abi/VanaEpochImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs +22 -65
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +17 -51
- package/dist/generated/abi/VanaPoolEntityImplementation.js +22 -65
- package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs +113 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +85 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.js +113 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.js.map +1 -1
- package/dist/generated/abi/index.d.ts +546 -146
- package/dist/generated/event-types.cjs.map +1 -1
- package/dist/generated/event-types.d.ts +14 -8
- package/dist/generated/eventRegistry.cjs +42 -18
- package/dist/generated/eventRegistry.cjs.map +1 -1
- package/dist/generated/eventRegistry.js +42 -18
- package/dist/generated/eventRegistry.js.map +1 -1
- package/dist/generated/server/server-exports.cjs +22 -0
- package/dist/generated/server/server-exports.cjs.map +1 -1
- package/dist/generated/server/server-exports.d.ts +27 -10
- package/dist/generated/server/server-exports.js +17 -0
- package/dist/generated/server/server-exports.js.map +1 -1
- package/dist/generated/server/server.cjs.map +1 -1
- package/dist/generated/server/server.d.ts +771 -402
- 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.browser.d.ts +2 -0
- package/dist/index.browser.js +10 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +26 -0
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +49 -5
- package/dist/index.node.js +25 -1
- package/dist/index.node.js.map +1 -1
- package/dist/lib/__tests__/redisAtomicStore.test.d.ts +1 -0
- package/dist/lib/redisAtomicStore.cjs +201 -0
- package/dist/lib/redisAtomicStore.cjs.map +1 -0
- package/dist/lib/redisAtomicStore.d.ts +120 -0
- package/dist/lib/redisAtomicStore.js +177 -0
- package/dist/lib/redisAtomicStore.js.map +1 -0
- package/dist/server/relayerHandler.cjs +313 -75
- package/dist/server/relayerHandler.cjs.map +1 -1
- package/dist/server/relayerHandler.d.ts +35 -2
- package/dist/server/relayerHandler.js +313 -75
- package/dist/server/relayerHandler.js.map +1 -1
- package/dist/storage/index.cjs +3 -0
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/providers/dropbox.cjs +237 -0
- package/dist/storage/providers/dropbox.cjs.map +1 -0
- package/dist/storage/providers/dropbox.d.ts +39 -0
- package/dist/storage/providers/dropbox.js +215 -0
- package/dist/storage/providers/dropbox.js.map +1 -0
- package/dist/storage/providers/dropbox.test.d.ts +1 -0
- package/dist/tests/data-upload-owner-validation.test.d.ts +1 -0
- package/dist/types/atomicStore.cjs +31 -0
- package/dist/types/atomicStore.cjs.map +1 -0
- package/dist/types/atomicStore.d.ts +236 -0
- package/dist/types/atomicStore.js +7 -0
- package/dist/types/atomicStore.js.map +1 -0
- 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 +4 -1
- package/dist/types/data.cjs.map +1 -1
- package/dist/types/data.d.ts +7 -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 +6 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/operationStore.cjs +17 -0
- package/dist/types/operationStore.cjs.map +1 -0
- package/dist/types/operationStore.d.ts +171 -0
- package/dist/types/operationStore.js +1 -0
- package/dist/types/operationStore.js.map +1 -0
- package/dist/types/operations.cjs +3 -15
- package/dist/types/operations.cjs.map +1 -1
- package/dist/types/operations.d.ts +17 -42
- package/dist/types/operations.js +2 -13
- 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 +308 -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 +4 -0
- package/dist/types/personal.cjs.map +1 -1
- package/dist/types/personal.d.ts +19 -0
- package/dist/types/relayer.cjs.map +1 -1
- package/dist/types/relayer.d.ts +53 -9
- package/dist/types/utils.cjs.map +1 -1
- package/dist/types/utils.d.ts +0 -49
- package/dist/utils/__tests__/chainQuery.test.d.ts +1 -0
- 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/grantFiles.cjs +4 -1
- package/dist/utils/grantFiles.cjs.map +1 -1
- package/dist/utils/grantFiles.js +4 -1
- package/dist/utils/grantFiles.js.map +1 -1
- 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,7 +1,7 @@
|
|
|
1
1
|
import type { Address, Hash } from "viem";
|
|
2
|
-
import type {
|
|
2
|
+
import type { TransactionOptions, TransactionResult } from "../types/operations";
|
|
3
|
+
import type { GrantPermissionParams, RevokePermissionParams, PermissionGrantTypedData, GenericTypedData, OnChainPermissionGrant, GetUserPermissionsOptions, AddAndTrustServerParams, TrustServerParams, UntrustServerParams, AddAndTrustServerTypedData, TrustServerTypedData, TrustedServerInfo, PaginatedTrustedServers, TrustedServerQueryOptions, BatchServerInfoResult, ServerTrustStatus, GrantFile, Grantee, GranteeInfo, RegisterGranteeParams, GranteeQueryOptions, PaginatedGrantees, ServerInfo, ServerFilesAndPermissionParams, ServerFilesAndPermissionTypedData } from "../types/index";
|
|
3
4
|
import type { PermissionGrantResult, PermissionRevokeResult, ServerTrustResult } from "../types/transactionResults";
|
|
4
|
-
import type { TransactionResult } from "../types/operations";
|
|
5
5
|
import type { PermissionInfo } from "../types/permissions";
|
|
6
6
|
/**
|
|
7
7
|
* Provides shared configuration and services for all SDK controllers.
|
|
@@ -101,7 +101,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
101
101
|
* await vana.permissions.revoke({ permissionId: result.permissionId });
|
|
102
102
|
* ```
|
|
103
103
|
*/
|
|
104
|
-
grant(params: GrantPermissionParams): Promise<PermissionGrantResult>;
|
|
104
|
+
grant(params: GrantPermissionParams, options?: TransactionOptions): Promise<PermissionGrantResult>;
|
|
105
105
|
/**
|
|
106
106
|
* Submits a permission grant transaction and returns a handle for flexible result access.
|
|
107
107
|
*
|
|
@@ -127,7 +127,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
127
127
|
* console.log(`Permission ID: ${eventData.permissionId}`);
|
|
128
128
|
* ```
|
|
129
129
|
*/
|
|
130
|
-
submitPermissionGrant(params: GrantPermissionParams): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
|
|
130
|
+
submitPermissionGrant(params: GrantPermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
|
|
131
131
|
/**
|
|
132
132
|
* Prepares a permission grant with preview before signing.
|
|
133
133
|
*
|
|
@@ -153,7 +153,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
153
153
|
* const transactionHash = await confirm();
|
|
154
154
|
* ```
|
|
155
155
|
*/
|
|
156
|
-
prepareGrant(params: GrantPermissionParams): Promise<{
|
|
156
|
+
prepareGrant(params: GrantPermissionParams, options?: TransactionOptions): Promise<{
|
|
157
157
|
preview: GrantFile;
|
|
158
158
|
confirm: () => Promise<PermissionGrantResult>;
|
|
159
159
|
}>;
|
|
@@ -225,7 +225,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
225
225
|
* );
|
|
226
226
|
* ```
|
|
227
227
|
*/
|
|
228
|
-
submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
|
|
228
|
+
submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
|
|
229
229
|
/**
|
|
230
230
|
* Submits an already-signed trust server transaction to the blockchain.
|
|
231
231
|
*
|
|
@@ -247,7 +247,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
247
247
|
* const result = await txHandle.waitForEvents();
|
|
248
248
|
* ```
|
|
249
249
|
*/
|
|
250
|
-
submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
|
|
250
|
+
submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
|
|
251
251
|
/**
|
|
252
252
|
* Submits an already-signed add and trust server transaction to the blockchain.
|
|
253
253
|
*
|
|
@@ -269,7 +269,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
269
269
|
* const result = await txHandle.waitForEvents();
|
|
270
270
|
* ```
|
|
271
271
|
*/
|
|
272
|
-
submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
|
|
272
|
+
submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
|
|
273
273
|
/**
|
|
274
274
|
* Internal method to submit a signed grant and wait for events.
|
|
275
275
|
*
|
|
@@ -288,6 +288,17 @@ export declare class PermissionsController extends BaseController {
|
|
|
288
288
|
* @returns Promise resolving to PermissionGrantResult with parsed events
|
|
289
289
|
*/
|
|
290
290
|
private confirmGrantInternalWithEvents;
|
|
291
|
+
/**
|
|
292
|
+
* Polls the relayer for confirmation of a pending operation.
|
|
293
|
+
*
|
|
294
|
+
* @param operationId - The operation ID to poll
|
|
295
|
+
* @param options - Polling configuration including status updates and cancellation
|
|
296
|
+
* @returns Promise resolving to the confirmed hash and receipt
|
|
297
|
+
* @throws {TransactionPendingError} When the operation times out
|
|
298
|
+
* @throws {Error} When the operation fails or is cancelled
|
|
299
|
+
* @internal
|
|
300
|
+
*/
|
|
301
|
+
private pollRelayerForConfirmation;
|
|
291
302
|
/**
|
|
292
303
|
* Submits an already-signed permission revoke transaction to the blockchain.
|
|
293
304
|
*
|
|
@@ -309,7 +320,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
309
320
|
* const result = await txHandle.waitForEvents();
|
|
310
321
|
* ```
|
|
311
322
|
*/
|
|
312
|
-
submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
|
|
323
|
+
submitSignedRevoke(typedData: GenericTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
|
|
313
324
|
/**
|
|
314
325
|
* Submits an already-signed untrust server transaction to the blockchain.
|
|
315
326
|
*
|
|
@@ -331,7 +342,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
331
342
|
* const result = await txHandle.waitForEvents();
|
|
332
343
|
* ```
|
|
333
344
|
*/
|
|
334
|
-
submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "untrustServerWithSignature">>;
|
|
345
|
+
submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "untrustServerWithSignature">>;
|
|
335
346
|
/**
|
|
336
347
|
* Submits a signed transaction directly to the blockchain.
|
|
337
348
|
*
|
|
@@ -416,7 +427,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
416
427
|
* console.log(`Permission ${result.permissionId} revoked`);
|
|
417
428
|
* ```
|
|
418
429
|
*/
|
|
419
|
-
submitRevokeWithSignature(params: RevokePermissionParams): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
|
|
430
|
+
submitRevokeWithSignature(params: RevokePermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
|
|
420
431
|
/**
|
|
421
432
|
* Retrieves the user's current nonce from the DataPortabilityServers contract.
|
|
422
433
|
* This nonce is used for server-related operations (AddAndTrustServer, TrustServer, UntrustServer).
|
|
@@ -598,7 +609,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
598
609
|
* @param params - Parameters for adding and trusting the server
|
|
599
610
|
* @returns Promise resolving to TransactionResult with ServerTrustResult event data
|
|
600
611
|
*/
|
|
601
|
-
submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
|
|
612
|
+
submitAddAndTrustServerWithSignature(params: AddAndTrustServerParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
|
|
602
613
|
/**
|
|
603
614
|
* Trusts a server using a signature (gasless transaction - legacy method).
|
|
604
615
|
*
|
|
@@ -612,7 +623,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
612
623
|
* @throws {ServerUrlMismatchError} When server URL doesn't match existing registration
|
|
613
624
|
* @throws {BlockchainError} When trust operation fails for any other reason
|
|
614
625
|
*/
|
|
615
|
-
submitTrustServerWithSignature(params: TrustServerParams): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
|
|
626
|
+
submitTrustServerWithSignature(params: TrustServerParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
|
|
616
627
|
/**
|
|
617
628
|
* Submits a direct untrust server transaction (without signature).
|
|
618
629
|
*
|
|
@@ -840,6 +851,9 @@ export declare class PermissionsController extends BaseController {
|
|
|
840
851
|
* A grantee is an entity (like an application) that can receive data permissions
|
|
841
852
|
* from users. Once registered, users can grant the grantee access to their data.
|
|
842
853
|
*
|
|
854
|
+
* This method supports gasless transactions via relayer when configured.
|
|
855
|
+
* If no relayer is available, it falls back to direct wallet transactions.
|
|
856
|
+
*
|
|
843
857
|
* @param params - Parameters for registering the grantee
|
|
844
858
|
* @param params.owner - The Ethereum address that will own this grantee registration
|
|
845
859
|
* @param params.granteeAddress - The Ethereum address of the grantee (application)
|
|
@@ -848,7 +862,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
848
862
|
* @returns Promise resolving to the transaction hash
|
|
849
863
|
* @throws {BlockchainError} When the grantee registration transaction fails
|
|
850
864
|
* @throws {UserRejectedRequestError} When user rejects the transaction
|
|
851
|
-
* @throws {
|
|
865
|
+
* @throws {RelayerError} When gasless transaction submission fails
|
|
852
866
|
*
|
|
853
867
|
* @example
|
|
854
868
|
* ```typescript
|
|
@@ -895,15 +909,16 @@ export declare class PermissionsController extends BaseController {
|
|
|
895
909
|
*/
|
|
896
910
|
getGrantees(options?: GranteeQueryOptions): Promise<PaginatedGrantees>;
|
|
897
911
|
/**
|
|
898
|
-
* Retrieves a specific grantee by their Ethereum address
|
|
912
|
+
* Retrieves a specific grantee by their Ethereum wallet address.
|
|
899
913
|
*
|
|
914
|
+
* @remarks
|
|
900
915
|
* Looks up a registered grantee (application) using their Ethereum address
|
|
901
|
-
* and returns their complete registration information including permissions.
|
|
916
|
+
* and returns their complete registration information including all associated permissions.
|
|
902
917
|
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
* @
|
|
906
|
-
* @
|
|
918
|
+
* Returns `null` if the address is not registered as a grantee or if an error occurs.
|
|
919
|
+
*
|
|
920
|
+
* @param granteeAddress - Ethereum wallet address of the grantee to query
|
|
921
|
+
* @returns Grantee information including ID, addresses, public key, and permission IDs, or `null` if not found
|
|
907
922
|
*
|
|
908
923
|
* @example
|
|
909
924
|
* ```typescript
|
|
@@ -922,15 +937,16 @@ export declare class PermissionsController extends BaseController {
|
|
|
922
937
|
*/
|
|
923
938
|
getGranteeByAddress(granteeAddress: Address): Promise<Grantee | null>;
|
|
924
939
|
/**
|
|
925
|
-
* Retrieves a specific grantee by their unique ID
|
|
940
|
+
* Retrieves a specific grantee by their unique ID.
|
|
926
941
|
*
|
|
942
|
+
* @remarks
|
|
927
943
|
* Looks up a registered grantee (application) using their numeric ID assigned during
|
|
928
|
-
* registration and returns their complete information including permissions.
|
|
944
|
+
* registration and returns their complete information including all associated permissions.
|
|
929
945
|
*
|
|
930
|
-
*
|
|
931
|
-
*
|
|
932
|
-
* @
|
|
933
|
-
* @
|
|
946
|
+
* Returns `null` if the grantee is not found or if an error occurs during fetching.
|
|
947
|
+
*
|
|
948
|
+
* @param granteeId - Unique numeric ID of the grantee (1-indexed)
|
|
949
|
+
* @returns Grantee information including ID, addresses, public key, and permission IDs, or `null` if not found
|
|
934
950
|
*
|
|
935
951
|
* @example
|
|
936
952
|
* ```typescript
|
|
@@ -938,7 +954,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
938
954
|
*
|
|
939
955
|
* if (grantee) {
|
|
940
956
|
* console.log(`Grantee ID: ${grantee.id}`);
|
|
941
|
-
* console.log(`Address: ${grantee.
|
|
957
|
+
* console.log(`Address: ${grantee.address}`);
|
|
942
958
|
* console.log(`Owner: ${grantee.owner}`);
|
|
943
959
|
* console.log(`Total permissions: ${grantee.permissionIds.length}`);
|
|
944
960
|
* } else {
|
|
@@ -1041,6 +1057,24 @@ export declare class PermissionsController extends BaseController {
|
|
|
1041
1057
|
* @returns Promise resolving to array of file IDs
|
|
1042
1058
|
*/
|
|
1043
1059
|
getPermissionFileIds(permissionId: bigint): Promise<bigint[]>;
|
|
1060
|
+
/**
|
|
1061
|
+
* Retrieves detailed grant file data from IPFS or HTTP storage.
|
|
1062
|
+
*
|
|
1063
|
+
* @remarks
|
|
1064
|
+
* This method automatically uses the SDK's configured downloadRelayer to bypass CORS restrictions.
|
|
1065
|
+
* Use this instead of importing the standalone `retrieveGrantFile` utility.
|
|
1066
|
+
*
|
|
1067
|
+
* @param grantUrl - The grant file URL (from OnChainPermissionGrant.grantUrl)
|
|
1068
|
+
* @returns Promise resolving to the complete grant file with operation details
|
|
1069
|
+
* @throws {NetworkError} When all retrieval attempts fail
|
|
1070
|
+
* @example
|
|
1071
|
+
* ```typescript
|
|
1072
|
+
* const grants = await vana.permissions.getUserPermissionGrantsOnChain();
|
|
1073
|
+
* const grantFile = await vana.permissions.retrieveGrantFile(grants[0].grantUrl);
|
|
1074
|
+
* console.log(`Operation: ${grantFile.operation}`);
|
|
1075
|
+
* ```
|
|
1076
|
+
*/
|
|
1077
|
+
retrieveGrantFile(grantUrl: string): Promise<GrantFile>;
|
|
1044
1078
|
/**
|
|
1045
1079
|
* Get all permissions for a specific file (alias for getFilePermissionIds)
|
|
1046
1080
|
*
|
|
@@ -1049,17 +1083,39 @@ export declare class PermissionsController extends BaseController {
|
|
|
1049
1083
|
*/
|
|
1050
1084
|
getFilePermissions(fileId: bigint): Promise<bigint[]>;
|
|
1051
1085
|
/**
|
|
1052
|
-
*
|
|
1086
|
+
* Retrieves detailed grantee information including all associated permissions.
|
|
1087
|
+
*
|
|
1088
|
+
* @remarks
|
|
1089
|
+
* Returns grantee metadata and associated permission IDs. Uses the newer
|
|
1090
|
+
* paginated contract method internally for efficient permission fetching.
|
|
1053
1091
|
*
|
|
1054
|
-
* @param granteeId -
|
|
1055
|
-
* @returns
|
|
1092
|
+
* @param granteeId - Unique grantee identifier as bigint
|
|
1093
|
+
* @returns Grantee information containing owner address, grantee address, public key, and permission IDs
|
|
1094
|
+
* @throws {BlockchainError} When grantee ID is not found or contract read fails
|
|
1095
|
+
*
|
|
1096
|
+
* @example
|
|
1097
|
+
* ```typescript
|
|
1098
|
+
* const granteeInfo = await vana.permissions.getGranteeInfo(BigInt(1));
|
|
1099
|
+
* console.log(`Grantee ${granteeInfo.granteeAddress} has ${granteeInfo.permissionIds.length} permissions`);
|
|
1100
|
+
* ```
|
|
1056
1101
|
*/
|
|
1057
1102
|
getGranteeInfo(granteeId: bigint): Promise<GranteeInfo>;
|
|
1058
1103
|
/**
|
|
1059
|
-
*
|
|
1104
|
+
* Retrieves detailed grantee information by wallet address.
|
|
1105
|
+
*
|
|
1106
|
+
* @remarks
|
|
1107
|
+
* Looks up the grantee ID from the provided address, then fetches complete
|
|
1108
|
+
* grantee information including all associated permissions.
|
|
1109
|
+
*
|
|
1110
|
+
* @param granteeAddress - Ethereum wallet address of the grantee to query
|
|
1111
|
+
* @returns Grantee information containing owner address, grantee address, public key, and permission IDs
|
|
1112
|
+
* @throws {BlockchainError} When grantee address is not registered or contract read fails
|
|
1060
1113
|
*
|
|
1061
|
-
* @
|
|
1062
|
-
*
|
|
1114
|
+
* @example
|
|
1115
|
+
* ```typescript
|
|
1116
|
+
* const granteeInfo = await vana.permissions.getGranteeInfoByAddress("0x742d35Cc6634c0532925a3b844Bc9e8e1ee3b2De");
|
|
1117
|
+
* console.log(`Found grantee with ${granteeInfo.permissionIds.length} permissions`);
|
|
1118
|
+
* ```
|
|
1063
1119
|
*/
|
|
1064
1120
|
getGranteeInfoByAddress(granteeAddress: Address): Promise<GranteeInfo>;
|
|
1065
1121
|
/**
|
|
@@ -1076,6 +1132,57 @@ export declare class PermissionsController extends BaseController {
|
|
|
1076
1132
|
* @returns Promise resolving to array of permission IDs
|
|
1077
1133
|
*/
|
|
1078
1134
|
getGranteePermissions(granteeId: bigint): Promise<bigint[]>;
|
|
1135
|
+
/**
|
|
1136
|
+
* Retrieves permission IDs for a specific grantee with flexible pagination.
|
|
1137
|
+
*
|
|
1138
|
+
* @remarks
|
|
1139
|
+
* **Pagination Behavior:**
|
|
1140
|
+
* Returns different types based on parameters:
|
|
1141
|
+
* - Without offset/limit: Returns `bigint[]` of all permissions using batched multicall
|
|
1142
|
+
* - With offset/limit: Returns paginated object with `permissionIds`, `totalCount`, and `hasMore`
|
|
1143
|
+
*
|
|
1144
|
+
* Uses gas-aware multicall for efficient batch fetching when retrieving all permissions.
|
|
1145
|
+
*
|
|
1146
|
+
* @param granteeId - Grantee ID to get permissions for
|
|
1147
|
+
* @param options - Optional pagination parameters
|
|
1148
|
+
* @param options.offset - Zero-based starting index for pagination. Defaults to 0 when fetching all permissions. Required for single-page requests.
|
|
1149
|
+
* @param options.limit - Maximum number of permission IDs to return per page. Defaults to 100 when fetching all permissions. Required for single-page requests.
|
|
1150
|
+
* @returns When called without options: Array of all permission IDs as `bigint[]`.
|
|
1151
|
+
* When called with offset and limit: Paginated result object containing `permissionIds` array,
|
|
1152
|
+
* `totalCount`, and `hasMore` boolean.
|
|
1153
|
+
* @throws {BlockchainError} When contract read operation fails
|
|
1154
|
+
*
|
|
1155
|
+
* @example
|
|
1156
|
+
* ```typescript
|
|
1157
|
+
* // Fetch all permissions (no pagination params)
|
|
1158
|
+
* const allPermissions = await vana.permissions.getGranteePermissionsPaginated(BigInt(1));
|
|
1159
|
+
* console.log(`Total permissions: ${allPermissions.length}`);
|
|
1160
|
+
*
|
|
1161
|
+
* // Fetch a specific page (with pagination params)
|
|
1162
|
+
* const page = await vana.permissions.getGranteePermissionsPaginated(BigInt(1), {
|
|
1163
|
+
* offset: BigInt(0),
|
|
1164
|
+
* limit: BigInt(100)
|
|
1165
|
+
* });
|
|
1166
|
+
* console.log(`Fetched ${page.permissionIds.length} permissions`);
|
|
1167
|
+
* console.log(`Total: ${page.totalCount}, Has more: ${page.hasMore}`);
|
|
1168
|
+
*
|
|
1169
|
+
* // Fetch next page
|
|
1170
|
+
* if (page.hasMore) {
|
|
1171
|
+
* const nextPage = await vana.permissions.getGranteePermissionsPaginated(BigInt(1), {
|
|
1172
|
+
* offset: BigInt(100),
|
|
1173
|
+
* limit: BigInt(100)
|
|
1174
|
+
* });
|
|
1175
|
+
* }
|
|
1176
|
+
* ```
|
|
1177
|
+
*/
|
|
1178
|
+
getGranteePermissionsPaginated(granteeId: bigint, options?: {
|
|
1179
|
+
offset?: bigint;
|
|
1180
|
+
limit?: bigint;
|
|
1181
|
+
}): Promise<bigint[] | {
|
|
1182
|
+
permissionIds: bigint[];
|
|
1183
|
+
totalCount: bigint;
|
|
1184
|
+
hasMore: boolean;
|
|
1185
|
+
}>;
|
|
1079
1186
|
/**
|
|
1080
1187
|
* Get all server IDs for a user
|
|
1081
1188
|
*
|
|
@@ -1183,7 +1290,7 @@ export declare class PermissionsController extends BaseController {
|
|
|
1183
1290
|
* @throws {BlockchainError} When permission addition fails
|
|
1184
1291
|
* @throws {NetworkError} When network communication fails
|
|
1185
1292
|
*/
|
|
1186
|
-
submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
|
|
1293
|
+
submitSignedAddPermission(typedData: GenericTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
|
|
1187
1294
|
/**
|
|
1188
1295
|
* Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
|
|
1189
1296
|
*
|