@lit-protocol/vincent-ability-evm-transaction-signer 0.0.1-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.
- package/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +88 -0
- package/README.md +166 -0
- package/dist/package.json +30 -0
- package/dist/src/generated/vincent-ability-metadata.json +3 -0
- package/dist/src/generated/vincent-bundled-ability.d.ts +971 -0
- package/dist/src/generated/vincent-bundled-ability.d.ts.map +1 -0
- package/dist/src/generated/vincent-bundled-ability.js +15 -0
- package/dist/src/generated/vincent-bundled-ability.js.map +1 -0
- package/dist/src/generated/vincent-bundled-tool.d.ts +971 -0
- package/dist/src/generated/vincent-bundled-tool.d.ts.map +1 -0
- package/dist/src/generated/vincent-bundled-tool.js +15 -0
- package/dist/src/generated/vincent-bundled-tool.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/lit-action-helpers/build-transaction-for-signing.d.ts +6 -0
- package/dist/src/lib/lit-action-helpers/build-transaction-for-signing.d.ts.map +1 -0
- package/dist/src/lib/lit-action-helpers/build-transaction-for-signing.js +32 -0
- package/dist/src/lib/lit-action-helpers/build-transaction-for-signing.js.map +1 -0
- package/dist/src/lib/lit-action-helpers/index.d.ts +4 -0
- package/dist/src/lib/lit-action-helpers/index.d.ts.map +1 -0
- package/dist/src/lib/lit-action-helpers/index.js +10 -0
- package/dist/src/lib/lit-action-helpers/index.js.map +1 -0
- package/dist/src/lib/lit-action-helpers/serialize-transaction-for-response.d.ts +47 -0
- package/dist/src/lib/lit-action-helpers/serialize-transaction-for-response.d.ts.map +1 -0
- package/dist/src/lib/lit-action-helpers/serialize-transaction-for-response.js +76 -0
- package/dist/src/lib/lit-action-helpers/serialize-transaction-for-response.js.map +1 -0
- package/dist/src/lib/lit-action-helpers/sign-tx.d.ts +3 -0
- package/dist/src/lib/lit-action-helpers/sign-tx.d.ts.map +1 -0
- package/dist/src/lib/lit-action-helpers/sign-tx.js +28 -0
- package/dist/src/lib/lit-action-helpers/sign-tx.js.map +1 -0
- package/dist/src/lib/lit-action.d.ts +2 -0
- package/dist/src/lib/lit-action.d.ts.map +1 -0
- package/dist/src/lib/lit-action.js +16 -0
- package/dist/src/lib/lit-action.js.map +1 -0
- package/dist/src/lib/schemas.d.ts +185 -0
- package/dist/src/lib/schemas.d.ts.map +1 -0
- package/dist/src/lib/schemas.js +62 -0
- package/dist/src/lib/schemas.js.map +1 -0
- package/dist/src/lib/vincent-ability.d.ts +968 -0
- package/dist/src/lib/vincent-ability.d.ts.map +1 -0
- package/dist/src/lib/vincent-ability.js +66 -0
- package/dist/src/lib/vincent-ability.js.map +1 -0
- package/package.json +29 -0
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundledVincentAbility = void 0;
|
|
4
|
+
var vincent_bundled_ability_1 = require("./generated/vincent-bundled-ability");
|
|
5
|
+
Object.defineProperty(exports, "bundledVincentAbility", { enumerable: true, get: function () { return vincent_bundled_ability_1.bundledVincentAbility; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+EAA4E;AAAnE,gIAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a clean transaction object for signing, including only defined optional fields
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildTransactionForSigning(transaction: ethers.Transaction): ethers.Transaction;
|
|
6
|
+
//# sourceMappingURL=build-transaction-for-signing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-transaction-for-signing.d.ts","sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/build-transaction-for-signing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CA0B9F"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildTransactionForSigning = buildTransactionForSigning;
|
|
4
|
+
/**
|
|
5
|
+
* Builds a clean transaction object for signing, including only defined optional fields
|
|
6
|
+
*/
|
|
7
|
+
function buildTransactionForSigning(transaction) {
|
|
8
|
+
const txToSign = {
|
|
9
|
+
to: transaction.to,
|
|
10
|
+
nonce: transaction.nonce,
|
|
11
|
+
gasLimit: transaction.gasLimit,
|
|
12
|
+
gasPrice: transaction.gasPrice,
|
|
13
|
+
data: transaction.data,
|
|
14
|
+
value: transaction.value,
|
|
15
|
+
chainId: transaction.chainId,
|
|
16
|
+
};
|
|
17
|
+
// Only include optional properties if they are defined
|
|
18
|
+
if (transaction.type !== null && transaction.type !== undefined) {
|
|
19
|
+
txToSign.type = transaction.type;
|
|
20
|
+
}
|
|
21
|
+
if (transaction.accessList !== undefined) {
|
|
22
|
+
txToSign.accessList = transaction.accessList;
|
|
23
|
+
}
|
|
24
|
+
if (transaction.maxPriorityFeePerGas !== undefined) {
|
|
25
|
+
txToSign.maxPriorityFeePerGas = transaction.maxPriorityFeePerGas;
|
|
26
|
+
}
|
|
27
|
+
if (transaction.maxFeePerGas !== undefined) {
|
|
28
|
+
txToSign.maxFeePerGas = transaction.maxFeePerGas;
|
|
29
|
+
}
|
|
30
|
+
return txToSign;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=build-transaction-for-signing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-transaction-for-signing.js","sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/build-transaction-for-signing.ts"],"names":[],"mappings":";;AAKA,gEA0BC;AA7BD;;GAEG;AACH,SAAgB,0BAA0B,CAAC,WAA+B;IACxE,MAAM,QAAQ,GAAuB;QACnC,EAAE,EAAE,WAAW,CAAC,EAAE;QAClB,KAAK,EAAE,WAAW,CAAC,KAAK;QACxB,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,KAAK,EAAE,WAAW,CAAC,KAAK;QACxB,OAAO,EAAE,WAAW,CAAC,OAAO;KAC7B,CAAC;IAEF,uDAAuD;IACvD,IAAI,WAAW,CAAC,IAAI,KAAK,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChE,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IACnC,CAAC;IACD,IAAI,WAAW,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACzC,QAAQ,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAC/C,CAAC;IACD,IAAI,WAAW,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACnD,QAAQ,CAAC,oBAAoB,GAAG,WAAW,CAAC,oBAAoB,CAAC;IACnE,CAAC;IACD,IAAI,WAAW,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QAC3C,QAAQ,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IACnD,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeTransactionForResponse = exports.buildTransactionForSigning = exports.signTx = void 0;
|
|
4
|
+
var sign_tx_1 = require("./sign-tx");
|
|
5
|
+
Object.defineProperty(exports, "signTx", { enumerable: true, get: function () { return sign_tx_1.signTx; } });
|
|
6
|
+
var build_transaction_for_signing_1 = require("./build-transaction-for-signing");
|
|
7
|
+
Object.defineProperty(exports, "buildTransactionForSigning", { enumerable: true, get: function () { return build_transaction_for_signing_1.buildTransactionForSigning; } });
|
|
8
|
+
var serialize_transaction_for_response_1 = require("./serialize-transaction-for-response");
|
|
9
|
+
Object.defineProperty(exports, "serializeTransactionForResponse", { enumerable: true, get: function () { return serialize_transaction_for_response_1.serializeTransactionForResponse; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,iGAAA,MAAM,OAAA;AACf,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,2FAAuF;AAA9E,qJAAA,+BAA+B,OAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
interface SignatureFields {
|
|
3
|
+
hash: string;
|
|
4
|
+
from: string;
|
|
5
|
+
v: number;
|
|
6
|
+
r: string;
|
|
7
|
+
s: string;
|
|
8
|
+
}
|
|
9
|
+
interface SerializedUnsignedTransaction {
|
|
10
|
+
to: string;
|
|
11
|
+
nonce?: number;
|
|
12
|
+
gasLimit: string;
|
|
13
|
+
gasPrice?: string | null;
|
|
14
|
+
data: string;
|
|
15
|
+
value: string;
|
|
16
|
+
chainId: number;
|
|
17
|
+
type?: number;
|
|
18
|
+
accessList?: Array<{
|
|
19
|
+
address: string;
|
|
20
|
+
storageKeys: string[];
|
|
21
|
+
}>;
|
|
22
|
+
maxPriorityFeePerGas?: string | null;
|
|
23
|
+
maxFeePerGas?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface SerializedSignedTransaction extends SignatureFields {
|
|
26
|
+
to: string;
|
|
27
|
+
nonce: number;
|
|
28
|
+
gasLimit: string;
|
|
29
|
+
gasPrice?: string | null;
|
|
30
|
+
data: string;
|
|
31
|
+
value: string;
|
|
32
|
+
chainId: number;
|
|
33
|
+
type?: number | null;
|
|
34
|
+
accessList?: Array<{
|
|
35
|
+
address: string;
|
|
36
|
+
storageKeys: string[];
|
|
37
|
+
}>;
|
|
38
|
+
maxPriorityFeePerGas?: string | null;
|
|
39
|
+
maxFeePerGas?: string | null;
|
|
40
|
+
}
|
|
41
|
+
export declare function serializeTransactionForResponse(transaction: ethers.Transaction): SerializedUnsignedTransaction;
|
|
42
|
+
/**
|
|
43
|
+
* Serializes a parsed transaction to a format suitable for API responses (signed)
|
|
44
|
+
*/
|
|
45
|
+
export declare function serializeTransactionForResponse(transaction: ethers.Transaction, signature: SignatureFields): SerializedSignedTransaction;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=serialize-transaction-for-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-transaction-for-response.d.ts","sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/serialize-transaction-for-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC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C,WAAW,EAC/B,SAAS,EAAE,eAAe,GACzB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeTransactionForResponse = serializeTransactionForResponse;
|
|
4
|
+
/**
|
|
5
|
+
* Serializes a parsed transaction to a format suitable for API responses (unsigned)
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Adds optional transaction fields to the serialized object
|
|
9
|
+
*/
|
|
10
|
+
function addOptionalFields(serialized, transaction) {
|
|
11
|
+
if (transaction.gasPrice !== undefined && transaction.gasPrice !== null) {
|
|
12
|
+
serialized.gasPrice = transaction.gasPrice.toHexString();
|
|
13
|
+
}
|
|
14
|
+
else if (transaction.gasPrice === null) {
|
|
15
|
+
// For EIP-1559 transactions, gasPrice is null
|
|
16
|
+
serialized.gasPrice = null;
|
|
17
|
+
}
|
|
18
|
+
if (transaction.type !== null && transaction.type !== undefined) {
|
|
19
|
+
serialized.type = transaction.type;
|
|
20
|
+
}
|
|
21
|
+
if (transaction.accessList !== undefined) {
|
|
22
|
+
serialized.accessList = transaction.accessList;
|
|
23
|
+
}
|
|
24
|
+
if (transaction.maxPriorityFeePerGas !== undefined && transaction.maxPriorityFeePerGas !== null) {
|
|
25
|
+
serialized.maxPriorityFeePerGas = transaction.maxPriorityFeePerGas.toHexString();
|
|
26
|
+
}
|
|
27
|
+
if (transaction.maxFeePerGas !== undefined && transaction.maxFeePerGas !== null) {
|
|
28
|
+
serialized.maxFeePerGas = transaction.maxFeePerGas.toHexString();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function serializeTransactionForResponse(transaction, signature) {
|
|
32
|
+
if (signature) {
|
|
33
|
+
// Validate that 'to' address is provided (no contract deployment allowed)
|
|
34
|
+
if (!transaction.to) {
|
|
35
|
+
throw new Error('Transaction must have a "to" address. Contract deployment transactions are not supported.');
|
|
36
|
+
}
|
|
37
|
+
// Build signed transaction response
|
|
38
|
+
const signedTx = {
|
|
39
|
+
hash: signature.hash,
|
|
40
|
+
to: transaction.to,
|
|
41
|
+
from: signature.from,
|
|
42
|
+
nonce: transaction.nonce,
|
|
43
|
+
gasLimit: transaction.gasLimit.toHexString(),
|
|
44
|
+
data: transaction.data,
|
|
45
|
+
value: transaction.value.toHexString(),
|
|
46
|
+
chainId: transaction.chainId,
|
|
47
|
+
v: signature.v,
|
|
48
|
+
r: signature.r,
|
|
49
|
+
s: signature.s,
|
|
50
|
+
};
|
|
51
|
+
// Add optional fields
|
|
52
|
+
addOptionalFields(signedTx, transaction);
|
|
53
|
+
return signedTx;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// Validate that 'to' address is provided (no contract deployment allowed)
|
|
57
|
+
if (!transaction.to) {
|
|
58
|
+
throw new Error('Transaction must have a "to" address. Contract deployment transactions are not supported.');
|
|
59
|
+
}
|
|
60
|
+
// Build unsigned transaction response
|
|
61
|
+
const unsignedTx = {
|
|
62
|
+
to: transaction.to,
|
|
63
|
+
gasLimit: transaction.gasLimit.toHexString(),
|
|
64
|
+
data: transaction.data,
|
|
65
|
+
value: transaction.value.toHexString(),
|
|
66
|
+
chainId: transaction.chainId,
|
|
67
|
+
};
|
|
68
|
+
// Add optional fields
|
|
69
|
+
if (transaction.nonce !== undefined) {
|
|
70
|
+
unsignedTx.nonce = transaction.nonce;
|
|
71
|
+
}
|
|
72
|
+
addOptionalFields(unsignedTx, transaction);
|
|
73
|
+
return unsignedTx;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=serialize-transaction-for-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-transaction-for-response.js","sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/serialize-transaction-for-response.ts"],"names":[],"mappings":";;AAgFA,0EAwDC;AAlGD;;GAEG;AACH;;GAEG;AACH,SAAS,iBAAiB,CACxB,UAAuE,EACv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sourceRoot":"","sources":["../../../../src/lib/lit-action-helpers/sign-tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAYhC,eAAO,MAAM,MAAM,GAAU,cAAc,MAAM,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE,SAAS,MAAM,oBA2BzF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signTx = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const signTx = async (pkpPublicKey, tx, sigName) => {
|
|
6
|
+
// Remove 0x prefix if it exists, Lit expects a hex string without 0x prefix
|
|
7
|
+
const publicKeyForLit = pkpPublicKey.replace(/^0x/, '');
|
|
8
|
+
console.log(`Signing using PKP Public Key: ${publicKeyForLit} (signTx)`);
|
|
9
|
+
const unsignedSerializedTx = ethers_1.ethers.utils.serializeTransaction(tx);
|
|
10
|
+
const txHash = ethers_1.ethers.utils.keccak256(unsignedSerializedTx);
|
|
11
|
+
console.log('Tx hash (signTx)', txHash);
|
|
12
|
+
const signatureResponse = await Lit.Actions.signAndCombineEcdsa({
|
|
13
|
+
toSign: ethers_1.ethers.utils.arrayify(txHash),
|
|
14
|
+
publicKey: publicKeyForLit,
|
|
15
|
+
sigName,
|
|
16
|
+
});
|
|
17
|
+
const { r, s, v } = JSON.parse(signatureResponse);
|
|
18
|
+
const ethersJoinedSignature = ethers_1.ethers.utils.joinSignature({
|
|
19
|
+
r: '0x' + r.substring(2),
|
|
20
|
+
s: '0x' + s,
|
|
21
|
+
v: v,
|
|
22
|
+
});
|
|
23
|
+
const signedSerializedTx = ethers_1.ethers.utils.serializeTransaction(tx, ethersJoinedSignature);
|
|
24
|
+
console.log('Signed serialized tx (signTx)', signedSerializedTx);
|
|
25
|
+
return signedSerializedTx;
|
|
26
|
+
};
|
|
27
|
+
exports.signTx = signTx;
|
|
28
|
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C;IACxF,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAC;IAEjE,OAAO,kBAAkB,CAAC;AAC5B,CAAC,CAAC;AA3BW,QAAA,MAAM,UA2BjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit-action.d.ts","sourceRoot":"","sources":["../../../src/lib/lit-action.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vincent_ability_sdk_1 = require("@lit-protocol/vincent-ability-sdk");
|
|
4
|
+
// FIXME: This should be generated code
|
|
5
|
+
const vincent_ability_1 = require("./vincent-ability");
|
|
6
|
+
(async () => {
|
|
7
|
+
const func = (0, vincent_ability_sdk_1.vincentAbilityHandler)({
|
|
8
|
+
vincentAbility: vincent_ability_1.vincentAbility,
|
|
9
|
+
context: {
|
|
10
|
+
delegatorPkpEthAddress: context.delegatorPkpEthAddress,
|
|
11
|
+
},
|
|
12
|
+
abilityParams,
|
|
13
|
+
});
|
|
14
|
+
await func();
|
|
15
|
+
})();
|
|
16
|
+
//# sourceMappingURL=lit-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit-action.js","sourceRoot":"","sources":["../../../src/lib/lit-action.ts"],"names":[],"mappings":";;AAAA,2EAA0E;AAG1E,uCAAuC;AAEvC,uDAAmD;AAQnD,CAAC,KAAK,IAAI,EAAE;IACV,MAAM,IAAI,GAAG,IAAA,2CAAqB,EAAC;QACjC,cAAc,EAAE,gCAAc;QAC9B,OAAO,EAAE;YACP,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;SACvD;QACD,aAAa;KACd,CAAC,CAAC;IACH,MAAM,IAAI,EAAE,CAAC;AACf,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const abilityParamsSchema: z.ZodObject<{
|
|
3
|
+
serializedTransaction: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
serializedTransaction: string;
|
|
6
|
+
}, {
|
|
7
|
+
serializedTransaction: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const precheckSuccessSchema: z.ZodObject<{
|
|
10
|
+
deserializedUnsignedTransaction: z.ZodObject<{
|
|
11
|
+
to: z.ZodString;
|
|
12
|
+
nonce: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
gasLimit: z.ZodString;
|
|
14
|
+
gasPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
data: z.ZodString;
|
|
16
|
+
value: z.ZodString;
|
|
17
|
+
chainId: z.ZodNumber;
|
|
18
|
+
type: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
accessList: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
20
|
+
maxPriorityFeePerGas: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
maxFeePerGas: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
value: string;
|
|
24
|
+
to: string;
|
|
25
|
+
gasLimit: string;
|
|
26
|
+
data: string;
|
|
27
|
+
chainId: number;
|
|
28
|
+
type?: number | undefined;
|
|
29
|
+
nonce?: number | undefined;
|
|
30
|
+
gasPrice?: string | null | undefined;
|
|
31
|
+
accessList?: any[] | undefined;
|
|
32
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
33
|
+
maxFeePerGas?: string | null | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
value: string;
|
|
36
|
+
to: string;
|
|
37
|
+
gasLimit: string;
|
|
38
|
+
data: string;
|
|
39
|
+
chainId: number;
|
|
40
|
+
type?: number | undefined;
|
|
41
|
+
nonce?: number | undefined;
|
|
42
|
+
gasPrice?: string | null | undefined;
|
|
43
|
+
accessList?: any[] | undefined;
|
|
44
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
45
|
+
maxFeePerGas?: string | null | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
deserializedUnsignedTransaction: {
|
|
49
|
+
value: string;
|
|
50
|
+
to: string;
|
|
51
|
+
gasLimit: string;
|
|
52
|
+
data: string;
|
|
53
|
+
chainId: number;
|
|
54
|
+
type?: number | undefined;
|
|
55
|
+
nonce?: number | undefined;
|
|
56
|
+
gasPrice?: string | null | undefined;
|
|
57
|
+
accessList?: any[] | undefined;
|
|
58
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
59
|
+
maxFeePerGas?: string | null | undefined;
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
deserializedUnsignedTransaction: {
|
|
63
|
+
value: string;
|
|
64
|
+
to: string;
|
|
65
|
+
gasLimit: string;
|
|
66
|
+
data: string;
|
|
67
|
+
chainId: number;
|
|
68
|
+
type?: number | undefined;
|
|
69
|
+
nonce?: number | undefined;
|
|
70
|
+
gasPrice?: string | null | undefined;
|
|
71
|
+
accessList?: any[] | undefined;
|
|
72
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
73
|
+
maxFeePerGas?: string | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
export declare const precheckFailSchema: z.ZodObject<{
|
|
77
|
+
error: z.ZodString;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
error: string;
|
|
80
|
+
}, {
|
|
81
|
+
error: string;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const executeSuccessSchema: z.ZodObject<{
|
|
84
|
+
signedTransaction: z.ZodString;
|
|
85
|
+
deserializedSignedTransaction: z.ZodObject<{
|
|
86
|
+
hash: z.ZodString;
|
|
87
|
+
to: z.ZodString;
|
|
88
|
+
from: z.ZodString;
|
|
89
|
+
nonce: z.ZodNumber;
|
|
90
|
+
gasLimit: z.ZodString;
|
|
91
|
+
gasPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
data: z.ZodString;
|
|
93
|
+
value: z.ZodString;
|
|
94
|
+
chainId: z.ZodNumber;
|
|
95
|
+
v: z.ZodNumber;
|
|
96
|
+
r: z.ZodString;
|
|
97
|
+
s: z.ZodString;
|
|
98
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
99
|
+
accessList: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
100
|
+
maxPriorityFeePerGas: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
maxFeePerGas: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
value: string;
|
|
104
|
+
to: string;
|
|
105
|
+
nonce: number;
|
|
106
|
+
gasLimit: string;
|
|
107
|
+
data: string;
|
|
108
|
+
chainId: number;
|
|
109
|
+
hash: string;
|
|
110
|
+
from: string;
|
|
111
|
+
v: number;
|
|
112
|
+
r: string;
|
|
113
|
+
s: string;
|
|
114
|
+
type?: number | null | undefined;
|
|
115
|
+
gasPrice?: string | null | undefined;
|
|
116
|
+
accessList?: any[] | undefined;
|
|
117
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
118
|
+
maxFeePerGas?: string | null | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
value: string;
|
|
121
|
+
to: string;
|
|
122
|
+
nonce: number;
|
|
123
|
+
gasLimit: string;
|
|
124
|
+
data: string;
|
|
125
|
+
chainId: number;
|
|
126
|
+
hash: string;
|
|
127
|
+
from: string;
|
|
128
|
+
v: number;
|
|
129
|
+
r: string;
|
|
130
|
+
s: string;
|
|
131
|
+
type?: number | null | undefined;
|
|
132
|
+
gasPrice?: string | null | undefined;
|
|
133
|
+
accessList?: any[] | undefined;
|
|
134
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
135
|
+
maxFeePerGas?: string | null | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
signedTransaction: string;
|
|
139
|
+
deserializedSignedTransaction: {
|
|
140
|
+
value: string;
|
|
141
|
+
to: string;
|
|
142
|
+
nonce: number;
|
|
143
|
+
gasLimit: string;
|
|
144
|
+
data: string;
|
|
145
|
+
chainId: number;
|
|
146
|
+
hash: string;
|
|
147
|
+
from: string;
|
|
148
|
+
v: number;
|
|
149
|
+
r: string;
|
|
150
|
+
s: string;
|
|
151
|
+
type?: number | null | undefined;
|
|
152
|
+
gasPrice?: string | null | undefined;
|
|
153
|
+
accessList?: any[] | undefined;
|
|
154
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
155
|
+
maxFeePerGas?: string | null | undefined;
|
|
156
|
+
};
|
|
157
|
+
}, {
|
|
158
|
+
signedTransaction: string;
|
|
159
|
+
deserializedSignedTransaction: {
|
|
160
|
+
value: string;
|
|
161
|
+
to: string;
|
|
162
|
+
nonce: number;
|
|
163
|
+
gasLimit: string;
|
|
164
|
+
data: string;
|
|
165
|
+
chainId: number;
|
|
166
|
+
hash: string;
|
|
167
|
+
from: string;
|
|
168
|
+
v: number;
|
|
169
|
+
r: string;
|
|
170
|
+
s: string;
|
|
171
|
+
type?: number | null | undefined;
|
|
172
|
+
gasPrice?: string | null | undefined;
|
|
173
|
+
accessList?: any[] | undefined;
|
|
174
|
+
maxPriorityFeePerGas?: string | null | undefined;
|
|
175
|
+
maxFeePerGas?: string | null | undefined;
|
|
176
|
+
};
|
|
177
|
+
}>;
|
|
178
|
+
export declare const executeFailSchema: z.ZodOptional<z.ZodObject<{
|
|
179
|
+
error: z.ZodString;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
error: string;
|
|
182
|
+
}, {
|
|
183
|
+
error: string;
|
|
184
|
+
}>>;
|
|
185
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/lib/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;GAIjB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeFailSchema = exports.executeSuccessSchema = exports.precheckFailSchema = exports.precheckSuccessSchema = exports.abilityParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.abilityParamsSchema = zod_1.z.object({
|
|
6
|
+
serializedTransaction: zod_1.z
|
|
7
|
+
.string()
|
|
8
|
+
.describe('The serialized transaction to be evaluated and signed'),
|
|
9
|
+
});
|
|
10
|
+
exports.precheckSuccessSchema = zod_1.z.object({
|
|
11
|
+
deserializedUnsignedTransaction: zod_1.z.object({
|
|
12
|
+
to: zod_1.z.string().describe('The address the transaction is being sent to'),
|
|
13
|
+
nonce: zod_1.z.number().optional().describe('The transaction nonce'),
|
|
14
|
+
gasLimit: zod_1.z.string().describe('The gas limit'),
|
|
15
|
+
gasPrice: zod_1.z.string().nullable().optional().describe('The gas price'),
|
|
16
|
+
data: zod_1.z.string().describe('The data of the transaction'),
|
|
17
|
+
value: zod_1.z.string().describe('The value sent'),
|
|
18
|
+
chainId: zod_1.z.number().describe('The chain ID'),
|
|
19
|
+
type: zod_1.z.number().optional().describe('The transaction type'),
|
|
20
|
+
accessList: zod_1.z.array(zod_1.z.any()).optional().describe('The access list (EIP-2930)'),
|
|
21
|
+
maxPriorityFeePerGas: zod_1.z
|
|
22
|
+
.string()
|
|
23
|
+
.nullable()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('EIP-1559 maxPriorityFeePerGas'),
|
|
26
|
+
maxFeePerGas: zod_1.z.string().nullable().optional().describe('EIP-1559 maxFeePerGas'),
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
exports.precheckFailSchema = zod_1.z.object({
|
|
30
|
+
error: zod_1.z.string().describe('A string containing the error message if the precheck failed.'),
|
|
31
|
+
});
|
|
32
|
+
exports.executeSuccessSchema = zod_1.z.object({
|
|
33
|
+
signedTransaction: zod_1.z.string().describe('The signed transaction'),
|
|
34
|
+
deserializedSignedTransaction: zod_1.z.object({
|
|
35
|
+
hash: zod_1.z.string().describe('The transaction hash'),
|
|
36
|
+
to: zod_1.z.string().describe('The address the transaction is being sent to'),
|
|
37
|
+
from: zod_1.z.string().describe('The address the transaction is sent from'),
|
|
38
|
+
nonce: zod_1.z.number().describe('The transaction nonce'),
|
|
39
|
+
gasLimit: zod_1.z.string().describe('The gas limit'),
|
|
40
|
+
gasPrice: zod_1.z.string().nullable().optional().describe('The gas price'),
|
|
41
|
+
data: zod_1.z.string().describe('The data of the transaction'),
|
|
42
|
+
value: zod_1.z.string().describe('The value sent'),
|
|
43
|
+
chainId: zod_1.z.number().describe('The chain ID'),
|
|
44
|
+
v: zod_1.z.number().describe('The v value of the signature'),
|
|
45
|
+
r: zod_1.z.string().describe('The r value of the signature'),
|
|
46
|
+
s: zod_1.z.string().describe('The s value of the signature'),
|
|
47
|
+
type: zod_1.z.number().nullable().optional().describe('The transaction type'),
|
|
48
|
+
accessList: zod_1.z.array(zod_1.z.any()).optional().describe('The access list (EIP-2930)'),
|
|
49
|
+
maxPriorityFeePerGas: zod_1.z
|
|
50
|
+
.string()
|
|
51
|
+
.nullable()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('EIP-1559 maxPriorityFeePerGas'),
|
|
54
|
+
maxFeePerGas: zod_1.z.string().nullable().optional().describe('EIP-1559 maxFeePerGas'),
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
exports.executeFailSchema = zod_1.z
|
|
58
|
+
.object({
|
|
59
|
+
error: zod_1.z.string().describe('A string containing the error message if the execution failed.'),
|
|
60
|
+
})
|
|
61
|
+
.optional();
|
|
62
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/lib/schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,qBAAqB,EAAE,OAAC;SACrB,MAAM,EAAE;SACR,QAAQ,CAAC,uDAAuD,CAAC;CACrE,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,+BAA+B,EAAE,OAAC,CAAC,MAAM,CAAC;QACxC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;QACvE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAE9D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC9C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAEpE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACxD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;Q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