permissionless 0.0.30 → 0.0.32
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 +12 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js +21 -15
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/bundler/sendUserOperation.js +14 -7
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/errors/account.js +311 -0
- package/_cjs/errors/account.js.map +1 -0
- package/_cjs/errors/bundler.js +61 -0
- package/_cjs/errors/bundler.js.map +1 -0
- package/_cjs/errors/estimateUserOperationGas.js +47 -0
- package/_cjs/errors/estimateUserOperationGas.js.map +1 -0
- package/_cjs/errors/gas.js +113 -0
- package/_cjs/errors/gas.js.map +1 -0
- package/_cjs/errors/index.js +35 -0
- package/_cjs/errors/index.js.map +1 -0
- package/_cjs/errors/paymaster.js +228 -0
- package/_cjs/errors/paymaster.js.map +1 -0
- package/_cjs/errors/sendUserOperation.js +47 -0
- package/_cjs/errors/sendUserOperation.js.map +1 -0
- package/_cjs/errors/utils.js +18 -0
- package/_cjs/errors/utils.js.map +1 -0
- package/_cjs/index.js +1 -0
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/errors/getBundlerError.js +124 -0
- package/_cjs/utils/errors/getBundlerError.js.map +1 -0
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js +19 -0
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js.map +1 -0
- package/_cjs/utils/errors/getSendUserOperationError.js +19 -0
- package/_cjs/utils/errors/getSendUserOperationError.js.map +1 -0
- package/_cjs/utils/getAddressFromInitCodeOrPaymasterAndData.js +15 -0
- package/_cjs/utils/getAddressFromInitCodeOrPaymasterAndData.js.map +1 -0
- package/_cjs/utils/index.js +5 -3
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js +22 -15
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/bundler/sendUserOperation.js +14 -7
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/errors/account.js +298 -0
- package/_esm/errors/account.js.map +1 -0
- package/_esm/errors/bundler.js +56 -0
- package/_esm/errors/bundler.js.map +1 -0
- package/_esm/errors/estimateUserOperationGas.js +43 -0
- package/_esm/errors/estimateUserOperationGas.js.map +1 -0
- package/_esm/errors/gas.js +106 -0
- package/_esm/errors/gas.js.map +1 -0
- package/_esm/errors/index.js +8 -0
- package/_esm/errors/index.js.map +1 -0
- package/_esm/errors/paymaster.js +218 -0
- package/_esm/errors/paymaster.js.map +1 -0
- package/_esm/errors/sendUserOperation.js +44 -0
- package/_esm/errors/sendUserOperation.js.map +1 -0
- package/_esm/errors/utils.js +14 -0
- package/_esm/errors/utils.js.map +1 -0
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/utils/errors/getBundlerError.js +121 -0
- package/_esm/utils/errors/getBundlerError.js.map +1 -0
- package/_esm/utils/errors/getEstimateUserOperationGasError.js +19 -0
- package/_esm/utils/errors/getEstimateUserOperationGasError.js.map +1 -0
- package/_esm/utils/errors/getSendUserOperationError.js +15 -0
- package/_esm/utils/errors/getSendUserOperationError.js.map +1 -0
- package/_esm/utils/getAddressFromInitCodeOrPaymasterAndData.js +11 -0
- package/_esm/utils/getAddressFromInitCodeOrPaymasterAndData.js.map +1 -0
- package/_esm/utils/index.js +3 -2
- package/_esm/utils/index.js.map +1 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +3 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/index.d.ts +2 -2
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/errors/account.d.ts +121 -0
- package/_types/errors/account.d.ts.map +1 -0
- package/_types/errors/bundler.d.ts +24 -0
- package/_types/errors/bundler.d.ts.map +1 -0
- package/_types/errors/estimateUserOperationGas.d.ts +13 -0
- package/_types/errors/estimateUserOperationGas.d.ts.map +1 -0
- package/_types/errors/gas.d.ts +47 -0
- package/_types/errors/gas.d.ts.map +1 -0
- package/_types/errors/index.d.ts +8 -0
- package/_types/errors/index.d.ts.map +1 -0
- package/_types/errors/paymaster.d.ts +85 -0
- package/_types/errors/paymaster.d.ts.map +1 -0
- package/_types/errors/sendUserOperation.d.ts +13 -0
- package/_types/errors/sendUserOperation.d.ts.map +1 -0
- package/_types/errors/utils.d.ts +5 -0
- package/_types/errors/utils.d.ts.map +1 -0
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/utils/errors/getBundlerError.d.ts +11 -0
- package/_types/utils/errors/getBundlerError.d.ts.map +1 -0
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts +9 -0
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts.map +1 -0
- package/_types/utils/errors/getSendUserOperationError.d.ts +4 -0
- package/_types/utils/errors/getSendUserOperationError.d.ts.map +1 -0
- package/_types/utils/getAddressFromInitCodeOrPaymasterAndData.d.ts +3 -0
- package/_types/utils/getAddressFromInitCodeOrPaymasterAndData.d.ts.map +1 -0
- package/_types/utils/index.d.ts +3 -2
- package/_types/utils/index.d.ts.map +1 -1
- package/actions/bundler/estimateUserOperationGas.ts +33 -15
- package/actions/bundler/sendUserOperation.ts +26 -8
- package/actions/index.ts +3 -1
- package/errors/account.ts +345 -0
- package/errors/bundler.ts +62 -0
- package/errors/estimateUserOperationGas.ts +50 -0
- package/errors/gas.ts +120 -0
- package/errors/index.ts +118 -0
- package/errors/paymaster.ts +257 -0
- package/errors/sendUserOperation.ts +49 -0
- package/errors/utils.ts +19 -0
- package/index.ts +1 -0
- package/package.json +6 -1
- package/utils/errors/getBundlerError.ts +220 -0
- package/utils/errors/getEstimateUserOperationGasError.ts +37 -0
- package/utils/errors/getSendUserOperationError.ts +25 -0
- package/utils/getAddressFromInitCodeOrPaymasterAndData.ts +13 -0
- package/utils/index.ts +4 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSendUserOperationError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const errors_1 = require("../../errors");
|
|
6
|
+
const getBundlerError_1 = require("./getBundlerError");
|
|
7
|
+
function getSendUserOperationError(err, args) {
|
|
8
|
+
const cause = (() => {
|
|
9
|
+
const cause = (0, getBundlerError_1.getBundlerError)(err, args);
|
|
10
|
+
if (cause instanceof viem_1.UnknownNodeError)
|
|
11
|
+
return err;
|
|
12
|
+
return cause;
|
|
13
|
+
})();
|
|
14
|
+
throw new errors_1.SendUserOperationError(cause, {
|
|
15
|
+
...args
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.getSendUserOperationError = getSendUserOperationError;
|
|
19
|
+
//# sourceMappingURL=getSendUserOperationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSendUserOperationError.js","sourceRoot":"","sources":["../../../utils/errors/getSendUserOperationError.ts"],"names":[],"mappings":";;;AAAA,+BAAkD;AAElD,yCAAqD;AACrD,uDAG0B;AAE1B,SAAgB,yBAAyB,CACrC,GAAc,EACd,IAAiC;IAEjC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE;QAChB,MAAM,KAAK,GAAG,IAAA,iCAAe,EACzB,GAAgB,EAChB,IAAiC,CACpC,CAAA;QACD,IAAI,KAAK,YAAY,uBAAgB;YAAE,OAAO,GAAgB,CAAA;QAC9D,OAAO,KAAK,CAAA;IAChB,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,IAAI,+BAAsB,CAAC,KAAK,EAAE;QACpC,GAAG,IAAI;KACV,CAAC,CAAA;AACN,CAAC;AAhBD,8DAgBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAddressFromInitCodeOrPaymasterAndData = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
function getAddressFromInitCodeOrPaymasterAndData(data) {
|
|
6
|
+
if (!data) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (data.length >= 42) {
|
|
10
|
+
return (0, viem_1.getAddress)(data.slice(0, 42));
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
exports.getAddressFromInitCodeOrPaymasterAndData = getAddressFromInitCodeOrPaymasterAndData;
|
|
15
|
+
//# sourceMappingURL=getAddressFromInitCodeOrPaymasterAndData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAddressFromInitCodeOrPaymasterAndData.js","sourceRoot":"","sources":["../../utils/getAddressFromInitCodeOrPaymasterAndData.ts"],"names":[],"mappings":";;;AAAA,+BAAyD;AAEzD,SAAgB,wCAAwC,CACpD,IAAS;IAET,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,SAAS,CAAA;IACpB,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QACpB,OAAO,IAAA,iBAAU,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,SAAS,CAAA;AACpB,CAAC;AAVD,4FAUC"}
|
package/_cjs/utils/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSmartAccountDeployed = exports.AccountOrClientNotFoundError = exports.signUserOperationHashWithECDSA = exports.walletClientToCustomSigner = exports.getRequiredPrefund = exports.getUserOperationHash = exports.getAction = exports.deepHexlify = exports.transactionReceiptStatus = exports.parseAccount = void 0;
|
|
3
|
+
exports.getAddressFromInitCodeOrPaymasterAndData = exports.isSmartAccountDeployed = exports.AccountOrClientNotFoundError = exports.signUserOperationHashWithECDSA = exports.walletClientToCustomSigner = exports.getRequiredPrefund = exports.getUserOperationHash = exports.getAction = exports.deepHexlify = exports.transactionReceiptStatus = exports.parseAccount = void 0;
|
|
4
4
|
const deepHexlify_js_1 = require("./deepHexlify.js");
|
|
5
5
|
Object.defineProperty(exports, "deepHexlify", { enumerable: true, get: function () { return deepHexlify_js_1.deepHexlify; } });
|
|
6
6
|
Object.defineProperty(exports, "transactionReceiptStatus", { enumerable: true, get: function () { return deepHexlify_js_1.transactionReceiptStatus; } });
|
|
7
7
|
const getAction_js_1 = require("./getAction.js");
|
|
8
8
|
Object.defineProperty(exports, "getAction", { enumerable: true, get: function () { return getAction_js_1.getAction; } });
|
|
9
|
+
const getAddressFromInitCodeOrPaymasterAndData_js_1 = require("./getAddressFromInitCodeOrPaymasterAndData.js");
|
|
10
|
+
Object.defineProperty(exports, "getAddressFromInitCodeOrPaymasterAndData", { enumerable: true, get: function () { return getAddressFromInitCodeOrPaymasterAndData_js_1.getAddressFromInitCodeOrPaymasterAndData; } });
|
|
9
11
|
const getRequiredPrefund_js_1 = require("./getRequiredPrefund.js");
|
|
10
12
|
Object.defineProperty(exports, "getRequiredPrefund", { enumerable: true, get: function () { return getRequiredPrefund_js_1.getRequiredPrefund; } });
|
|
11
13
|
const getUserOperationHash_js_1 = require("./getUserOperationHash.js");
|
|
12
14
|
Object.defineProperty(exports, "getUserOperationHash", { enumerable: true, get: function () { return getUserOperationHash_js_1.getUserOperationHash; } });
|
|
13
|
-
const
|
|
14
|
-
Object.defineProperty(exports, "isSmartAccountDeployed", { enumerable: true, get: function () { return
|
|
15
|
+
const isSmartAccountDeployed_js_1 = require("./isSmartAccountDeployed.js");
|
|
16
|
+
Object.defineProperty(exports, "isSmartAccountDeployed", { enumerable: true, get: function () { return isSmartAccountDeployed_js_1.isSmartAccountDeployed; } });
|
|
15
17
|
const signUserOperationHashWithECDSA_js_1 = require("./signUserOperationHashWithECDSA.js");
|
|
16
18
|
Object.defineProperty(exports, "AccountOrClientNotFoundError", { enumerable: true, get: function () { return signUserOperationHashWithECDSA_js_1.AccountOrClientNotFoundError; } });
|
|
17
19
|
Object.defineProperty(exports, "signUserOperationHashWithECDSA", { enumerable: true, get: function () { return signUserOperationHashWithECDSA_js_1.signUserOperationHashWithECDSA; } });
|
package/_cjs/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;AACA,qDAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;AACA,qDAAwE;AA2BpE,4FA3BK,4BAAW,OA2BL;AADX,yGA1BkB,yCAAwB,OA0BlB;AAzB5B,iDAA0C;AA2BtC,0FA3BK,wBAAS,OA2BL;AA1Bb,+GAAwG;AAoCpG,yHApCK,sFAAwC,OAoCL;AAnC5C,mEAGgC;AAwB5B,mGAzBA,0CAAkB,OAyBA;AAvBtB,uEAGkC;AAmB9B,qGApBA,8CAAoB,OAoBA;AAlBxB,2EAAoE;AA0BhE,uGA1BK,kDAAsB,OA0BL;AAzB1B,2FAI4C;AAoBxC,6GAvBA,gEAA4B,OAuBA;AAF5B,+GAnBA,kEAA8B,OAmBA;AAjBlC,mFAA4E;AAcxE,2GAdK,0DAA0B,OAcL;AAZ9B,SAAgB,YAAY,CAAC,OAA0B;IACnD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;IACjD,OAAO,OAAO,CAAA;AAClB,CAAC;AAJD,oCAIC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { BaseError } from "viem";
|
|
1
2
|
import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
3
|
+
import { getEstimateUserOperationGasError } from "../../utils/errors/getEstimateUserOperationGasError.js";
|
|
2
4
|
/**
|
|
3
5
|
* Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
|
|
4
6
|
*
|
|
@@ -30,20 +32,25 @@ export const estimateUserOperationGas = async (client, args, stateOverrides) =>
|
|
|
30
32
|
const { userOperation, entryPoint } = args;
|
|
31
33
|
const userOperationWithBigIntAsHex = deepHexlify(userOperation);
|
|
32
34
|
const stateOverridesWithBigIntAsHex = deepHexlify(stateOverrides);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
try {
|
|
36
|
+
const response = await client.request({
|
|
37
|
+
method: "eth_estimateUserOperationGas",
|
|
38
|
+
params: stateOverrides
|
|
39
|
+
? [
|
|
40
|
+
userOperationWithBigIntAsHex,
|
|
41
|
+
entryPoint,
|
|
42
|
+
stateOverridesWithBigIntAsHex
|
|
43
|
+
]
|
|
44
|
+
: [userOperationWithBigIntAsHex, entryPoint]
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
preVerificationGas: BigInt(response.preVerificationGas || 0),
|
|
48
|
+
verificationGasLimit: BigInt(response.verificationGasLimit || 0),
|
|
49
|
+
callGasLimit: BigInt(response.callGasLimit || 0)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
throw getEstimateUserOperationGasError(err, args);
|
|
54
|
+
}
|
|
48
55
|
};
|
|
49
56
|
//# sourceMappingURL=estimateUserOperationGas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,SAAS,EAIZ,MAAM,MAAM,CAAA;AAMb,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAEH,gCAAgC,EACnC,MAAM,wDAAwD,CAAA;AAmB/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAA8D,EAC9D,IAAkD,EAClD,cAA+B,EACsB,EAAE;IACvD,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,MAAM,4BAA4B,GAAG,WAAW,CAAC,aAAa,CAAC,CAAA;IAC/D,MAAM,6BAA6B,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;IAEjE,IAAI,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YAClC,MAAM,EAAE,8BAA8B;YACtC,MAAM,EAAE,cAAc;gBAClB,CAAC,CAAC;oBACI,4BAA4B;oBAC5B,UAAU;oBACV,6BAA6B;iBAChC;gBACH,CAAC,CAAC,CAAC,4BAA4B,EAAE,UAAU,CAAC;SACnD,CAAC,CAAA;QAEF,OAAO;YACH,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,IAAI,CAAC,CAAC;YAC5D,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,IAAI,CAAC,CAAC;YAChE,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC;SACnD,CAAA;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,gCAAgC,CAAC,GAAgB,EAAE,IAAI,CAAC,CAAA;IAClE,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
2
|
+
import { getSendUserOperationError } from "../../utils/errors/getSendUserOperationError.js";
|
|
2
3
|
/**
|
|
3
4
|
* Sends user operation to the bundler
|
|
4
5
|
*
|
|
@@ -26,12 +27,18 @@ import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
|
26
27
|
*/
|
|
27
28
|
export const sendUserOperation = async (client, args) => {
|
|
28
29
|
const { userOperation, entryPoint } = args;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
try {
|
|
31
|
+
const userOperationHash = await client.request({
|
|
32
|
+
method: "eth_sendUserOperation",
|
|
33
|
+
params: [
|
|
34
|
+
deepHexlify(userOperation),
|
|
35
|
+
entryPoint
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
return userOperationHash;
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
throw getSendUserOperationError(err, args);
|
|
42
|
+
}
|
|
36
43
|
};
|
|
37
44
|
//# sourceMappingURL=sendUserOperation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAA;AAO3F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAKlC,MAA8D,EAC9D,IAA2C,EAC9B,EAAE;IACf,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,IAAI,CAAC;QACD,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YAC3C,MAAM,EAAE,uBAAuB;YAC/B,MAAM,EAAE;gBACJ,WAAW,CAAC,aAAa,CAAiC;gBAC1D,UAAqB;aACxB;SACJ,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAA;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,yBAAyB,CAC3B,GAAgB,EAChB,IAAmC,CACtC,CAAA;IACL,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EACnB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAA;AACtF,OAAO,EAEH,uCAAuC,EAC1C,MAAM,0CAA0C,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAgB7D,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,2BAA2B,EAC3B,uCAAuC,EAC1C,CAAA"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { BaseError } from "viem";
|
|
2
|
+
export class SenderAlreadyDeployedError extends BaseError {
|
|
3
|
+
constructor({ cause, sender, docsPath } = {}) {
|
|
4
|
+
super([
|
|
5
|
+
`Smart account ${sender} is already deployed.`,
|
|
6
|
+
"",
|
|
7
|
+
"Possible solutions:",
|
|
8
|
+
`• Remove the initCode from the user operation and set it to "0x"`,
|
|
9
|
+
"",
|
|
10
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
11
|
+
].join("\n"), {
|
|
12
|
+
cause
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(this, "name", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value: "SenderAlreadyDeployedError"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(SenderAlreadyDeployedError, "message", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: /aa10/
|
|
27
|
+
});
|
|
28
|
+
export class InitCodeRevertedError extends BaseError {
|
|
29
|
+
constructor({ cause, docsPath } = {}) {
|
|
30
|
+
super([
|
|
31
|
+
"EntryPoint failed to create the smart account with the initCode provided.",
|
|
32
|
+
"",
|
|
33
|
+
"Possible reasons:",
|
|
34
|
+
"• The initCode ran out of gas",
|
|
35
|
+
"• The initCode reverted during the account deployment process",
|
|
36
|
+
"",
|
|
37
|
+
"Possible solutions:",
|
|
38
|
+
"• Verify that the factory address in the initCode is correct (the factory address is the first 20 bytes of the initCode).",
|
|
39
|
+
"• Verify that the initCode is correct.",
|
|
40
|
+
"• Check whether the verificationGasLimit is sufficient for the initCode to complete without running out of gas.",
|
|
41
|
+
"",
|
|
42
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
43
|
+
].join("\n"), {
|
|
44
|
+
cause
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(this, "name", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true,
|
|
49
|
+
writable: true,
|
|
50
|
+
value: "InitCodeRevertedError"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
Object.defineProperty(InitCodeRevertedError, "message", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: /aa13/
|
|
59
|
+
});
|
|
60
|
+
export class SenderAddressMismatchError extends BaseError {
|
|
61
|
+
constructor({ cause, sender, docsPath }) {
|
|
62
|
+
super([
|
|
63
|
+
"The initCode returned a different smart account address than expected.",
|
|
64
|
+
`Expected: ${sender}`,
|
|
65
|
+
"",
|
|
66
|
+
"Possible reasons:",
|
|
67
|
+
"• Account deployed with the initCode provided does not match match the sender address provided",
|
|
68
|
+
"",
|
|
69
|
+
"Possible solutions:",
|
|
70
|
+
"• Verify that the sender address was generated deterministically from the initCode. (consider leveraging functions like getSenderAddress)",
|
|
71
|
+
"• Verify that the factory address in the initCode is correct (the factory address is the first 20 bytes of the initCode)",
|
|
72
|
+
"• Verify that the initCode is correct.",
|
|
73
|
+
"",
|
|
74
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
75
|
+
].join("\n"), {
|
|
76
|
+
cause
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(this, "name", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
value: "SenderAddressMismatchError"
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
Object.defineProperty(SenderAddressMismatchError, "message", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: /aa14/
|
|
91
|
+
});
|
|
92
|
+
export class InitCodeDidNotDeploySenderError extends BaseError {
|
|
93
|
+
constructor({ cause, sender, docsPath }) {
|
|
94
|
+
super([
|
|
95
|
+
`The initCode did not deploy the sender at the address ${sender}.`,
|
|
96
|
+
"",
|
|
97
|
+
"Possible reasons:",
|
|
98
|
+
"• The initCode factory is not creating an account.",
|
|
99
|
+
"• The initCode factory is creating an account, but is not implemented correctly as it is not deploying at the sender address",
|
|
100
|
+
"",
|
|
101
|
+
"Possible solutions:",
|
|
102
|
+
"• Verify that the factory address in the initCode is correct (the factory address is the first 20 bytes of the initCode).",
|
|
103
|
+
"• Verify that the initCode factory is implemented correctly. The factory must deploy the smart account at the sender address.",
|
|
104
|
+
"",
|
|
105
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
106
|
+
].join("\n"), {
|
|
107
|
+
cause
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(this, "name", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
value: "InitCodeDidNotDeploySenderError"
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
Object.defineProperty(InitCodeDidNotDeploySenderError, "message", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
configurable: true,
|
|
120
|
+
writable: true,
|
|
121
|
+
value: /aa15/
|
|
122
|
+
});
|
|
123
|
+
export class SenderNotDeployedError extends BaseError {
|
|
124
|
+
constructor({ cause, sender, docsPath }) {
|
|
125
|
+
super([
|
|
126
|
+
`Smart account ${sender} is not deployed.`,
|
|
127
|
+
"",
|
|
128
|
+
"Possible reasons:",
|
|
129
|
+
"• An initCode was not specified, but the sender address (i.e. the smart account) is not deployed.",
|
|
130
|
+
"",
|
|
131
|
+
"Possible solutions:",
|
|
132
|
+
"• If this is the first transaction by this account, make sure the initCode is included in the user operation.",
|
|
133
|
+
"• If the smart account is already supposed to be deployed, verify that you have selected the correct sender address for the user operation.",
|
|
134
|
+
"",
|
|
135
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
136
|
+
].join("\n"), {
|
|
137
|
+
cause
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(this, "name", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
configurable: true,
|
|
142
|
+
writable: true,
|
|
143
|
+
value: "SenderNotDeployedError"
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
Object.defineProperty(SenderNotDeployedError, "message", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
configurable: true,
|
|
150
|
+
writable: true,
|
|
151
|
+
value: /aa20/
|
|
152
|
+
});
|
|
153
|
+
export class SmartAccountInsufficientFundsError extends BaseError {
|
|
154
|
+
constructor({ cause, sender, docsPath }) {
|
|
155
|
+
super([
|
|
156
|
+
`You are not using a paymaster, and the ${sender} address did not have enough native tokens to cover the gas costs associated with the user operation.`,
|
|
157
|
+
"",
|
|
158
|
+
"Possible solutions:",
|
|
159
|
+
"• If you are not using a paymaster, verify that the sender address has enough native tokens to cover the required prefund. Consider leveraging functions like getRequiredPrefund.",
|
|
160
|
+
"• If you are looking to use a paymaster to cover the gas fees, verify that the paymasterAndData field is set.",
|
|
161
|
+
"",
|
|
162
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
163
|
+
].join("\n"), {
|
|
164
|
+
cause
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(this, "name", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
configurable: true,
|
|
169
|
+
writable: true,
|
|
170
|
+
value: "SmartAccountInsufficientFundsError"
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
Object.defineProperty(SmartAccountInsufficientFundsError, "message", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
configurable: true,
|
|
177
|
+
writable: true,
|
|
178
|
+
value: /aa21/
|
|
179
|
+
});
|
|
180
|
+
export class SmartAccountSignatureValidityPeriodError extends BaseError {
|
|
181
|
+
constructor({ cause, docsPath }) {
|
|
182
|
+
super([
|
|
183
|
+
"The signature used in the user operation is not valid, because it is outside of the time range it specified.",
|
|
184
|
+
"",
|
|
185
|
+
"Possible reasons:",
|
|
186
|
+
"• This error occurs when the block.timestamp falls after the validUntil timestamp, or before the validAfter timestamp.",
|
|
187
|
+
"",
|
|
188
|
+
"Possible solutions:",
|
|
189
|
+
"• If you are looking to use time-based signatures, verify that the validAfter and validUntil fields are set correctly and that the user operation is sent within the specified range.",
|
|
190
|
+
"• If you are not looking to use time-based signatures, verify that the validAfter and validUntil fields are set to 0.",
|
|
191
|
+
"",
|
|
192
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
193
|
+
].join("\n"), {
|
|
194
|
+
cause
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(this, "name", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
configurable: true,
|
|
199
|
+
writable: true,
|
|
200
|
+
value: "SmartAccountSignatureValidityPeriodError"
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
Object.defineProperty(SmartAccountSignatureValidityPeriodError, "message", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
configurable: true,
|
|
207
|
+
writable: true,
|
|
208
|
+
value: /aa22/
|
|
209
|
+
});
|
|
210
|
+
export class SmartAccountValidationRevertedError extends BaseError {
|
|
211
|
+
constructor({ cause, sender, docsPath }) {
|
|
212
|
+
super([
|
|
213
|
+
`The smart account ${sender} reverted or ran out of gas during the validation of the user operation.`,
|
|
214
|
+
"",
|
|
215
|
+
"Possible solutions:",
|
|
216
|
+
"• Verify that the verificationGasLimit is high enough to cover the validateUserOp function's gas costs.",
|
|
217
|
+
"• Make sure validateUserOp returns uint(1) for invalid signatures, and MUST NOT REVERT when the signature is invalid",
|
|
218
|
+
"• If you are not using a paymaster, verify that the sender address has enough native tokens to cover the required pre fund. Consider leveraging functions like getRequiredPrefund.",
|
|
219
|
+
"• Verify that the validateUserOp function is implemented with the correct logic, and that the user operation is supposed to be valid.",
|
|
220
|
+
"",
|
|
221
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
222
|
+
].join("\n"), {
|
|
223
|
+
cause
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(this, "name", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
configurable: true,
|
|
228
|
+
writable: true,
|
|
229
|
+
value: "SmartAccountValidationRevertedError"
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
Object.defineProperty(SmartAccountValidationRevertedError, "message", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
configurable: true,
|
|
236
|
+
writable: true,
|
|
237
|
+
value: /aa23/
|
|
238
|
+
});
|
|
239
|
+
export class InvalidSmartAccountSignatureError extends BaseError {
|
|
240
|
+
constructor({ cause, sender, docsPath }) {
|
|
241
|
+
super([
|
|
242
|
+
`The smart account ${sender} signature is invalid.`,
|
|
243
|
+
"",
|
|
244
|
+
"Possible solutions:",
|
|
245
|
+
"• Verify that the user operation was correctly signed, and that the signature was correctly encoded in the signature field of the user operation.",
|
|
246
|
+
"• Most smart account implementations sign over the userOpHash. Make sure that the userOpHash is correctly computed. Consider leveraging functions like getUserOperationHash.",
|
|
247
|
+
"• Make sure you have selected the correct chainId and entryPointAddress when computing the userOpHash.",
|
|
248
|
+
"• Make sure the smart account signature verification function is correctly implemented.",
|
|
249
|
+
"",
|
|
250
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
251
|
+
].join("\n"), {
|
|
252
|
+
cause
|
|
253
|
+
});
|
|
254
|
+
Object.defineProperty(this, "name", {
|
|
255
|
+
enumerable: true,
|
|
256
|
+
configurable: true,
|
|
257
|
+
writable: true,
|
|
258
|
+
value: "InvalidSmartAccountSignatureError"
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
Object.defineProperty(InvalidSmartAccountSignatureError, "message", {
|
|
263
|
+
enumerable: true,
|
|
264
|
+
configurable: true,
|
|
265
|
+
writable: true,
|
|
266
|
+
value: /aa24/
|
|
267
|
+
});
|
|
268
|
+
export class InvalidSmartAccountNonceError extends BaseError {
|
|
269
|
+
constructor({ cause, sender, nonce, docsPath }) {
|
|
270
|
+
const nonceKey = nonce >> 64n; // first 192 bits of nonce
|
|
271
|
+
const nonceSequence = nonce & 0xffffffffffffffffn; // last 64 bits of nonce
|
|
272
|
+
super([
|
|
273
|
+
`The smart account ${sender} nonce is invalid.`,
|
|
274
|
+
`Nonce sent: ${nonce} (key: ${nonceKey}, sequence: ${nonceSequence})`,
|
|
275
|
+
"",
|
|
276
|
+
"Possible solutions:",
|
|
277
|
+
"• Verify that you are using the correct nonce for the user operation. The nonce should be the current nonce of the smart account for the selected key. Consider leveraging functions like getAccountNonce.",
|
|
278
|
+
"• Verify that the nonce is formatted correctly.",
|
|
279
|
+
"",
|
|
280
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
281
|
+
].join("\n"), {
|
|
282
|
+
cause
|
|
283
|
+
});
|
|
284
|
+
Object.defineProperty(this, "name", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
configurable: true,
|
|
287
|
+
writable: true,
|
|
288
|
+
value: "InvalidSmartAccountNonceError"
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
Object.defineProperty(InvalidSmartAccountNonceError, "message", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
configurable: true,
|
|
295
|
+
writable: true,
|
|
296
|
+
value: /aa25/
|
|
297
|
+
});
|
|
298
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../errors/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,MAAM,MAAM,CAAA;AAK9C,MAAM,OAAO,0BAA2B,SAAQ,SAAS;IAGrD,YAAY,EACR,KAAK,EACL,MAAM,EACN,QAAQ,KACoD,EAAE;QAC9D,KAAK,CACD;YACI,iBAAiB,MAAM,uBAAuB;YAC9C,EAAE;YACF,qBAAqB;YACrB,kEAAkE;YAClE,EAAE;YACF,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,CAA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AE,CAAC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACI,KAAK;SACR,CACJ,CAAA;QAzBI;;;;mBAAO,mCAA4C;WAAA;IA0B5D,CAAC;;AA3BM;;;;WAAU,MAAM;EAAT,CAAS;AAkC3B,MAAM,OAAO,6BAA8B,SAAQ,SAAS;IAGxD,YAAY,EACR,KAAK,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EAMX;QACG,MAAM,QAAQ,GAAG,KAAK,IAAI,GAAG,CAAA,CAAC,0BAA0B;QACxD,MAAM,aAAa,GAAG,KAAK,GAAG,mBAAmB,CAAA,CAAC,wBAAwB;QAE1E,KAAK,CACD;YACI,qBAAqB,MAAM,oBAAoB;YAC/C,eAAe,KAAK,UAAU,QAAQ,eAAe,aAAa,GAAG;YACrE,EAAE;YACF,qBAAqB;YACrB,4MAA4M;YAC5M,iDAAiD;YACjD,EAAE;YACF,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACI,KAAK;SACR,CACJ,CAAA;QA7BI;;;;mBAAO,+BAAwC;WAAA;IA8BxD,CAAC;;AA/BM;;;;WAAU,MAAM;EAAT,CAAS"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseError } from "viem";
|
|
2
|
+
export class InvalidBeneficiaryAddressError extends BaseError {
|
|
3
|
+
constructor({ cause, docsPath }) {
|
|
4
|
+
super([
|
|
5
|
+
"The bundler did not set a beneficiary address when bundling the user operation.",
|
|
6
|
+
"",
|
|
7
|
+
"Possible solutions:",
|
|
8
|
+
"• If you encounter this error when running self-hosted bundler, make sure you have configured the bundler correctly.",
|
|
9
|
+
"• If you are using a bundler provider, reach out to them.",
|
|
10
|
+
"",
|
|
11
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
12
|
+
].join("\n"), {
|
|
13
|
+
cause
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(this, "name", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: "InvalidBeneficiaryAddressError"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(InvalidBeneficiaryAddressError, "message", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: /aa9[01]/
|
|
28
|
+
});
|
|
29
|
+
export class InvalidAggregatorError extends BaseError {
|
|
30
|
+
constructor({ cause, docsPath }) {
|
|
31
|
+
super([
|
|
32
|
+
"The bundler tried to bundle the user operation with an invalid aggregator.",
|
|
33
|
+
"",
|
|
34
|
+
"Possible solutions:",
|
|
35
|
+
"• If you are using your own bundler, configure it to use a valid aggregator.",
|
|
36
|
+
"• If you are using a bundler provider, reach out to them.",
|
|
37
|
+
"",
|
|
38
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
39
|
+
].join("\n"), {
|
|
40
|
+
cause
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(this, "name", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: "InvalidAggregatorError"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
Object.defineProperty(InvalidAggregatorError, "message", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: /aa96/
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../errors/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAMhC,MAAM,OAAO,8BAA+B,SAAQ,SAAS;IAGzD,YAAY,EACR,KAAK,EACL,QAAQ,EAIX;QACG,KAAK,CACD;YACI,iFAAiF;YACjF,EAAE;YACF,qBAAqB;YACrB,sHAAsH;YACtH,2DAA2D;YAC3D,EAAE;YACF,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACI,KAAK;SACR,CACJ,CAAA;QArBI;;;;mBAAO,gCAAgC;WAAA;IAsBhD,CAAC;;AAvBM;;;;WAAU,SAAS;EAAZ,CAAY;AA6B9B,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAGjD,YAAY,EACR,KAAK,EACL,QAAQ,EAIX;QACG,KAAK,CACD;YACI,4EAA4E;YAC5E,EAAE;YACF,qBAAqB;YACrB,8EAA8E;YAC9E,2DAA2D;YAC3D,EAAE;YACF,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACI,KAAK;SACR,CACJ,CAAA;QArBI;;;;mBAAO,wBAAwB;WAAA;IAsBxC,CAAC;;AAvBM;;;;WAAU,MAAM;EAAT,CAAS"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseError } from "viem";
|
|
2
|
+
import { prettyPrint } from "./utils.js";
|
|
3
|
+
export class EstimateUserOperationGasError extends BaseError {
|
|
4
|
+
constructor(cause, { userOperation, entryPoint, docsPath }) {
|
|
5
|
+
const prettyArgs = prettyPrint({
|
|
6
|
+
sender: userOperation.sender,
|
|
7
|
+
nonce: userOperation.nonce,
|
|
8
|
+
initCode: userOperation.initCode,
|
|
9
|
+
callData: userOperation.callData,
|
|
10
|
+
callGasLimit: userOperation.callGasLimit,
|
|
11
|
+
verificationGasLimit: userOperation.verificationGasLimit,
|
|
12
|
+
preVerificationGas: userOperation.preVerificationGas,
|
|
13
|
+
maxFeePerGas: userOperation.maxFeePerGas,
|
|
14
|
+
maxPriorityFeePerGas: userOperation.maxPriorityFeePerGas,
|
|
15
|
+
paymasterAndData: userOperation.paymasterAndData,
|
|
16
|
+
signature: userOperation.signature,
|
|
17
|
+
entryPoint
|
|
18
|
+
});
|
|
19
|
+
super(cause.shortMessage, {
|
|
20
|
+
cause,
|
|
21
|
+
docsPath,
|
|
22
|
+
metaMessages: [
|
|
23
|
+
...(cause.metaMessages ? [...cause.metaMessages, " "] : []),
|
|
24
|
+
"Estimate Gas Arguments:",
|
|
25
|
+
prettyArgs
|
|
26
|
+
].filter(Boolean)
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(this, "cause", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
configurable: true,
|
|
31
|
+
writable: true,
|
|
32
|
+
value: void 0
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(this, "name", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
configurable: true,
|
|
37
|
+
writable: true,
|
|
38
|
+
value: "EstimateUserOperationGasError"
|
|
39
|
+
});
|
|
40
|
+
this.cause = cause;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=estimateUserOperationGas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../errors/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAMxC,MAAM,OAAO,6BAA8B,SAAQ,SAAS;IAKxD,YACI,KAAgB,EAChB,EACI,aAAa,EACb,UAAU,EACV,QAAQ,EAGX;QAED,MAAM,UAAU,GAAG,WAAW,CAAC;YAC3B,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,KAAK,EAAE,aAAa,CAAC,KAAK;YAC1B,QAAQ,EAAE,aAAa,CAAC,QAAQ;YAChC,QAAQ,EAAE,aAAa,CAAC,QAAQ;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