@lit-protocol/vincent-ability-evm-transaction-signer 0.0.2 → 0.0.4-ea

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vincent-bundled-tool.d.ts","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA4D,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.bundledVincentAbility = void 0;
7
+ const tslib_1 = require("tslib");
8
+ const vincent_ability_sdk_1 = require("@lit-protocol/vincent-ability-sdk");
9
+ const vincent_ability_1 = require("../lib/vincent-ability");
10
+ const vincent_ability_metadata_json_1 = tslib_1.__importDefault(require("./vincent-ability-metadata.json"));
11
+ if (!vincent_ability_metadata_json_1.default.ipfsCid) {
12
+ throw new Error('ipfsCid is not defined in metadata JSON file');
13
+ }
14
+ exports.bundledVincentAbility = (0, vincent_ability_sdk_1.asBundledVincentAbility)(vincent_ability_1.vincentAbility, vincent_ability_metadata_json_1.default.ipfsCid);
15
+ //# sourceMappingURL=vincent-bundled-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vincent-bundled-tool.js","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-tool.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,2EAA4E;AAC5E,4DAAwD;AACxD,4GAAuD;AAEvD,IAAI,CAAC,uCAAQ,CAAC,OAAO,EAAE,CAAC;IACtB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;AAClE,CAAC;AAEY,QAAA,qBAAqB,GAAG,IAAA,6CAAuB,EAAC,gCAAc,EAAE,uCAAQ,CAAC,OAAO,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-ability-evm-transaction-signer",
3
- "version": "0.0.2",
3
+ "version": "0.0.4-ea",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "dependencies": {
8
+ "@lit-protocol/vincent-policy-contract-whitelist": "0.0.4-ea",
9
+ "@lit-protocol/vincent-ability-sdk": "0.0.4-ea",
8
10
  "ethers": "^5.8.0",
9
11
  "tslib": "2.8.1",
10
- "zod": "^3.25.64",
11
- "@lit-protocol/vincent-policy-contract-whitelist": "1.0.0",
12
- "@lit-protocol/vincent-ability-sdk": "2.0.0"
12
+ "zod": "^3.25.64"
13
13
  },
14
14
  "peerDependencies": {
15
- "@lit-protocol/vincent-app-sdk": "^2.0.0"
15
+ "@lit-protocol/vincent-app-sdk": "0.0.4-ea"
16
16
  },
17
17
  "devDependencies": {
18
18
  "esbuild": "^0.19.12",
package/dist/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- ## 0.0.2 (2025-08-05)
2
-
3
- ### 🧱 Updated Dependencies
4
-
5
- - Updated ability-sdk to 2.0.0
6
- - Updated app-sdk to 2.0.0
7
- - Updated policy-contract-whitelist to 1.0.0
@@ -1,88 +0,0 @@
1
- # Contributing to Vincent Ability Transaction Signer
2
-
3
- This document provides guidelines for contributing to the Vincent Ability Transaction Signer project.
4
-
5
- ## Overview
6
-
7
- The Vincent Ability Transaction Signer is a ability to sign transactions using a Vincent Agent Wallet. It's part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK.
8
-
9
- ## Setup
10
-
11
- 1. Follow the global setup instructions in the repository root [CONTRIBUTING.md](../../../CONTRIBUTING.md).
12
- 2. Install dependencies:
13
- ```bash
14
- pnpm install
15
- ```
16
-
17
- ## Development Workflow
18
-
19
- ### Testing
20
-
21
- Run tests:
22
-
23
- ```bash
24
- nx test ability-evm-transaction-signer
25
- ```
26
-
27
- ### Building the Lit Action
28
-
29
- Build the policy:
30
-
31
- ```bash
32
- nx action:build ability-evm-transaction-signer
33
- ```
34
-
35
- ### Deploying the Lit Action to IPFS
36
-
37
- Building will be done automatically. Deploy the policy:
38
-
39
- ```bash
40
- nx action:deploy ability-evm-transaction-signer
41
- ```
42
-
43
- ## Project Structure
44
-
45
- - `src/`: Source code
46
- - `index.ts`: Main entry point
47
-
48
- ## Ability Development Guidelines
49
-
50
- 1. Use the Vincent Ability SDK to create abilities
51
- 2. Define clear schemas for ability parameters
52
- 3. Implement the ability lifecycle methods (precheck, execute)
53
- 4. Handle errors gracefully
54
- 5. Write comprehensive tests for all functionality
55
- 6. Document the ability's purpose and usage
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 Contract Whitelist
62
-
63
- ## Testing
64
-
65
- Write unit tests for all functionality:
66
-
67
- ```bash
68
- pnpm test
69
- ```
70
-
71
- ## Documentation
72
-
73
- - Document the ability's purpose and usage
74
- - Update README.md when adding new features
75
- - Document the ability's parameters and behavior
76
-
77
- ## Pull Request Process
78
-
79
- 1. Ensure your code follows the coding standards
80
- 2. Update documentation if necessary
81
- 3. Include tests for new functionality
82
- 4. Link any related issues in your pull request description
83
- 5. Request a review from a maintainer
84
-
85
- ## Additional Resources
86
-
87
- - [Vincent Documentation](https://docs.heyvincent.ai/)
88
- - [Vincent Ability SDK Documentation](../../libs/ability-sdk/README.md)
package/dist/README.md DELETED
@@ -1,174 +0,0 @@
1
- # Vincent Ability: EVM Transaction Signer
2
-
3
- ## Overview
4
-
5
- The EVM Transaction Signer Ability enables Vincent Apps to sign Ethereum Virtual Machine (EVM) transactions on behalf of Vincent Users using their Vincent Agent Wallets. This enables Vincent Apps to interact with contracts even if there isn't an explicit Vincent Ability made for interacting with that contract.
6
-
7
- This Vincent Ability is intended to be used with Vincent Policies, such as the [@lit-protocol/vincent-policy-contract-whitelist](../policy-contract-whitelist/) policy, to provide protections such as only signing transactions that interact with specific contracts and/or call specific functions on contract.
8
-
9
- ## Key Features
10
-
11
- - **Secure Transaction Signing**: Signs transactions using Vincent Agent Wallets within Lit Protocol's secure Trusted Execution Environment
12
- - **Full Transaction Support**: Handles all EVM transaction types including legacy, EIP-2930, and EIP-1559
13
- - **Policy Integration**: Supports the Contract Whitelist Policy for restricting what transactions can be signed
14
-
15
- ## How It Works
16
-
17
- The Transaction Signer Ability is built using the Vincent Ability SDK and provides a secure way to sign Ethereum transactions. Here's how it operates:
18
-
19
- 1. **Precheck Phase**: Validates the transaction structure and runs policy checks
20
-
21
- - Deserializes the provided serialized transaction using ethers.js
22
- - Validates all required fields are present (nonce, gasPrice, gasLimit, etc.)
23
- - Returns deserialized transaction details for review
24
-
25
- 2. **Execution Phase**: If permitted by the evaluated Policies, signs the serialized transaction
26
- - Signs the transaction using the Vincent Agent Wallet
27
- - Returns both the signed transaction hex and decoded signature components
28
-
29
- ### Workflow
30
-
31
- 1. **Precheck Phase**: Validates the transaction structure and runs policy checks
32
-
33
- - Deserializes the provided serialized transaction using ethers.js
34
- - Validates all required fields are present (nonce, gasPrice, gasLimit, etc.)
35
- - Returns deserialized transaction details for review
36
-
37
- 2. **Execution Phase**: If permitted by the evaluated Policies, signs the serialized transaction
38
- - Signs the transaction using the Vincent Agent Wallet
39
- - Returns both the signed transaction hex and decoded signature components
40
-
41
- ## Using the Ability
42
-
43
- See the comprehensive E2E test in [contract-whitelist.spec.ts](../abilities-e2e/test-e2e/contract-whitelist.spec.ts) for a complete example of:
44
-
45
- - Setting up permissions and the Contract Whitelist Policy
46
- - Executing the Transaction Signer Ability
47
- - Validating the signed transaction
48
- - Broadcasting the signed transaction to the network
49
-
50
- ```typescript
51
- import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
52
- import { bundledVincentAbility } from '@lit-protocol/vincent-ability-evm-transaction-signer';
53
-
54
- // Create ability client
55
- const abilityClient = getVincentAbilityClient({
56
- bundledVincentAbility: bundledVincentAbility,
57
- ethersSigner: yourEthersSigner,
58
- });
59
-
60
- // Create a transaction
61
- const transaction = {
62
- to: '0x4200000000000000000000000000000000000006', // Base WETH
63
- value: '0x00',
64
- data: '0xa9059cbb...', // transfer function call
65
- chainId: 8453,
66
- nonce: 0,
67
- gasPrice: '0x...',
68
- gasLimit: '0x...',
69
- };
70
-
71
- // Serialize the transaction
72
- const serializedTx = ethers.utils.serializeTransaction(transaction);
73
-
74
- const precheckResult = await abilityClient.precheck(
75
- {
76
- serializedTransaction: serializedTx,
77
- },
78
- {
79
- delegatorPkpEthAddress: '0x...', // The Agent Wallet PKP that will sign
80
- },
81
- );
82
-
83
- if (precheckResult.success) {
84
- const { deserializedUnsignedTransaction } = precheckResult.result;
85
- // Use the deserialized transaction
86
- }
87
-
88
- // Execute the ability
89
- const executeResult = await abilityClient.execute(
90
- {
91
- serializedTransaction: serializedTx,
92
- },
93
- {
94
- delegatorPkpEthAddress: '0x...', // The Agent Wallet PKP that will sign
95
- },
96
- );
97
-
98
- if (executeResult.success) {
99
- const { signedTransaction, deserializedSignedTransaction } = executeResult.result;
100
- // Use the signed transaction
101
- }
102
- ```
103
-
104
- ## Input/Output Schemas
105
-
106
- ### Ability Parameters
107
-
108
- ```typescript
109
- {
110
- serializedTransaction: string; // The serialized unsigned transaction
111
- }
112
- ```
113
-
114
- ### Precheck Success Output
115
-
116
- ```typescript
117
- {
118
- deserializedUnsignedTransaction: {
119
- to?: string;
120
- nonce?: number;
121
- gasLimit: string;
122
- gasPrice?: string;
123
- data: string;
124
- value: string;
125
- chainId: number;
126
- type?: number;
127
- accessList?: any[];
128
- maxPriorityFeePerGas?: string;
129
- maxFeePerGas?: string;
130
- }
131
- }
132
- ```
133
-
134
- ### Execution Success Output
135
-
136
- ```typescript
137
- {
138
- signedTransaction: string; // The signed transaction ready for broadcast
139
- deserializedSignedTransaction: {
140
- hash?: string;
141
- to: string;
142
- from: string;
143
- nonce: number;
144
- gasLimit: string;
145
- gasPrice?: string;
146
- data: string;
147
- value: string;
148
- chainId: number;
149
- v: number;
150
- r: string;
151
- s: string;
152
- type?: number;
153
- accessList?: any[];
154
- maxPriorityFeePerGas?: string;
155
- maxFeePerGas?: string;
156
- }
157
- }
158
- ```
159
-
160
- ## Building
161
-
162
- Run `pnpx nx build ability-evm-transaction-signer` to build the Ability.
163
-
164
- ## Running E2E tests
165
-
166
- Run `pnpx nx run abilities-e2e:test-e2e packages/apps/abilities-e2e/test-e2e/contract-whitelist.spec.ts` to execute the E2E tests via [Jest](https://jestjs.io).
167
-
168
- ## Contributing
169
-
170
- Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on how to contribute to this project.
171
-
172
- ## License
173
-
174
- This project is licensed under the MIT License - see the LICENSE file for details.