@lit-protocol/vincent-ability-aave 0.2.8 → 1.0.1-mma

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.
Files changed (50) hide show
  1. package/README.md +51 -86
  2. package/dist/CHANGELOG.md +7 -0
  3. package/dist/README.md +51 -86
  4. package/dist/package.json +5 -5
  5. package/dist/src/generated/lit-action.js +2 -2
  6. package/dist/src/generated/vincent-ability-metadata.json +1 -1
  7. package/dist/src/generated/vincent-bundled-ability.d.ts +1417 -66
  8. package/dist/src/generated/vincent-bundled-ability.d.ts.map +1 -1
  9. package/dist/src/index.d.ts +2 -0
  10. package/dist/src/index.d.ts.map +1 -1
  11. package/dist/src/index.js +17 -1
  12. package/dist/src/index.js.map +1 -1
  13. package/dist/src/lib/decodeTransaction.d.ts +3 -0
  14. package/dist/src/lib/decodeTransaction.d.ts.map +1 -0
  15. package/dist/src/lib/decodeTransaction.js +49 -0
  16. package/dist/src/lib/decodeTransaction.js.map +1 -0
  17. package/dist/src/lib/helpers/aave.d.ts +85 -0
  18. package/dist/src/lib/helpers/aave.d.ts.map +1 -0
  19. package/dist/src/lib/helpers/aave.js +331 -0
  20. package/dist/src/lib/helpers/aave.js.map +1 -0
  21. package/dist/src/lib/helpers/erc20.d.ts +6 -0
  22. package/dist/src/lib/helpers/erc20.d.ts.map +1 -0
  23. package/dist/src/lib/helpers/erc20.js +53 -0
  24. package/dist/src/lib/helpers/erc20.js.map +1 -0
  25. package/dist/src/lib/helpers/transactionKind.d.ts +6 -0
  26. package/dist/src/lib/helpers/transactionKind.d.ts.map +1 -0
  27. package/dist/src/lib/helpers/transactionKind.js +10 -0
  28. package/dist/src/lib/helpers/transactionKind.js.map +1 -0
  29. package/dist/src/lib/lit-action.js.map +1 -1
  30. package/dist/src/lib/validateSimulation.d.ts +3 -0
  31. package/dist/src/lib/validateSimulation.d.ts.map +1 -0
  32. package/dist/src/lib/validateSimulation.js +56 -0
  33. package/dist/src/lib/validateSimulation.js.map +1 -0
  34. package/dist/src/lib/validateTransaction.d.ts +3 -0
  35. package/dist/src/lib/validateTransaction.d.ts.map +1 -0
  36. package/dist/src/lib/validateTransaction.js +79 -0
  37. package/dist/src/lib/validateTransaction.js.map +1 -0
  38. package/dist/src/lib/vincent-ability.d.ts +1417 -67
  39. package/dist/src/lib/vincent-ability.d.ts.map +1 -1
  40. package/dist/src/lib/vincent-ability.js +9 -345
  41. package/dist/src/lib/vincent-ability.js.map +1 -1
  42. package/package.json +7 -7
  43. package/dist/src/lib/helpers/index.d.ts +0 -71
  44. package/dist/src/lib/helpers/index.d.ts.map +0 -1
  45. package/dist/src/lib/helpers/index.js +0 -345
  46. package/dist/src/lib/helpers/index.js.map +0 -1
  47. package/dist/src/lib/schemas.d.ts +0 -115
  48. package/dist/src/lib/schemas.d.ts.map +0 -1
  49. package/dist/src/lib/schemas.js +0 -110
  50. package/dist/src/lib/schemas.js.map +0 -1
package/README.md CHANGED
@@ -1,112 +1,77 @@
1
- # Vincent Aave Ability
1
+ # Vincent Aave Gated Signer Ability
2
2
 
3
- A comprehensive DeFi ability for interacting with Aave v3 protocol on Ethereum, built for the Vincent
4
- Scaffold SDK and Lit Actions execution environment.
3
+ A Vincent Ability that acts as a secure, gated signer for Aave v3 operations. It is designed to work with ERC-4337 Smart Accounts (UserOperations) and EOAs (Transactions).
5
4
 
6
5
  ## Overview
7
6
 
8
- The Vincent Aave Ability enables secure, decentralized interactions with the Aave v3 lending protocol
9
- through Lit Actions. It supports all core Aave operations: supplying assets as collateral, borrowing
10
- against collateral, repaying debt, and withdrawing assets.
7
+ This ability validates transactions or UserOperations destined for the Aave v3 protocol. It ensures that the operations are safe and aligned with the user's intent before signing them with the delegated Vincent PKP.
11
8
 
12
- ## Features
9
+ It uses the `createVincentGatedSignerAbility` from `@lit-protocol/vincent-ability-sdk/gatedSigner` to enforce a strict validation lifecycle:
13
10
 
14
- - Supply assets as collateral to earn interest
15
- - Withdraw supplied assets
16
- - Borrow against collateral with stable or variable rates
17
- - Repay borrowed assets
18
- - Multi-chain support (Ethereum, Polygon, Arbitrum, Optimism, Base, and more)
19
- - Integrated with Vincent Ability SDK for secure execution
11
+ 1. **Decode**: Decodes the transaction or userOperation calldata.
12
+ 2. **Simulation**: Simulates the transaction/userOperation on-chain.
13
+ 3. **Validation**:
14
+ - Verifies interaction with authorized Aave contracts.
15
+ - Checks for value extraction (no unexpected transfers or approvals).
16
+ - Validates operation types (Approve, Supply, Withdraw, etc.).
17
+ 4. **Signing**: Signs the UserOperation (ECDSA or EIP-712) or Transaction (ECDSA) if all checks pass.
20
18
 
21
- ## Installation
19
+ ## Features
22
20
 
23
- ```bash
24
- npm install @lit-protocol/vincent-ability-aave
25
- ```
21
+ - **Smart Account Support**: Compatible with Kernel, Crossmint, Safe, and other ERC-4337 accounts.
22
+ - **EOA Support**: Can sign raw transactions for EOAs.
23
+ - **Protocol Safety**: Restricts interactions to the Aave v3 protocol.
24
+ - **Simulation-based Security**: Validates the actual on-chain effects of the transaction.
26
25
 
27
26
  ## Usage
28
27
 
28
+ This ability is typically used within a Vincent App. The backend service prepares an unsigned UserOperation or Transaction and sends it to the ability for validation and signing.
29
+
30
+ ### Parameters
31
+
32
+ The ability accepts either a `UserOperation` or a `Transaction` object.
33
+
34
+ #### For UserOperations (Smart Accounts)
35
+
29
36
  ```typescript
30
- import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk';
31
- import { bundledVincentAbility as aaveAbility } from '@lit-protocol/vincent-ability-aave';
32
-
33
- // Initialize the ability client
34
- const aaveAbilityClient = getVincentAbilityClient({
35
- bundledVincentAbility: aaveAbility,
36
- ethersSigner: yourSigner, // Your ethers signer
37
- });
38
-
39
- // Example: Supply WETH as collateral
40
- const supplyParams = {
41
- operation: 'supply',
42
- asset: '0xC558DBdd856501FCd9aaF1E62eae57A9F0629a3c', // WETH on Sepolia
43
- amount: '0.01',
44
- chain: 'sepolia',
37
+ const abilityParams = {
38
+ alchemyRpcUrl: 'https://...', // Required for simulation
39
+ entryPointAddress: '0x...',
40
+ userOp: { ... }, // The UserOperation object
41
+ // Optional parameters for Safe/EIP-712
42
+ safe4337ModuleAddress: '0x...',
43
+ eip712Params: { ... },
45
44
  };
46
-
47
- // First run precheck
48
- const precheckRes = await aaveAbilityClient.precheck(supplyParams, {
49
- delegatorPkpEthAddress: pkpAddress,
50
- });
51
-
52
- if (precheckRes.success) {
53
- // Then execute
54
- const executeRes = await aaveAbilityClient.execute(supplyParams, {
55
- delegatorPkpEthAddress: pkpAddress,
56
- });
57
-
58
- if (executeRes.success) {
59
- console.log('Transaction hash:', executeRes.result.data.txHash);
60
- }
61
- }
62
45
  ```
63
46
 
64
- ## Parameters
47
+ #### For Transactions (EOA)
48
+
49
+ ```typescript
50
+ const abilityParams = {
51
+ alchemyRpcUrl: 'https://...', // Required for simulation
52
+ transaction: {
53
+ to: '0x...',
54
+ data: '0x...',
55
+ value: '0x...',
56
+ // ... other tx fields
57
+ },
58
+ };
59
+ ```
65
60
 
66
- | Parameter | Type | Required | Description |
67
- | ------------------ | ----------------------------------------------- | -------- | ------------------------------------------------ |
68
- | `operation` | `"supply" \| "withdraw" \| "borrow" \| "repay"` | ✅ | The Aave operation to perform |
69
- | `asset` | `string` | ✅ | Token contract address (0x format) |
70
- | `amount` | `string` | ✅ | Amount as a string (e.g., "1.5") |
71
- | `chain` | `string` | ✅ | Chain identifier (e.g., "ethereum", "polygon") |
72
- | `interestRateMode` | `1 \| 2` | ❌ | 1=Stable, 2=Variable (required for borrow/repay) |
73
- | `rpcUrl` | `string` | ❌ | Custom RPC URL for precheck validation |
61
+ ## Integration
74
62
 
75
- ## Prerequisites
63
+ For a full integration example, please refer to the `vincent-smart-account-integration` project, which demonstrates how to use this ability with various smart account providers.
76
64
 
77
- - Node.js 16+ and npm/yarn
78
- - Sufficient token balance for the operation
79
- - Token approval for supply/repay operations
80
- - Properly configured PKP wallet with required permissions
65
+ ## Development
81
66
 
82
- ## Building
67
+ ### Building
83
68
 
84
69
  ```bash
85
- # Build the ability
86
- npm run build
87
-
88
- # Build all abilitys and policies
89
- npm run vincent:build
70
+ nx build ability-aave
90
71
  ```
91
72
 
92
- ## Testing
73
+ ### Testing
93
74
 
94
75
  ```bash
95
- # Run unit tests
96
- npm test
97
-
98
- # Run E2E tests
99
- npm run test:e2e
100
-
101
- # Reset test state
102
- npm run test:reset
76
+ nx test ability-aave
103
77
  ```
104
-
105
- ## Contributing
106
-
107
- Contributions are welcome! Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines on how
108
- to contribute to this project.
109
-
110
- ## License
111
-
112
- This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
package/dist/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.2.8 (2025-11-23)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated ability-sdk to 2.3.4
6
+ - Updated app-sdk to 2.5.0
7
+
1
8
  ## 0.2.5 (2025-11-06)
2
9
 
3
10
  ### 🧱 Updated Dependencies
package/dist/README.md CHANGED
@@ -1,112 +1,77 @@
1
- # Vincent Aave Ability
1
+ # Vincent Aave Gated Signer Ability
2
2
 
3
- A comprehensive DeFi ability for interacting with Aave v3 protocol on Ethereum, built for the Vincent
4
- Scaffold SDK and Lit Actions execution environment.
3
+ A Vincent Ability that acts as a secure, gated signer for Aave v3 operations. It is designed to work with ERC-4337 Smart Accounts (UserOperations) and EOAs (Transactions).
5
4
 
6
5
  ## Overview
7
6
 
8
- The Vincent Aave Ability enables secure, decentralized interactions with the Aave v3 lending protocol
9
- through Lit Actions. It supports all core Aave operations: supplying assets as collateral, borrowing
10
- against collateral, repaying debt, and withdrawing assets.
7
+ This ability validates transactions or UserOperations destined for the Aave v3 protocol. It ensures that the operations are safe and aligned with the user's intent before signing them with the delegated Vincent PKP.
11
8
 
12
- ## Features
9
+ It uses the `createVincentGatedSignerAbility` from `@lit-protocol/vincent-ability-sdk/gatedSigner` to enforce a strict validation lifecycle:
13
10
 
14
- - Supply assets as collateral to earn interest
15
- - Withdraw supplied assets
16
- - Borrow against collateral with stable or variable rates
17
- - Repay borrowed assets
18
- - Multi-chain support (Ethereum, Polygon, Arbitrum, Optimism, Base, and more)
19
- - Integrated with Vincent Ability SDK for secure execution
11
+ 1. **Decode**: Decodes the transaction or userOperation calldata.
12
+ 2. **Simulation**: Simulates the transaction/userOperation on-chain.
13
+ 3. **Validation**:
14
+ - Verifies interaction with authorized Aave contracts.
15
+ - Checks for value extraction (no unexpected transfers or approvals).
16
+ - Validates operation types (Approve, Supply, Withdraw, etc.).
17
+ 4. **Signing**: Signs the UserOperation (ECDSA or EIP-712) or Transaction (ECDSA) if all checks pass.
20
18
 
21
- ## Installation
19
+ ## Features
22
20
 
23
- ```bash
24
- npm install @lit-protocol/vincent-ability-aave
25
- ```
21
+ - **Smart Account Support**: Compatible with Kernel, Crossmint, Safe, and other ERC-4337 accounts.
22
+ - **EOA Support**: Can sign raw transactions for EOAs.
23
+ - **Protocol Safety**: Restricts interactions to the Aave v3 protocol.
24
+ - **Simulation-based Security**: Validates the actual on-chain effects of the transaction.
26
25
 
27
26
  ## Usage
28
27
 
28
+ This ability is typically used within a Vincent App. The backend service prepares an unsigned UserOperation or Transaction and sends it to the ability for validation and signing.
29
+
30
+ ### Parameters
31
+
32
+ The ability accepts either a `UserOperation` or a `Transaction` object.
33
+
34
+ #### For UserOperations (Smart Accounts)
35
+
29
36
  ```typescript
30
- import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk';
31
- import { bundledVincentAbility as aaveAbility } from '@lit-protocol/vincent-ability-aave';
32
-
33
- // Initialize the ability client
34
- const aaveAbilityClient = getVincentAbilityClient({
35
- bundledVincentAbility: aaveAbility,
36
- ethersSigner: yourSigner, // Your ethers signer
37
- });
38
-
39
- // Example: Supply WETH as collateral
40
- const supplyParams = {
41
- operation: 'supply',
42
- asset: '0xC558DBdd856501FCd9aaF1E62eae57A9F0629a3c', // WETH on Sepolia
43
- amount: '0.01',
44
- chain: 'sepolia',
37
+ const abilityParams = {
38
+ alchemyRpcUrl: 'https://...', // Required for simulation
39
+ entryPointAddress: '0x...',
40
+ userOp: { ... }, // The UserOperation object
41
+ // Optional parameters for Safe/EIP-712
42
+ safe4337ModuleAddress: '0x...',
43
+ eip712Params: { ... },
45
44
  };
46
-
47
- // First run precheck
48
- const precheckRes = await aaveAbilityClient.precheck(supplyParams, {
49
- delegatorPkpEthAddress: pkpAddress,
50
- });
51
-
52
- if (precheckRes.success) {
53
- // Then execute
54
- const executeRes = await aaveAbilityClient.execute(supplyParams, {
55
- delegatorPkpEthAddress: pkpAddress,
56
- });
57
-
58
- if (executeRes.success) {
59
- console.log('Transaction hash:', executeRes.result.data.txHash);
60
- }
61
- }
62
45
  ```
63
46
 
64
- ## Parameters
47
+ #### For Transactions (EOA)
48
+
49
+ ```typescript
50
+ const abilityParams = {
51
+ alchemyRpcUrl: 'https://...', // Required for simulation
52
+ transaction: {
53
+ to: '0x...',
54
+ data: '0x...',
55
+ value: '0x...',
56
+ // ... other tx fields
57
+ },
58
+ };
59
+ ```
65
60
 
66
- | Parameter | Type | Required | Description |
67
- | ------------------ | ----------------------------------------------- | -------- | ------------------------------------------------ |
68
- | `operation` | `"supply" \| "withdraw" \| "borrow" \| "repay"` | ✅ | The Aave operation to perform |
69
- | `asset` | `string` | ✅ | Token contract address (0x format) |
70
- | `amount` | `string` | ✅ | Amount as a string (e.g., "1.5") |
71
- | `chain` | `string` | ✅ | Chain identifier (e.g., "ethereum", "polygon") |
72
- | `interestRateMode` | `1 \| 2` | ❌ | 1=Stable, 2=Variable (required for borrow/repay) |
73
- | `rpcUrl` | `string` | ❌ | Custom RPC URL for precheck validation |
61
+ ## Integration
74
62
 
75
- ## Prerequisites
63
+ For a full integration example, please refer to the `vincent-smart-account-integration` project, which demonstrates how to use this ability with various smart account providers.
76
64
 
77
- - Node.js 16+ and npm/yarn
78
- - Sufficient token balance for the operation
79
- - Token approval for supply/repay operations
80
- - Properly configured PKP wallet with required permissions
65
+ ## Development
81
66
 
82
- ## Building
67
+ ### Building
83
68
 
84
69
  ```bash
85
- # Build the ability
86
- npm run build
87
-
88
- # Build all abilitys and policies
89
- npm run vincent:build
70
+ nx build ability-aave
90
71
  ```
91
72
 
92
- ## Testing
73
+ ### Testing
93
74
 
94
75
  ```bash
95
- # Run unit tests
96
- npm test
97
-
98
- # Run E2E tests
99
- npm run test:e2e
100
-
101
- # Reset test state
102
- npm run test:reset
76
+ nx test ability-aave
103
77
  ```
104
-
105
- ## Contributing
106
-
107
- Contributions are welcome! Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines on how
108
- to contribute to this project.
109
-
110
- ## License
111
-
112
- This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
package/dist/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-ability-aave",
3
- "version": "0.2.7",
3
+ "version": "1.0.1-mma",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "dependencies": {
8
8
  "@bgd-labs/aave-address-book": "^4.19.3",
9
- "@lit-protocol/vincent-scaffold-sdk": "^1.1.6",
10
9
  "@lit-protocol/vincent-ability-sdk": "workspace:*",
11
- "ethers": "^5.8.0",
12
10
  "tslib": "2.8.1",
13
- "zod": "^3.25.64"
11
+ "viem": "^2.38.3"
14
12
  },
15
13
  "peerDependencies": {
16
14
  "@lit-protocol/vincent-app-sdk": "workspace:^"
17
15
  },
18
16
  "devDependencies": {
19
- "esbuild": "^0.19.12",
20
17
  "@lit-protocol/esbuild-plugin-polyfill-node": "^0.3.0",
18
+ "@lit-protocol/vincent-app-sdk": "workspace:^",
19
+ "@lit-protocol/vincent-contracts-sdk": "workspace:*",
20
+ "esbuild": "^0.19.12",
21
21
  "ipfs-only-hash": "^4.0.0"
22
22
  },
23
23
  "main": "./dist/src/index.js",