permissionless 0.0.31 → 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 +6 -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 +3 -1
- 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 +2 -1
- 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 +2 -1
- 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 +3 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BundlerOutOfGasError = exports.GasValuesOverflowError = exports.ActualGasCostTooHighError = exports.VerificationGasLimitTooLowError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
class VerificationGasLimitTooLowError extends viem_1.BaseError {
|
|
6
|
+
constructor({ cause, verificationGasLimit, docsPath }) {
|
|
7
|
+
super([
|
|
8
|
+
`The smart account and paymaster verification exceeded the verificationGasLimit ${verificationGasLimit} set for the user operation.`,
|
|
9
|
+
"",
|
|
10
|
+
"Possible solutions:",
|
|
11
|
+
"• Verify that the verificationGasLimit set for the user operation is high enough to cover the gas used during smart account and paymaster verification.",
|
|
12
|
+
"• If you are using the eth_estimateUserOperationGas or pm_sponsorUserOperation method from bundler provider to set user operation gas limits and the EntryPoint throws this error during submission, reach out to them.",
|
|
13
|
+
"",
|
|
14
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
15
|
+
].join("\n"), {
|
|
16
|
+
cause
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "name", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: "VerificationGasLimitTooLowError"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.VerificationGasLimitTooLowError = VerificationGasLimitTooLowError;
|
|
27
|
+
Object.defineProperty(VerificationGasLimitTooLowError, "message", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: /aa4[01]/
|
|
32
|
+
});
|
|
33
|
+
class ActualGasCostTooHighError extends viem_1.BaseError {
|
|
34
|
+
constructor({ cause, docsPath }) {
|
|
35
|
+
super([
|
|
36
|
+
"The actual gas cost of the user operation ended up being higher than the funds paid by the smart account or the paymaster.",
|
|
37
|
+
"",
|
|
38
|
+
"Possible solutions:",
|
|
39
|
+
"• If you encounter this error, try increasing the verificationGasLimit set for the user operation.",
|
|
40
|
+
"• If you are using the eth_estimateUserOperationGas or pm_sponsorUserOperation method from bundler provider to set user operation gas limits and the EntryPoint throws this error during submission, reach out to them.",
|
|
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: "ActualGasCostTooHighError"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.ActualGasCostTooHighError = ActualGasCostTooHighError;
|
|
55
|
+
Object.defineProperty(ActualGasCostTooHighError, "message", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: /aa51/
|
|
60
|
+
});
|
|
61
|
+
class GasValuesOverflowError extends viem_1.BaseError {
|
|
62
|
+
constructor({ cause, docsPath }) {
|
|
63
|
+
super([
|
|
64
|
+
"The gas limit values of the user operation overflowed, they must fit in uint160.",
|
|
65
|
+
"",
|
|
66
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
67
|
+
].join("\n"), {
|
|
68
|
+
cause
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(this, "name", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
configurable: true,
|
|
73
|
+
writable: true,
|
|
74
|
+
value: "GasValuesOverflowError"
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.GasValuesOverflowError = GasValuesOverflowError;
|
|
79
|
+
Object.defineProperty(GasValuesOverflowError, "message", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: /aa94/
|
|
84
|
+
});
|
|
85
|
+
class BundlerOutOfGasError extends viem_1.BaseError {
|
|
86
|
+
constructor({ cause, docsPath }) {
|
|
87
|
+
super([
|
|
88
|
+
"The bundler tried to bundle the user operation with the gas limit set too low.",
|
|
89
|
+
"",
|
|
90
|
+
"Possible solutions:",
|
|
91
|
+
"• If you are using your own bundler, configure it send gas limits properly.",
|
|
92
|
+
"• If you are using a bundler provider, reach out to them.",
|
|
93
|
+
"",
|
|
94
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
95
|
+
].join("\n"), {
|
|
96
|
+
cause
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(this, "name", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
value: "BundlerOutOfGasError"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.BundlerOutOfGasError = BundlerOutOfGasError;
|
|
107
|
+
Object.defineProperty(BundlerOutOfGasError, "message", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
configurable: true,
|
|
110
|
+
writable: true,
|
|
111
|
+
value: /aa95/
|
|
112
|
+
});
|
|
113
|
+
//# sourceMappingURL=gas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../errors/gas.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAMhC,MAAa,+BAAgC,SAAQ,gBAAS;IAG1D,YAAY,EACR,KAAK,EACL,oBAAoB,EACpB,QAAQ,EAKX;QACG,KAAK,CACD;YACI,kFAAkF,oBAAoB,8BAA8B;YACpI,EAAE;YACF,qBAAqB;YACrB,yJAAyJ;YACzJ,yNAAyN;YACzN,EAAE;YACF,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,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ACR,CACJ,CAAA;QArBI;;;;mBAAO,sBAAsB;WAAA;IAsBtC,CAAC;;AAxBL,oDAyBC;AAxBU;;;;WAAU,MAAM;EAAT,CAAS"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendUserOperationError = exports.PaymasterPostOpRevertedError = exports.BundlerOutOfGasError = exports.GasValuesOverflowError = exports.ActualGasCostTooHighError = exports.VerificationGasLimitTooLowError = exports.PaymasterValidationRevertedError = exports.PaymasterValidityPeriodError = exports.PaymasterDataRejectedError = exports.InvalidPaymasterAndDataError = exports.InvalidAggregatorError = exports.InvalidBeneficiaryAddressError = exports.InvalidSmartAccountSignatureError = exports.PaymasterDepositTooLowError = exports.PaymasterNotDeployedError = exports.InvalidSmartAccountNonceError = exports.SmartAccountValidationRevertedError = exports.SmartAccountSignatureValidityPeriodError = exports.SmartAccountInsufficientFundsError = exports.SenderNotDeployedError = exports.InitCodeDidNotDeploySenderError = exports.SenderAddressMismatchError = exports.InitCodeRevertedError = exports.EstimateUserOperationGasError = exports.SenderAlreadyDeployedError = void 0;
|
|
4
|
+
const account_js_1 = require("./account.js");
|
|
5
|
+
Object.defineProperty(exports, "InitCodeDidNotDeploySenderError", { enumerable: true, get: function () { return account_js_1.InitCodeDidNotDeploySenderError; } });
|
|
6
|
+
Object.defineProperty(exports, "InitCodeRevertedError", { enumerable: true, get: function () { return account_js_1.InitCodeRevertedError; } });
|
|
7
|
+
Object.defineProperty(exports, "InvalidSmartAccountNonceError", { enumerable: true, get: function () { return account_js_1.InvalidSmartAccountNonceError; } });
|
|
8
|
+
Object.defineProperty(exports, "InvalidSmartAccountSignatureError", { enumerable: true, get: function () { return account_js_1.InvalidSmartAccountSignatureError; } });
|
|
9
|
+
Object.defineProperty(exports, "SenderAddressMismatchError", { enumerable: true, get: function () { return account_js_1.SenderAddressMismatchError; } });
|
|
10
|
+
Object.defineProperty(exports, "SenderAlreadyDeployedError", { enumerable: true, get: function () { return account_js_1.SenderAlreadyDeployedError; } });
|
|
11
|
+
Object.defineProperty(exports, "SenderNotDeployedError", { enumerable: true, get: function () { return account_js_1.SenderNotDeployedError; } });
|
|
12
|
+
Object.defineProperty(exports, "SmartAccountInsufficientFundsError", { enumerable: true, get: function () { return account_js_1.SmartAccountInsufficientFundsError; } });
|
|
13
|
+
Object.defineProperty(exports, "SmartAccountSignatureValidityPeriodError", { enumerable: true, get: function () { return account_js_1.SmartAccountSignatureValidityPeriodError; } });
|
|
14
|
+
Object.defineProperty(exports, "SmartAccountValidationRevertedError", { enumerable: true, get: function () { return account_js_1.SmartAccountValidationRevertedError; } });
|
|
15
|
+
const estimateUserOperationGas_js_1 = require("./estimateUserOperationGas.js");
|
|
16
|
+
Object.defineProperty(exports, "EstimateUserOperationGasError", { enumerable: true, get: function () { return estimateUserOperationGas_js_1.EstimateUserOperationGasError; } });
|
|
17
|
+
const sendUserOperation_js_1 = require("./sendUserOperation.js");
|
|
18
|
+
Object.defineProperty(exports, "SendUserOperationError", { enumerable: true, get: function () { return sendUserOperation_js_1.SendUserOperationError; } });
|
|
19
|
+
const paymaster_js_1 = require("./paymaster.js");
|
|
20
|
+
Object.defineProperty(exports, "InvalidPaymasterAndDataError", { enumerable: true, get: function () { return paymaster_js_1.InvalidPaymasterAndDataError; } });
|
|
21
|
+
Object.defineProperty(exports, "PaymasterDataRejectedError", { enumerable: true, get: function () { return paymaster_js_1.PaymasterDataRejectedError; } });
|
|
22
|
+
Object.defineProperty(exports, "PaymasterDepositTooLowError", { enumerable: true, get: function () { return paymaster_js_1.PaymasterDepositTooLowError; } });
|
|
23
|
+
Object.defineProperty(exports, "PaymasterNotDeployedError", { enumerable: true, get: function () { return paymaster_js_1.PaymasterNotDeployedError; } });
|
|
24
|
+
Object.defineProperty(exports, "PaymasterPostOpRevertedError", { enumerable: true, get: function () { return paymaster_js_1.PaymasterPostOpRevertedError; } });
|
|
25
|
+
Object.defineProperty(exports, "PaymasterValidationRevertedError", { enumerable: true, get: function () { return paymaster_js_1.PaymasterValidationRevertedError; } });
|
|
26
|
+
Object.defineProperty(exports, "PaymasterValidityPeriodError", { enumerable: true, get: function () { return paymaster_js_1.PaymasterValidityPeriodError; } });
|
|
27
|
+
const bundler_js_1 = require("./bundler.js");
|
|
28
|
+
Object.defineProperty(exports, "InvalidAggregatorError", { enumerable: true, get: function () { return bundler_js_1.InvalidAggregatorError; } });
|
|
29
|
+
Object.defineProperty(exports, "InvalidBeneficiaryAddressError", { enumerable: true, get: function () { return bundler_js_1.InvalidBeneficiaryAddressError; } });
|
|
30
|
+
const gas_js_1 = require("./gas.js");
|
|
31
|
+
Object.defineProperty(exports, "ActualGasCostTooHighError", { enumerable: true, get: function () { return gas_js_1.ActualGasCostTooHighError; } });
|
|
32
|
+
Object.defineProperty(exports, "BundlerOutOfGasError", { enumerable: true, get: function () { return gas_js_1.BundlerOutOfGasError; } });
|
|
33
|
+
Object.defineProperty(exports, "GasValuesOverflowError", { enumerable: true, get: function () { return gas_js_1.GasValuesOverflowError; } });
|
|
34
|
+
Object.defineProperty(exports, "VerificationGasLimitTooLowError", { enumerable: true, get: function () { return gas_js_1.VerificationGasLimitTooLowError; } });
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../errors/index.ts"],"names":[],"mappings":";;;AAAA,6CAqBqB;AAyEjB,gHA7FA,4CAA+B,OA6FA;AAF/B,sGAzFA,kCAAqB,OAyFA;AAOrB,8GA9FA,0CAA6B,OA8FA;AAG7B,kHA/FA,8CAAiC,OA+FA;AATjC,2GApFA,uCAA0B,OAoFA;AAH1B,2GA/EA,uCAA0B,OA+EA;AAK1B,uGAlFA,mCAAsB,OAkFA;AACtB,mHAjFA,+CAAkC,OAiFA;AAClC,yHAhFA,qDAAwC,OAgFA;AACxC,oHA/EA,gDAAmC,OA+EA;AA5EvC,+EAGsC;AAkElC,8GApEA,2DAA6B,OAoEA;AAjEjC,iEAG+B;AAqF3B,uGAvFA,6CAAsB,OAuFA;AAnF1B,iDAeuB;AA2DnB,6GAzEA,2CAA4B,OAyEA;AAC5B,2GAxEA,yCAA0B,OAwEA;AAL1B,4GAjEA,0CAA2B,OAiEA;AAD3B,0GA9DA,wCAAyB,OA8DA;AAazB,6GAzEA,2CAA4B,OAyEA;AAL5B,iHAlEA,+CAAgC,OAkEA;AADhC,6GA/DA,2CAA4B,OA+DA;AA3DhC,6CAKqB;AAmDjB,uGAvDA,mCAAsB,OAuDA;AADtB,+GApDA,2CAA8B,OAoDA;AAhDlC,qCASiB;AA8Cb,0GAtDA,kCAAyB,OAsDA;AAEzB,qGAtDA,6BAAoB,OAsDA;AADpB,uGAnDA,+BAAsB,OAmDA;AAFtB,gHA/CA,wCAA+B,OA+CA"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidPaymasterAndDataError = exports.PaymasterPostOpRevertedError = exports.PaymasterDataRejectedError = exports.PaymasterValidationRevertedError = exports.PaymasterValidityPeriodError = exports.PaymasterDepositTooLowError = exports.PaymasterNotDeployedError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const index_js_1 = require("../utils/index.js");
|
|
6
|
+
class PaymasterNotDeployedError extends viem_1.BaseError {
|
|
7
|
+
constructor({ cause, paymasterAndData, docsPath } = {}) {
|
|
8
|
+
const paymaster = paymasterAndData
|
|
9
|
+
? (0, index_js_1.getAddressFromInitCodeOrPaymasterAndData)(paymasterAndData)
|
|
10
|
+
: "0x";
|
|
11
|
+
super([
|
|
12
|
+
`Paymaster ${paymaster} is not deployed.`,
|
|
13
|
+
"",
|
|
14
|
+
"Possible solutions:",
|
|
15
|
+
"• Verify that the paymasterAndData field is correct, and that the first 20 bytes are the address of the paymaster contract you intend to use.",
|
|
16
|
+
"• Verify that the paymaster contract is deployed on the network you are using.",
|
|
17
|
+
"",
|
|
18
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
19
|
+
].join("\n"), {
|
|
20
|
+
cause
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(this, "name", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: "PaymasterNotDeployedError"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.PaymasterNotDeployedError = PaymasterNotDeployedError;
|
|
31
|
+
Object.defineProperty(PaymasterNotDeployedError, "message", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: /aa30/
|
|
36
|
+
});
|
|
37
|
+
class PaymasterDepositTooLowError extends viem_1.BaseError {
|
|
38
|
+
constructor({ cause, paymasterAndData, docsPath } = {}) {
|
|
39
|
+
const paymaster = paymasterAndData
|
|
40
|
+
? (0, index_js_1.getAddressFromInitCodeOrPaymasterAndData)(paymasterAndData)
|
|
41
|
+
: "0x";
|
|
42
|
+
super([
|
|
43
|
+
`Paymaster ${paymaster} contract does not have enough funds deposited into the EntryPoint contract to cover the required funds for the user operation.`,
|
|
44
|
+
"",
|
|
45
|
+
"Possible solutions:",
|
|
46
|
+
"• If you are using your own paymaster contract, deposit more funds into the EntryPoint contract through the deposit() function of the paymaster contract.",
|
|
47
|
+
"• Verify that the paymasterAndData field is correct, and that the first 20 bytes are the address of the paymaster contract you intend to useVerify that the paymasterAndData field is correct, and that the first 20 bytes are the address of the paymaster contract you intend to use.",
|
|
48
|
+
"• If you are using a paymaster service, reach out to them.",
|
|
49
|
+
"",
|
|
50
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
51
|
+
].join("\n"), {
|
|
52
|
+
cause
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(this, "name", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: "PaymasterDepositTooLowError"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.PaymasterDepositTooLowError = PaymasterDepositTooLowError;
|
|
63
|
+
Object.defineProperty(PaymasterDepositTooLowError, "message", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
configurable: true,
|
|
66
|
+
writable: true,
|
|
67
|
+
value: /aa31/
|
|
68
|
+
});
|
|
69
|
+
class PaymasterValidityPeriodError extends viem_1.BaseError {
|
|
70
|
+
constructor({ cause, paymasterAndData, docsPath }) {
|
|
71
|
+
const paymaster = paymasterAndData
|
|
72
|
+
? (0, index_js_1.getAddressFromInitCodeOrPaymasterAndData)(paymasterAndData)
|
|
73
|
+
: "0x";
|
|
74
|
+
super([
|
|
75
|
+
`Paymaster ${paymaster}'s data used in the paymasterAndData field of the user operation is not valid, because it is outside of the time range it specified.`,
|
|
76
|
+
"",
|
|
77
|
+
"Possible reasons:",
|
|
78
|
+
"• This error occurs when the block.timestamp falls after the validUntil timestamp, or before the validAfter timestamp.",
|
|
79
|
+
"",
|
|
80
|
+
"Possible solutions:",
|
|
81
|
+
"• If you are using your own paymaster contract and using time-based signatures, verify that the validAfter and validUntil fields are set correctly and that the user operation is sent within the specified range.",
|
|
82
|
+
"• If you are using your own paymaster contract and not looking to use time-based signatures, verify that the validAfter and validUntil fields are set to 0.",
|
|
83
|
+
"• If you are using a service, contact your service provider for their paymaster's validity.",
|
|
84
|
+
"",
|
|
85
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
86
|
+
].join("\n"), {
|
|
87
|
+
cause
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(this, "name", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
value: "PaymasterValidityPeriodError"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.PaymasterValidityPeriodError = PaymasterValidityPeriodError;
|
|
98
|
+
Object.defineProperty(PaymasterValidityPeriodError, "message", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
value: /aa32/
|
|
103
|
+
});
|
|
104
|
+
class PaymasterValidationRevertedError extends viem_1.BaseError {
|
|
105
|
+
constructor({ cause, paymasterAndData, docsPath }) {
|
|
106
|
+
const paymaster = paymasterAndData
|
|
107
|
+
? (0, index_js_1.getAddressFromInitCodeOrPaymasterAndData)(paymasterAndData)
|
|
108
|
+
: "0x";
|
|
109
|
+
super([
|
|
110
|
+
`The validatePaymasterUserOp function of the paymaster ${paymaster} either reverted or ran out of gas.`,
|
|
111
|
+
"",
|
|
112
|
+
"Possible solutions:",
|
|
113
|
+
"• Verify that the verificationGasLimit is high enough to cover the validatePaymasterUserOp function's gas costs.",
|
|
114
|
+
"• If you are using your own paymaster contract, verify that the validatePaymasterUserOp function is implemented with the correct logic, and that the user operation is supposed to be valid.",
|
|
115
|
+
"• If you are using a paymaster service, and the user operation is well formed with a high enough verificationGasLimit, reach out to them.",
|
|
116
|
+
"• If you are not looking to use a paymaster to cover the gas fees, verify that the paymasterAndData field is not set.",
|
|
117
|
+
"",
|
|
118
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
119
|
+
].join("\n"), {
|
|
120
|
+
cause
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(this, "name", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
configurable: true,
|
|
125
|
+
writable: true,
|
|
126
|
+
value: "PaymasterValidationRevertedError"
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.PaymasterValidationRevertedError = PaymasterValidationRevertedError;
|
|
131
|
+
Object.defineProperty(PaymasterValidationRevertedError, "message", {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
configurable: true,
|
|
134
|
+
writable: true,
|
|
135
|
+
value: /aa33/
|
|
136
|
+
});
|
|
137
|
+
class PaymasterDataRejectedError extends viem_1.BaseError {
|
|
138
|
+
constructor({ cause, paymasterAndData, docsPath }) {
|
|
139
|
+
const paymaster = paymasterAndData
|
|
140
|
+
? (0, index_js_1.getAddressFromInitCodeOrPaymasterAndData)(paymasterAndData)
|
|
141
|
+
: "0x";
|
|
142
|
+
super([
|
|
143
|
+
`The validatePaymasterUserOp function of the paymaster ${paymaster} rejected paymasterAndData.`,
|
|
144
|
+
"",
|
|
145
|
+
"Possible solutions:",
|
|
146
|
+
"• If you are using your own paymaster contract, verify that the user operation was correctly signed according to your implementation, and that the paymaster signature was correctly encoded in the paymasterAndData field of the user operation.",
|
|
147
|
+
"• If you are using a paymaster service, make sure you do not modify any of the fields of the user operation after the paymaster signs over it (except the signature field).",
|
|
148
|
+
"• If you are using a paymaster service and you have not modified any of the fields except the signature but you are still getting this error, reach out to them.",
|
|
149
|
+
"",
|
|
150
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
151
|
+
].join("\n"), {
|
|
152
|
+
cause
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(this, "name", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
configurable: true,
|
|
157
|
+
writable: true,
|
|
158
|
+
value: "PaymasterDataRejectedError"
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.PaymasterDataRejectedError = PaymasterDataRejectedError;
|
|
163
|
+
Object.defineProperty(PaymasterDataRejectedError, "message", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
configurable: true,
|
|
166
|
+
writable: true,
|
|
167
|
+
value: /aa34/
|
|
168
|
+
});
|
|
169
|
+
class PaymasterPostOpRevertedError extends viem_1.BaseError {
|
|
170
|
+
constructor({ cause, paymasterAndData, docsPath }) {
|
|
171
|
+
const paymaster = paymasterAndData
|
|
172
|
+
? (0, index_js_1.getAddressFromInitCodeOrPaymasterAndData)(paymasterAndData)
|
|
173
|
+
: "0x";
|
|
174
|
+
super([
|
|
175
|
+
`The postOp function of the paymaster ${paymaster} reverted.`,
|
|
176
|
+
"",
|
|
177
|
+
"Possible solutions:",
|
|
178
|
+
"• If you are using your own paymaster contract, verify that that you have correctly implemented the postOp function (if you are using one). If you do not intent to make use of the postOp function, make sure you do not set the context parameter in the paymaster's validatePaymasterUserOp function.",
|
|
179
|
+
"• If you are using a paymaster service and you see this error, reach out to them.",
|
|
180
|
+
"",
|
|
181
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
182
|
+
].join("\n"), {
|
|
183
|
+
cause
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(this, "name", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
configurable: true,
|
|
188
|
+
writable: true,
|
|
189
|
+
value: "PaymasterPostOpRevertedError"
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
exports.PaymasterPostOpRevertedError = PaymasterPostOpRevertedError;
|
|
194
|
+
Object.defineProperty(PaymasterPostOpRevertedError, "message", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
configurable: true,
|
|
197
|
+
writable: true,
|
|
198
|
+
value: /aa50/
|
|
199
|
+
});
|
|
200
|
+
class InvalidPaymasterAndDataError extends viem_1.BaseError {
|
|
201
|
+
constructor({ cause, docsPath }) {
|
|
202
|
+
super([
|
|
203
|
+
"The paymasterAndData field of the user operation is invalid.",
|
|
204
|
+
"",
|
|
205
|
+
"Possible solutions:",
|
|
206
|
+
"• Make sure you have either not set a value for the paymasterAndData, or that it is at least 20 bytes long.",
|
|
207
|
+
"• If you are using a paymaster service, reach out to them.",
|
|
208
|
+
"",
|
|
209
|
+
docsPath ? `Docs: ${docsPath}` : ""
|
|
210
|
+
].join("\n"), {
|
|
211
|
+
cause
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(this, "name", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
configurable: true,
|
|
216
|
+
writable: true,
|
|
217
|
+
value: "InvalidPaymasterAndDataError"
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.InvalidPaymasterAndDataError = InvalidPaymasterAndDataError;
|
|
222
|
+
Object.defineProperty(InvalidPaymasterAndDataError, "message", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
configurable: true,
|
|
225
|
+
writable: true,
|
|
226
|
+
value: /aa93/
|
|
227
|
+
});
|
|
228
|
+
//# sourceMappingURL=paymaster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymaster.js","sourceRoot":"","sources":["../../errors/paymaster.ts"],"names":[],"mappings":";;;AAAA,+BAA0C;AAC1C,gDAA4E;AAK5E,MAAa,yBAA0B,SAAQ,gBAAS;IAGpD,YAAY,EACR,KAAK,EACL,gBAAgB,EAChB,QAAQ,KAKR,EAAE;QACF,MAAM,SAAS,GAAG,gBAAgB;YAC9B,CAAC,CAAC,IAAA,mDAAwC,EAAC,gBAAgB,CAAC;YAC5D,CAAC,CAAC,IAAI,CAAA;QAEV,KAAK,CACD;YACI,aAAa,SAAS,mBAAmB;YACzC,EAAE;YACF,qBAAqB;YACrB,+IAA+I;YAC/I,gFAAgF;YAChF,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;QA3BI;;;;mBAAO,2BAA2B;WAAA;IA4B3C,CAAC;;AA9BL,8DA+BC;AA9BU;;;;WAAU,MAAM;EAAT,CAAS;AAmC3B,MAAa,2BAA4B,SAAQ,gBAAS;IAGtD,YAAY,EACR,KAAK,EACL,gBAAgB,EAChB,QAAQ,KAKR,EAAE;QACF,MAAM,SAAS,GAAG,gBAAgB;YAC9B,CAAC,CAAC,IAAA,mDAAwC,EAAC,gBAAgB,CAAC;YAC5D,CAAC,CAAC,IAAI,CAAA;QAEV,KAAK,CACD;YACI,aAAa,SAAS,iIAAiI;YACvJ,EAAE;YACF,qBAAqB;Y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AC,CAAC,CAAC,EAAE;SACtC,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACI,KAAK;SACR,CACJ,CAAA;QA3BI;;;;mBAAO,8BAA8B;WAAA;IA4B9C,CAAC;;AA9BL,oEA+BC;AA9BU;;;;WAAU,MAAM;EAAT,CAAS;AAmC3B,MAAa,4BAA6B,SAAQ,gBAAS;IAGvD,YAAY,EACR,KAAK,EACL,QAAQ,EAIX;QACG,KAAK,CACD;YACI,8DAA8D;YAC9D,EAAE;YACF,qBAAqB;YACrB,6GAA6G;YAC7G,4DAA4D;YAC5D,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,8BAA8B;WAAA;IAsB9C,CAAC;;AAxBL,oEAyBC;AAxBU;;;;WAAU,MAAM;EAAT,CAAS"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendUserOperationError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const utils_js_1 = require("./utils.js");
|
|
6
|
+
class SendUserOperationError extends viem_1.BaseError {
|
|
7
|
+
constructor(cause, { userOperation, entryPoint, docsPath }) {
|
|
8
|
+
const prettyArgs = (0, utils_js_1.prettyPrint)({
|
|
9
|
+
sender: userOperation.sender,
|
|
10
|
+
nonce: userOperation.nonce,
|
|
11
|
+
initCode: userOperation.initCode,
|
|
12
|
+
callData: userOperation.callData,
|
|
13
|
+
callGasLimit: userOperation.callGasLimit,
|
|
14
|
+
verificationGasLimit: userOperation.verificationGasLimit,
|
|
15
|
+
preVerificationGas: userOperation.preVerificationGas,
|
|
16
|
+
maxFeePerGas: userOperation.maxFeePerGas,
|
|
17
|
+
maxPriorityFeePerGas: userOperation.maxPriorityFeePerGas,
|
|
18
|
+
paymasterAndData: userOperation.paymasterAndData,
|
|
19
|
+
signature: userOperation.signature,
|
|
20
|
+
entryPoint
|
|
21
|
+
});
|
|
22
|
+
super(cause.shortMessage, {
|
|
23
|
+
cause,
|
|
24
|
+
docsPath,
|
|
25
|
+
metaMessages: [
|
|
26
|
+
...(cause.metaMessages ? [...cause.metaMessages, " "] : []),
|
|
27
|
+
"sendUserOperation Arguments:",
|
|
28
|
+
prettyArgs
|
|
29
|
+
].filter(Boolean)
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "cause", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "name", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: "SendUserOperationError"
|
|
42
|
+
});
|
|
43
|
+
this.cause = cause;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.SendUserOperationError = SendUserOperationError;
|
|
47
|
+
//# sourceMappingURL=sendUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../errors/sendUserOperation.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEhC,yCAAwC;AAKxC,MAAa,sBAAuB,SAAQ,gBAAS;IAKjD,YACI,KAAgB,EAChB,EACI,aAAa,EACb,UAAU,EACV,QAAQ,EAGX;QAED,MAAM,UAAU,GAAG,IAAA,sBAAW,EAAC;YAC3B,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,KAAK,EAAE,aAAa,CAAC,KAAK;YAC1B,QAAQ,EAAE,aAAa,CAAC,QAAQ;YAChC,QAAQ,EAAE,aAAa,CAAC,QAAQ;YAChC,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,oBAAoB,EAAE,aAAa,CAAC,oBAAoB;YACxD,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;YACpD,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,oBAAoB,EAAE,aAAa,CAAC,oBAAoB;YACxD,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;YAChD,SAAS,EAAE,aAAa,CAAC,SAAS;YAClC,UAAU;SACb,CAAC,CAAA;QAEF,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE;YACtB,KAAK;YACL,QAAQ;YACR,YAAY,EAAE;gBACV,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3D,8BAA8B;gBAC9B,UAAU;aACb,CAAC,MAAM,CAAC,OAAO,CAAa;SAChC,CAAC,CAAA;QArCG;;;;;WAAgB;QAEhB;;;;mBAAO,wBAAwB;WAAA;QAoCpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;CACJ;AAzCD,wDAyCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prettyPrint = void 0;
|
|
4
|
+
function prettyPrint(args) {
|
|
5
|
+
const entries = Object.entries(args)
|
|
6
|
+
.map(([key, value]) => {
|
|
7
|
+
if (value === undefined || value === false)
|
|
8
|
+
return null;
|
|
9
|
+
return [key, value];
|
|
10
|
+
})
|
|
11
|
+
.filter(Boolean);
|
|
12
|
+
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
13
|
+
return entries
|
|
14
|
+
.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`)
|
|
15
|
+
.join("\n");
|
|
16
|
+
}
|
|
17
|
+
exports.prettyPrint = prettyPrint;
|
|
18
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../errors/utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CACvB,IAA4E;IAE5E,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAClB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK;YAAE,OAAO,IAAI,CAAA;QACvD,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAuB,CAAA;IAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAC5B,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,EACzC,CAAC,CACJ,CAAA;IACD,OAAO,OAAO;SACT,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;SACvE,IAAI,CAAC,IAAI,CAAC,CAAA;AACnB,CAAC;AAhBD,kCAgBC"}
|
package/_cjs/index.js
CHANGED
|
@@ -33,4 +33,5 @@ Object.defineProperty(exports, "smartAccountActions", { enumerable: true, get: f
|
|
|
33
33
|
const getUserOperationHash_js_1 = require("./utils/getUserOperationHash.js");
|
|
34
34
|
Object.defineProperty(exports, "getUserOperationHash", { enumerable: true, get: function () { return getUserOperationHash_js_1.getUserOperationHash; } });
|
|
35
35
|
tslib_1.__exportStar(require("./utils/index.js"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./errors/index.js"), exports);
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
package/_cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAaA,8EAAuE;AAwDnE,iGAxDK,sCAAgB,OAwDL;AAtDpB,6DAAsD;AAmDlD,wFAnDK,oBAAO,OAmDL;AAlDX,+FAAwF;AAgDpF,yGAhDK,sDAAwB,OAgDL;AA/C5B,2FAAoF;AAkDhF,uGAlDK,kDAAsB,OAkDL;AAjD1B,6FAAsF;AAkDlF,wGAlDK,oDAAuB,OAkDL;AAjD3B,iFAA0E;AA4CtE,kGA5CK,wCAAiB,OA4CL;AA3CrB,uFAAgF;AA6C5E,qGA7CK,8CAAoB,OA6CL;AA5CxB,qGAA8F;AAkD1F,4GAlDK,4DAA2B,OAkDL;AAjD/B,qGAGyD;AAiDrD,wHAlDA,wEAAuC,OAkDA;AA/C3C,4EAAqE;AA2CjE,gGA3CK,oCAAe,OA2CL;AA1CnB,6EAGyC;AAyCrC,oGA1CA,4CAAmB,OA0CA;AAxCvB,uFAAgF;AA2C5E,yGA3CK,sDAAwB,OA2CL;AArC5B,gEAAgE;AAmC5D,+FAnCK,2BAAc,OAmCL;AAlClB,0EAG6C;AAkCzC,oGAnCA,qCAAmB,OAmCA;AAOvB,6EAAsE;AAE7D,qGAFA,8CAAoB,OAEA;AAC7B,2DAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAaA,8EAAuE;AAwDnE,iGAxDK,sCAAgB,OAwDL;AAtDpB,6DAAsD;AAmDlD,wFAnDK,oBAAO,OAmDL;AAlDX,+FAAwF;AAgDpF,yGAhDK,sDAAwB,OAgDL;AA/C5B,2FAAoF;AAkDhF,uGAlDK,kDAAsB,OAkDL;AAjD1B,6FAAsF;AAkDlF,wGAlDK,oDAAuB,OAkDL;AAjD3B,iFAA0E;AA4CtE,kGA5CK,wCAAiB,OA4CL;AA3CrB,uFAAgF;AA6C5E,qGA7CK,8CAAoB,OA6CL;AA5CxB,qGAA8F;AAkD1F,4GAlDK,4DAA2B,OAkDL;AAjD/B,qGAGyD;AAiDrD,wHAlDA,wEAAuC,OAkDA;AA/C3C,4EAAqE;AA2CjE,gGA3CK,oCAAe,OA2CL;AA1CnB,6EAGyC;AAyCrC,oGA1CA,4CAAmB,OA0CA;AAxCvB,uFAAgF;AA2C5E,yGA3CK,sDAAwB,OA2CL;AArC5B,gEAAgE;AAmC5D,+FAnCK,2BAAc,OAmCL;AAlClB,0EAG6C;AAkCzC,oGAnCA,qCAAmB,OAmCA;AAOvB,6EAAsE;AAE7D,qGAFA,8CAAoB,OAEA;AAC7B,2DAAgC;AAChC,4DAAiC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBundlerError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const errors_1 = require("../../errors");
|
|
6
|
+
const account_1 = require("../../errors/account");
|
|
7
|
+
const paymaster_1 = require("../../errors/paymaster");
|
|
8
|
+
function getBundlerError(err, args) {
|
|
9
|
+
const message = (err.details || "").toLowerCase();
|
|
10
|
+
const executionRevertedError = err instanceof viem_1.BaseError
|
|
11
|
+
? err.walk((e) => e.code ===
|
|
12
|
+
viem_1.ExecutionRevertedError.code)
|
|
13
|
+
: err;
|
|
14
|
+
if (executionRevertedError instanceof viem_1.BaseError) {
|
|
15
|
+
return new viem_1.ExecutionRevertedError({
|
|
16
|
+
cause: err,
|
|
17
|
+
message: executionRevertedError.details
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (args.userOperation.sender === undefined)
|
|
21
|
+
return new viem_1.UnknownNodeError({ cause: err });
|
|
22
|
+
if (args.userOperation.nonce === undefined)
|
|
23
|
+
return new viem_1.UnknownNodeError({ cause: err });
|
|
24
|
+
if (errors_1.SenderAlreadyDeployedError.message.test(message)) {
|
|
25
|
+
return new errors_1.SenderAlreadyDeployedError({
|
|
26
|
+
cause: err,
|
|
27
|
+
sender: args.userOperation.sender,
|
|
28
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa10"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (account_1.InitCodeRevertedError.message.test(message)) {
|
|
32
|
+
return new account_1.InitCodeRevertedError({
|
|
33
|
+
cause: err,
|
|
34
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa13"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (account_1.SenderAddressMismatchError.message.test(message)) {
|
|
38
|
+
return new account_1.SenderAddressMismatchError({
|
|
39
|
+
cause: err,
|
|
40
|
+
sender: args.userOperation.sender,
|
|
41
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa14"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (account_1.InitCodeDidNotDeploySenderError.message.test(message)) {
|
|
45
|
+
return new account_1.InitCodeDidNotDeploySenderError({
|
|
46
|
+
cause: err,
|
|
47
|
+
sender: args.userOperation.sender,
|
|
48
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa15"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (account_1.SenderNotDeployedError.message.test(message)) {
|
|
52
|
+
return new account_1.SenderNotDeployedError({
|
|
53
|
+
cause: err,
|
|
54
|
+
sender: args.userOperation.sender,
|
|
55
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa20"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (account_1.SmartAccountInsufficientFundsError.message.test(message)) {
|
|
59
|
+
return new account_1.SmartAccountInsufficientFundsError({
|
|
60
|
+
cause: err,
|
|
61
|
+
sender: args.userOperation.sender,
|
|
62
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa21"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (account_1.SmartAccountSignatureValidityPeriodError.message.test(message)) {
|
|
66
|
+
return new account_1.SmartAccountSignatureValidityPeriodError({
|
|
67
|
+
cause: err,
|
|
68
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa22"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (account_1.SmartAccountValidationRevertedError.message.test(message)) {
|
|
72
|
+
return new account_1.SmartAccountValidationRevertedError({
|
|
73
|
+
cause: err,
|
|
74
|
+
sender: args.userOperation.sender,
|
|
75
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa23"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (account_1.InvalidSmartAccountNonceError.message.test(message)) {
|
|
79
|
+
return new account_1.InvalidSmartAccountNonceError({
|
|
80
|
+
cause: err,
|
|
81
|
+
sender: args.userOperation.sender,
|
|
82
|
+
nonce: args.userOperation.nonce,
|
|
83
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa25"
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (paymaster_1.PaymasterNotDeployedError.message.test(message)) {
|
|
87
|
+
return new paymaster_1.PaymasterNotDeployedError({
|
|
88
|
+
cause: err,
|
|
89
|
+
paymasterAndData: args.userOperation.paymasterAndData,
|
|
90
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa30"
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (paymaster_1.PaymasterDepositTooLowError.message.test(message)) {
|
|
94
|
+
return new paymaster_1.PaymasterDepositTooLowError({
|
|
95
|
+
cause: err,
|
|
96
|
+
paymasterAndData: args.userOperation.paymasterAndData,
|
|
97
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa31"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (paymaster_1.PaymasterValidityPeriodError.message.test(message)) {
|
|
101
|
+
return new paymaster_1.PaymasterValidityPeriodError({
|
|
102
|
+
cause: err,
|
|
103
|
+
paymasterAndData: args.userOperation.paymasterAndData,
|
|
104
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa32"
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (paymaster_1.PaymasterValidationRevertedError.message.test(message)) {
|
|
108
|
+
return new paymaster_1.PaymasterValidationRevertedError({
|
|
109
|
+
cause: err,
|
|
110
|
+
paymasterAndData: args.userOperation.paymasterAndData,
|
|
111
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa33"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (paymaster_1.PaymasterDataRejectedError.message.test(message)) {
|
|
115
|
+
return new paymaster_1.PaymasterDataRejectedError({
|
|
116
|
+
cause: err,
|
|
117
|
+
paymasterAndData: args.userOperation.paymasterAndData,
|
|
118
|
+
docsPath: "https://docs.pimlico.io/bundler/reference/entrypoint-errors/aa34"
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return new viem_1.UnknownNodeError({ cause: err });
|
|
122
|
+
}
|
|
123
|
+
exports.getBundlerError = getBundlerError;
|
|
124
|
+
//# sourceMappingURL=getBundlerError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBundlerError.js","sourceRoot":"","sources":["../../../utils/errors/getBundlerError.ts"],"names":[],"mappings":";;;AAAA,+BAOa;AACb,yCAAyD;AACzD,kDAkB6B;AAC7B,sDAW+B;AA0B/B,SAAgB,eAAe,CAC3B,GAAc,EACd,IAA+B;IAE/B,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;IAEjD,MAAM,sBAAsB,GACxB,GAAG,YAAY,gBAAS;QACpB,CAAC,CAAC,GAAG,CAAC,IAAI,CACJ,CAAC,CAAC,EAAE,EAAE,CACD,CAAsB,CAAC,IAAI;YAC5B,6BAAsB,CAAC,IAAI,CAClC;QACH,CAAC,CAAC,GAAG,CAAA;I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b,CAAC;IAED,OAAO,IAAI,uBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAQ,CAAA;AACtD,CAAC;AA1JD,0CA0JC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEstimateUserOperationGasError = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const estimateUserOperationGas_1 = require("../../errors/estimateUserOperationGas");
|
|
6
|
+
const getBundlerError_1 = require("./getBundlerError");
|
|
7
|
+
function getEstimateUserOperationGasError(error, args) {
|
|
8
|
+
const cause = (() => {
|
|
9
|
+
const cause = (0, getBundlerError_1.getBundlerError)(error, args);
|
|
10
|
+
if (cause instanceof viem_1.UnknownNodeError)
|
|
11
|
+
return error;
|
|
12
|
+
return cause;
|
|
13
|
+
})();
|
|
14
|
+
throw new estimateUserOperationGas_1.EstimateUserOperationGasError(cause, {
|
|
15
|
+
...args
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.getEstimateUserOperationGasError = getEstimateUserOperationGasError;
|
|
19
|
+
//# sourceMappingURL=getEstimateUserOperationGasError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEstimateUserOperationGasError.js","sourceRoot":"","sources":["../../../utils/errors/getEstimateUserOperationGasError.ts"],"names":[],"mappings":";;;AAAA,+BAAkD;AAElD,oFAG8C;AAE9C,uDAI0B;AAO1B,SAAgB,gCAAgC,CAC5C,KAAU,EACV,IAAwC;IAExC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE;QAChB,MAAM,KAAK,GAAG,IAAA,iCAAe,EAEzB,KAAwB,EACxB,IAAiC,CACpC,CAAA;QAED,IAAI,KAAK,YAAY,uBAAgB;YAAE,OAAO,KAAwB,CAAA;QACtE,OAAO,KAAK,CAAA;IAChB,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,IAAI,wDAA6B,CAAC,KAAK,EAAE;QAC3C,GAAG,IAAI;KACV,CAAoD,CAAA;AACzD,CAAC;AAlBD,4EAkBC"}
|