Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/aave.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to perform Aave operations on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/aerodrome-swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to execute token swaps on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/debridge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to bridge tokens across chains on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/erc20-approval.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to manage ERC20 token approvals on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/erc20-transfer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to transfer ERC20 tokens on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to sign transactions on behalf of your Vincent App Users, allowing them to interact with contracts that don't have an explicit Vincent Ability made for interacting with them, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/morpho.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to perform Morpho vault operations on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
2 changes: 1 addition & 1 deletion docs/ability/official-abilities/uniswap-swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Depending on your role in the Vincent Ecosystem, you'll be interacting with this

If you want to enable your App Delegatees to execute token swaps on behalf of your Vincent App Users, you can add this Ability to your App.

Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Create Vincent App](/app/quickstart) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.
Adding Abilities to your Vincent App is done using the [Vincent App Dashboard](https://dashboard.heyvincent.ai/). Visit the [Creating an App](/app/creating-an-app) guide to learn more about how to add Abilities to your App during creation, or check out the [Updating Your App](/app/updating-apps) guide to learn how to add Abilities to an existing App.

## Executing the Ability as a Vincent App Delegatee

Expand Down
25 changes: 17 additions & 8 deletions docs/app/quickstart.mdx → docs/app/app-starter-kit.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
title: Quick Start
title: App Starter Kit
---

Build your first Vincent App and start accepting users in under 20 minutes.
Get started quickly with Vincent using our pre-configured App Starter Kit. This approach provides a complete example application with all the setup already done for you.

## What is the App Starter Kit?

The Vincent App Starter Kit is an opinionated template that includes a fully configured Vincent App with example abilities, policies, and testing setup. It's a complete reference implementation that demonstrates best practices for building with Vincent.

<Card title="App Starter Kit" icon="github" href="https://github.com/LIT-Protocol/vincent-starter-app">
Clone the Vincent App Starter Kit repository for quick setup
Expand All @@ -24,7 +28,7 @@ Build your first Vincent App and start accepting users in under 20 minutes.

## Video Tutorial

Follow along with this comprehensive video tutorial to build your first Vincent App:
Follow along with this comprehensive video tutorial to build your first Vincent App using the starter kit:

<iframe
width="100%"
Expand All @@ -38,14 +42,19 @@ Follow along with this comprehensive video tutorial to build your first Vincent

## What's Next?

<CardGroup cols={3}>
<CardGroup cols={2}>
<Card title="Publishing Guide" icon="cloud-arrow-up" href="/app/publishing-apps">
Learn how to publish your App to the Vincent Registry
</Card>
<Card title="Understanding Apps" icon="code" href="/app/explaining-apps">
Deep dive into how Vincent Apps work
Publish your App to the Vincent Registry
</Card>
<Card title="User Authentication" icon="shield-check" href="/app/authenticating-users">
Learn how to authenticate users in your App
</Card>
</CardGroup>

## Prefer Manual Setup?

If you'd like more control over the setup process or want to integrate Vincent into an existing project, check out our manual setup guide:

<Card title="Creating an App" icon="code" href="/app/creating-an-app">
Follow the step-by-step manual setup guide
</Card>
271 changes: 271 additions & 0 deletions docs/app/creating-an-app.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
---
title: Creating an App
---

Set up your Vincent development environment and test your abilities locally by following this guide.

## Step 1: Configure Environment Variables

To start onboarding your application onto Vincent, add the following environment variables to your project's `.env` file:

```bash
# This wallet is expected to have Lit test tokens, and will be used to:
# - Fund the App Manager to register the Vincent App
# - Fund the App Delegatee to be able to execute Vincent Abilities
# You can fund this wallet with test tokens using the faucet:
# https://chronicle-yellowstone-faucet.getlit.dev/
TEST_FUNDER_PRIVATE_KEY='<Funder Private Key Here>'

# This wallet will own the Vincent App and will be in charge of:
# - Creating new App Versions
# - Adding Vincent Abilities to App Versions
# - Adding Delegatees to the App
TEST_APP_MANAGER_PRIVATE_KEY='<App Manager Private Key Here>'

# This wallet will execute the Vincent Abilities for a specific
# Vincent App on behalf of the Vincent User
TEST_APP_DELEGATEE_PRIVATE_KEY='<Delegatee Private Key here>'

# This wallet will own the Vincent Agent Wallet that Vincent Delegatees use to
# execute Abilities on its behalf. It's responsible for permitting each App Version,
# granting the App Delegatees to sign with the Agent Wallet within Abilities
TEST_AGENT_WALLET_PKP_OWNER_PRIVATE_KEY='<Agent Wallet Owner Private Key here>'
```

<Warning>
**Security Note:** These are test environment private keys. Never commit your `.env` file to version control. Add it to your `.gitignore` file.
</Warning>

## Step 2: Fund Your Wallets

Go to the [Lit Protocol Faucet](https://chronicle-yellowstone-faucet.getlit.dev/) and claim some `tstLPX` tokens for the Ethereum wallet address that corresponds to the `TEST_FUNDER_PRIVATE_KEY`.

The funder wallet will automatically fund the App Manager and Delegatee wallets to ensure they have enough tokens to cover the gas fees necessary to interact with the Vincent Contract.

## Step 3: Install Required Packages

Install the necessary Vincent packages for your project.

**Replace `@lit-protocol/vincent-ability-evm-transaction-signer` with your chosen Vincent ability and policy packages:**

<CodeGroup>
```bash npm
npm install -D tsx
npm install @lit-protocol/vincent-ability-evm-transaction-signer @lit-protocol/vincent-app-sdk @lit-protocol/vincent-e2e-test-utils dotenv ethers@5
```

```bash yarn
yarn add -D tsx
yarn add @lit-protocol/vincent-ability-evm-transaction-signer @lit-protocol/vincent-app-sdk @lit-protocol/vincent-e2e-test-utils dotenv ethers@5
```

```bash pnpm
pnpm add -D tsx
pnpm add @lit-protocol/vincent-ability-evm-transaction-signer @lit-protocol/vincent-app-sdk @lit-protocol/vincent-e2e-test-utils dotenv ethers@5
```
</CodeGroup>

### Choosing Abilities and Policies

If you're unsure about what Vincent abilities and policies to use for your app, explore these resources:

<CardGroup cols={2}>
<Card title="Official Abilities" icon="puzzle-piece" href="/ability/official-abilities">
Browse pre-built abilities for common use cases
</Card>
<Card title="Official Policies" icon="shield-check" href="/ability/policy/official-policies">
Browse pre-built policies for common ability restriction requirements
</Card>
</CardGroup>

<CardGroup cols={1}>
<Card title="Need to Create a Custom Ability?" icon="wrench" href="/ability/official-abilities">
Build your own ability using the Vincent Ability Starter Kit
</Card>
</CardGroup>

## Step 4: Create Your Test Script

Create a file called `test-vincent-app.ts` in your project. This script will set up your Vincent development environment and test ability execution.

<Warning>
**Important:** The code below uses the EVM Transaction Signer ability as an example. You must replace the following to match your chosen ability and policies:

1. **Ability import** - Replace `@lit-protocol/vincent-ability-evm-transaction-signer` with your ability package
2. **PERMISSION_DATA object** - Update with your ability's IPFS CID and associated policies
3. **Ability parameters** - Update the `precheck()` and `execute()` parameters to match your ability's requirements

Look for `TODO` comments in the code to locate these sections.
</Warning>

```typescript
import { config } from 'dotenv';
import * as util from 'util';
import {
setupVincentDevelopmentEnvironment,
} from '@lit-protocol/vincent-e2e-test-utils';
import {
getVincentAbilityClient,
disconnectVincentAbilityClients,
} from '@lit-protocol/vincent-app-sdk/abilityClient';
import { ethers } from 'ethers';

// TODO: Import your bundled abilities here
import {
bundledVincentAbility,
} from '@lit-protocol/vincent-ability-evm-transaction-signer';

// Load environment variables
config();

// Run setup and execution if this file is executed directly
if (require.main === module) {
(async () => {
try {
console.log('🚀 Starting ability execution...\n');

// Setup Vincent development environment (handles funding internally)
console.log('🔧 Setting up Vincent development environment...');
// TODO: Add your bundled Vincent Abilities, Policies, and Policy values here
const PERMISSION_DATA = {
[bundledVincentAbility.ipfsCid]: {},
};

const { agentPkpInfo, wallets } = await setupVincentDevelopmentEnvironment({
permissionData: PERMISSION_DATA,
});

console.log('✅ Setup complete\n');

// Create ability client with your bundled ability
const abilityClient = getVincentAbilityClient({
bundledVincentAbility: bundledVincentAbility,
ethersSigner: wallets.appDelegatee,
debug: false
});

// Create and serialize a sample transaction (ERC20 transfer of USDC)
// Note: This transaction won't be submitted, so we use example values
console.log('📝 Creating transaction...');

const serializedTx = ethers.utils.serializeTransaction({
to: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base
value: '0x00',
data: new ethers.utils.Interface([
'function transfer(address to, uint256 amount) returns (bool)',
]).encodeFunctionData('transfer', [
'0x4200000000000000000000000000000000000006', // Recipient (WETH contract as example)
'100000', // 0.1 USDC (6 decimals)
]),
chainId: 8453, // Base mainnet
nonce: 0, // Example nonce
gasPrice: '0x3B9ACA00', // Example: 1 gwei
gasLimit: '0x186A0', // 100,000 gas
});

// TODO: Run the precheck according to your imported abilities
console.log('\n🔍 Running precheck...');
const precheckResult = await abilityClient.precheck(
{
serializedTransaction: serializedTx,
},
{
delegatorPkpEthAddress: agentPkpInfo.ethAddress,
},
);

console.log('Precheck result:', util.inspect(precheckResult, { depth: 10 }));

if (!precheckResult.success) {
console.error('❌ Precheck failed:');
if (precheckResult.runtimeError) {
console.error(' Runtime error:', precheckResult.runtimeError);
}
if (precheckResult.result) {
console.error(' Result:', util.inspect(precheckResult.result, { depth: 10 }));
}
return;
}

const { deserializedUnsignedTransaction } = precheckResult.result;
console.log('✅ Precheck passed - deserialized transaction:', deserializedUnsignedTransaction);

// TODO: Execute according to your imported abilities
console.log('\n⚡ Executing ability (signing transaction)...');
const executeResult = await abilityClient.execute(
{
serializedTransaction: serializedTx,
},
{
delegatorPkpEthAddress: agentPkpInfo.ethAddress,
},
);

console.log('Execution result:', util.inspect(executeResult, { depth: 10 }));

if (!executeResult.success) {
console.error('❌ Execution failed:');
if (executeResult.runtimeError) {
console.error(' Runtime error:', executeResult.runtimeError);
}
if (executeResult.result) {
console.error(' Result:', util.inspect(executeResult.result, { depth: 10 }));
}
return;
}

const { signedTransaction, deserializedSignedTransaction } = executeResult.result;
console.log('\n🎉 All ability executions completed successfully!');
console.log('\nSigned transaction:', signedTransaction);
console.log('Deserialized signed transaction:', deserializedSignedTransaction);
} catch (error) {
console.error('❌ Execution failed with error:', error);
throw error;
} finally {
console.log('\n🧹 Cleaning up...');
await disconnectVincentAbilityClients();
}
})();
}
```

## Step 5: Run Your Test

Execute your test script using `tsx`:

<CodeGroup>
```bash npm
npx tsx test-vincent-app.ts
```

```bash yarn
yarn tsx test-vincent-app.ts
```

```bash pnpm
pnpm tsx test-vincent-app.ts
```
</CodeGroup>

The output will show the setup progress, precheck results, and execution results. A successful run will end with:

```
🎉 All ability executions completed successfully!
🧹 Cleaning up...
```

**Congratulations!** You've successfully set up and tested your Vincent App!

## What's Next?

<Card title="Migrating to Production" icon="rocket" href="/app/migrating-to-production">
Deploy your App to production environment
</Card>

## Want a Full Example Instead?

If you'd prefer to explore a complete working application rather than integrating Vincent into your own project, check out our App Starter Kit:

<Card title="App Starter Kit" icon="github" href="/app/app-starter-kit">
Explore a pre-configured template with video tutorial
</Card>
Loading