@lit-protocol/vincent-ability-morpho 0.0.7-mma → 0.0.9-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.
- package/CONTRIBUTING.md +2 -8
- package/README.md +21 -31
- package/dist/CONTRIBUTING.md +2 -8
- package/dist/README.md +21 -31
- package/dist/src/generated/lit-action.js +2 -2
- package/dist/src/generated/vincent-ability-metadata.json +1 -1
- package/dist/src/generated/vincent-bundled-ability.d.ts +9 -21
- package/dist/src/generated/vincent-bundled-ability.d.ts.map +1 -1
- package/dist/src/lib/helpers/index.d.ts +6 -87
- package/dist/src/lib/helpers/index.d.ts.map +1 -1
- package/dist/src/lib/helpers/index.js +16 -193
- package/dist/src/lib/helpers/index.js.map +1 -1
- package/dist/src/lib/schemas.d.ts +13 -27
- package/dist/src/lib/schemas.d.ts.map +1 -1
- package/dist/src/lib/schemas.js +13 -36
- package/dist/src/lib/schemas.js.map +1 -1
- package/dist/src/lib/vincent-ability.d.ts +9 -21
- package/dist/src/lib/vincent-ability.d.ts.map +1 -1
- package/dist/src/lib/vincent-ability.js +82 -211
- package/dist/src/lib/vincent-ability.js.map +1 -1
- package/package.json +3 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -4,7 +4,7 @@ This document provides guidelines for contributing to the Vincent Ability Morpho
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
The Vincent Ability Morpho is a ability to send deposit, withdraw or redeem Morpho
|
|
7
|
+
The Vincent Ability Morpho is a ability to send deposit, withdraw or redeem Morpho transactions from a Vincent app on behalf of the delegator. It's part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK.
|
|
8
8
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
@@ -37,7 +37,7 @@ nx action:build ability-morpho
|
|
|
37
37
|
Building will be done automatically. Deploy the ability:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
nx action:deploy ability-
|
|
40
|
+
nx action:deploy ability-morpho
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Project Structure
|
|
@@ -54,12 +54,6 @@ nx action:deploy ability-erc20-approval
|
|
|
54
54
|
5. Write comprehensive tests for all functionality
|
|
55
55
|
6. Document the ability's purpose and usage
|
|
56
56
|
|
|
57
|
-
## Integration with Policies
|
|
58
|
-
|
|
59
|
-
This ability can be integrated with various Vincent Policies to enforce constraints. When developing or modifying the ability, consider how it will be used with policies such as:
|
|
60
|
-
|
|
61
|
-
- Vincent Policy Spending Limit
|
|
62
|
-
|
|
63
57
|
## Testing
|
|
64
58
|
|
|
65
59
|
Write unit tests for all functionality:
|
package/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
# Vincent Ability Morpho
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
withdrawCollateral) from a Vincent app on behalf of the delegator.
|
|
3
|
+
A ability to interact with Morpho vaults (deposit, withdraw, redeem) from a Vincent app on behalf of the delegator.
|
|
5
4
|
|
|
6
5
|
## Overview
|
|
7
6
|
|
|
8
|
-
The Vincent Ability Morpho is part of the Vincent Abilities ecosystem and is built using the Vincent
|
|
9
|
-
|
|
10
|
-
Vincent apps to interact with Morpho vaults on behalf of users, enabling seamless integration with
|
|
11
|
-
DeFi yield
|
|
7
|
+
The Vincent Ability Morpho is part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK. It allows
|
|
8
|
+
Vincent apps to interact with Morpho vaults on behalf of users, enabling seamless integration with DeFi yield
|
|
12
9
|
strategies.
|
|
13
10
|
|
|
14
11
|
## Features
|
|
@@ -31,7 +28,7 @@ This ability can be used in Vincent apps to interact with Morpho vaults:
|
|
|
31
28
|
|
|
32
29
|
```typescript
|
|
33
30
|
import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
|
|
34
|
-
import { bundledVincentAbility
|
|
31
|
+
import { bundledVincentAbility } from '@lit-protocol/vincent-ability-morpho';
|
|
35
32
|
|
|
36
33
|
// One of delegatee signers from your app's Vincent Dashboard
|
|
37
34
|
const delegateeSigner = new ethers.Wallet('YOUR_DELEGATEE_PRIVATE_KEY');
|
|
@@ -44,12 +41,10 @@ const abilityClient = getVincentAbilityClient({
|
|
|
44
41
|
const delegatorPkpEthAddress = '0x09182301238'; // The delegator PKP Eth Address
|
|
45
42
|
|
|
46
43
|
const abilityParams = {
|
|
47
|
-
operation:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
chain: 'base', // The chain where the contract is deployed
|
|
52
|
-
onBehalfOf: '0xabcd...', // Optional: address to receive vault shares (defaults to delegator)
|
|
44
|
+
operation: 'deposit', // 'deposit', 'withdraw', or 'redeem'
|
|
45
|
+
vaultAddress: '0x1234...', // The Morpho vault address
|
|
46
|
+
amount: '1.0', // Amount to deposit/withdraw/redeem
|
|
47
|
+
chain: 'base', // The chain where the vault is deployed
|
|
53
48
|
};
|
|
54
49
|
|
|
55
50
|
// Run precheck to see if ability should be executed
|
|
@@ -71,11 +66,11 @@ if (precheckResult.success === true) {
|
|
|
71
66
|
|
|
72
67
|
Before executing vault operations, ensure that:
|
|
73
68
|
|
|
74
|
-
1. The user has approved the vault to spend their tokens (for deposits)
|
|
69
|
+
1. The user has approved the vault to spend their tokens (for deposits). You can use the Vincent Ability ERC20 Approval to handle token approvals
|
|
75
70
|
2. The user has sufficient balance of the required tokens
|
|
76
71
|
3. The user has delegated permission to the Vincent app to execute operations
|
|
77
72
|
|
|
78
|
-
|
|
73
|
+
Note: The ability can subsidize gas for the user using Alchemy. If not doing so, the user will also have to pay for the gas.
|
|
79
74
|
|
|
80
75
|
## Vault Operations
|
|
81
76
|
|
|
@@ -85,22 +80,18 @@ The ability supports the following operations on Morpho vaults:
|
|
|
85
80
|
- **WITHDRAW** - Withdraw assets from a Morpho vault
|
|
86
81
|
- **REDEEM** - Redeem vault shares for underlying assets
|
|
87
82
|
|
|
88
|
-
And the following operations on Morpho markets:
|
|
89
|
-
|
|
90
|
-
- **SUPPLY** - Supply collateral to a Morpho market to earn yield
|
|
91
|
-
- **WITHDRAW_COLLATERAL** - Withdraw collateral from a Morpho market
|
|
92
|
-
|
|
93
83
|
## Parameters
|
|
94
84
|
|
|
95
|
-
| Parameter
|
|
96
|
-
|
|
|
97
|
-
| `operation`
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
85
|
+
| Parameter | Type | Required | Description |
|
|
86
|
+
| --------------------------- | ------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
|
|
87
|
+
| `operation` | `"deposit" \| "withdraw" \| "redeem"` | ✅ | The vault operation to perform |
|
|
88
|
+
| `vaultAddress` | `string` | ✅ | Morpho vault contract address (0x format) |
|
|
89
|
+
| `amount` | `string` | ✅ | Amount as string in units, no decimal places (assets for deposit or withdraw, shares for redeem) |
|
|
90
|
+
| `chain` | `string` | ✅ | Chain identifier (e.g., "base") |
|
|
91
|
+
| `rpcUrl` | `string` | ❌ | Custom RPC URL (for precheck validation) |
|
|
92
|
+
| `alchemyGasSponsor` | `boolean` | ❌ | Whether to use Alchemy's gas sponsorship (EIP-7702) |
|
|
93
|
+
| `alchemyGasSponsorApiKey` | `string` | ❌ | Alchemy API key for gas sponsorship (required if alchemyGasSponsor is true) |
|
|
94
|
+
| `alchemyGasSponsorPolicyId` | `string` | ❌ | Alchemy gas policy ID for sponsorship (required if alchemyGasSponsor is true) |
|
|
104
95
|
|
|
105
96
|
## Supported Networks
|
|
106
97
|
|
|
@@ -128,8 +119,7 @@ nx e2e ability-morpho-e2e
|
|
|
128
119
|
|
|
129
120
|
## Contributing
|
|
130
121
|
|
|
131
|
-
Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md) for guidelines on how to contribute to this
|
|
132
|
-
project.
|
|
122
|
+
Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md) for guidelines on how to contribute to this project.
|
|
133
123
|
|
|
134
124
|
## License
|
|
135
125
|
|
package/dist/CONTRIBUTING.md
CHANGED
|
@@ -4,7 +4,7 @@ This document provides guidelines for contributing to the Vincent Ability Morpho
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
The Vincent Ability Morpho is a ability to send deposit, withdraw or redeem Morpho
|
|
7
|
+
The Vincent Ability Morpho is a ability to send deposit, withdraw or redeem Morpho transactions from a Vincent app on behalf of the delegator. It's part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK.
|
|
8
8
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
@@ -37,7 +37,7 @@ nx action:build ability-morpho
|
|
|
37
37
|
Building will be done automatically. Deploy the ability:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
nx action:deploy ability-
|
|
40
|
+
nx action:deploy ability-morpho
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Project Structure
|
|
@@ -54,12 +54,6 @@ nx action:deploy ability-erc20-approval
|
|
|
54
54
|
5. Write comprehensive tests for all functionality
|
|
55
55
|
6. Document the ability's purpose and usage
|
|
56
56
|
|
|
57
|
-
## Integration with Policies
|
|
58
|
-
|
|
59
|
-
This ability can be integrated with various Vincent Policies to enforce constraints. When developing or modifying the ability, consider how it will be used with policies such as:
|
|
60
|
-
|
|
61
|
-
- Vincent Policy Spending Limit
|
|
62
|
-
|
|
63
57
|
## Testing
|
|
64
58
|
|
|
65
59
|
Write unit tests for all functionality:
|
package/dist/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
# Vincent Ability Morpho
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
withdrawCollateral) from a Vincent app on behalf of the delegator.
|
|
3
|
+
A ability to interact with Morpho vaults (deposit, withdraw, redeem) from a Vincent app on behalf of the delegator.
|
|
5
4
|
|
|
6
5
|
## Overview
|
|
7
6
|
|
|
8
|
-
The Vincent Ability Morpho is part of the Vincent Abilities ecosystem and is built using the Vincent
|
|
9
|
-
|
|
10
|
-
Vincent apps to interact with Morpho vaults on behalf of users, enabling seamless integration with
|
|
11
|
-
DeFi yield
|
|
7
|
+
The Vincent Ability Morpho is part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK. It allows
|
|
8
|
+
Vincent apps to interact with Morpho vaults on behalf of users, enabling seamless integration with DeFi yield
|
|
12
9
|
strategies.
|
|
13
10
|
|
|
14
11
|
## Features
|
|
@@ -31,7 +28,7 @@ This ability can be used in Vincent apps to interact with Morpho vaults:
|
|
|
31
28
|
|
|
32
29
|
```typescript
|
|
33
30
|
import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
|
|
34
|
-
import { bundledVincentAbility
|
|
31
|
+
import { bundledVincentAbility } from '@lit-protocol/vincent-ability-morpho';
|
|
35
32
|
|
|
36
33
|
// One of delegatee signers from your app's Vincent Dashboard
|
|
37
34
|
const delegateeSigner = new ethers.Wallet('YOUR_DELEGATEE_PRIVATE_KEY');
|
|
@@ -44,12 +41,10 @@ const abilityClient = getVincentAbilityClient({
|
|
|
44
41
|
const delegatorPkpEthAddress = '0x09182301238'; // The delegator PKP Eth Address
|
|
45
42
|
|
|
46
43
|
const abilityParams = {
|
|
47
|
-
operation:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
chain: 'base', // The chain where the contract is deployed
|
|
52
|
-
onBehalfOf: '0xabcd...', // Optional: address to receive vault shares (defaults to delegator)
|
|
44
|
+
operation: 'deposit', // 'deposit', 'withdraw', or 'redeem'
|
|
45
|
+
vaultAddress: '0x1234...', // The Morpho vault address
|
|
46
|
+
amount: '1.0', // Amount to deposit/withdraw/redeem
|
|
47
|
+
chain: 'base', // The chain where the vault is deployed
|
|
53
48
|
};
|
|
54
49
|
|
|
55
50
|
// Run precheck to see if ability should be executed
|
|
@@ -71,11 +66,11 @@ if (precheckResult.success === true) {
|
|
|
71
66
|
|
|
72
67
|
Before executing vault operations, ensure that:
|
|
73
68
|
|
|
74
|
-
1. The user has approved the vault to spend their tokens (for deposits)
|
|
69
|
+
1. The user has approved the vault to spend their tokens (for deposits). You can use the Vincent Ability ERC20 Approval to handle token approvals
|
|
75
70
|
2. The user has sufficient balance of the required tokens
|
|
76
71
|
3. The user has delegated permission to the Vincent app to execute operations
|
|
77
72
|
|
|
78
|
-
|
|
73
|
+
Note: The ability can subsidize gas for the user using Alchemy. If not doing so, the user will also have to pay for the gas.
|
|
79
74
|
|
|
80
75
|
## Vault Operations
|
|
81
76
|
|
|
@@ -85,22 +80,18 @@ The ability supports the following operations on Morpho vaults:
|
|
|
85
80
|
- **WITHDRAW** - Withdraw assets from a Morpho vault
|
|
86
81
|
- **REDEEM** - Redeem vault shares for underlying assets
|
|
87
82
|
|
|
88
|
-
And the following operations on Morpho markets:
|
|
89
|
-
|
|
90
|
-
- **SUPPLY** - Supply collateral to a Morpho market to earn yield
|
|
91
|
-
- **WITHDRAW_COLLATERAL** - Withdraw collateral from a Morpho market
|
|
92
|
-
|
|
93
83
|
## Parameters
|
|
94
84
|
|
|
95
|
-
| Parameter
|
|
96
|
-
|
|
|
97
|
-
| `operation`
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
85
|
+
| Parameter | Type | Required | Description |
|
|
86
|
+
| --------------------------- | ------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
|
|
87
|
+
| `operation` | `"deposit" \| "withdraw" \| "redeem"` | ✅ | The vault operation to perform |
|
|
88
|
+
| `vaultAddress` | `string` | ✅ | Morpho vault contract address (0x format) |
|
|
89
|
+
| `amount` | `string` | ✅ | Amount as string in units, no decimal places (assets for deposit or withdraw, shares for redeem) |
|
|
90
|
+
| `chain` | `string` | ✅ | Chain identifier (e.g., "base") |
|
|
91
|
+
| `rpcUrl` | `string` | ❌ | Custom RPC URL (for precheck validation) |
|
|
92
|
+
| `alchemyGasSponsor` | `boolean` | ❌ | Whether to use Alchemy's gas sponsorship (EIP-7702) |
|
|
93
|
+
| `alchemyGasSponsorApiKey` | `string` | ❌ | Alchemy API key for gas sponsorship (required if alchemyGasSponsor is true) |
|
|
94
|
+
| `alchemyGasSponsorPolicyId` | `string` | ❌ | Alchemy gas policy ID for sponsorship (required if alchemyGasSponsor is true) |
|
|
104
95
|
|
|
105
96
|
## Supported Networks
|
|
106
97
|
|
|
@@ -128,8 +119,7 @@ nx e2e ability-morpho-e2e
|
|
|
128
119
|
|
|
129
120
|
## Contributing
|
|
130
121
|
|
|
131
|
-
Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md) for guidelines on how to contribute to this
|
|
132
|
-
project.
|
|
122
|
+
Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md) for guidelines on how to contribute to this project.
|
|
133
123
|
|
|
134
124
|
## License
|
|
135
125
|
|