1- import {
2- delegator ,
3- delegatee ,
4- appManager ,
5- funder ,
6- getChainHelpers ,
7- ensureUnexpiredCapacityToken ,
8- type PkpInfo ,
9- } from '../index' ;
10- import { type PermissionData } from '@lit-protocol/vincent-contracts-sdk' ;
11- import { type Wallet } from 'ethers' ;
1+ import type { Wallet } from 'ethers' ;
122
13- export interface SetupResult {
3+ import type { PermissionData } from '@lit-protocol/vincent-contracts-sdk' ;
4+
5+ import type { PkpInfo } from './mint-new-pkp' ;
6+
7+ import * as appManager from './appManager' ;
8+ import { getChainHelpers } from './chain' ;
9+ import * as delegatee from './delegatee' ;
10+ import * as delegator from './delegator' ;
11+ import { ensureUnexpiredCapacityToken } from './ensure-capacity-credit' ;
12+ import * as funder from './funder' ;
13+
14+ export interface VincentDevEnvironment {
1415 agentPkpInfo : PkpInfo ;
1516 wallets : {
1617 appDelegatee : Wallet ;
@@ -35,19 +36,29 @@ export interface SetupResult {
3536 * @returns the setup result including agent PKP info, wallets, app ID, and app version
3637 * @example
3738 * ```typescript
39+ * // Example with no policies
3840 * const permissionData = {
39- * // EVM Transaction Signer Ability has no policies
40- * // If yours does, you would add the policies to this object
4141 * [bundledVincentAbility.ipfsCid]: {},
4242 * };
43+ *
44+ * // Example with policies
45+ * const permissionDataWithPolicies = {
46+ * [bundledVincentAbility.ipfsCid]: {
47+ * [spendingLimitPolicy.ipfsCid]: {
48+ * limit: '1000000',
49+ * period: '86400',
50+ * },
51+ * },
52+ * };
53+ *
4354 * const result = await setupVincentDevelopmentEnvironment({ permissionData });
4455 * ```
4556 */
4657export const setupVincentDevelopmentEnvironment = async ( {
4758 permissionData,
4859} : {
4960 permissionData : PermissionData ;
50- } ) : Promise < SetupResult > => {
61+ } ) : Promise < VincentDevEnvironment > => {
5162 // Check and fund all required accounts
5263 await funder . checkFunderBalance ( ) ;
5364 await delegatee . ensureAppDelegateeFunded ( ) ;
0 commit comments