permissionless 0.2.14 → 0.2.16
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 +13 -0
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js +11 -11
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/index.js +16 -16
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/kernel/toEcdsaKernelSmartAccount.js +30 -30
- package/_cjs/accounts/kernel/toEcdsaKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/encodeCallData.js +7 -7
- package/_cjs/accounts/kernel/utils/encodeCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/getNonceKey.js +5 -5
- package/_cjs/accounts/kernel/utils/getNonceKey.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signMessage.js +4 -4
- package/_cjs/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signTypedData.js +4 -4
- package/_cjs/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_cjs/accounts/light/toLightSmartAccount.js +6 -6
- package/_cjs/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_cjs/accounts/nexus/toNexusSmartAccount.js +6 -6
- package/_cjs/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/toSafeSmartAccount.js +9 -8
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/toSimpleSmartAccount.js +6 -6
- package/_cjs/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/thirdweb/toThirdwebSmartAccount.js +14 -14
- package/_cjs/accounts/thirdweb/toThirdwebSmartAccount.js.map +1 -1
- package/_cjs/accounts/trust/toTrustSmartAccount.js +10 -10
- package/_cjs/accounts/trust/toTrustSmartAccount.js.map +1 -1
- package/_cjs/actions/erc7579/accountId.js +2 -2
- package/_cjs/actions/erc7579/accountId.js.map +1 -1
- package/_cjs/actions/erc7579/installModule.js +4 -4
- package/_cjs/actions/erc7579/installModule.js.map +1 -1
- package/_cjs/actions/erc7579/installModules.js +4 -4
- package/_cjs/actions/erc7579/installModules.js.map +1 -1
- package/_cjs/actions/erc7579/isModuleInstalled.js +5 -5
- package/_cjs/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_cjs/actions/erc7579/supportsExecutionMode.js +2 -2
- package/_cjs/actions/erc7579/supportsExecutionMode.js.map +1 -1
- package/_cjs/actions/erc7579/supportsModule.js +2 -2
- package/_cjs/actions/erc7579/supportsModule.js.map +1 -1
- package/_cjs/actions/erc7579/uninstallModule.js +4 -4
- package/_cjs/actions/erc7579/uninstallModule.js.map +1 -1
- package/_cjs/actions/erc7579/uninstallModules.js +4 -4
- package/_cjs/actions/erc7579/uninstallModules.js.map +1 -1
- package/_cjs/actions/erc7579.js +24 -24
- package/_cjs/actions/erc7579.js.map +1 -1
- package/_cjs/actions/index.js +5 -5
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js +3 -3
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js +2 -2
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_cjs/actions/pimlico.js +14 -14
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/actions/public/getSenderAddress.js +30 -137
- package/_cjs/actions/public/getSenderAddress.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +2 -2
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/signMessage.js +2 -2
- package/_cjs/actions/smartAccount/signMessage.js.map +1 -1
- package/_cjs/actions/smartAccount/signTypedData.js +2 -2
- package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
- package/_cjs/actions/smartAccount/writeContract.js +2 -2
- package/_cjs/actions/smartAccount/writeContract.js.map +1 -1
- package/_cjs/actions/smartAccount.js +8 -8
- package/_cjs/actions/smartAccount.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js +3 -3
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +10 -10
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +11 -11
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_cjs/clients/index.js.map +1 -1
- package/_cjs/clients/pimlico.js +2 -2
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/experimental/pimlico/index.js +2 -2
- package/_cjs/experimental/pimlico/index.js.map +1 -1
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +6 -5
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/encode7579Calls.js +3 -3
- package/_cjs/utils/encode7579Calls.js.map +1 -1
- package/_cjs/utils/encodeInstallModule.js +4 -4
- package/_cjs/utils/encodeInstallModule.js.map +1 -1
- package/_cjs/utils/encodeUninstallModule.js +4 -4
- package/_cjs/utils/encodeUninstallModule.js.map +1 -1
- package/_cjs/utils/index.js +25 -25
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/toOwner.js.map +1 -1
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/toEcdsaKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/encodeCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/getNonceKey.js.map +1 -1
- package/_esm/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_esm/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_esm/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js +2 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/thirdweb/toThirdwebSmartAccount.js.map +1 -1
- package/_esm/accounts/trust/toTrustSmartAccount.js.map +1 -1
- package/_esm/actions/erc7579/accountId.js.map +1 -1
- package/_esm/actions/erc7579/installModule.js +1 -1
- package/_esm/actions/erc7579/installModule.js.map +1 -1
- package/_esm/actions/erc7579/installModules.js.map +1 -1
- package/_esm/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_esm/actions/erc7579/supportsExecutionMode.js.map +1 -1
- package/_esm/actions/erc7579/supportsModule.js.map +1 -1
- package/_esm/actions/erc7579/uninstallModule.js.map +1 -1
- package/_esm/actions/erc7579/uninstallModules.js.map +1 -1
- package/_esm/actions/erc7579.js.map +1 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/actions/public/getSenderAddress.js +33 -142
- package/_esm/actions/public/getSenderAddress.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/signMessage.js.map +1 -1
- package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/_esm/actions/smartAccount/writeContract.js.map +1 -1
- package/_esm/actions/smartAccount.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +2 -2
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/decorators/smartAccount.js +3 -3
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/clients/index.js.map +1 -1
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/experimental/pimlico/index.js.map +1 -1
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +2 -1
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/utils/encode7579Calls.js.map +1 -1
- package/_esm/utils/encodeInstallModule.js.map +1 -1
- package/_esm/utils/encodeUninstallModule.js.map +1 -1
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/toOwner.js.map +1 -1
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts +3 -2
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/index.d.ts +8 -8
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/toEcdsaKernelSmartAccount.d.ts +3 -2
- package/_types/accounts/kernel/toEcdsaKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/encodeCallData.d.ts +1 -1
- package/_types/accounts/kernel/utils/encodeCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/getNonceKey.d.ts +1 -1
- package/_types/accounts/kernel/utils/getNonceKey.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/isKernelV2.d.ts +1 -1
- package/_types/accounts/kernel/utils/isKernelV2.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signMessage.d.ts +1 -1
- package/_types/accounts/kernel/utils/signMessage.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts +1 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +1 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +1 -1
- package/_types/accounts/light/toLightSmartAccount.d.ts +3 -2
- package/_types/accounts/light/toLightSmartAccount.d.ts.map +1 -1
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts +3 -2
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/toSafeSmartAccount.d.ts +3 -2
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts +3 -2
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/thirdweb/toThirdwebSmartAccount.d.ts +3 -2
- package/_types/accounts/thirdweb/toThirdwebSmartAccount.d.ts.map +1 -1
- package/_types/accounts/trust/toTrustSmartAccount.d.ts +3 -2
- package/_types/accounts/trust/toTrustSmartAccount.d.ts.map +1 -1
- package/_types/actions/erc7579/installModule.d.ts +1 -1
- package/_types/actions/erc7579/installModule.d.ts.map +1 -1
- package/_types/actions/erc7579/installModules.d.ts +1 -1
- package/_types/actions/erc7579/installModules.d.ts.map +1 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts +1 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts.map +1 -1
- package/_types/actions/erc7579/uninstallModule.d.ts +1 -1
- package/_types/actions/erc7579/uninstallModule.d.ts.map +1 -1
- package/_types/actions/erc7579/uninstallModules.d.ts +1 -1
- package/_types/actions/erc7579/uninstallModules.d.ts.map +1 -1
- package/_types/actions/erc7579.d.ts +10 -10
- package/_types/actions/erc7579.d.ts.map +1 -1
- package/_types/actions/index.d.ts +4 -4
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/pimlico/getTokenQuotes.d.ts +1 -1
- package/_types/actions/pimlico/getTokenQuotes.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -1
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts +1 -1
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
- package/_types/actions/pimlico.d.ts +8 -8
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
- package/_types/actions/smartAccount.d.ts +4 -4
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +1 -1
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +4 -4
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/decorators/smartAccount.d.ts +5 -51
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/clients/index.d.ts +2 -2
- package/_types/clients/index.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +2 -2
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/experimental/pimlico/index.d.ts +1 -1
- package/_types/experimental/pimlico/index.d.ts.map +1 -1
- package/_types/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.d.ts.map +1 -1
- package/_types/index.d.ts +3 -3
- package/_types/index.d.ts.map +1 -1
- package/_types/utils/encode7579Calls.d.ts +1 -1
- package/_types/utils/encode7579Calls.d.ts.map +1 -1
- package/_types/utils/encodeInstallModule.d.ts +1 -1
- package/_types/utils/encodeInstallModule.d.ts.map +1 -1
- package/_types/utils/encodeUninstallModule.d.ts +1 -1
- package/_types/utils/encodeUninstallModule.d.ts.map +1 -1
- package/_types/utils/index.d.ts +12 -12
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/toOwner.d.ts +6 -3
- package/_types/utils/toOwner.d.ts.map +1 -1
- package/accounts/biconomy/toBiconomySmartAccount.ts +4 -5
- package/accounts/index.ts +8 -8
- package/accounts/kernel/toEcdsaKernelSmartAccount.ts +16 -14
- package/accounts/kernel/utils/encodeCallData.ts +4 -4
- package/accounts/kernel/utils/getNonceKey.ts +3 -3
- package/accounts/kernel/utils/isKernelV2.ts +1 -1
- package/accounts/kernel/utils/signMessage.ts +5 -2
- package/accounts/kernel/utils/signTypedData.ts +5 -2
- package/accounts/kernel/utils/wrapMessageHash.ts +1 -1
- package/accounts/light/toLightSmartAccount.ts +4 -5
- package/accounts/nexus/toNexusSmartAccount.ts +4 -5
- package/accounts/safe/toSafeSmartAccount.ts +5 -5
- package/accounts/simple/toSimpleSmartAccount.ts +4 -5
- package/accounts/thirdweb/toThirdwebSmartAccount.ts +8 -9
- package/accounts/trust/toTrustSmartAccount.ts +6 -7
- package/actions/erc7579/accountId.ts +1 -1
- package/actions/erc7579/installModule.ts +3 -3
- package/actions/erc7579/installModules.ts +2 -2
- package/actions/erc7579/isModuleInstalled.ts +2 -2
- package/actions/erc7579/supportsExecutionMode.ts +1 -1
- package/actions/erc7579/supportsModule.ts +1 -1
- package/actions/erc7579/uninstallModule.ts +3 -3
- package/actions/erc7579/uninstallModules.ts +2 -2
- package/actions/erc7579.ts +13 -10
- package/actions/index.ts +4 -4
- package/actions/pimlico/getTokenQuotes.ts +1 -1
- package/actions/pimlico/getUserOperationGasPrice.ts +1 -1
- package/actions/pimlico/getUserOperationStatus.ts +1 -1
- package/actions/pimlico/sendCompressedUserOperation.ts +1 -1
- package/actions/pimlico/sponsorUserOperation.ts +2 -2
- package/actions/pimlico/validateSponsorshipPolicies.ts +2 -2
- package/actions/pimlico.ts +8 -8
- package/actions/public/getSenderAddress.test.ts +1 -1
- package/actions/public/getSenderAddress.ts +42 -186
- package/actions/smartAccount/sendTransaction.ts +1 -1
- package/actions/smartAccount/signMessage.ts +1 -1
- package/actions/smartAccount/signTypedData.ts +1 -1
- package/actions/smartAccount/writeContract.ts +1 -1
- package/actions/smartAccount.ts +4 -4
- package/clients/createSmartAccountClient.ts +3 -3
- package/clients/decorators/pimlico.ts +4 -4
- package/clients/decorators/smartAccount.ts +12 -14
- package/clients/index.ts +2 -2
- package/clients/pimlico.ts +2 -2
- package/experimental/pimlico/index.ts +1 -1
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +3 -2
- package/index.ts +3 -3
- package/package.json +1 -1
- package/utils/encode7579Calls.ts +1 -1
- package/utils/encodeInstallModule.ts +2 -2
- package/utils/encodeUninstallModule.ts +2 -2
- package/utils/index.ts +15 -12
- package/utils/toOwner.ts +7 -12
|
@@ -4,12 +4,12 @@ exports.isModuleInstalled = isModuleInstalled;
|
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const actions_1 = require("viem/actions");
|
|
6
6
|
const utils_1 = require("viem/utils");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const index_js_1 = require("../../errors/index.js");
|
|
8
|
+
const supportsModule_js_1 = require("./supportsModule.js");
|
|
9
9
|
async function isModuleInstalled(client, parameters) {
|
|
10
10
|
const { account: account_ = client.account, address, context, additionalContext } = parameters;
|
|
11
11
|
if (!account_) {
|
|
12
|
-
throw new
|
|
12
|
+
throw new index_js_1.AccountNotFoundError({
|
|
13
13
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -41,7 +41,7 @@ async function isModuleInstalled(client, parameters) {
|
|
|
41
41
|
abi,
|
|
42
42
|
functionName: "isModuleInstalled",
|
|
43
43
|
args: [
|
|
44
|
-
(0,
|
|
44
|
+
(0, supportsModule_js_1.parseModuleTypeId)(parameters.type),
|
|
45
45
|
(0, viem_1.getAddress)(address),
|
|
46
46
|
context ?? additionalContext
|
|
47
47
|
],
|
|
@@ -59,7 +59,7 @@ async function isModuleInstalled(client, parameters) {
|
|
|
59
59
|
abi,
|
|
60
60
|
functionName: "isModuleInstalled",
|
|
61
61
|
args: [
|
|
62
|
-
(0,
|
|
62
|
+
(0, supportsModule_js_1.parseModuleTypeId)(parameters.type),
|
|
63
63
|
(0, viem_1.getAddress)(address),
|
|
64
64
|
context ?? additionalContext
|
|
65
65
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isModuleInstalled.js","sourceRoot":"","sources":["../../../actions/erc7579/isModuleInstalled.ts"],"names":[],"mappings":";;AAmCA,8CAgGC;AAnID,+BAWa;AAKb,0CAAiD;AACjD,sCAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"isModuleInstalled.js","sourceRoot":"","sources":["../../../actions/erc7579/isModuleInstalled.ts"],"names":[],"mappings":";;AAmCA,8CAgGC;AAnID,+BAWa;AAKb,0CAAiD;AACjD,sCAAoD;AACpD,oDAA4D;AAC5D,2DAAwE;AAgBjE,KAAK,UAAU,iBAAiB,CAGnC,MAA2D,EAC3D,UAAsD;IAEtD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,OAAO,EACP,OAAO,EACP,iBAAiB,EACpB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAA;IAEnC,MAAM,GAAG,GAAG;QACR;YACI,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE;gBACJ;oBACI,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,SAAS;iBAC1B;gBACD,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;gBAC5D;oBACI,IAAI,EAAE,mBAAmB;oBACzB,IAAI,EAAE,OAAO;oBACb,YAAY,EAAE,OAAO;iBACxB;aACJ;YACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;YAC3D,eAAe,EAAE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AM,KAAK,CAAA;IACf,CAAC;AACL,CAAC"}
|
|
@@ -6,7 +6,7 @@ const viem_1 = require("viem");
|
|
|
6
6
|
const actions_1 = require("viem/actions");
|
|
7
7
|
const utils_1 = require("viem/utils");
|
|
8
8
|
const utils_2 = require("viem/utils");
|
|
9
|
-
const
|
|
9
|
+
const index_js_1 = require("../../errors/index.js");
|
|
10
10
|
function parseCallType(callType) {
|
|
11
11
|
switch (callType) {
|
|
12
12
|
case "call":
|
|
@@ -29,7 +29,7 @@ function encodeExecutionMode({ type, revertOnError, selector, context }) {
|
|
|
29
29
|
async function supportsExecutionMode(client, args) {
|
|
30
30
|
const { account: account_ = client.account, type, revertOnError, selector, context } = args;
|
|
31
31
|
if (!account_) {
|
|
32
|
-
throw new
|
|
32
|
+
throw new index_js_1.AccountNotFoundError({
|
|
33
33
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportsExecutionMode.js","sourceRoot":"","sources":["../../../actions/erc7579/supportsExecutionMode.ts"],"names":[],"mappings":";;AA8CA,kDAgBC;AAED,sDA8FC;AA9JD,+BAWa;AAKb,0CAAiD;AACjD,sCAAsC;AACtC,sCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"supportsExecutionMode.js","sourceRoot":"","sources":["../../../actions/erc7579/supportsExecutionMode.ts"],"names":[],"mappings":";;AA8CA,kDAgBC;AAED,sDA8FC;AA9JD,+BAWa;AAKb,0CAAiD;AACjD,sCAAsC;AACtC,sCAAyC;AACzC,oDAA4D;AAgB5D,SAAS,aAAa,CAAC,QAAkB;IACrC,QAAQ,QAAQ,EAAE,CAAC;QACf,KAAK,MAAM;YACP,OAAO,MAAM,CAAA;QACjB,KAAK,WAAW;YACZ,OAAO,MAAM,CAAA;QACjB,KAAK,cAAc;YACf,OAAO,MAAM,CAAA;IACrB,CAAC;AACL,CAAC;AAED,SAAgB,mBAAmB,CAA4B,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EAAE,uBAAuB;gBACrC,IAAI,EAAE,MAAM,CAAC,IAAI;aACpB,CAAC,CAAA;QACN,CAAC;QAED,MAAM,KAAK,CAAA;IACf,CAAC;AACL,CAAC"}
|
|
@@ -6,7 +6,7 @@ const viem_1 = require("viem");
|
|
|
6
6
|
const actions_1 = require("viem/actions");
|
|
7
7
|
const utils_1 = require("viem/utils");
|
|
8
8
|
const utils_2 = require("viem/utils");
|
|
9
|
-
const
|
|
9
|
+
const index_js_1 = require("../../errors/index.js");
|
|
10
10
|
function parseModuleTypeId(type) {
|
|
11
11
|
switch (type) {
|
|
12
12
|
case "validator":
|
|
@@ -24,7 +24,7 @@ function parseModuleTypeId(type) {
|
|
|
24
24
|
async function supportsModule(client, args) {
|
|
25
25
|
const { account: account_ = client.account } = args;
|
|
26
26
|
if (!account_) {
|
|
27
|
-
throw new
|
|
27
|
+
throw new index_js_1.AccountNotFoundError({
|
|
28
28
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
29
29
|
});
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportsModule.js","sourceRoot":"","sources":["../../../actions/erc7579/supportsModule.ts"],"names":[],"mappings":";;AAyBA,8CAaC;AAED,wCAgFC;AAxHD,+BAOa;AAKb,0CAAiD;AACjD,sCAAsC;AACtC,sCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"supportsModule.js","sourceRoot":"","sources":["../../../actions/erc7579/supportsModule.ts"],"names":[],"mappings":";;AAyBA,8CAaC;AAED,wCAgFC;AAxHD,+BAOa;AAKb,0CAAiD;AACjD,sCAAsC;AACtC,sCAAyC;AACzC,oDAA4D;AAU5D,SAAgB,iBAAiB,CAAC,IAAgB;IAC9C,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,WAAW;YACZ,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;QACpB,KAAK,UAAU;YACX,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;QACpB,KAAK,UAAU;Y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,cAAc,EAAE,CAAA;YAE/D,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAS,EAC1B,YAAY,EACZ,cAAI,EACJ,MAAM,CACT,CAAC;gBACE,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,WAAW;gBACxB,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,IAAA,yBAAkB,EAAC;oBACrB,GAAG;oBACH,YAAY,EAAE,gBAAgB;oBAC9B,IAAI,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACvC,CAAC;aACL,CAAC,CAAA;YAEF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;YAChD,CAAC;YAED,OAAO,IAAA,2BAAoB,EAAC;gBACxB,GAAG;gBACH,YAAY,EAAE,gBAAgB;gBAC9B,IAAI,EAAE,MAAM,CAAC,IAAI;aACpB,CAAC,CAAA;QACN,CAAC;QAED,MAAM,KAAK,CAAA;IACf,CAAC;AACL,CAAC"}
|
|
@@ -4,19 +4,19 @@ exports.uninstallModule = uninstallModule;
|
|
|
4
4
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
5
|
const utils_1 = require("viem/utils");
|
|
6
6
|
const utils_2 = require("viem/utils");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const index_js_1 = require("../../errors/index.js");
|
|
8
|
+
const encodeUninstallModule_js_1 = require("../../utils/encodeUninstallModule.js");
|
|
9
9
|
async function uninstallModule(client, parameters) {
|
|
10
10
|
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, address, context, deInitData, type, calls, paymaster, paymasterContext } = parameters;
|
|
11
11
|
if (!account_) {
|
|
12
|
-
throw new
|
|
12
|
+
throw new index_js_1.AccountNotFoundError({
|
|
13
13
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
const account = (0, utils_2.parseAccount)(account_);
|
|
17
17
|
return (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
18
18
|
calls: [
|
|
19
|
-
...(0,
|
|
19
|
+
...(0, encodeUninstallModule_js_1.encodeUninstallModule)({
|
|
20
20
|
account,
|
|
21
21
|
modules: [{ type, address, context: context ?? deInitData }]
|
|
22
22
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstallModule.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModule.ts"],"names":[],"mappings":";;AAyDA,0CA+CC;AA/FD,kEAMiC;AACjC,sCAAsC;AACtC,sCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"uninstallModule.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModule.ts"],"names":[],"mappings":";;AAyDA,0CA+CC;AA/FD,kEAMiC;AACjC,sCAAsC;AACtC,sCAAyC;AACzC,oDAA4D;AAC5D,mFAA4E;AAsCrE,KAAK,UAAU,eAAe,CAGjC,MAA2D,EAC3D,UAAoD;IAEpD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,IAAI,EACJ,KAAK,EACL,SAAS,EACT,gBAAgB,EACnB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,IAAA,iBAAS,EACZ,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,KAAK,EAAE;YACH,GAAG,IAAA,gDAAqB,EAAC;gBACrB,OAAO;gBACP,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,CAAC;aAC/D,CAAC;YACF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACnB;QACD,SAAS;QACT,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO,EAAE,OAAO;KACnB,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -4,19 +4,19 @@ exports.uninstallModules = uninstallModules;
|
|
|
4
4
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
5
|
const utils_1 = require("viem/utils");
|
|
6
6
|
const utils_2 = require("viem/utils");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const index_js_1 = require("../../errors/index.js");
|
|
8
|
+
const encodeUninstallModule_js_1 = require("../../utils/encodeUninstallModule.js");
|
|
9
9
|
async function uninstallModules(client, parameters) {
|
|
10
10
|
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules, calls, paymaster, paymasterContext } = parameters;
|
|
11
11
|
if (!account_) {
|
|
12
|
-
throw new
|
|
12
|
+
throw new index_js_1.AccountNotFoundError({
|
|
13
13
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
const account = (0, utils_2.parseAccount)(account_);
|
|
17
17
|
return (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
18
18
|
calls: [
|
|
19
|
-
...(0,
|
|
19
|
+
...(0, encodeUninstallModule_js_1.encodeUninstallModule)({
|
|
20
20
|
account,
|
|
21
21
|
modules
|
|
22
22
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstallModules.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModules.ts"],"names":[],"mappings":";;AAyCA,4CA4CC;AApFD,kEAKiC;AACjC,sCAAsC;AACtC,sCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"uninstallModules.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModules.ts"],"names":[],"mappings":";;AAyCA,4CA4CC;AApFD,kEAKiC;AACjC,sCAAsC;AACtC,sCAAyC;AACzC,oDAA4D;AAC5D,mFAG6C;AA4BtC,KAAK,UAAU,gBAAgB,CAGlC,MAA2D,EAC3D,UAAqD;IAErD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,EACnB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,IAAA,iBAAS,EACZ,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,KAAK,EAAE;YACH,GAAG,IAAA,gDAAqB,EAAC;gBACrB,OAAO;gBACP,OAAO;aACV,CAAC;YACF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACnB;QACD,SAAS;QACT,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO;KACV,CAAC,CAAA;AACN,CAAC"}
|
package/_cjs/actions/erc7579.js
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uninstallModules = exports.uninstallModule = exports.supportsModule = exports.supportsExecutionMode = exports.isModuleInstalled = exports.installModules = exports.installModule = exports.accountId = void 0;
|
|
4
4
|
exports.erc7579Actions = erc7579Actions;
|
|
5
|
-
const
|
|
6
|
-
Object.defineProperty(exports, "accountId", { enumerable: true, get: function () { return
|
|
7
|
-
const
|
|
8
|
-
Object.defineProperty(exports, "installModule", { enumerable: true, get: function () { return
|
|
9
|
-
const
|
|
10
|
-
Object.defineProperty(exports, "installModules", { enumerable: true, get: function () { return
|
|
11
|
-
const
|
|
12
|
-
Object.defineProperty(exports, "isModuleInstalled", { enumerable: true, get: function () { return
|
|
13
|
-
const
|
|
14
|
-
Object.defineProperty(exports, "supportsExecutionMode", { enumerable: true, get: function () { return
|
|
15
|
-
const
|
|
16
|
-
Object.defineProperty(exports, "supportsModule", { enumerable: true, get: function () { return
|
|
17
|
-
const
|
|
18
|
-
Object.defineProperty(exports, "uninstallModule", { enumerable: true, get: function () { return
|
|
19
|
-
const
|
|
20
|
-
Object.defineProperty(exports, "uninstallModules", { enumerable: true, get: function () { return
|
|
5
|
+
const accountId_js_1 = require("./erc7579/accountId.js");
|
|
6
|
+
Object.defineProperty(exports, "accountId", { enumerable: true, get: function () { return accountId_js_1.accountId; } });
|
|
7
|
+
const installModule_js_1 = require("./erc7579/installModule.js");
|
|
8
|
+
Object.defineProperty(exports, "installModule", { enumerable: true, get: function () { return installModule_js_1.installModule; } });
|
|
9
|
+
const installModules_js_1 = require("./erc7579/installModules.js");
|
|
10
|
+
Object.defineProperty(exports, "installModules", { enumerable: true, get: function () { return installModules_js_1.installModules; } });
|
|
11
|
+
const isModuleInstalled_js_1 = require("./erc7579/isModuleInstalled.js");
|
|
12
|
+
Object.defineProperty(exports, "isModuleInstalled", { enumerable: true, get: function () { return isModuleInstalled_js_1.isModuleInstalled; } });
|
|
13
|
+
const supportsExecutionMode_js_1 = require("./erc7579/supportsExecutionMode.js");
|
|
14
|
+
Object.defineProperty(exports, "supportsExecutionMode", { enumerable: true, get: function () { return supportsExecutionMode_js_1.supportsExecutionMode; } });
|
|
15
|
+
const supportsModule_js_1 = require("./erc7579/supportsModule.js");
|
|
16
|
+
Object.defineProperty(exports, "supportsModule", { enumerable: true, get: function () { return supportsModule_js_1.supportsModule; } });
|
|
17
|
+
const uninstallModule_js_1 = require("./erc7579/uninstallModule.js");
|
|
18
|
+
Object.defineProperty(exports, "uninstallModule", { enumerable: true, get: function () { return uninstallModule_js_1.uninstallModule; } });
|
|
19
|
+
const uninstallModules_js_1 = require("./erc7579/uninstallModules.js");
|
|
20
|
+
Object.defineProperty(exports, "uninstallModules", { enumerable: true, get: function () { return uninstallModules_js_1.uninstallModules; } });
|
|
21
21
|
function erc7579Actions() {
|
|
22
22
|
return (client) => ({
|
|
23
|
-
accountId: (args) => (0,
|
|
24
|
-
installModule: (args) => (0,
|
|
25
|
-
installModules: (args) => (0,
|
|
26
|
-
isModuleInstalled: (args) => (0,
|
|
27
|
-
supportsExecutionMode: (args) => (0,
|
|
28
|
-
supportsModule: (args) => (0,
|
|
29
|
-
uninstallModule: (args) => (0,
|
|
30
|
-
uninstallModules: (args) => (0,
|
|
23
|
+
accountId: (args) => (0, accountId_js_1.accountId)(client, args),
|
|
24
|
+
installModule: (args) => (0, installModule_js_1.installModule)(client, args),
|
|
25
|
+
installModules: (args) => (0, installModules_js_1.installModules)(client, args),
|
|
26
|
+
isModuleInstalled: (args) => (0, isModuleInstalled_js_1.isModuleInstalled)(client, args),
|
|
27
|
+
supportsExecutionMode: (args) => (0, supportsExecutionMode_js_1.supportsExecutionMode)(client, args),
|
|
28
|
+
supportsModule: (args) => (0, supportsModule_js_1.supportsModule)(client, args),
|
|
29
|
+
uninstallModule: (args) => (0, uninstallModule_js_1.uninstallModule)(client, args),
|
|
30
|
+
uninstallModules: (args) => (0, uninstallModules_js_1.uninstallModules)(client, args)
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=erc7579.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erc7579.js","sourceRoot":"","sources":["../../actions/erc7579.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"erc7579.js","sourceRoot":"","sources":["../../actions/erc7579.ts"],"names":[],"mappings":";;;AAyFA,wCAaC;AAjGD,yDAAkD;AA0E9C,0FA1EK,wBAAS,OA0EL;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|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvalidEntryPointError = exports.getAccountNonce = exports.getSenderAddress = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "InvalidEntryPointError", { enumerable: true, get: function () { return
|
|
6
|
-
Object.defineProperty(exports, "getSenderAddress", { enumerable: true, get: function () { return
|
|
7
|
-
const
|
|
8
|
-
Object.defineProperty(exports, "getAccountNonce", { enumerable: true, get: function () { return
|
|
4
|
+
const getSenderAddress_js_1 = require("./public/getSenderAddress.js");
|
|
5
|
+
Object.defineProperty(exports, "InvalidEntryPointError", { enumerable: true, get: function () { return getSenderAddress_js_1.InvalidEntryPointError; } });
|
|
6
|
+
Object.defineProperty(exports, "getSenderAddress", { enumerable: true, get: function () { return getSenderAddress_js_1.getSenderAddress; } });
|
|
7
|
+
const getAccountNonce_js_1 = require("./public/getAccountNonce.js");
|
|
8
|
+
Object.defineProperty(exports, "getAccountNonce", { enumerable: true, get: function () { return getAccountNonce_js_1.getAccountNonce; } });
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AACA,sEAGqC;AAOO,uGATxC,4CAAsB,OASwC;AAAzD,iGARL,sCAAgB,OAQK;AAJzB,oEAA6D;AAIlC,gGAJlB,oCAAe,OAIkB"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sponsorUserOperation = void 0;
|
|
4
|
-
const
|
|
4
|
+
const deepHexlify_js_1 = require("../../utils/deepHexlify.js");
|
|
5
5
|
const sponsorUserOperation = async (client, args) => {
|
|
6
6
|
const response = await client.request({
|
|
7
7
|
method: "pm_sponsorUserOperation",
|
|
8
8
|
params: args.sponsorshipPolicyId
|
|
9
9
|
? [
|
|
10
|
-
(0,
|
|
10
|
+
(0, deepHexlify_js_1.deepHexlify)(args.userOperation),
|
|
11
11
|
args.entryPoint.address,
|
|
12
12
|
{
|
|
13
13
|
sponsorshipPolicyId: args.sponsorshipPolicyId
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
|
-
: [(0,
|
|
16
|
+
: [(0, deepHexlify_js_1.deepHexlify)(args.userOperation), args.entryPoint.address]
|
|
17
17
|
});
|
|
18
18
|
if (args.entryPoint.version === "0.6") {
|
|
19
19
|
const responseV06 = response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAYA
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAYA,+DAAwD;AA2DjD,MAAM,oBAAoB,GAAG,KAAK,EAGrC,MAKC,EACD,IAA8D,EACJ,EAAE;IAC5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB;YAC5B,CAAC,CAAC;gBACI,IAAA,4BAAW,EAAC,IAAI,CAAC,aAAa,CAAC;gBAC/B,IAAI,CAAC,UAAU,CAAC,OAAO;gBACvB;oBACI,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;iBAChD;aACJ;YACH,CAAC,CAAC,CAAC,IAAA,4BAAW,EAAC,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;KACnE,CAAC,CAAA;IAEF,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QACpC,MAAM,WAAW,GAAG,QASnB,CAAA;QACD,OAAO;YACH,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;YAC9C,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAC1D,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;YAC9D,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACI,CAAA;IAC1D,CAAC;IAED,MAAM,WAAW,GAAG,QASnB,CAAA;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;KACU,CAAA;AAC1D,CAAC,CAAA;AAjEY,QAAA,oBAAoB,wBAiEhC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateSponsorshipPolicies = void 0;
|
|
4
|
-
const
|
|
4
|
+
const deepHexlify_js_1 = require("../../utils/deepHexlify.js");
|
|
5
5
|
const validateSponsorshipPolicies = async (client, args) => {
|
|
6
6
|
return await client.request({
|
|
7
7
|
method: "pm_validateSponsorshipPolicies",
|
|
8
8
|
params: [
|
|
9
|
-
(0,
|
|
9
|
+
(0, deepHexlify_js_1.deepHexlify)(args.userOperation),
|
|
10
10
|
args.entryPointAddress,
|
|
11
11
|
args.sponsorshipPolicyIds
|
|
12
12
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":";;;AAGA
|
|
1
|
+
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":";;;AAGA,+DAAwD;AAqDjD,MAAM,2BAA2B,GAAG,KAAK,EAC5C,MAKC,EACD,IAA2C,EACL,EAAE;IACxC,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE;YACJ,IAAA,4BAAW,EAAC,IAAI,CAAC,aAAa,CAAC;YAC/B,IAAI,CAAC,iBAAiB;YACtB,IAAI,CAAC,oBAAoB;SAC5B;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAjBY,QAAA,2BAA2B,+BAiBvC"}
|
package/_cjs/actions/pimlico.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTokenQuotes = exports.validateSponsorshipPolicies = exports.sponsorUserOperation = exports.sendCompressedUserOperation = exports.pimlicoActions = exports.getUserOperationStatus = exports.getUserOperationGasPrice = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "getTokenQuotes", { enumerable: true, get: function () { return
|
|
6
|
-
const
|
|
7
|
-
Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return
|
|
8
|
-
const
|
|
9
|
-
Object.defineProperty(exports, "getUserOperationStatus", { enumerable: true, get: function () { return
|
|
10
|
-
const
|
|
11
|
-
Object.defineProperty(exports, "sendCompressedUserOperation", { enumerable: true, get: function () { return
|
|
12
|
-
const
|
|
13
|
-
Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get: function () { return
|
|
14
|
-
const
|
|
15
|
-
Object.defineProperty(exports, "pimlicoActions", { enumerable: true, get: function () { return
|
|
16
|
-
const
|
|
17
|
-
Object.defineProperty(exports, "validateSponsorshipPolicies", { enumerable: true, get: function () { return
|
|
4
|
+
const getTokenQuotes_js_1 = require("./pimlico/getTokenQuotes.js");
|
|
5
|
+
Object.defineProperty(exports, "getTokenQuotes", { enumerable: true, get: function () { return getTokenQuotes_js_1.getTokenQuotes; } });
|
|
6
|
+
const getUserOperationGasPrice_js_1 = require("./pimlico/getUserOperationGasPrice.js");
|
|
7
|
+
Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return getUserOperationGasPrice_js_1.getUserOperationGasPrice; } });
|
|
8
|
+
const getUserOperationStatus_js_1 = require("./pimlico/getUserOperationStatus.js");
|
|
9
|
+
Object.defineProperty(exports, "getUserOperationStatus", { enumerable: true, get: function () { return getUserOperationStatus_js_1.getUserOperationStatus; } });
|
|
10
|
+
const sendCompressedUserOperation_js_1 = require("./pimlico/sendCompressedUserOperation.js");
|
|
11
|
+
Object.defineProperty(exports, "sendCompressedUserOperation", { enumerable: true, get: function () { return sendCompressedUserOperation_js_1.sendCompressedUserOperation; } });
|
|
12
|
+
const sponsorUserOperation_js_1 = require("./pimlico/sponsorUserOperation.js");
|
|
13
|
+
Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get: function () { return sponsorUserOperation_js_1.sponsorUserOperation; } });
|
|
14
|
+
const pimlico_js_1 = require("../clients/decorators/pimlico.js");
|
|
15
|
+
Object.defineProperty(exports, "pimlicoActions", { enumerable: true, get: function () { return pimlico_js_1.pimlicoActions; } });
|
|
16
|
+
const validateSponsorshipPolicies_js_1 = require("./pimlico/validateSponsorshipPolicies.js");
|
|
17
|
+
Object.defineProperty(exports, "validateSponsorshipPolicies", { enumerable: true, get: function () { return validateSponsorshipPolicies_js_1.validateSponsorshipPolicies; } });
|
|
18
18
|
//# sourceMappingURL=pimlico.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,mEAIoC;AAkDhC,+FAnDA,kCAAc,OAmDA;AAjDlB,uFAG8C;AAwC1C,yGAzCA,sDAAwB,OAyCA;AAvC5B,mFAI4C;AAoCxC,uGArCA,kDAAsB,OAqCA;AAnC1B,6FAGiD;AAkC7C,4GAnCA,4DAA2B,OAmCA;AAjC/B,+EAI0C;AA8BtC,qGA/BA,8CAAoB,OA+BA;AA3BxB,iEAAiE;AAyB7D,+FAzBK,2BAAc,OAyBL;AAvBlB,6FAIiD;AAsB7C,4GAvBA,4DAA2B,OAuBA"}
|
|
@@ -4,6 +4,25 @@ exports.getSenderAddress = exports.InvalidEntryPointError = void 0;
|
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const actions_1 = require("viem/actions");
|
|
6
6
|
const utils_1 = require("viem/utils");
|
|
7
|
+
const GetSenderAddressHelperByteCode = "0x608060405260405161058a38038061058a83398181016040528101906100259190610341565b5f808373ffffffffffffffffffffffffffffffffffffffff16639b249f6960e01b8460405160240161005791906103ed565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516100c19190610447565b5f604051808303815f865af19150503d805f81146100fa576040519150601f19603f3d011682016040523d82523d5f602084013e6100ff565b606091505b50915091505f8261015f576004825111156101245760248201519050805f526014600cf35b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610156906104dd565b60405180910390fd5b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101919061056b565b60405180910390fd5b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101d4826101ab565b9050919050565b6101e4816101ca565b81146101ee575f80fd5b50565b5f815190506101ff816101db565b92915050565b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6102538261020d565b810181811067ffffffffffffffff821117156102725761027161021d565b5b80604052505050565b5f61028461019a565b9050610290828261024a565b919050565b5f67ffffffffffffffff8211156102af576102ae61021d565b5b6102b88261020d565b9050602081019050919050565b8281835e5f83830152505050565b5f6102e56102e084610295565b61027b565b90508281526020810184848401111561030157610300610209565b5b61030c8482856102c5565b509392505050565b5f82601f83011261032857610327610205565b5b81516103388482602086016102d3565b91505092915050565b5f8060408385031215610357576103566101a3565b5b5f610364858286016101f1565b925050602083015167ffffffffffffffff811115610385576103846101a7565b5b61039185828601610314565b9150509250929050565b5f81519050919050565b5f82825260208201905092915050565b5f6103bf8261039b565b6103c981856103a5565b93506103d98185602086016102c5565b6103e28161020d565b840191505092915050565b5f6020820190508181035f83015261040581846103b5565b905092915050565b5f81905092915050565b5f6104218261039b565b61042b818561040d565b935061043b8185602086016102c5565b80840191505092915050565b5f6104528284610417565b915081905092915050565b5f82825260208201905092915050565b7f67657453656e64657241646472657373206661696c656420776974686f7574205f8201527f6461746100000000000000000000000000000000000000000000000000000000602082015250565b5f6104c760248361045d565b91506104d28261046d565b604082019050919050565b5f6020820190508181035f8301526104f4816104bb565b9050919050565b7f67657453656e6465724164647265737320646964206e6f7420726576657274205f8201527f6173206578706563746564000000000000000000000000000000000000000000602082015250565b5f610555602b8361045d565b9150610560826104fb565b604082019050919050565b5f6020820190508181035f83015261058281610549565b905091905056fe";
|
|
8
|
+
const GetSenderAddressHelperAbi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
internalType: "address",
|
|
13
|
+
name: "_entryPoint",
|
|
14
|
+
type: "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
internalType: "bytes",
|
|
18
|
+
name: "initCode",
|
|
19
|
+
type: "bytes"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
stateMutability: "payable",
|
|
23
|
+
type: "constructor"
|
|
24
|
+
}
|
|
25
|
+
];
|
|
7
26
|
class InvalidEntryPointError extends viem_1.BaseError {
|
|
8
27
|
constructor({ cause, entryPointAddress } = {}) {
|
|
9
28
|
super(`The entry point address (\`entryPoint\`${entryPointAddress ? ` = ${entryPointAddress}` : ""}) is not a valid entry point. getSenderAddress did not revert with a SenderAddressResult error.`, {
|
|
@@ -23,144 +42,18 @@ const getSenderAddress = async (client, args) => {
|
|
|
23
42
|
if (!initCode && !factory && !factoryData) {
|
|
24
43
|
throw new Error("Either `initCode` or `factory` and `factoryData` must be provided");
|
|
25
44
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
abi:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
name: "SenderAddressResult",
|
|
39
|
-
type: "error"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
inputs: [
|
|
43
|
-
{
|
|
44
|
-
internalType: "bytes",
|
|
45
|
-
name: "initCode",
|
|
46
|
-
type: "bytes"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
name: "getSenderAddress",
|
|
50
|
-
outputs: [],
|
|
51
|
-
stateMutability: "nonpayable",
|
|
52
|
-
type: "function"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
functionName: "getSenderAddress",
|
|
56
|
-
args: [initCode || (0, viem_1.concat)([factory, factoryData])]
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
const revertError = e.walk((err) => err instanceof viem_1.ContractFunctionRevertedError ||
|
|
61
|
-
err instanceof viem_1.RpcRequestError ||
|
|
62
|
-
err instanceof viem_1.InvalidInputRpcError ||
|
|
63
|
-
err instanceof viem_1.UnknownRpcError);
|
|
64
|
-
if (!revertError) {
|
|
65
|
-
const cause = e.cause;
|
|
66
|
-
const errorName = cause?.data?.errorName ?? "";
|
|
67
|
-
if (errorName === "SenderAddressResult" &&
|
|
68
|
-
cause?.data?.args &&
|
|
69
|
-
cause?.data?.args[0]) {
|
|
70
|
-
return cause.data?.args[0];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (revertError instanceof viem_1.ContractFunctionRevertedError) {
|
|
74
|
-
const errorName = revertError.data?.errorName ?? "";
|
|
75
|
-
if (errorName === "SenderAddressResult" &&
|
|
76
|
-
revertError.data?.args &&
|
|
77
|
-
revertError.data?.args[0]) {
|
|
78
|
-
return revertError.data?.args[0];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (revertError instanceof viem_1.RpcRequestError) {
|
|
82
|
-
const hexStringRegex = /0x[a-fA-F0-9]+/;
|
|
83
|
-
const match = revertError.cause.data.match(hexStringRegex);
|
|
84
|
-
if (!match) {
|
|
85
|
-
throw new Error("Failed to parse revert bytes from RPC response");
|
|
86
|
-
}
|
|
87
|
-
const data = match[0];
|
|
88
|
-
const error = (0, viem_1.decodeErrorResult)({
|
|
89
|
-
abi: [
|
|
90
|
-
{
|
|
91
|
-
inputs: [
|
|
92
|
-
{
|
|
93
|
-
internalType: "address",
|
|
94
|
-
name: "sender",
|
|
95
|
-
type: "address"
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
name: "SenderAddressResult",
|
|
99
|
-
type: "error"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
data
|
|
103
|
-
});
|
|
104
|
-
return error.args[0];
|
|
105
|
-
}
|
|
106
|
-
if (revertError instanceof viem_1.InvalidInputRpcError) {
|
|
107
|
-
const { data: data_ } = (e instanceof viem_1.RawContractError
|
|
108
|
-
? e
|
|
109
|
-
: e instanceof viem_1.BaseError
|
|
110
|
-
? e.walk((err) => "data" in err) || e.walk()
|
|
111
|
-
: {});
|
|
112
|
-
const data = typeof data_ === "string" ? data_ : data_?.data;
|
|
113
|
-
if (data === undefined) {
|
|
114
|
-
throw new Error("Failed to parse revert bytes from RPC response");
|
|
115
|
-
}
|
|
116
|
-
const error = (0, viem_1.decodeErrorResult)({
|
|
117
|
-
abi: [
|
|
118
|
-
{
|
|
119
|
-
inputs: [
|
|
120
|
-
{
|
|
121
|
-
internalType: "address",
|
|
122
|
-
name: "sender",
|
|
123
|
-
type: "address"
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
name: "SenderAddressResult",
|
|
127
|
-
type: "error"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
data
|
|
131
|
-
});
|
|
132
|
-
return error.args[0];
|
|
133
|
-
}
|
|
134
|
-
if (revertError instanceof viem_1.UnknownRpcError) {
|
|
135
|
-
const parsedBody = JSON.parse(revertError.cause.body);
|
|
136
|
-
const revertData = parsedBody.error.data;
|
|
137
|
-
const hexStringRegex = /0x[a-fA-F0-9]+/;
|
|
138
|
-
const match = revertData.match(hexStringRegex);
|
|
139
|
-
if (!match) {
|
|
140
|
-
throw new Error("Failed to parse revert bytes from RPC response");
|
|
141
|
-
}
|
|
142
|
-
const data = match[0];
|
|
143
|
-
const error = (0, viem_1.decodeErrorResult)({
|
|
144
|
-
abi: [
|
|
145
|
-
{
|
|
146
|
-
inputs: [
|
|
147
|
-
{
|
|
148
|
-
internalType: "address",
|
|
149
|
-
name: "sender",
|
|
150
|
-
type: "address"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
name: "SenderAddressResult",
|
|
154
|
-
type: "error"
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
data
|
|
158
|
-
});
|
|
159
|
-
return error.args[0];
|
|
160
|
-
}
|
|
161
|
-
throw e;
|
|
45
|
+
const formattedInitCode = initCode || (0, viem_1.concat)([factory, factoryData]);
|
|
46
|
+
const { data } = await (0, utils_1.getAction)(client, actions_1.call, "call")({
|
|
47
|
+
data: (0, viem_1.encodeDeployData)({
|
|
48
|
+
abi: GetSenderAddressHelperAbi,
|
|
49
|
+
bytecode: GetSenderAddressHelperByteCode,
|
|
50
|
+
args: [entryPointAddress, formattedInitCode]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
if (!data) {
|
|
54
|
+
throw new Error("Failed to get sender address");
|
|
162
55
|
}
|
|
163
|
-
|
|
56
|
+
return (0, viem_1.getAddress)(data);
|
|
164
57
|
};
|
|
165
58
|
exports.getSenderAddress = getSenderAddress;
|
|
166
59
|
//# sourceMappingURL=getSenderAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":";;;AAAA,+BAUa;AAEb,0CAAmC;AACnC,sCAAsC;AAGtC,MAAM,8BAA8B,GAChC,wxFAAwxF,CAAA;AAE5xF,MAAM,yBAAyB,GAAG;IAC9B;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,aAAa;KACtB;CACJ,CAAA;AAiBD,MAAa,sBAAuB,SAAQ,gBAAS;IAGjD,YAAY,EACR,KAAK,EACL,iBAAiB,KACmC,EAAE;QACtD,KAAK,CACD,0CACI,iBAAiB,CAAC,CAAC,CAAC,MAAM,iBAAiB,EAAE,CAAC,CAAC,CAAC,EACpD,iGAAiG,EACjG;YACI,KAAK;SACR,CACJ,CAAA;QAbI;;;;mBAAO,wBAAwB;WAAA;IAcxC,CAAC;CACJ;AAhBD,wDAgBC;AA2BM,MAAM,gBAAgB,GAAG,KAAK,EACjC,MAAc,EACd,IAAsC,EACtB,EAAE;IAClB,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;IAElE,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACX,mEAAmE,CACtE,CAAA;IACL,CAAC;IAED,MAAM,iBAAiB,GACnB,QAAQ,IAAI,IAAA,aAAM,EAAC,CAAC,OAAc,EAAE,WAAkB,CAAC,CAAC,CAAA;IAE5D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,iBAAS,EAC5B,MAAM,EACN,cAAI,EACJ,MAAM,CACT,CAAC;QACE,IAAI,EAAE,IAAA,uBAAgB,EAAC;YACnB,GAAG,EAAE,yBAAyB;YAC9B,QAAQ,EAAE,8BAA8B;YACxC,IAAI,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;SAC/C,CAAC;KACL,CAAC,CAAA;IAEF,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACnD,CAAC;IAED,OAAO,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAA;AAC3B,CAAC,CAAA;AAhCY,QAAA,gBAAgB,oBAgC5B"}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.sendTransaction = sendTransaction;
|
|
4
4
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
5
|
const utils_1 = require("viem/utils");
|
|
6
|
-
const
|
|
6
|
+
const index_js_1 = require("../../errors/index.js");
|
|
7
7
|
async function sendTransaction(client, args) {
|
|
8
8
|
let userOpHash;
|
|
9
9
|
if ("to" in args) {
|
|
10
10
|
const { account: account_ = client.account, data, maxFeePerGas, maxPriorityFeePerGas, to, value, nonce } = args;
|
|
11
11
|
if (!account_) {
|
|
12
|
-
throw new
|
|
12
|
+
throw new index_js_1.AccountNotFoundError({
|
|
13
13
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":";;AA8DA,0CAqEC;AA5HD,kEAKiC;AACjC,sCAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":";;AA8DA,0CAqEC;AA5HD,kEAKiC;AACjC,sCAAoD;AACpD,oDAA4D;AAgDrD,KAAK,UAAU,eAAe,CAOjC,MAAyC,EACzC,IAEkE;IAElE,IAAI,UAAgB,CAAA;IAEpB,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,EAAE,EACF,KAAK,EACL,KAAK,EACR,GAAG,IAAI,CAAA;QAER,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,MAAM,IAAI,+BAAoB,CAAC;gBAC3B,QAAQ,EAAE,sCAAsC;aACnD,CAAC,CAAA;QACN,CAAC;QAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;QAEtD,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE9C,UAAU,GAAG,MAAM,IAAA,iBAAS,EACxB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;YACE,KAAK,EAAE;gBACH;oBACI,EAAE;oBACF,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,EAAE,IAAI,IAAI,IAAI;iBACrB;aACJ;YACD,OAAO;YACP,YAAY;YACZ,oBAAoB;YACpB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SA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