@lit-protocol/vincent-ability-sdk 2.3.4 → 2.4.0-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/README.md +49 -1
- package/dist/CHANGELOG.md +6 -0
- package/dist/README.md +49 -1
- package/dist/package.json +7 -1
- package/dist/src/gatedSigner.d.ts +2 -0
- package/dist/src/gatedSigner.d.ts.map +1 -0
- package/dist/src/gatedSigner.js +5 -0
- package/dist/src/gatedSigner.js.map +1 -0
- package/dist/src/lib/abilityHelpers/gasSponsorship/get-alchemy-chain-config.js +1 -1
- package/dist/src/lib/abilityHelpers/gasSponsorship/get-alchemy-chain-config.js.map +1 -1
- package/dist/src/lib/gatedSigner/helpers/eip712.d.ts +34 -0
- package/dist/src/lib/gatedSigner/helpers/eip712.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/eip712.js +30 -0
- package/dist/src/lib/gatedSigner/helpers/eip712.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/hex.d.ts +5 -0
- package/dist/src/lib/gatedSigner/helpers/hex.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/hex.js +16 -0
- package/dist/src/lib/gatedSigner/helpers/hex.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.d.ts +54 -0
- package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.js +91 -0
- package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/lowLevelCall.d.ts +13 -0
- package/dist/src/lib/gatedSigner/helpers/lowLevelCall.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/lowLevelCall.js +21 -0
- package/dist/src/lib/gatedSigner/helpers/lowLevelCall.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/schemas.d.ts +925 -0
- package/dist/src/lib/gatedSigner/helpers/schemas.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/schemas.js +64 -0
- package/dist/src/lib/gatedSigner/helpers/schemas.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/signTransaction.d.ts +9 -0
- package/dist/src/lib/gatedSigner/helpers/signTransaction.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/signTransaction.js +30 -0
- package/dist/src/lib/gatedSigner/helpers/signTransaction.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/signUserOperation.d.ts +15 -0
- package/dist/src/lib/gatedSigner/helpers/signUserOperation.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/signUserOperation.js +115 -0
- package/dist/src/lib/gatedSigner/helpers/signUserOperation.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/simulation.d.ts +204 -0
- package/dist/src/lib/gatedSigner/helpers/simulation.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/simulation.js +93 -0
- package/dist/src/lib/gatedSigner/helpers/simulation.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.d.ts +8 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.js +177 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.d.ts +26 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.js +195 -0
- package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.d.ts +20 -0
- package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.js +69 -0
- package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/transaction.d.ts +148 -0
- package/dist/src/lib/gatedSigner/helpers/transaction.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/transaction.js +87 -0
- package/dist/src/lib/gatedSigner/helpers/transaction.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/userOperation.d.ts +200 -0
- package/dist/src/lib/gatedSigner/helpers/userOperation.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/userOperation.js +106 -0
- package/dist/src/lib/gatedSigner/helpers/userOperation.js.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/validation.d.ts +43 -0
- package/dist/src/lib/gatedSigner/helpers/validation.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/helpers/validation.js +81 -0
- package/dist/src/lib/gatedSigner/helpers/validation.js.map +1 -0
- package/dist/src/lib/gatedSigner/index.d.ts +12 -0
- package/dist/src/lib/gatedSigner/index.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/index.js +19 -0
- package/dist/src/lib/gatedSigner/index.js.map +1 -0
- package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.d.ts +566 -0
- package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.d.ts.map +1 -0
- package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.js +48 -0
- package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.js.map +1 -0
- package/dist/src/type-inference-verification/ability-definition-tests.d.ts +6 -6
- package/dist/src/type-inference-verification/allow-deny-test-cases-ability.d.ts +90 -90
- package/dist/src/type-inference-verification/allow-deny-test-cases.d.ts +8 -8
- package/dist/src/type-inference-verification/context-switching-tests.d.ts +3 -3
- package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.d.ts +533 -0
- package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.d.ts.map +1 -0
- package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.js +19 -0
- package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.js.map +1 -0
- package/dist/src/type-inference-verification/parameter-inference-tests-tool.d.ts +58 -58
- package/dist/src/type-inference-verification/parameter-inference-tests.d.ts +5 -5
- package/dist/src/type-inference-verification/playground.d.ts +8 -8
- package/dist/src/type-inference-verification/schema-test.d.ts +5 -5
- package/package.json +8 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;GAEG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB7B,CAAC;AAEH,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,aAAa,KAAG,MAAM,IAAI,mBACpD,CAAC;AACrB,eAAO,MAAM,0BAA0B,GACrC,QAAQ,aAAa,KACpB,MAAM,IAAI,wBAAmD,CAAC;AAQjE,eAAO,MAAM,kBAAkB;;;;;;EAAiB,CAAC;AACjD,eAAO,MAAM,iBAAiB;;;;;;EAAiB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE/B,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeSuccessSchema = exports.precheckSuccessSchema = exports.executeFailSchema = exports.precheckFailSchema = exports.isTransactionAbilityParams = exports.isUserOpAbilityParams = exports.abilityParamsSchema = void 0;
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const eip712_1 = require("./eip712");
|
|
7
|
+
const hex_1 = require("./hex");
|
|
8
|
+
const simulation_1 = require("./simulation");
|
|
9
|
+
const transaction_1 = require("./transaction");
|
|
10
|
+
const userOperation_1 = require("./userOperation");
|
|
11
|
+
const baseAbilityParamsSchema = zod_1.z.object({
|
|
12
|
+
alchemyRpcUrl: simulation_1.alchemyRpcUrlSchema,
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Ability params Schemas. Can be to sign either a user operation or a transaction
|
|
16
|
+
*/
|
|
17
|
+
const userOpAbilityParamsSchema = baseAbilityParamsSchema.extend({
|
|
18
|
+
userOp: userOperation_1.userOpSchema.describe('User operation to simulate, validate and sign. This MUST be a valid UserOperation object as defined in the UserOperation schemas.'),
|
|
19
|
+
entryPointAddress: hex_1.addressSchema
|
|
20
|
+
.optional()
|
|
21
|
+
.default(account_abstraction_1.entryPoint07Address)
|
|
22
|
+
.describe('EntryPoint to use for the simulation. Currently only v0.7 is supported. Defaults to standard v0.7 entryPoint address.'),
|
|
23
|
+
alchemyRpcUrl: simulation_1.alchemyRpcUrlSchema,
|
|
24
|
+
validAfter: zod_1.z.number().default(0).describe('Valid after timestamp (for Safe smart accounts)'),
|
|
25
|
+
validUntil: zod_1.z.number().default(0).describe('Valid until timestamp (for Safe smart accounts)'),
|
|
26
|
+
safe4337ModuleAddress: hex_1.addressSchema
|
|
27
|
+
.default('0x75cf11467937ce3F2f357CE24ffc3DBF8fD5c226')
|
|
28
|
+
.describe('Safe 4337 Module address (for Safe smart accounts)'),
|
|
29
|
+
eip712Params: eip712_1.eip712ParamsSchema
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('EIP-712 signing parameters for non-standard signing (e.g. Safe smart accounts)'),
|
|
32
|
+
});
|
|
33
|
+
const transactionAbilityParamsSchema = baseAbilityParamsSchema.extend({
|
|
34
|
+
alchemyRpcUrl: simulation_1.alchemyRpcUrlSchema,
|
|
35
|
+
transaction: transaction_1.transactionSchema.describe('EOA transaction to simulate, validate and sign. This must be a valid and complete transaction.'),
|
|
36
|
+
});
|
|
37
|
+
exports.abilityParamsSchema = zod_1.z.union([
|
|
38
|
+
userOpAbilityParamsSchema,
|
|
39
|
+
transactionAbilityParamsSchema,
|
|
40
|
+
]);
|
|
41
|
+
const isUserOpAbilityParams = (params) => 'userOp' in params;
|
|
42
|
+
exports.isUserOpAbilityParams = isUserOpAbilityParams;
|
|
43
|
+
const isTransactionAbilityParams = (params) => 'transaction' in params;
|
|
44
|
+
exports.isTransactionAbilityParams = isTransactionAbilityParams;
|
|
45
|
+
/**
|
|
46
|
+
* Failure result schema
|
|
47
|
+
*/
|
|
48
|
+
const baseFailSchema = zod_1.z.object({
|
|
49
|
+
error: zod_1.z.string().describe('A string containing the error message if the precheck failed.'),
|
|
50
|
+
});
|
|
51
|
+
exports.precheckFailSchema = baseFailSchema;
|
|
52
|
+
exports.executeFailSchema = baseFailSchema;
|
|
53
|
+
/**
|
|
54
|
+
* Success result schema
|
|
55
|
+
*/
|
|
56
|
+
exports.precheckSuccessSchema = zod_1.z.object({
|
|
57
|
+
simulationChanges: zod_1.z
|
|
58
|
+
.array(simulation_1.simulateAssetChangeSchema)
|
|
59
|
+
.describe('Simulated changes user op will make to the blockchain.'),
|
|
60
|
+
});
|
|
61
|
+
exports.executeSuccessSchema = exports.precheckSuccessSchema.extend({
|
|
62
|
+
signature: hex_1.hexSchema.describe('ECDSA signature over the received user operation or transaction.'),
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/schemas.ts"],"names":[],"mappings":";;;AAAA,kEAA+D;AAC/D,6BAAwB;AAExB,qCAA8C;AAC9C,+BAAiD;AACjD,6CAA8E;AAC9E,+CAAkD;AAClD,mDAA+C;AAE/C,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,gCAAmB;CACnC,CAAC,CAAC;AAEH;;GAE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,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;CAC5F,CAAC,CAAC;AACU,QAAA,kBAAkB,GAAG,cAAc,CAAC;AACpC,QAAA,iBAAiB,GAAG,cAAc,CAAC;AAEhD;;GAEG;AACU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,iBAAiB,EAAE,OAAC;SACjB,KAAK,CAAC,sCAAyB,CAAC;SAChC,QAAQ,CAAC,wDAAwD,CAAC;CACtE,CAAC,CAAC;AACU,QAAA,oBAAoB,GAAG,6BAAqB,CAAC,MAAM,CAAC;IAC/D,SAAS,EAAE,eAAS,CAAC,QAAQ,CAAC,kEAAkE,CAAC;CAClG,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { Transaction } from './transaction';
|
|
3
|
+
interface SignTransactionParams {
|
|
4
|
+
pkpPublicKey: Hex;
|
|
5
|
+
transaction: Transaction;
|
|
6
|
+
}
|
|
7
|
+
export declare function signTransaction({ pkpPublicKey, transaction }: SignTransactionParams): Promise<`0x${string}`>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=signTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signTransaction.d.ts","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/signTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAIhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,UAAU,qBAAqB;IAC7B,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAsB,eAAe,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,qBAAqB,0BA4BzF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signTransaction = signTransaction;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const toLitActionAccount_1 = require("./toLitActionAccount");
|
|
6
|
+
async function signTransaction({ pkpPublicKey, transaction }) {
|
|
7
|
+
const account = (0, toLitActionAccount_1.toLitActionAccount)(pkpPublicKey);
|
|
8
|
+
const signableTransaction = {
|
|
9
|
+
...transaction,
|
|
10
|
+
accessList: transaction.accessList || [],
|
|
11
|
+
gas: transaction.gas ? (0, viem_1.hexToBigInt)(transaction.gas) : undefined,
|
|
12
|
+
gasLimit: transaction.gasLimit ? (0, viem_1.hexToBigInt)(transaction.gasLimit) : undefined,
|
|
13
|
+
gasPrice: transaction.gasPrice ? (0, viem_1.hexToBigInt)(transaction.gasPrice) : undefined,
|
|
14
|
+
maxFeePerGas: transaction.maxFeePerGas ? (0, viem_1.hexToBigInt)(transaction.maxFeePerGas) : undefined,
|
|
15
|
+
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas
|
|
16
|
+
? (0, viem_1.hexToBigInt)(transaction.maxPriorityFeePerGas)
|
|
17
|
+
: undefined,
|
|
18
|
+
nonce: (0, viem_1.hexToNumber)(transaction.nonce),
|
|
19
|
+
value: (0, viem_1.hexToBigInt)(transaction.value),
|
|
20
|
+
};
|
|
21
|
+
// @ts-expect-error viem complains but the tx should be coherent besides generalities
|
|
22
|
+
const signedTx = await account.signTransaction(signableTransaction);
|
|
23
|
+
const parsed = (0, viem_1.parseTransaction)(signedTx);
|
|
24
|
+
if (!parsed.r || !parsed.s || parsed.yParity === undefined)
|
|
25
|
+
throw new Error('Signed tx missing signature fields');
|
|
26
|
+
const yParityByte = parsed.yParity === 0 ? '0x00' : '0x01';
|
|
27
|
+
const signature = (0, viem_1.concatHex)([parsed.r, parsed.s, yParityByte]);
|
|
28
|
+
return signature;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=signTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,uBAAgB,EAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QACxD,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAExD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAE3D,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/D,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { Eip712Params } from './eip712';
|
|
3
|
+
import type { UserOp } from './userOperation';
|
|
4
|
+
export interface SignUserOperationParams {
|
|
5
|
+
alchemyRpcUrl: string;
|
|
6
|
+
entryPointAddress: Address;
|
|
7
|
+
pkpPublicKey: Hex;
|
|
8
|
+
userOp: UserOp;
|
|
9
|
+
validAfter: number;
|
|
10
|
+
validUntil: number;
|
|
11
|
+
safe4337ModuleAddress: Address;
|
|
12
|
+
eip712Params?: Eip712Params;
|
|
13
|
+
}
|
|
14
|
+
export declare function signUserOperation({ alchemyRpcUrl, entryPointAddress, pkpPublicKey, userOp, validAfter, validUntil, safe4337ModuleAddress, eip712Params, }: SignUserOperationParams): Promise<`0x${string}`>;
|
|
15
|
+
//# sourceMappingURL=signUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signUserOperation.d.ts","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/signUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAMzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAI9C,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,GAAG,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,wBAAsB,iBAAiB,CAAC,EACtC,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,YAAY,GACb,EAAE,uBAAuB,0BAiHzB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signUserOperation = signUserOperation;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
6
|
+
const toLitActionAccount_1 = require("./toLitActionAccount");
|
|
7
|
+
async function signUserOperation({ alchemyRpcUrl, entryPointAddress, pkpPublicKey, userOp, validAfter, validUntil, safe4337ModuleAddress, eip712Params, }) {
|
|
8
|
+
const publicClient = (0, viem_1.createPublicClient)({
|
|
9
|
+
transport: (0, viem_1.http)(alchemyRpcUrl),
|
|
10
|
+
});
|
|
11
|
+
const chainId = await publicClient.getChainId();
|
|
12
|
+
const account = (0, toLitActionAccount_1.toLitActionAccount)(pkpPublicKey);
|
|
13
|
+
const userOperationToHash = {
|
|
14
|
+
...userOp,
|
|
15
|
+
callGasLimit: BigInt(userOp.callGasLimit),
|
|
16
|
+
maxFeePerGas: BigInt(userOp.maxFeePerGas),
|
|
17
|
+
maxPriorityFeePerGas: BigInt(userOp.maxPriorityFeePerGas),
|
|
18
|
+
nonce: BigInt(userOp.nonce),
|
|
19
|
+
paymasterPostOpGasLimit: BigInt(userOp.paymasterPostOpGasLimit),
|
|
20
|
+
paymasterVerificationGasLimit: BigInt(userOp.paymasterVerificationGasLimit),
|
|
21
|
+
preVerificationGas: BigInt(userOp.preVerificationGas),
|
|
22
|
+
verificationGasLimit: BigInt(userOp.verificationGasLimit),
|
|
23
|
+
};
|
|
24
|
+
if (eip712Params) {
|
|
25
|
+
const resolveValue = (value) => {
|
|
26
|
+
if (typeof value === 'string' && value.startsWith('$')) {
|
|
27
|
+
switch (value) {
|
|
28
|
+
case '$userOp.sender':
|
|
29
|
+
return userOperationToHash.sender;
|
|
30
|
+
case '$userOp.nonce':
|
|
31
|
+
return userOperationToHash.nonce;
|
|
32
|
+
case '$userOp.initCode':
|
|
33
|
+
if (userOperationToHash.factory && userOperationToHash.factoryData) {
|
|
34
|
+
return (0, viem_1.concat)([userOperationToHash.factory, userOperationToHash.factoryData]);
|
|
35
|
+
}
|
|
36
|
+
return '0x';
|
|
37
|
+
case '$userOp.callData':
|
|
38
|
+
return userOperationToHash.callData;
|
|
39
|
+
case '$userOp.callGasLimit':
|
|
40
|
+
return userOperationToHash.callGasLimit;
|
|
41
|
+
case '$userOp.verificationGasLimit':
|
|
42
|
+
return userOperationToHash.verificationGasLimit;
|
|
43
|
+
case '$userOp.preVerificationGas':
|
|
44
|
+
return userOperationToHash.preVerificationGas;
|
|
45
|
+
case '$userOp.maxFeePerGas':
|
|
46
|
+
return userOperationToHash.maxFeePerGas;
|
|
47
|
+
case '$userOp.maxPriorityFeePerGas':
|
|
48
|
+
return userOperationToHash.maxPriorityFeePerGas;
|
|
49
|
+
case '$userOp.paymasterAndData':
|
|
50
|
+
if (userOperationToHash.paymaster) {
|
|
51
|
+
return (0, viem_1.concat)([
|
|
52
|
+
userOperationToHash.paymaster,
|
|
53
|
+
(0, viem_1.pad)((0, viem_1.toHex)(userOperationToHash.paymasterVerificationGasLimit || 0n), { size: 16 }),
|
|
54
|
+
(0, viem_1.pad)((0, viem_1.toHex)(userOperationToHash.paymasterPostOpGasLimit || 0n), { size: 16 }),
|
|
55
|
+
userOperationToHash.paymasterData || '0x',
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
return '0x';
|
|
59
|
+
case '$userOp.signature':
|
|
60
|
+
return userOperationToHash.signature;
|
|
61
|
+
case '$userOp.factory':
|
|
62
|
+
return userOperationToHash.factory;
|
|
63
|
+
case '$userOp.factoryData':
|
|
64
|
+
return userOperationToHash.factoryData;
|
|
65
|
+
case '$userOp.paymaster':
|
|
66
|
+
return userOperationToHash.paymaster;
|
|
67
|
+
case '$userOp.paymasterData':
|
|
68
|
+
return userOperationToHash.paymasterData;
|
|
69
|
+
case '$userOp.paymasterVerificationGasLimit':
|
|
70
|
+
return userOperationToHash.paymasterVerificationGasLimit;
|
|
71
|
+
case '$userOp.paymasterPostOpGasLimit':
|
|
72
|
+
return userOperationToHash.paymasterPostOpGasLimit;
|
|
73
|
+
case '$entryPointAddress':
|
|
74
|
+
return entryPointAddress;
|
|
75
|
+
case '$validAfter':
|
|
76
|
+
return validAfter;
|
|
77
|
+
case '$validUntil':
|
|
78
|
+
return validUntil;
|
|
79
|
+
case '$safe4337ModuleAddress':
|
|
80
|
+
return safe4337ModuleAddress;
|
|
81
|
+
case '$chainId':
|
|
82
|
+
return chainId;
|
|
83
|
+
default:
|
|
84
|
+
throw new Error(`Unknown mapping reference: ${value}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (typeof value === 'object' && value !== null) {
|
|
88
|
+
const result = {};
|
|
89
|
+
for (const key in value) {
|
|
90
|
+
result[key] = resolveValue(value[key]);
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
return value;
|
|
95
|
+
};
|
|
96
|
+
const message = resolveValue(eip712Params.message);
|
|
97
|
+
const domain = resolveValue(eip712Params.domain);
|
|
98
|
+
return await account.signTypedData({
|
|
99
|
+
domain,
|
|
100
|
+
types: eip712Params.types,
|
|
101
|
+
primaryType: eip712Params.primaryType,
|
|
102
|
+
message,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const userOpHash = (0, account_abstraction_1.getUserOperationHash)({
|
|
106
|
+
chainId,
|
|
107
|
+
entryPointAddress,
|
|
108
|
+
entryPointVersion: '0.7',
|
|
109
|
+
userOperation: userOperationToHash,
|
|
110
|
+
});
|
|
111
|
+
return await account.signMessage({
|
|
112
|
+
message: { raw: userOpHash },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=signUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/signUserOperation.ts"],"names":[],"mappings":";;AAsBA,8CA0HC;AA7ID,+BAAoE;AACpE,kEAAgE;AAKhE,6DAA0D;AAanD,KAAK,UAAU,iBAAiB,CAAC,EACtC,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,YAAY,GACY;IACxB,MAAM,YAAY,GAAG,IAAA,yBAAkB,EAAC;QACtC,SAAS,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC;KAC/B,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,IAAA,uCAAkB,EAAC,YAAY,CAAC,CAAC;IAEjD,MAAM,mBAAmB,GAAyB;QAChD,GAAG,MAAM;QACT,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;QACzC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;QACzC,oBAAoB,EAAE,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC;QACzD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3B,uBAAuB,EAAE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K,IAAI,EAAE,CAAC;gBAChD,MAAM,MAAM,GAAwB,EAAE,CAAC;gBACvC,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;oBACxB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBACzC,CAAC;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAEjD,OAAO,MAAM,OAAO,CAAC,aAAa,CAAC;YACjC,MAAM;YACN,KAAK,EAAE,YAAY,CAAC,KAAK;YACzB,WAAW,EAAE,YAAY,CAAC,WAAW;YACrC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED,MAAM,UAAU,GAAG,IAAA,0CAAoB,EAAC;QACtC,OAAO;QACP,iBAAiB;QACjB,iBAAiB,EAAE,KAAK;QACxB,aAAa,EAAE,mBAAmB;KACnC,CAAC,CAAC;IAEH,OAAO,MAAM,OAAO,CAAC,WAAW,CAAC;QAC/B,OAAO,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { Address, PublicClient } from 'viem';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Transaction } from './transaction';
|
|
4
|
+
import type { UserOp } from './userOperation';
|
|
5
|
+
/**
|
|
6
|
+
* Validates valid Alchemy RPC URLs, the simulation provider
|
|
7
|
+
*/
|
|
8
|
+
export declare const alchemyRpcUrlSchema: z.ZodString;
|
|
9
|
+
export declare enum SimulateAssetType {
|
|
10
|
+
NATIVE = "NATIVE",
|
|
11
|
+
ERC20 = "ERC20",
|
|
12
|
+
ERC721 = "ERC721",
|
|
13
|
+
ERC1155 = "ERC1155",
|
|
14
|
+
/**
|
|
15
|
+
* Special contracts that don't follow ERC 721/1155. Currently limited to
|
|
16
|
+
* CryptoKitties and CryptoPunks.
|
|
17
|
+
*/
|
|
18
|
+
SPECIAL_NFT = "SPECIAL_NFT"
|
|
19
|
+
}
|
|
20
|
+
export declare const simulateAssetTypeSchema: z.ZodNativeEnum<typeof SimulateAssetType>;
|
|
21
|
+
export declare enum SimulateChangeType {
|
|
22
|
+
APPROVE = "APPROVE",
|
|
23
|
+
TRANSFER = "TRANSFER"
|
|
24
|
+
}
|
|
25
|
+
export declare const simulateChangeTypeSchema: z.ZodNativeEnum<typeof SimulateChangeType>;
|
|
26
|
+
export declare const simulateAssetChangeSchema: z.ZodObject<{
|
|
27
|
+
assetType: z.ZodNativeEnum<typeof SimulateAssetType>;
|
|
28
|
+
changeType: z.ZodNativeEnum<typeof SimulateChangeType>;
|
|
29
|
+
from: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
30
|
+
to: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
31
|
+
rawAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
contractAddress: z.ZodOptional<z.ZodNullable<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>>;
|
|
34
|
+
tokenId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
decimals: z.ZodNumber;
|
|
36
|
+
symbol: z.ZodString;
|
|
37
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
symbol: string;
|
|
41
|
+
to: `0x${string}`;
|
|
42
|
+
from: `0x${string}`;
|
|
43
|
+
assetType: SimulateAssetType;
|
|
44
|
+
changeType: SimulateChangeType;
|
|
45
|
+
decimals: number;
|
|
46
|
+
tokenId?: string | null | undefined;
|
|
47
|
+
name?: string | null | undefined;
|
|
48
|
+
rawAmount?: string | null | undefined;
|
|
49
|
+
amount?: string | null | undefined;
|
|
50
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
51
|
+
logo?: string | null | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
symbol: string;
|
|
54
|
+
to: `0x${string}`;
|
|
55
|
+
from: `0x${string}`;
|
|
56
|
+
assetType: SimulateAssetType;
|
|
57
|
+
changeType: SimulateChangeType;
|
|
58
|
+
decimals: number;
|
|
59
|
+
tokenId?: string | null | undefined;
|
|
60
|
+
name?: string | null | undefined;
|
|
61
|
+
rawAmount?: string | null | undefined;
|
|
62
|
+
amount?: string | null | undefined;
|
|
63
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
64
|
+
logo?: string | null | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const simulateAssetChangesErrorSchema: z.ZodObject<{
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
69
|
+
message: z.ZodString;
|
|
70
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
71
|
+
message: z.ZodString;
|
|
72
|
+
}, z.ZodUnknown, "strip">>;
|
|
73
|
+
export declare const simulateAssetChangesResponseSchema: z.ZodObject<{
|
|
74
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
75
|
+
assetType: z.ZodNativeEnum<typeof SimulateAssetType>;
|
|
76
|
+
changeType: z.ZodNativeEnum<typeof SimulateChangeType>;
|
|
77
|
+
from: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
78
|
+
to: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
79
|
+
rawAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
contractAddress: z.ZodOptional<z.ZodNullable<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>>;
|
|
82
|
+
tokenId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
decimals: z.ZodNumber;
|
|
84
|
+
symbol: z.ZodString;
|
|
85
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
symbol: string;
|
|
89
|
+
to: `0x${string}`;
|
|
90
|
+
from: `0x${string}`;
|
|
91
|
+
assetType: SimulateAssetType;
|
|
92
|
+
changeType: SimulateChangeType;
|
|
93
|
+
decimals: number;
|
|
94
|
+
tokenId?: string | null | undefined;
|
|
95
|
+
name?: string | null | undefined;
|
|
96
|
+
rawAmount?: string | null | undefined;
|
|
97
|
+
amount?: string | null | undefined;
|
|
98
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
99
|
+
logo?: string | null | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
symbol: string;
|
|
102
|
+
to: `0x${string}`;
|
|
103
|
+
from: `0x${string}`;
|
|
104
|
+
assetType: SimulateAssetType;
|
|
105
|
+
changeType: SimulateChangeType;
|
|
106
|
+
decimals: number;
|
|
107
|
+
tokenId?: string | null | undefined;
|
|
108
|
+
name?: string | null | undefined;
|
|
109
|
+
rawAmount?: string | null | undefined;
|
|
110
|
+
amount?: string | null | undefined;
|
|
111
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
112
|
+
logo?: string | null | undefined;
|
|
113
|
+
}>, "many">;
|
|
114
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
115
|
+
message: z.ZodString;
|
|
116
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
117
|
+
message: z.ZodString;
|
|
118
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
119
|
+
message: z.ZodString;
|
|
120
|
+
}, z.ZodUnknown, "strip">>>>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
changes: {
|
|
123
|
+
symbol: string;
|
|
124
|
+
to: `0x${string}`;
|
|
125
|
+
from: `0x${string}`;
|
|
126
|
+
assetType: SimulateAssetType;
|
|
127
|
+
changeType: SimulateChangeType;
|
|
128
|
+
decimals: number;
|
|
129
|
+
tokenId?: string | null | undefined;
|
|
130
|
+
name?: string | null | undefined;
|
|
131
|
+
rawAmount?: string | null | undefined;
|
|
132
|
+
amount?: string | null | undefined;
|
|
133
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
134
|
+
logo?: string | null | undefined;
|
|
135
|
+
}[];
|
|
136
|
+
error?: z.objectOutputType<{
|
|
137
|
+
message: z.ZodString;
|
|
138
|
+
}, z.ZodUnknown, "strip"> | null | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
changes: {
|
|
141
|
+
symbol: string;
|
|
142
|
+
to: `0x${string}`;
|
|
143
|
+
from: `0x${string}`;
|
|
144
|
+
assetType: SimulateAssetType;
|
|
145
|
+
changeType: SimulateChangeType;
|
|
146
|
+
decimals: number;
|
|
147
|
+
tokenId?: string | null | undefined;
|
|
148
|
+
name?: string | null | undefined;
|
|
149
|
+
rawAmount?: string | null | undefined;
|
|
150
|
+
amount?: string | null | undefined;
|
|
151
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
152
|
+
logo?: string | null | undefined;
|
|
153
|
+
}[];
|
|
154
|
+
error?: z.objectInputType<{
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
}, z.ZodUnknown, "strip"> | null | undefined;
|
|
157
|
+
}>;
|
|
158
|
+
export type SimulateAssetChangesResponse = z.infer<typeof simulateAssetChangesResponseSchema>;
|
|
159
|
+
export declare const simulateTransaction: ({ publicClient, transaction, }: {
|
|
160
|
+
publicClient: PublicClient;
|
|
161
|
+
transaction: Transaction;
|
|
162
|
+
}) => Promise<{
|
|
163
|
+
changes: {
|
|
164
|
+
symbol: string;
|
|
165
|
+
to: `0x${string}`;
|
|
166
|
+
from: `0x${string}`;
|
|
167
|
+
assetType: SimulateAssetType;
|
|
168
|
+
changeType: SimulateChangeType;
|
|
169
|
+
decimals: number;
|
|
170
|
+
tokenId?: string | null | undefined;
|
|
171
|
+
name?: string | null | undefined;
|
|
172
|
+
rawAmount?: string | null | undefined;
|
|
173
|
+
amount?: string | null | undefined;
|
|
174
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
175
|
+
logo?: string | null | undefined;
|
|
176
|
+
}[];
|
|
177
|
+
error?: z.objectOutputType<{
|
|
178
|
+
message: z.ZodString;
|
|
179
|
+
}, z.ZodUnknown, "strip"> | null | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
export declare const simulateUserOp: ({ entryPointAddress, publicClient, userOp, }: {
|
|
182
|
+
entryPointAddress: Address;
|
|
183
|
+
publicClient: PublicClient;
|
|
184
|
+
userOp: UserOp;
|
|
185
|
+
}) => Promise<{
|
|
186
|
+
changes: {
|
|
187
|
+
symbol: string;
|
|
188
|
+
to: `0x${string}`;
|
|
189
|
+
from: `0x${string}`;
|
|
190
|
+
assetType: SimulateAssetType;
|
|
191
|
+
changeType: SimulateChangeType;
|
|
192
|
+
decimals: number;
|
|
193
|
+
tokenId?: string | null | undefined;
|
|
194
|
+
name?: string | null | undefined;
|
|
195
|
+
rawAmount?: string | null | undefined;
|
|
196
|
+
amount?: string | null | undefined;
|
|
197
|
+
contractAddress?: `0x${string}` | null | undefined;
|
|
198
|
+
logo?: string | null | undefined;
|
|
199
|
+
}[];
|
|
200
|
+
error?: z.objectOutputType<{
|
|
201
|
+
message: z.ZodString;
|
|
202
|
+
}, z.ZodUnknown, "strip"> | null | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
//# sourceMappingURL=simulation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/simulation.ts"],"names":[],"mappings":"AA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|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.simulateUserOp = exports.simulateTransaction = exports.simulateAssetChangesResponseSchema = exports.simulateAssetChangesErrorSchema = exports.simulateAssetChangeSchema = exports.simulateChangeTypeSchema = exports.SimulateChangeType = exports.simulateAssetTypeSchema = exports.SimulateAssetType = exports.alchemyRpcUrlSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const hex_1 = require("./hex");
|
|
6
|
+
/**
|
|
7
|
+
* Validates valid Alchemy RPC URLs, the simulation provider
|
|
8
|
+
*/
|
|
9
|
+
exports.alchemyRpcUrlSchema = zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.regex(/^https:\/\/[a-z0-9-]+\.g\.alchemy\.com\/v2\/.+/, { message: 'Invalid Alchemy RPC URL' })
|
|
12
|
+
.url()
|
|
13
|
+
.describe('Alchemy RPC URL for the desired chain. Will be used to simulate the transaction or user op and define the target chain.');
|
|
14
|
+
// Types copied from @account-kit/infra
|
|
15
|
+
// Zod schemas are created for runtime validation; types are derived from them to ensure consistency
|
|
16
|
+
// Enums and their schemas
|
|
17
|
+
var SimulateAssetType;
|
|
18
|
+
(function (SimulateAssetType) {
|
|
19
|
+
SimulateAssetType["NATIVE"] = "NATIVE";
|
|
20
|
+
SimulateAssetType["ERC20"] = "ERC20";
|
|
21
|
+
SimulateAssetType["ERC721"] = "ERC721";
|
|
22
|
+
SimulateAssetType["ERC1155"] = "ERC1155";
|
|
23
|
+
/**
|
|
24
|
+
* Special contracts that don't follow ERC 721/1155. Currently limited to
|
|
25
|
+
* CryptoKitties and CryptoPunks.
|
|
26
|
+
*/
|
|
27
|
+
SimulateAssetType["SPECIAL_NFT"] = "SPECIAL_NFT";
|
|
28
|
+
})(SimulateAssetType || (exports.SimulateAssetType = SimulateAssetType = {}));
|
|
29
|
+
exports.simulateAssetTypeSchema = zod_1.z.nativeEnum(SimulateAssetType);
|
|
30
|
+
var SimulateChangeType;
|
|
31
|
+
(function (SimulateChangeType) {
|
|
32
|
+
SimulateChangeType["APPROVE"] = "APPROVE";
|
|
33
|
+
SimulateChangeType["TRANSFER"] = "TRANSFER";
|
|
34
|
+
})(SimulateChangeType || (exports.SimulateChangeType = SimulateChangeType = {}));
|
|
35
|
+
exports.simulateChangeTypeSchema = zod_1.z.nativeEnum(SimulateChangeType);
|
|
36
|
+
exports.simulateAssetChangeSchema = zod_1.z.object({
|
|
37
|
+
assetType: exports.simulateAssetTypeSchema,
|
|
38
|
+
changeType: exports.simulateChangeTypeSchema,
|
|
39
|
+
from: hex_1.hexSchema,
|
|
40
|
+
to: hex_1.hexSchema,
|
|
41
|
+
rawAmount: zod_1.z.string().nullable().optional(),
|
|
42
|
+
amount: zod_1.z.string().nullable().optional(),
|
|
43
|
+
contractAddress: hex_1.hexSchema.nullable().optional(),
|
|
44
|
+
tokenId: zod_1.z.string().nullable().optional(),
|
|
45
|
+
decimals: zod_1.z.number(),
|
|
46
|
+
symbol: zod_1.z.string(),
|
|
47
|
+
name: zod_1.z.string().nullable().optional(),
|
|
48
|
+
logo: zod_1.z.string().nullable().optional(),
|
|
49
|
+
});
|
|
50
|
+
exports.simulateAssetChangesErrorSchema = zod_1.z
|
|
51
|
+
.object({
|
|
52
|
+
message: zod_1.z.string(),
|
|
53
|
+
})
|
|
54
|
+
.catchall(zod_1.z.unknown());
|
|
55
|
+
exports.simulateAssetChangesResponseSchema = zod_1.z.object({
|
|
56
|
+
changes: zod_1.z.array(exports.simulateAssetChangeSchema),
|
|
57
|
+
error: exports.simulateAssetChangesErrorSchema.nullable().optional(),
|
|
58
|
+
});
|
|
59
|
+
const simulateTransaction = async ({ publicClient, transaction, }) => {
|
|
60
|
+
// Convert transaction to RPC-compatible format
|
|
61
|
+
const rpcTransaction = {
|
|
62
|
+
from: transaction.from,
|
|
63
|
+
to: transaction.to,
|
|
64
|
+
data: transaction.data,
|
|
65
|
+
value: transaction.value,
|
|
66
|
+
nonce: transaction.nonce,
|
|
67
|
+
...(transaction.gas && { gas: transaction.gas }),
|
|
68
|
+
...(transaction.gasLimit && !transaction.gas && { gas: transaction.gasLimit }),
|
|
69
|
+
...(transaction.gasPrice && { gasPrice: transaction.gasPrice }),
|
|
70
|
+
...(transaction.maxFeePerGas && { maxFeePerGas: transaction.maxFeePerGas }),
|
|
71
|
+
...(transaction.maxPriorityFeePerGas && {
|
|
72
|
+
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas,
|
|
73
|
+
}),
|
|
74
|
+
...(transaction.accessList && { accessList: transaction.accessList }),
|
|
75
|
+
};
|
|
76
|
+
return (await publicClient.request({
|
|
77
|
+
// @ts-expect-error viem types do not include this method
|
|
78
|
+
method: 'alchemy_simulateAssetChanges',
|
|
79
|
+
// @ts-expect-error viem types do not include this method
|
|
80
|
+
params: [rpcTransaction],
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
exports.simulateTransaction = simulateTransaction;
|
|
84
|
+
const simulateUserOp = async ({ entryPointAddress, publicClient, userOp, }) => {
|
|
85
|
+
return (await publicClient.request({
|
|
86
|
+
// @ts-expect-error viem types do not include this method
|
|
87
|
+
method: 'alchemy_simulateUserOperationAssetChanges',
|
|
88
|
+
// @ts-expect-error viem types do not include this method
|
|
89
|
+
params: [userOp, entryPointAddress],
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
92
|
+
exports.simulateUserOp = simulateUserOp;
|
|
93
|
+
//# sourceMappingURL=simulation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation.js","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/simulation.ts"],"names":[],"mappings":";;;AAEA,6BAAwB;AAKxB,+BAAkC;AAElC;;GAEG;AACU,QAAA,mBAAmB,GAAG,OAAC;KACjC,MAAM,EAAE;KACR,KAAK,CAAC,gDAAgD,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;KAC/F,G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WAAW,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC;KACtE,CAAC;IAEF,OAAO,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC;QACjC,yDAAyD;QACzD,MAAM,EAAE,8BAA8B;QACtC,yDAAyD;QACzD,MAAM,EAAE,CAAC,cAAc,CAAC;KACzB,CAAC,CAAiC,CAAC;AACtC,CAAC,CAAC;AA9BW,QAAA,mBAAmB,uBA8B9B;AAEK,MAAM,cAAc,GAAG,KAAK,EAAE,EACnC,iBAAiB,EACjB,YAAY,EACZ,MAAM,GAKP,EAAE,EAAE;IACH,OAAO,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC;QACjC,yDAAyD;QACzD,MAAM,EAAE,2CAA2C;QACnD,yDAAyD;QACzD,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC;KACpC,CAAC,CAAiC,CAAC;AACtC,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { LowLevelCall } from '../lowLevelCall';
|
|
3
|
+
export declare function tryDecodeKernelCalldataToLowLevelCalls(callData: Hex): LowLevelCall[] | null;
|
|
4
|
+
export declare function formatSecondaryValidatorKernelSignature(params: {
|
|
5
|
+
secondValidatorId: Hex;
|
|
6
|
+
signature: Hex;
|
|
7
|
+
}): `0x${string}`;
|
|
8
|
+
//# sourceMappingURL=kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/gatedSigner/helpers/smartAccounts/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,GAAG,EAAE,MAAM,MAAM,CAAC;AAWrC,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAmJzE,wBAAgB,sCAAsC,CAAC,QAAQ,EAAE,GAAG,GAAG,YAAY,EAAE,GAAG,IAAI,CAkC3F;AAED,wBAAgB,uCAAuC,CAAC,MAAM,EAAE;IAC9D,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,GAAG,CAAC;CAChB,iBAEA"}
|