@aa-sdk/core 4.35.0 → 4.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +1 -1
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/bundler/estimateUserOperationGas.d.ts +3 -2
- package/dist/esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/bundler/getSupportedEntryPoints.js.map +1 -1
- package/dist/esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/dist/esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/dist/esm/actions/bundler/sendRawUserOperation.d.ts +2 -1
- package/dist/esm/actions/bundler/sendRawUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js +8 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/getAddress.js.map +1 -1
- package/dist/esm/actions/smartAccount/getUserOperationError.d.ts +14 -0
- package/dist/esm/actions/smartAccount/getUserOperationError.js +90 -0
- package/dist/esm/actions/smartAccount/getUserOperationError.js.map +1 -0
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js +11 -4
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/signMessage.js.map +1 -1
- package/dist/esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/dist/esm/actions/smartAccount/signUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/types.js.map +1 -1
- package/dist/esm/actions/smartAccount/upgradeAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
- package/dist/esm/client/addBreadcrumb.js.map +1 -1
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/schema.d.ts +25 -25
- package/dist/esm/client/schema.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/ens/utils.js.map +1 -1
- package/dist/esm/entrypoint/0.6.d.ts +2 -2
- package/dist/esm/entrypoint/0.6.js.map +1 -1
- package/dist/esm/entrypoint/0.7.d.ts +1 -1
- package/dist/esm/entrypoint/0.7.js.map +1 -1
- package/dist/esm/entrypoint/index.d.ts +1 -1
- package/dist/esm/entrypoint/index.js.map +1 -1
- package/dist/esm/entrypoint/types.js.map +1 -1
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/7702gasEstimator.d.ts +2 -2
- package/dist/esm/middleware/defaults/7702gasEstimator.js +2 -2
- package/dist/esm/middleware/defaults/7702gasEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/7702signer.d.ts +1 -1
- package/dist/esm/middleware/defaults/7702signer.js +1 -1
- package/dist/esm/middleware/defaults/7702signer.js.map +1 -1
- package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
- package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.js.map +1 -1
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +2 -207
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/schema.d.ts +1 -1
- package/dist/esm/signer/types.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +2 -207
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/defaults.js.map +1 -1
- package/dist/esm/utils/index.d.ts +2 -2
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/stateOverride.js.map +1 -1
- package/dist/esm/utils/testUtils.js.map +1 -1
- package/dist/esm/utils/traceHeader.js.map +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.d.ts +2 -2
- package/dist/esm/utils/userop.js +1 -1
- package/dist/esm/utils/userop.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +1 -1
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/bundler/estimateUserOperationGas.d.ts +3 -2
- package/dist/types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/dist/types/actions/bundler/getSupportedEntryPoints.d.ts.map +1 -1
- package/dist/types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/dist/types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/dist/types/actions/bundler/sendRawUserOperation.d.ts +2 -1
- package/dist/types/actions/bundler/sendRawUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/getUserOperationError.d.ts +15 -0
- package/dist/types/actions/smartAccount/getUserOperationError.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/signUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/types.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -1
- package/dist/types/client/schema.d.ts +25 -25
- package/dist/types/client/schema.d.ts.map +1 -1
- package/dist/types/ens/utils.d.ts.map +1 -1
- package/dist/types/entrypoint/0.6.d.ts +2 -2
- package/dist/types/entrypoint/0.6.d.ts.map +1 -1
- package/dist/types/entrypoint/0.7.d.ts +1 -1
- package/dist/types/entrypoint/0.7.d.ts.map +1 -1
- package/dist/types/entrypoint/index.d.ts +1 -1
- package/dist/types/entrypoint/index.d.ts.map +1 -1
- package/dist/types/entrypoint/types.d.ts.map +1 -1
- package/dist/types/errors/useroperation.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/middleware/actions.d.ts.map +1 -1
- package/dist/types/middleware/defaults/7702gasEstimator.d.ts +2 -2
- package/dist/types/middleware/defaults/7702signer.d.ts +1 -1
- package/dist/types/middleware/types.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +2 -207
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/schema.d.ts +1 -1
- package/dist/types/signer/schema.d.ts.map +1 -1
- package/dist/types/signer/utils.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +2 -207
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts.map +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/utils/bytes.d.ts.map +1 -1
- package/dist/types/utils/defaults.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/testUtils.d.ts.map +1 -1
- package/dist/types/utils/traceHeader.d.ts.map +1 -1
- package/dist/types/utils/userop.d.ts +2 -2
- package/dist/types/utils/userop.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -6
- package/src/account/smartContractAccount.ts +27 -25
- package/src/actions/bundler/estimateUserOperationGas.ts +2 -2
- package/src/actions/bundler/getSupportedEntryPoints.ts +2 -2
- package/src/actions/bundler/getUserOperationByHash.ts +2 -2
- package/src/actions/bundler/getUserOperationReceipt.ts +2 -2
- package/src/actions/bundler/sendRawUserOperation.ts +2 -2
- package/src/actions/smartAccount/buildUserOperation.ts +5 -4
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +4 -3
- package/src/actions/smartAccount/buildUserOperationFromTxs.ts +9 -8
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +5 -4
- package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +7 -6
- package/src/actions/smartAccount/estimateUserOperationGas.ts +15 -8
- package/src/actions/smartAccount/getAddress.ts +2 -2
- package/src/actions/smartAccount/getUserOperationError.ts +119 -0
- package/src/actions/smartAccount/internal/initUserOperation.ts +7 -6
- package/src/actions/smartAccount/internal/runMiddlewareStack.ts +13 -12
- package/src/actions/smartAccount/internal/sendUserOperation.ts +13 -6
- package/src/actions/smartAccount/sendTransaction.ts +5 -4
- package/src/actions/smartAccount/sendTransactions.ts +3 -3
- package/src/actions/smartAccount/sendUserOperation.ts +4 -3
- package/src/actions/smartAccount/signMessage.ts +3 -3
- package/src/actions/smartAccount/signTypedData.ts +3 -3
- package/src/actions/smartAccount/signUserOperation.ts +4 -3
- package/src/actions/smartAccount/types.ts +23 -15
- package/src/actions/smartAccount/upgradeAccount.ts +3 -3
- package/src/actions/smartAccount/waitForUserOperationTransacation.ts +5 -5
- package/src/client/addBreadcrumb.ts +1 -1
- package/src/client/bundlerClient.ts +5 -5
- package/src/client/decorators/bundlerClient.ts +7 -7
- package/src/client/decorators/smartAccountClient.ts +20 -18
- package/src/client/isSmartAccountClient.ts +4 -4
- package/src/client/schema.ts +2 -2
- package/src/client/smartAccountClient.ts +14 -14
- package/src/client/types.ts +2 -2
- package/src/ens/utils.ts +1 -1
- package/src/entrypoint/0.6.ts +3 -3
- package/src/entrypoint/0.7.ts +4 -4
- package/src/entrypoint/index.ts +10 -9
- package/src/entrypoint/types.ts +30 -28
- package/src/errors/account.ts +1 -1
- package/src/errors/client.ts +3 -3
- package/src/errors/entrypoint.ts +2 -2
- package/src/errors/signer.ts +1 -1
- package/src/errors/useroperation.ts +6 -3
- package/src/index.ts +1 -0
- package/src/middleware/actions.ts +3 -3
- package/src/middleware/defaults/7702gasEstimator.ts +4 -4
- package/src/middleware/defaults/7702signer.ts +3 -3
- package/src/middleware/defaults/feeEstimator.ts +4 -4
- package/src/middleware/defaults/gasEstimator.ts +6 -6
- package/src/middleware/defaults/paymasterAndData.ts +1 -1
- package/src/middleware/defaults/userOpSigner.ts +2 -2
- package/src/middleware/erc7677middleware.ts +9 -9
- package/src/middleware/types.ts +7 -5
- package/src/signer/local-account.ts +7 -7
- package/src/signer/types.ts +3 -3
- package/src/signer/wallet-client.ts +2 -2
- package/src/transport/split.ts +1 -1
- package/src/types.ts +29 -29
- package/src/utils/bigint.ts +4 -4
- package/src/utils/defaults.ts +1 -1
- package/src/utils/index.ts +12 -9
- package/src/utils/schema.ts +2 -2
- package/src/utils/stateOverride.ts +4 -4
- package/src/utils/testUtils.ts +2 -2
- package/src/utils/traceHeader.ts +14 -11
- package/src/utils/types.ts +1 -1
- package/src/utils/userop.ts +17 -17
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initUserOperation.js","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/initUserOperation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAC;AAO7E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"initUserOperation.js","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/initUserOperation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAC;AAO7E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAYtC,MAA4D,EAC5D,IAEwE;IAExE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAE3C,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAChC,CAAC,CAAC,OAAO,EAAE,KAAK,QAAQ;YACtB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAEhC,MAAM,SAAS,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAE9C,MAAM,KAAK,GACT,SAAS,EAAE,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEnE,MAAM,MAAM,GACV,UAAU,CAAC,OAAO,KAAK,OAAO;QAC5B,CAAC,CAAE;YACC,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE;YAC/B,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,KAAK;YACL,QAAQ;YACR,SAAS;SAC8C;QAC3D,CAAC,CAAE;YACC,OAAO,EAAE,iBAAiB,CACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EACzD,OAAO,CAAC,iBAAiB,CAC1B;YACD,WAAW,EAAE,iBAAiB,CAC5B,OAAO,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EACzD,OAAO,CAAC,cAAc,CACvB;YACD,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,KAAK;YACL,QAAQ;YACR,SAAS;SAC8C,CAAC;IAEhE,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { Chain, Transport } from \"viem\";\nimport type {\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../../account/smartContractAccount.js\";\nimport type { BaseSmartAccountClient } from \"../../../client/smartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../../errors/account.js\";\nimport { ChainNotFoundError } from \"../../../errors/client.js\";\nimport type { UserOperationStruct } from \"../../../types.js\";\nimport { conditionalReturn, type Deferrable } from \"../../../utils/index.js\";\nimport type {\n BuildUserOperationParameters,\n SendUserOperationParameters,\n UserOperationContext,\n} from \"../types.js\";\n\n/**\n * Description internal action function of SmartAccountClient for initializing\n * a user operation for the sender account\n *\n * @template {Transport} TTransport\n * @template {Chain | undefined} TChain\n * @template {SmartContractAccount | undefined} TAccount\n * @template {UserOperationContext | undefined} TContext\n * @template {GetEntryPointFromAccount} TEntryPointVersion\n * @param {BaseSmartAccountClient<TTransport, TChain, TAccount>} client smart account client\n * @param {SendUserOperationParameters<TAccount, TContext, TEntryPointVersion> | BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>} args send user operation parameters\n * @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} initialized user operation struct\n */\nexport async function _initUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n>(\n client: BaseSmartAccountClient<TTransport, TChain, TAccount>,\n args:\n | SendUserOperationParameters<TAccount, TContext, TEntryPointVersion>\n | BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>,\n): Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>> {\n const { account = client.account, uo, overrides } = args;\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const entryPoint = account.getEntryPoint();\n\n const callData = Array.isArray(uo)\n ? account.encodeBatchExecute(uo)\n : typeof uo === \"string\"\n ? uo\n : account.encodeExecute(uo);\n\n const signature = account.getDummySignature();\n\n const nonce =\n overrides?.nonce ?? account.getAccountNonce(overrides?.nonceKey);\n\n const struct =\n entryPoint.version === \"0.6.0\"\n ? ({\n initCode: account.getInitCode(),\n sender: account.address,\n nonce,\n callData,\n signature,\n } as Deferrable<UserOperationStruct<TEntryPointVersion>>)\n : ({\n factory: conditionalReturn(\n account.isAccountDeployed().then((deployed) => !deployed),\n account.getFactoryAddress,\n ),\n factoryData: conditionalReturn(\n account.isAccountDeployed().then((deployed) => !deployed),\n account.getFactoryData,\n ),\n sender: account.address,\n nonce,\n callData,\n signature,\n } as Deferrable<UserOperationStruct<TEntryPointVersion>>);\n\n return struct;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runMiddlewareStack.js","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/runMiddlewareStack.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAMvE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,SAAS,GACb,CAAU,GAAG,GAAyC,EAAE,EAAE,CAC1D,KAAK,EAAE,CAAI,EAAE,IAAU,EAAE,EAAE;IACzB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEJ,MAAM,CAAC,KAAK,UAAU,mBAAmB,
|
|
1
|
+
{"version":3,"file":"runMiddlewareStack.js","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/runMiddlewareStack.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAMvE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,SAAS,GACb,CAAU,GAAG,GAAyC,EAAE,EAAE,CAC1D,KAAK,EAAE,CAAI,EAAE,IAAU,EAAE,EAAE;IACzB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEJ,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAYvC,MAA4D,EAC5D,IAIqD;IAErD,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,EACJ,qBAAqB,EACrB,gBAAgB,GACjB,GAGG,sBAAsB,CAAC,SAAS,CAAC;QACnC,CAAC,CAAC;YACE,qBAAqB,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;gBACjD,OAAO;oBACL,GAAG,EAAE;oBACL,GAAG,CAAC,kBAAkB,IAAI,SAAU;wBAClC,CAAC,CAAC,EAAE,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,EAAE;wBAClD,CAAC,CAAC,eAAe,IAAI,SAAU;4BAC3B,WAAW,IAAI,SAAS;4BACxB,SAAS,CAAC,aAAa,KAAK,IAAI;4BAClC,CAAC,CAAC;gCACE,aAAa,EAAE,SAAS,CAAC,aAAa;gCACtC,SAAS,EAAE,SAAS,CAAC,SAAS;6BAC/B;4BACH,CAAC,CAAC,sDAAsD;gCACtD,qEAAqE;gCACrE,SAAS,CAAC;iBACjB,CAAC;YACJ,CAAC;YACD,gBAAgB,EAAE,cAAc;SACjC;QACH,CAAC,CAAC;YACE,qBAAqB,EAAE,MAAM,CAAC,UAAU,CAAC,qBAAqB;YAC9D,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,gBAAgB;SACrD,CAAC;IAEN,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B,qBAAqB,EACrB,MAAM,CAAC,UAAU,CAAC,YAAY,EAC9B,MAAM,CAAC,UAAU,CAAC,YAAY,EAC9B,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAClC,gBAAgB,EAChB,MAAM,CAAC,UAAU,CAAC,sBAAsB,CACzC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAE9E,OAAO,iBAAiB,CAEtB,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import type { Chain, Transport } from \"viem\";\nimport type {\n GetAccountParameter,\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../../account/smartContractAccount\";\nimport type { BaseSmartAccountClient } from \"../../../client/smartAccountClient\";\nimport { AccountNotFoundError } from \"../../../errors/account.js\";\nimport { noopMiddleware } from \"../../../middleware/noopMiddleware.js\";\nimport type { ClientMiddleware } from \"../../../middleware/types\";\nimport type {\n UserOperationOverridesParameter,\n UserOperationStruct,\n} from \"../../../types\";\nimport {\n bypassPaymasterAndData,\n resolveProperties,\n type Deferrable,\n} from \"../../../utils/index.js\";\nimport type { UserOperationContext } from \"../types\";\n\nconst asyncPipe =\n <S, Opts>(...fns: ((s: S, opts: Opts) => Promise<S>)[]) =>\n async (s: S, opts: Opts) => {\n let result = s;\n for (const fn of fns) {\n result = await fn(result, opts);\n }\n return result;\n };\n\nexport async function _runMiddlewareStack<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n>(\n client: BaseSmartAccountClient<TTransport, TChain, TAccount>,\n args: {\n uo: Deferrable<UserOperationStruct<TEntryPointVersion>>;\n context?: TContext;\n } & GetAccountParameter<TAccount> &\n UserOperationOverridesParameter<TEntryPointVersion>,\n): Promise<UserOperationStruct<TEntryPointVersion>> {\n const { uo, overrides, account = client.account, context } = args;\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n const {\n dummyPaymasterAndData,\n paymasterAndData,\n }: Pick<\n ClientMiddleware<TContext>,\n \"dummyPaymasterAndData\" | \"paymasterAndData\"\n > = bypassPaymasterAndData(overrides)\n ? {\n dummyPaymasterAndData: async (uo, { overrides }) => {\n return {\n ...uo,\n ...(\"paymasterAndData\" in overrides!\n ? { paymasterAndData: overrides.paymasterAndData }\n : \"paymasterData\" in overrides! &&\n \"paymaster\" in overrides &&\n overrides.paymasterData !== \"0x\"\n ? {\n paymasterData: overrides.paymasterData,\n paymaster: overrides.paymaster,\n }\n : // At this point, nothing has run so no fields are set\n // for 0.7 when not using a paymaster, all fields should be undefined\n undefined),\n };\n },\n paymasterAndData: noopMiddleware,\n }\n : {\n dummyPaymasterAndData: client.middleware.dummyPaymasterAndData,\n paymasterAndData: client.middleware.paymasterAndData,\n };\n\n const result = await asyncPipe(\n dummyPaymasterAndData,\n client.middleware.feeEstimator,\n client.middleware.gasEstimator,\n client.middleware.customMiddleware,\n paymasterAndData,\n client.middleware.userOperationSimulator,\n )(uo, { overrides, feeOptions: client.feeOptions, account, client, context });\n\n return resolveProperties<\n UserOperationStruct<GetEntryPointFromAccount<TAccount>>\n >(result);\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AccountNotFoundError } from "../../../errors/account.js";
|
|
2
2
|
import { ChainNotFoundError } from "../../../errors/client.js";
|
|
3
3
|
import { signUserOperation } from "../signUserOperation.js";
|
|
4
|
+
import { getUserOperationError } from "../getUserOperationError.js";
|
|
4
5
|
export async function _sendUserOperation(client, args) {
|
|
5
6
|
const { account = client.account, uoStruct, context, overrides } = args;
|
|
6
7
|
if (!account) {
|
|
@@ -16,9 +17,15 @@ export async function _sendUserOperation(client, args) {
|
|
|
16
17
|
context,
|
|
17
18
|
overrides,
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
try {
|
|
21
|
+
return {
|
|
22
|
+
hash: await client.sendRawUserOperation(request, entryPoint.address),
|
|
23
|
+
request,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
getUserOperationError(client, request, entryPoint);
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
//# sourceMappingURL=sendUserOperation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/sendUserOperation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAK/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../../../src/actions/smartAccount/internal/sendUserOperation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAK/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAYtC,MAA4D,EAC5D,IAI+B;IAE/B,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACxE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE;QAC9C,QAAQ;QACR,OAAO;QACP,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,OAAO;YACL,IAAI,EAAE,MAAM,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;YACpE,OAAO;SACR,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["import type { Chain, Transport } from \"viem\";\nimport type {\n GetAccountParameter,\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../../account/smartContractAccount\";\nimport type { BaseSmartAccountClient } from \"../../../client/smartAccountClient\";\nimport type { SendUserOperationResult } from \"../../../client/types\";\nimport { AccountNotFoundError } from \"../../../errors/account.js\";\nimport { ChainNotFoundError } from \"../../../errors/client.js\";\nimport type {\n UserOperationOverrides,\n UserOperationStruct,\n} from \"../../../types\";\nimport { signUserOperation } from \"../signUserOperation.js\";\nimport type { GetContextParameter, UserOperationContext } from \"../types\";\nimport { getUserOperationError } from \"../getUserOperationError.js\";\n\nexport async function _sendUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n>(\n client: BaseSmartAccountClient<TTransport, TChain, TAccount>,\n args: {\n uoStruct: UserOperationStruct<TEntryPointVersion>;\n overrides?: UserOperationOverrides<TEntryPointVersion>;\n } & GetAccountParameter<TAccount> &\n GetContextParameter<TContext>,\n): Promise<SendUserOperationResult<TEntryPointVersion>> {\n const { account = client.account, uoStruct, context, overrides } = args;\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n const entryPoint = account.getEntryPoint();\n const request = await signUserOperation(client, {\n uoStruct,\n account,\n context,\n overrides,\n });\n\n try {\n return {\n hash: await client.sendRawUserOperation(request, entryPoint.address),\n request,\n };\n } catch (err) {\n getUserOperationError(client, request, entryPoint);\n throw err;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,
|
|
1
|
+
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendTransaction.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAYnC,OAA4C,EAC5C,IAAiE,EACjE,SAAsD,EACtD,OAAkB;IAElB,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;IACtE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC1C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,MAAM,IAAI,8BAA8B,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,iBAAiB,EACjB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAC7C,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,CACR,CAAC;IAEF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE;QACzD,OAAO,EAAE,OAA+B;QACxC,QAAQ;QACR,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,+BAA+B,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACnE,MAAM,IAAI,yBAAyB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n Chain,\n Client,\n Hex,\n SendTransactionParameters,\n Transport,\n} from \"viem\";\nimport type {\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../account/smartContractAccount.js\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { TransactionMissingToParamError } from \"../../errors/transaction.js\";\nimport { WaitForUserOperationError } from \"../../errors/useroperation.js\";\nimport type { UserOperationOverrides } from \"../../types.js\";\nimport { buildUserOperationFromTx } from \"./buildUserOperationFromTx.js\";\nimport { _sendUserOperation } from \"./internal/sendUserOperation.js\";\nimport type { UserOperationContext } from \"./types.js\";\nimport { waitForUserOperationTransaction } from \"./waitForUserOperationTransacation.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\n/**\n * Sends a transaction using the provided client, arguments, optional overrides, and context.\n * This sends a UO and then waits for it to be mined\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with sendTransaction\n * const client = createSmartAccountClient(...);\n * const result = await client.sendTransaction({\n * to: \"0x...\",\n * data: \"0x...\", // or \"0x\",\n * value: 0n, // optional\n * account, // only required if the client above is not connected to an account\n * });\n * ```\n *\n * @param {Client<Transport, TChain, TAccount>} client_ The client to send the transaction through\n * @param {SendTransactionParameters<TChain, TAccount, TChainOverride>} args The parameters required to send the transaction\n * @param {UserOperationOverrides<TEntryPointVersion>} [overrides] Optional overrides for the user operation\n * @param {UserOperationContext} [context] Optional context for the user operation\n * @returns {Promise<Hex>} A promise that resolves to a hex string representing the transaction hash\n */\nexport async function sendTransaction<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TChainOverride extends Chain | undefined = Chain | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n>(\n client_: Client<Transport, TChain, TAccount>,\n args: SendTransactionParameters<TChain, TAccount, TChainOverride>,\n overrides?: UserOperationOverrides<TEntryPointVersion>,\n context?: TContext,\n): Promise<Hex> {\n const client = clientHeaderTrack(client_, \"estimateUserOperationGas\");\n const { account = client.account } = args;\n if (!account || typeof account === \"string\") {\n throw new AccountNotFoundError();\n }\n\n if (!args.to) {\n throw new TransactionMissingToParamError();\n }\n\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"sendTransaction\",\n client,\n );\n }\n\n const uoStruct = await buildUserOperationFromTx(\n client,\n args,\n overrides,\n context,\n );\n\n const { hash, request } = await _sendUserOperation(client, {\n account: account as SmartContractAccount,\n uoStruct,\n context,\n overrides,\n });\n\n return waitForUserOperationTransaction(client, { hash }).catch((e) => {\n throw new WaitForUserOperationError(request, e);\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendTransactions.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendTransactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAQpC,OAA6C,EAC7C,IAAoD;IAEpD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;IACtE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACxE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,yBAAyB,CAAC,MAAM,EAAE;QAC3D,QAAQ;QACR,SAAS;QACT,OAAO;QACP,OAAO;KACR,CAAC,CAAC;IAEH,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE;QACzD,OAAO;QACP,QAAQ;QACR,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,+BAA+B,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACnE,MAAM,IAAI,yBAAyB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../../account/smartContractAccount.js\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { WaitForUserOperationError } from \"../../errors/useroperation.js\";\nimport { buildUserOperationFromTxs } from \"./buildUserOperationFromTxs.js\";\nimport { _sendUserOperation } from \"./internal/sendUserOperation.js\";\nimport type { SendTransactionsParameters, UserOperationContext } from \"./types\";\nimport { waitForUserOperationTransaction } from \"./waitForUserOperationTransacation.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\n/**\n * Sends transactions using the provided client and transaction parameters. This function builds user operations from the transactions, sends them, and waits for the transaction to be mined.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with sendTransactions\n * const client = createSmartAccountClient(...);\n * const result = await client.sendTransactions({\n * requests: [{\n * to: \"0x...\",\n * data: \"0x...\", // or \"0x\",\n * value: 0n, // optional\n * }],\n * account, // only required if the client above is not connected to an account\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client_ The client used to send the transactions\n * @param {SendTransactionsParameters<TAccount, TContext>} args The parameters for sending the transactions, including requests, overrides, account, and context\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash of the sent transactions\n */\nexport async function sendTransactions<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined = UserOperationContext
|
|
1
|
+
{"version":3,"file":"sendTransactions.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendTransactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAQpC,OAA6C,EAC7C,IAAoD;IAEpD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;IACtE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACxE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,yBAAyB,CAAC,MAAM,EAAE;QAC3D,QAAQ;QACR,SAAS;QACT,OAAO;QACP,OAAO;KACR,CAAC,CAAC;IAEH,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE;QACzD,OAAO;QACP,QAAQ;QACR,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,+BAA+B,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACnE,MAAM,IAAI,yBAAyB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../../account/smartContractAccount.js\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { WaitForUserOperationError } from \"../../errors/useroperation.js\";\nimport { buildUserOperationFromTxs } from \"./buildUserOperationFromTxs.js\";\nimport { _sendUserOperation } from \"./internal/sendUserOperation.js\";\nimport type { SendTransactionsParameters, UserOperationContext } from \"./types\";\nimport { waitForUserOperationTransaction } from \"./waitForUserOperationTransacation.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\n/**\n * Sends transactions using the provided client and transaction parameters. This function builds user operations from the transactions, sends them, and waits for the transaction to be mined.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with sendTransactions\n * const client = createSmartAccountClient(...);\n * const result = await client.sendTransactions({\n * requests: [{\n * to: \"0x...\",\n * data: \"0x...\", // or \"0x\",\n * value: 0n, // optional\n * }],\n * account, // only required if the client above is not connected to an account\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client_ The client used to send the transactions\n * @param {SendTransactionsParameters<TAccount, TContext>} args The parameters for sending the transactions, including requests, overrides, account, and context\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash of the sent transactions\n */\nexport async function sendTransactions<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined = UserOperationContext,\n>(\n client_: Client<TTransport, TChain, TAccount>,\n args: SendTransactionsParameters<TAccount, TContext>,\n): Promise<Hex> {\n const client = clientHeaderTrack(client_, \"estimateUserOperationGas\");\n const { requests, overrides, account = client.account, context } = args;\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"sendTransactions\",\n client,\n );\n }\n\n const { uoStruct } = await buildUserOperationFromTxs(client, {\n requests,\n overrides,\n account,\n context,\n });\n\n const { hash, request } = await _sendUserOperation(client, {\n account,\n uoStruct,\n context,\n overrides,\n });\n\n return waitForUserOperationTransaction(client, { hash }).catch((e) => {\n throw new WaitForUserOperationError(request, e);\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendUserOperation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAKrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/sendUserOperation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAKrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAYrC,OAA6C,EAC7C,IAAqD;IAErD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IAC/D,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAE9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE;QAChD,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,OAAO;QACP,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,kBAAkB,CAAC,MAAM,EAAE;QAChC,OAAO;QACP,QAAQ;QACR,OAAO;QACP,SAAS;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Chain, Client, Transport } from \"viem\";\nimport type {\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../account/smartContractAccount.js\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport type { SendUserOperationResult } from \"../../client/types.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { buildUserOperation } from \"./buildUserOperation.js\";\nimport { _sendUserOperation } from \"./internal/sendUserOperation.js\";\nimport type {\n SendUserOperationParameters,\n UserOperationContext,\n} from \"./types.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\n/**\n * Sends a user operation or batch of user operations using the connected account. Before executing, sendUserOperation will run the user operation through the middleware pipeline.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient, toSmartContractAccount } from \"@aa-sdk/core\";\n *\n * const account = await toSmartContractAccount(...);\n * const result = await createSmartAccountClient(...).sendUserOperation({\n * uo: {\n * target: \"0x...\",\n * data: \"0x...\", // or \"0x\",\n * value: 0n, // optional\n * }\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client_ the smart account client to use for RPC requests\n * @param {SendUserOperationParameters<TAccount, TContext>} args contains the UO or batch to send, context, overrides, and account if not hoisted on the client\n * @returns {Promise<SendUserOperationResult<TEntryPointVersion>>} a Promise containing the result of the user operation\n */\nexport async function sendUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n>(\n client_: Client<TTransport, TChain, TAccount>,\n args: SendUserOperationParameters<TAccount, TContext>,\n): Promise<SendUserOperationResult<TEntryPointVersion>> {\n const client = clientHeaderTrack(client_, \"sendUserOperation\");\n const { account = client.account, context, overrides } = args;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"sendUserOperation\",\n client,\n );\n }\n\n const uoStruct = await buildUserOperation(client, {\n uo: args.uo,\n account,\n context,\n overrides,\n });\n\n return _sendUserOperation(client, {\n account,\n uoStruct,\n context,\n overrides,\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signMessage.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signMessage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAQ/D,MAAM,CAAC,MAAM,WAAW,GASJ,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,CAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, SignableMessage, Transport } from \"viem\";\nimport type {\n GetAccountParameter,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\n\nexport type SignMessageParameters<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined
|
|
1
|
+
{"version":3,"file":"signMessage.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signMessage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAQ/D,MAAM,CAAC,MAAM,WAAW,GASJ,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,CAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, SignableMessage, Transport } from \"viem\";\nimport type {\n GetAccountParameter,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\n\nexport type SignMessageParameters<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n> = { message: SignableMessage } & GetAccountParameter<TAccount>;\n\nexport const signMessage: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: SignMessageParameters<TAccount>,\n) => Promise<Hex> = async (client, { account = client.account, message }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n return account.signMessageWith6492({ message });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signTypedData.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAY/D,MAAM,CAAC,MAAM,aAAa,GAWN,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;IAC5E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type {\n Chain,\n Client,\n Hex,\n Transport,\n TypedData,\n TypedDataDefinition,\n} from \"viem\";\nimport type {\n GetAccountParameter,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\n\nexport type SignTypedDataParameters<\n TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined
|
|
1
|
+
{"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signTypedData.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAY/D,MAAM,CAAC,MAAM,aAAa,GAWN,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;IAC5E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type {\n Chain,\n Client,\n Hex,\n Transport,\n TypedData,\n TypedDataDefinition,\n} from \"viem\";\nimport type {\n GetAccountParameter,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\n\nexport type SignTypedDataParameters<\n TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n> = {\n typedData: TypedDataDefinition<TTypedData, TPrimaryType>;\n} & GetAccountParameter<TAccount>;\n\nexport const signTypedData: <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,\n) => Promise<Hex> = async (client, { account = client.account, typedData }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n return account.signTypedDataWith6492(typedData);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signUserOperation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,MAAM,CAAC,KAAK,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/signUserOperation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CASrC,MAA4C,EAC5C,IAA2C;IAE3C,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAEnD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,OAAO,MAAM,MAAM,CAAC,UAAU;SAC3B,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE;QAChC,GAAG,IAAI;QACP,OAAO;QACP,MAAM;QACN,OAAO;KACR,CAAC;SACD,IAAI,CAAC,iBAAiB,CAAC;SACvB,IAAI,CAAC,WAAW,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import type { Chain, Client, Transport } from \"viem\";\nimport type {\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport {\n ChainNotFoundError,\n IncompatibleClientError,\n} from \"../../errors/client.js\";\nimport type { UserOperationRequest } from \"../../types\";\nimport { deepHexlify, resolveProperties } from \"../../utils/index.js\";\nimport type { SignUserOperationParameters } from \"./types\";\n\nexport async function signUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: SignUserOperationParameters<TAccount>,\n): Promise<UserOperationRequest<TEntryPointVersion>> {\n const { account = client.account, context } = args;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"signUserOperation\",\n client,\n );\n }\n\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n\n return await client.middleware\n .signUserOperation(args.uoStruct, {\n ...args,\n account,\n client,\n context,\n })\n .then(resolveProperties)\n .then(deepHexlify);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/types.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/types.ts"],"names":[],"mappings":";AAqKA,mCAAmC","sourcesContent":["import type { Hex, RpcTransactionRequest } from \"viem\";\nimport type {\n GetAccountParameter,\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport type { UpgradeToData } from \"../../client/types\";\nimport type { EntryPointVersion } from \"../../entrypoint/types\";\nimport type {\n BatchUserOperationCallData,\n UserOperationCallData,\n UserOperationOverridesParameter,\n UserOperationRequest,\n UserOperationStruct,\n} from \"../../types\";\nimport type { IsUndefined } from \"../../utils\";\n\n// [!region UpgradeAccountParams]\nexport type UpgradeAccountParams<\n TAccount extends SmartContractAccount | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = {\n upgradeTo: UpgradeToData;\n waitForTx?: boolean;\n} & GetAccountParameter<TAccount> &\n GetContextParameter<TContext> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n// [!endregion UpgradeAccountParams]\n\n// [!region SendUserOperationParameters]\nexport type SendUserOperationParameters<\n TAccount extends SmartContractAccount | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = {\n uo: UserOperationCallData | BatchUserOperationCallData;\n} & GetAccountParameter<TAccount> &\n GetContextParameter<TContext> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n// [!endregion SendUserOperationParameters]\n\n// [!region BuildUserOperationParameters]\nexport type BuildUserOperationParameters<\n TAccount extends SmartContractAccount | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = SendUserOperationParameters<TAccount, TContext, TEntryPointVersion>;\n// [!endregion BuildUserOperationParameters]\n\n// [!region SignUserOperationParameters]\nexport type SignUserOperationParameters<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> = {\n uoStruct: UserOperationStruct<TEntryPointVersion>;\n} & GetAccountParameter<TAccount> &\n GetContextParameter<TContext>;\n// [!endregion SignUserOperationParameters]\n\n// [!region SendTransactionsParameters]\nexport type SendTransactionsParameters<\n TAccount extends SmartContractAccount | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = {\n requests: RpcTransactionRequest[];\n} & GetAccountParameter<TAccount> &\n GetContextParameter<TContext> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n// [!endregion SendTransactionsParameters]\n\n// [!region BuildTransactionParameters]\nexport type BuildTransactionParameters<\n TAccount extends SmartContractAccount | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = SendTransactionsParameters<TAccount, TContext, TEntryPointVersion>;\n// [!endregion BuildTransactionParameters]\n\n// [!region DropAndReplaceUserOperationParameters]\nexport type DropAndReplaceUserOperationParameters<\n TAccount extends SmartContractAccount | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = {\n uoToDrop: UserOperationRequest<TEntryPointVersion>;\n} & GetAccountParameter<TAccount> &\n GetContextParameter<TContext> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n// [!endregion DropAndReplaceUserOperationParameters]\n\n// [!region WaitForUserOperationTxParameters]\nexport type WaitForUserOperationTxParameters = {\n hash: Hex;\n /**\n * Exponential backoff paramters that can be used to override\n * the configuration on the client. If not provided, this method\n * will use the paramters passed via the `opts` parameter on the\n * smart account client.\n */\n retries?: {\n /**\n * the base retry interval or delay between requests\n */\n intervalMs: number;\n /**\n * the multiplier to exponentiate based on the number retries\n * setting this to one will result in a linear backoff\n */\n multiplier: number;\n /** the maximum number of retries before failing */\n maxRetries: number;\n };\n};\n// [!endregion WaitForUserOperationTxParameters]\n\n// [!region BuildUserOperationFromTransactionsResult]\nexport type BuildUserOperationFromTransactionsResult<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n> = {\n uoStruct: UserOperationStruct<TEntryPointVersion>;\n batch: BatchUserOperationCallData;\n} & UserOperationOverridesParameter<TEntryPointVersion, true>;\n// [!endregion BuildUserOperationFromTransactionsResult]\n\n// [!region UserOperationContext]\nexport type UserOperationContext = Record<string, any>;\n// [!endregion UserOperationContext]\n\n// [!region GetContextParameter]\nexport type GetContextParameter<\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> =\n IsUndefined<TContext> extends true\n ? {\n context?: TContext;\n }\n : { context: TContext };\n// [!endregion GetContextParameter]\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgradeAccount.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/upgradeAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,cAAc,GAYN,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC3C,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAC5D,MAAM,EACJ,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,EACT,SAAS,EACT,SAAS,EACT,OAAO,GACR,GAAG,IAAI,CAAC;IAET,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,gBAAgB,EAChB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IAE1E,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC;QAC7D,gBAAgB,EAAE,kBAAkB;QACpC,iBAAiB,EAAE,kBAAkB;KACtC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE;QAC7C,EAAE,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,IAAI,EAAE,iBAAiB;SACxB;QACD,OAAO;QACP,SAAS;QACT,OAAO;KACR,CAAC,CAAC;IAEH,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,GAAG,MAAM,+BAA+B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hash, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../../account/smartContractAccount.js\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { sendUserOperation } from \"./sendUserOperation.js\";\nimport type { UpgradeAccountParams, UserOperationContext } from \"./types.js\";\nimport { waitForUserOperationTransaction } from \"./waitForUserOperationTransacation.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\nexport const upgradeAccount: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined
|
|
1
|
+
{"version":3,"file":"upgradeAccount.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/upgradeAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,cAAc,GAYN,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC3C,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAC5D,MAAM,EACJ,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,EACT,SAAS,EACT,SAAS,EACT,OAAO,GACR,GAAG,IAAI,CAAC;IAET,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,gBAAgB,EAChB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IAE1E,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC;QAC7D,gBAAgB,EAAE,kBAAkB;QACpC,iBAAiB,EAAE,kBAAkB;KACtC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE;QAC7C,EAAE,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,IAAI,EAAE,iBAAiB;SACxB;QACD,OAAO;QACP,SAAS;QACT,OAAO;KACR,CAAC,CAAC;IAEH,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,GAAG,MAAM,+BAA+B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hash, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../../account/smartContractAccount.js\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { AccountNotFoundError } from \"../../errors/account.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { sendUserOperation } from \"./sendUserOperation.js\";\nimport type { UpgradeAccountParams, UserOperationContext } from \"./types.js\";\nimport { waitForUserOperationTransaction } from \"./waitForUserOperationTransacation.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\nexport const upgradeAccount: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: UpgradeAccountParams<TAccount, TContext>,\n) => Promise<Hash> = async (client_, args) => {\n const client = clientHeaderTrack(client_, \"upgradeAccount\");\n const {\n account = client.account,\n upgradeTo,\n overrides,\n waitForTx,\n context,\n } = args;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"upgradeAccount\",\n client,\n );\n }\n\n const { implAddress: accountImplAddress, initializationData } = upgradeTo;\n\n const encodeUpgradeData = await account.encodeUpgradeToAndCall({\n upgradeToAddress: accountImplAddress,\n upgradeToInitData: initializationData,\n });\n\n const result = await sendUserOperation(client, {\n uo: {\n target: account.address,\n data: encodeUpgradeData,\n },\n account,\n overrides,\n context,\n });\n\n let hash = result.hash;\n if (waitForTx) {\n hash = await waitForUserOperationTransaction(client, result);\n }\n\n return hash;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForUserOperationTransacation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/waitForUserOperationTransacation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAMxB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC1C,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,iCAAiC,CAAC,CAAC;IAC7E,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,iCAAiC,EACjC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EACJ,IAAI,EACJ,OAAO,GAAG;QACR,UAAU,EAAE,MAAM,CAAC,YAAY;QAC/B,UAAU,EAAE,MAAM,CAAC,iBAAiB;QACpC,UAAU,EAAE,MAAM,CAAC,iBAAiB;KACrC,GACF,GAAG,IAAI,CAAC;IAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,2BAA2B,GAC/B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;QAEtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5B,UAAU,CAAC,OAAO,EAAE,2BAA2B,CAAC,CACjD,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,MAAM;aACzB,uBAAuB,CAAC,IAAqB,CAAC;aAC9C,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,CAAC,KAAK,CACV,qFAAqF,IAAI,KAAK,CAAC,EAAE,CAClG,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { FailedToFindTransactionError } from \"../../errors/transaction.js\";\nimport { Logger } from \"../../logger.js\";\nimport type { WaitForUserOperationTxParameters } from \"./types.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\n/**\n * Waits for a user operation transaction to be confirmed by checking the receipt periodically until it is found or a maximum number of retries is reached.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with waitForUserOperationTransaction\n * const client = createSmartAccountClient(...);\n * const result = await client.waitForUserOperationTransaction({\n * hash: \"0x...\",\n * retries: {...} // optional param to configure the retry amounts\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, any>} client_ The client instance used to interact with the blockchain\n * @param {WaitForUserOperationTxParameters} args The parameters for the transaction to wait for\n * @param {Hex} args.hash The transaction hash to wait for\n * @param {WaitForUserOperationTxParameters[\"retries\"]} [args.retries] Optional retry parameters\n * @param {number} [args.retries.maxRetries] The maximum number of retry attempts\n * @param {number} [args.retries.intervalMs] The interval in milliseconds between retries\n * @param {number} [args.retries.multiplier] The multiplier for the interval between retries\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash when the transaction is confirmed\n */\nexport const waitForUserOperationTransaction: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined
|
|
1
|
+
{"version":3,"file":"waitForUserOperationTransacation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/waitForUserOperationTransacation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAMxB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC1C,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,iCAAiC,CAAC,CAAC;IAC7E,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,iCAAiC,EACjC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EACJ,IAAI,EACJ,OAAO,GAAG;QACR,UAAU,EAAE,MAAM,CAAC,YAAY;QAC/B,UAAU,EAAE,MAAM,CAAC,iBAAiB;QACpC,UAAU,EAAE,MAAM,CAAC,iBAAiB;KACrC,GACF,GAAG,IAAI,CAAC;IAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,2BAA2B,GAC/B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;QAEtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5B,UAAU,CAAC,OAAO,EAAE,2BAA2B,CAAC,CACjD,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,MAAM;aACzB,uBAAuB,CAAC,IAAqB,CAAC;aAC9C,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,CAAC,KAAK,CACV,qFAAqF,IAAI,KAAK,CAAC,EAAE,CAClG,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { FailedToFindTransactionError } from \"../../errors/transaction.js\";\nimport { Logger } from \"../../logger.js\";\nimport type { WaitForUserOperationTxParameters } from \"./types.js\";\nimport { clientHeaderTrack } from \"../../index.js\";\n\n/**\n * Waits for a user operation transaction to be confirmed by checking the receipt periodically until it is found or a maximum number of retries is reached.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with waitForUserOperationTransaction\n * const client = createSmartAccountClient(...);\n * const result = await client.waitForUserOperationTransaction({\n * hash: \"0x...\",\n * retries: {...} // optional param to configure the retry amounts\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, any>} client_ The client instance used to interact with the blockchain\n * @param {WaitForUserOperationTxParameters} args The parameters for the transaction to wait for\n * @param {Hex} args.hash The transaction hash to wait for\n * @param {WaitForUserOperationTxParameters[\"retries\"]} [args.retries] Optional retry parameters\n * @param {number} [args.retries.maxRetries] The maximum number of retry attempts\n * @param {number} [args.retries.intervalMs] The interval in milliseconds between retries\n * @param {number} [args.retries.multiplier] The multiplier for the interval between retries\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash when the transaction is confirmed\n */\nexport const waitForUserOperationTransaction: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n>(\n client: Client<TTransport, TChain, any>,\n args: WaitForUserOperationTxParameters,\n) => Promise<Hex> = async (client_, args) => {\n const client = clientHeaderTrack(client_, \"waitForUserOperationTransaction\");\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"waitForUserOperationTransaction\",\n client,\n );\n }\n\n const {\n hash,\n retries = {\n maxRetries: client.txMaxRetries,\n intervalMs: client.txRetryIntervalMs,\n multiplier: client.txRetryMultiplier,\n },\n } = args;\n\n for (let i = 0; i < retries.maxRetries; i++) {\n const txRetryIntervalWithJitterMs =\n retries.intervalMs * Math.pow(retries.multiplier, i) +\n Math.random() * 100;\n\n await new Promise((resolve) =>\n setTimeout(resolve, txRetryIntervalWithJitterMs),\n );\n\n const receipt = await client\n .getUserOperationReceipt(hash as `0x${string}`)\n .catch((e) => {\n Logger.error(\n `[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}`,\n );\n });\n\n if (receipt) {\n return receipt?.receipt.transactionHash;\n }\n }\n\n throw new FailedToFindTransactionError(hash);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBreadcrumb.js","sourceRoot":"","sources":["../../../src/client/addBreadcrumb.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAEtD,SAAS,gBAAgB,CACvB,CAAI;IAEJ,OAAO,cAAc,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAe,MAAS,EAAE,KAAa;IACtE,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * The symbol that is used to add a breadcrumb to the headers. Is an optional\n * function that is used to add a breadcrumb to the headers.\n */\nexport const ADD_BREADCRUMB = Symbol(\"addBreadcrumb\");\n\nfunction hasAddBreadcrumb<A extends {}>(\n a: A
|
|
1
|
+
{"version":3,"file":"addBreadcrumb.js","sourceRoot":"","sources":["../../../src/client/addBreadcrumb.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAEtD,SAAS,gBAAgB,CACvB,CAAI;IAEJ,OAAO,cAAc,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAe,MAAS,EAAE,KAAa;IACtE,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * The symbol that is used to add a breadcrumb to the headers. Is an optional\n * function that is used to add a breadcrumb to the headers.\n */\nexport const ADD_BREADCRUMB = Symbol(\"addBreadcrumb\");\n\nfunction hasAddBreadcrumb<A extends {}>(\n a: A,\n): a is A & { [ADD_BREADCRUMB]: (breadcrumb: string) => A } {\n return ADD_BREADCRUMB in a;\n}\n\n/**\n * Add a crumb to the breadcrumb.\n *\n * @param {X} client Clients are somethings like viem, that we are adding breadcrumbs to, and could be owning the transport. Usually a alchemy client.\n * @param {string} crumb The crumb to add to the breadcrumb\n * @returns {Function} A function that updates the headers\n */\nexport function clientHeaderTrack<X extends {}>(client: X, crumb: string): X {\n if (hasAddBreadcrumb(client)) {\n return client[ADD_BREADCRUMB](crumb);\n }\n return client;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundlerClient.js","sourceRoot":"","sources":["../../../src/client/bundlerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,aAAa,GAUd,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,cAAc,GAGf,MAAM,+BAA+B,CAAC;AAWvC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAIpB,CACtB,MAA8B,EACZ,EAAE;IACpB,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC,CAAC;AAaF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAA4C;IAE5C,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IACD,MAAM,EACJ,GAAG,GAAG,gBAAgB,EACtB,IAAI,GAAG,uBAAuB,EAC9B,IAAI,GAAG,eAAe,GACvB,GAAG,IAAI,CAAC;IAET,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,iBAAiB,GAAG,SAAS,CAAC;QAClC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,eAAe,EAAE,IAAI,CAAC,eAAe;KACtC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG;QACrB,GAAG,IAAI;QACP,GAAG;QACH,IAAI;QACJ,IAAI;KACL,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE;QACnB,IAAI,iBAAiB,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC7C,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,iBAAiB,CAAC,KAG9D,CAAC;YAEF,MAAM,YAAY,GAAG,aAAa,IAAI,EAAE,CAAC;YAEzC,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAC9C,YAAY,CAAC,OAAO,GAAG;oBACrB,GAAG,YAAY,CAAC,OAAO;oBACvB,wBAAwB,EAAE,OAAO;iBAClC,CAAC;YACJ,CAAC;YAED,OAAO,YAAY,CAAmB;gBACpC,GAAG,cAAc;gBACjB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACnB,GAAG,iBAAiB,CAAC,MAAM;oBAC3B,YAAY;iBACb,CAAC;aACH,CAAC,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAmB,cAAc,CAAC,CAAC;IACxD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import {\n createClient,\n http,\n publicActions,\n type Chain,\n type Client,\n type FallbackTransport,\n type HttpTransportConfig,\n type PublicActions,\n type PublicClient,\n type PublicClientConfig,\n type PublicRpcSchema,\n type Transport,\n} from \"viem\";\nimport { ChainNotFoundError } from \"../errors/client.js\";\nimport { VERSION } from \"../version.js\";\nimport {\n bundlerActions,\n type BundlerActions,\n type BundlerRpcSchema,\n} from \"./decorators/bundlerClient.js\";\n\n// [!region BundlerClient]\nexport type BundlerClient<T extends Transport = Transport> = Client<\n T,\n Chain,\n undefined,\n [...PublicRpcSchema, ...BundlerRpcSchema],\n PublicActions<T, Chain> & BundlerActions\n>;\n\n/**\n * Creates a bundler client from an existing public client with the provided transport and chain.\n *\n * @example\n * ```ts\n * import { createPublicClient } from \"viem\";\n * import { createBundlerClientFromExisting } from \"@aa-sdk/core\";\n *\n * const publicClient = createPublicClient(...);\n * const bundlerClient = createBundlerClientFromExisting(publicClient);\n * ```\n *\n * @param {PublicClient<T, Chain>} client The existing public client to be extended with bundler actions\n * @returns {BundlerClient<T>} A bundler client that extends the functionality of the provided public client\n */\nexport const createBundlerClientFromExisting: <\n T extends Transport | FallbackTransport = Transport
|
|
1
|
+
{"version":3,"file":"bundlerClient.js","sourceRoot":"","sources":["../../../src/client/bundlerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,aAAa,GAUd,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,cAAc,GAGf,MAAM,+BAA+B,CAAC;AAWvC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAIpB,CACtB,MAA8B,EACZ,EAAE;IACpB,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC,CAAC;AAaF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAA4C;IAE5C,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IACD,MAAM,EACJ,GAAG,GAAG,gBAAgB,EACtB,IAAI,GAAG,uBAAuB,EAC9B,IAAI,GAAG,eAAe,GACvB,GAAG,IAAI,CAAC;IAET,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,iBAAiB,GAAG,SAAS,CAAC;QAClC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,eAAe,EAAE,IAAI,CAAC,eAAe;KACtC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG;QACrB,GAAG,IAAI;QACP,GAAG;QACH,IAAI;QACJ,IAAI;KACL,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE;QACnB,IAAI,iBAAiB,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC7C,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,iBAAiB,CAAC,KAG9D,CAAC;YAEF,MAAM,YAAY,GAAG,aAAa,IAAI,EAAE,CAAC;YAEzC,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAC9C,YAAY,CAAC,OAAO,GAAG;oBACrB,GAAG,YAAY,CAAC,OAAO;oBACvB,wBAAwB,EAAE,OAAO;iBAClC,CAAC;YACJ,CAAC;YAED,OAAO,YAAY,CAAmB;gBACpC,GAAG,cAAc;gBACjB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACnB,GAAG,iBAAiB,CAAC,MAAM;oBAC3B,YAAY;iBACb,CAAC;aACH,CAAC,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAmB,cAAc,CAAC,CAAC;IACxD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import {\n createClient,\n http,\n publicActions,\n type Chain,\n type Client,\n type FallbackTransport,\n type HttpTransportConfig,\n type PublicActions,\n type PublicClient,\n type PublicClientConfig,\n type PublicRpcSchema,\n type Transport,\n} from \"viem\";\nimport { ChainNotFoundError } from \"../errors/client.js\";\nimport { VERSION } from \"../version.js\";\nimport {\n bundlerActions,\n type BundlerActions,\n type BundlerRpcSchema,\n} from \"./decorators/bundlerClient.js\";\n\n// [!region BundlerClient]\nexport type BundlerClient<T extends Transport = Transport> = Client<\n T,\n Chain,\n undefined,\n [...PublicRpcSchema, ...BundlerRpcSchema],\n PublicActions<T, Chain> & BundlerActions\n>;\n\n/**\n * Creates a bundler client from an existing public client with the provided transport and chain.\n *\n * @example\n * ```ts\n * import { createPublicClient } from \"viem\";\n * import { createBundlerClientFromExisting } from \"@aa-sdk/core\";\n *\n * const publicClient = createPublicClient(...);\n * const bundlerClient = createBundlerClientFromExisting(publicClient);\n * ```\n *\n * @param {PublicClient<T, Chain>} client The existing public client to be extended with bundler actions\n * @returns {BundlerClient<T>} A bundler client that extends the functionality of the provided public client\n */\nexport const createBundlerClientFromExisting: <\n T extends Transport | FallbackTransport = Transport,\n>(\n client: PublicClient<T, Chain>,\n) => BundlerClient<T> = <T extends Transport | FallbackTransport = Transport>(\n client: PublicClient<T, Chain>,\n): BundlerClient<T> => {\n return client.extend(bundlerActions);\n};\n// [!endregion BundlerClient]\n\n/**\n * Creates a PublicClient with methods for calling Bundler RPC methods\n *\n * @param {PublicClientConfig<TTransport, Chain> & { type?: string }} args - configuration for the client\n * @returns {BundlerClient<TTransport>} a PublicClient with methods for calling Bundler RPC methods\n */\nexport function createBundlerClient<TTransport extends Transport>(\n args: PublicClientConfig<TTransport, Chain> & { type?: string },\n): BundlerClient<TTransport>;\n\n/**\n * Creates a Bundler Client using the provided configuration parameters, including chain and optional type.\n *\n * @example\n * ```ts\n * import { createBundlerClient } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n *\n * const client = createBundlerClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * });\n * ```\n *\n * @param {PublicClientConfig & { type?: string }} args Configuration for creating the Bundler Client, including parameters for the chain, transport, and optional type\n * @returns {BundlerClient} The created Bundler Client with extended public and bundler actions\n */\nexport function createBundlerClient(\n args: PublicClientConfig & { type?: string },\n): BundlerClient {\n if (!args.chain) {\n throw new ChainNotFoundError();\n }\n const {\n key = \"bundler-public\",\n name = \"Public Bundler Client\",\n type = \"bundlerClient\",\n } = args;\n\n const { transport, ...opts } = args;\n const resolvedTransport = transport({\n chain: args.chain,\n pollingInterval: opts.pollingInterval,\n });\n\n const baseParameters = {\n ...args,\n key,\n name,\n type,\n };\n\n const client = (() => {\n if (resolvedTransport.config.type === \"http\") {\n const { url, fetchOptions: fetchOptions_ } = resolvedTransport.value as {\n fetchOptions: HttpTransportConfig[\"fetchOptions\"];\n url: string;\n };\n\n const fetchOptions = fetchOptions_ ?? {};\n\n if (url.toLowerCase().indexOf(\"alchemy\") > -1) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n \"Alchemy-AA-Sdk-Version\": VERSION,\n };\n }\n\n return createClient<Transport, Chain>({\n ...baseParameters,\n transport: http(url, {\n ...resolvedTransport.config,\n fetchOptions,\n }),\n });\n }\n\n return createClient<Transport, Chain>(baseParameters);\n })();\n\n return client.extend(publicActions).extend(bundlerActions);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundlerClient.js","sourceRoot":"","sources":["../../../../src/client/decorators/bundlerClient.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AA6FrF,8BAA8B;AAE9B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GASL,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjC,wBAAwB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,CACrE,wBAAwB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IAC1E,oBAAoB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAClD,oBAAoB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACvD,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACrC,sBAAsB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC;IAC1C,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAAC,uBAAuB,CAAC,MAAM,CAAC;IACpE,uBAAuB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACtC,uBAAuB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC,CAAC","sourcesContent":["import type {\n Address,\n Chain,\n Client,\n Hash,\n PublicRpcSchema,\n RpcStateOverride,\n StateOverride,\n Transport,\n} from \"viem\";\nimport { estimateUserOperationGas } from \"../../actions/bundler/estimateUserOperationGas.js\";\nimport { getSupportedEntryPoints } from \"../../actions/bundler/getSupportedEntryPoints.js\";\nimport { getUserOperationByHash } from \"../../actions/bundler/getUserOperationByHash.js\";\nimport { getUserOperationReceipt } from \"../../actions/bundler/getUserOperationReceipt.js\";\nimport { sendRawUserOperation } from \"../../actions/bundler/sendRawUserOperation.js\";\nimport type { EntryPointVersion } from \"../../entrypoint/types.js\";\nimport type {\n UserOperationEstimateGasResponse,\n UserOperationReceipt,\n UserOperationRequest,\n UserOperationResponse,\n} from \"../../types.js\";\n\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace\nexport type BundlerRpcSchema = [\n {\n Method: \"eth_sendUserOperation\";\n Parameters: [UserOperationRequest, Address];\n ReturnType: Hash;\n },\n {\n Method: \"eth_estimateUserOperationGas\";\n Parameters: [UserOperationRequest, Address, RpcStateOverride?];\n ReturnType: UserOperationEstimateGasResponse;\n },\n {\n Method: \"eth_getUserOperationReceipt\";\n Parameters: [Hash];\n ReturnType: UserOperationReceipt | null;\n },\n {\n Method: \"eth_getUserOperationByHash\";\n Parameters: [Hash];\n ReturnType: UserOperationResponse | null;\n },\n {\n Method: \"eth_supportedEntryPoints\";\n Parameters: [];\n ReturnType: Address[];\n }
|
|
1
|
+
{"version":3,"file":"bundlerClient.js","sourceRoot":"","sources":["../../../../src/client/decorators/bundlerClient.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AA6FrF,8BAA8B;AAE9B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GASL,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjC,wBAAwB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,CACrE,wBAAwB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IAC1E,oBAAoB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAClD,oBAAoB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACvD,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACrC,sBAAsB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC;IAC1C,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAAC,uBAAuB,CAAC,MAAM,CAAC;IACpE,uBAAuB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACtC,uBAAuB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC,CAAC","sourcesContent":["import type {\n Address,\n Chain,\n Client,\n Hash,\n PublicRpcSchema,\n RpcStateOverride,\n StateOverride,\n Transport,\n} from \"viem\";\nimport { estimateUserOperationGas } from \"../../actions/bundler/estimateUserOperationGas.js\";\nimport { getSupportedEntryPoints } from \"../../actions/bundler/getSupportedEntryPoints.js\";\nimport { getUserOperationByHash } from \"../../actions/bundler/getUserOperationByHash.js\";\nimport { getUserOperationReceipt } from \"../../actions/bundler/getUserOperationReceipt.js\";\nimport { sendRawUserOperation } from \"../../actions/bundler/sendRawUserOperation.js\";\nimport type { EntryPointVersion } from \"../../entrypoint/types.js\";\nimport type {\n UserOperationEstimateGasResponse,\n UserOperationReceipt,\n UserOperationRequest,\n UserOperationResponse,\n} from \"../../types.js\";\n\n// Reference: https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace\nexport type BundlerRpcSchema = [\n {\n Method: \"eth_sendUserOperation\";\n Parameters: [UserOperationRequest, Address];\n ReturnType: Hash;\n },\n {\n Method: \"eth_estimateUserOperationGas\";\n Parameters: [UserOperationRequest, Address, RpcStateOverride?];\n ReturnType: UserOperationEstimateGasResponse;\n },\n {\n Method: \"eth_getUserOperationReceipt\";\n Parameters: [Hash];\n ReturnType: UserOperationReceipt | null;\n },\n {\n Method: \"eth_getUserOperationByHash\";\n Parameters: [Hash];\n ReturnType: UserOperationResponse | null;\n },\n {\n Method: \"eth_supportedEntryPoints\";\n Parameters: [];\n ReturnType: Address[];\n },\n];\n\n// [!region BundlerActions]\nexport type BundlerActions = {\n /**\n * calls `eth_estimateUserOperationGas` and returns the result\n *\n * @param request - the UserOperationRequest to estimate gas for\n * @param entryPoint - the entry point address the op will be sent to\n * @param stateOverride - the state override to use for the estimation\n * @returns the gas estimates for the given response\n */\n estimateUserOperationGas<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n >(\n request: UserOperationRequest<TEntryPointVersion>,\n entryPoint: Address,\n stateOverride?: StateOverride,\n ): Promise<UserOperationEstimateGasResponse<TEntryPointVersion>>;\n\n /**\n * calls `eth_sendUserOperation` and returns the hash of the sent UserOperation\n *\n * @param request - the UserOperationRequest to send\n * @param entryPoint - the entry point address the op will be sent to\n * @returns the hash of the sent UserOperation\n */\n sendRawUserOperation<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n >(\n request: UserOperationRequest<TEntryPointVersion>,\n entryPoint: Address,\n ): Promise<Hash>;\n\n /**\n * calls `eth_getUserOperationByHash` and returns the UserOperationResponse\n *\n * @param hash - the hash of the UserOperation to fetch\n * @returns - the user operation if found or null\n */\n getUserOperationByHash(hash: Hash): Promise<UserOperationResponse | null>;\n\n /**\n * calls `eth_getUserOperationReceipt` and returns the UserOperationReceipt\n *\n * @param hash - the hash of the UserOperation to get the receipt for\n * @returns - a user operation receipt or null if not found\n */\n getUserOperationReceipt(hash: Hash): Promise<UserOperationReceipt | null>;\n\n /**\n * calls `eth_supportedEntryPoints` and returns the entry points the RPC supports\n *\n * @returns - an array of the entrypoint addresses supported\n */\n getSupportedEntryPoints(): Promise<Address[]>;\n};\n// [!endregion BundlerActions]\n\n/**\n * A viem client decorator that provides Bundler specific actions.\n * These actions include estimating gas for user operations, sending raw user operations, retrieving user operations by hash, getting supported entry points, and getting user operation receipts.\n *\n * NOTE: this is already added to the client returned from `createBundlerClient`\n *\n * @param {TClient} client The client instance that will be used to perform bundler actions\n * @returns {BundlerActions} An object containing various bundler-related actions that can be executed using the provided client\n */\nexport const bundlerActions: <\n TClient extends Client<\n Transport,\n Chain | undefined,\n any,\n [...PublicRpcSchema, ...BundlerRpcSchema]\n >,\n>(\n client: TClient,\n) => BundlerActions = (client) => ({\n estimateUserOperationGas: async (request, entryPoint, stateOverride) =>\n estimateUserOperationGas(client, { request, entryPoint, stateOverride }),\n sendRawUserOperation: async (request, entryPoint) =>\n sendRawUserOperation(client, { request, entryPoint }),\n getUserOperationByHash: async (hash) =>\n getUserOperationByHash(client, { hash }),\n getSupportedEntryPoints: async () => getSupportedEntryPoints(client),\n getUserOperationReceipt: async (hash) =>\n getUserOperationReceipt(client, { hash }),\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../../src/client/decorators/smartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAQN,MAAM,MAAM,CAAC;AAMd,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EACL,8BAA8B,GAE/B,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,OAAO,EACL,WAAW,GAEZ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,aAAa,GAEd,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAapF,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,gEAAgE,CAAC;AAkFjH,uCAAuC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAW2B,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5E,kBAAkB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC9D,wBAAwB,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CACrD,wBAAwB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;IAC5D,yBAAyB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5E,8BAA8B,EAAE,CAAC,IAAI,EAAE,EAAE,CACvC,8BAA8B,CAAC,MAAM,EAAE,IAAI,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5D,2BAA2B,EAAE,CAAC,IAAI,EAAE,EAAE,CACpC,2BAA2B,CAAC,MAAM,EAAE,IAAI,CAAC;IAC3C,eAAe,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CAC5C,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;IACnD,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5D,+BAA+B,EAAE,CAAC,IAAI,EAAE,EAAE,CACxC,+BAA+B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5D,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;IACtD,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC;IAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC;IAChD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI;AACrD,gDAAgD;AAChD,yBAAyB,CAAC,SAAS,CAAC,CACrC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACvB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChB,OAAO,KAAK,CAAC;AACf,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC","sourcesContent":["import {\n type Address,\n type Chain,\n type Client,\n type Hex,\n type SendTransactionParameters,\n type Transport,\n type TypedData,\n} from \"viem\";\nimport type {\n GetAccountParameter,\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { buildUserOperation } from \"../../actions/smartAccount/buildUserOperation.js\";\nimport { buildUserOperationFromTx } from \"../../actions/smartAccount/buildUserOperationFromTx.js\";\nimport { buildUserOperationFromTxs } from \"../../actions/smartAccount/buildUserOperationFromTxs.js\";\nimport {\n checkGasSponsorshipEligibility,\n type CheckGasSponsorshipEligibilityResult,\n} from \"../../actions/smartAccount/checkGasSponsorshipEligibility.js\";\nimport { dropAndReplaceUserOperation } from \"../../actions/smartAccount/dropAndReplaceUserOperation.js\";\nimport { getAddress } from \"../../actions/smartAccount/getAddress.js\";\nimport { sendTransaction } from \"../../actions/smartAccount/sendTransaction.js\";\nimport { sendTransactions } from \"../../actions/smartAccount/sendTransactions.js\";\nimport { sendUserOperation } from \"../../actions/smartAccount/sendUserOperation.js\";\nimport {\n signMessage,\n type SignMessageParameters,\n} from \"../../actions/smartAccount/signMessage.js\";\nimport {\n signTypedData,\n type SignTypedDataParameters,\n} from \"../../actions/smartAccount/signTypedData.js\";\nimport { signUserOperation } from \"../../actions/smartAccount/signUserOperation.js\";\nimport type {\n BuildTransactionParameters,\n BuildUserOperationFromTransactionsResult,\n BuildUserOperationParameters,\n DropAndReplaceUserOperationParameters,\n SendTransactionsParameters,\n SendUserOperationParameters,\n SignUserOperationParameters,\n UpgradeAccountParams,\n UserOperationContext,\n WaitForUserOperationTxParameters,\n} from \"../../actions/smartAccount/types\";\nimport { upgradeAccount } from \"../../actions/smartAccount/upgradeAccount.js\";\nimport { waitForUserOperationTransaction } from \"../../actions/smartAccount/waitForUserOperationTransacation.js\";\nimport type {\n UserOperationOverrides,\n UserOperationRequest,\n UserOperationStruct,\n} from \"../../types\";\nimport type { IsUndefined } from \"../../utils\";\nimport type { SendUserOperationResult } from \"../types\";\n\n//#region SmartAccountClientActions\nexport type BaseSmartAccountClientActions<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n buildUserOperation: (\n args: BuildUserOperationParameters<TAccount, TContext>\n ) => Promise<UserOperationStruct<TEntryPointVersion>>;\n buildUserOperationFromTx: (\n args: SendTransactionParameters<TChain, TAccount>,\n overrides?: UserOperationOverrides<TEntryPointVersion>,\n context?: TContext\n ) => Promise<UserOperationStruct<TEntryPointVersion>>;\n buildUserOperationFromTxs: (\n args: BuildTransactionParameters<TAccount, TContext>\n ) => Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>>;\n checkGasSponsorshipEligibility: <\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n >(\n args: SendUserOperationParameters<TAccount, TContext>\n ) => Promise<\n CheckGasSponsorshipEligibilityResult<TAccount, TEntryPointVersion>\n >;\n signUserOperation: (\n args: SignUserOperationParameters<TAccount, TEntryPointVersion, TContext>\n ) => Promise<UserOperationRequest<TEntryPointVersion>>;\n dropAndReplaceUserOperation: (\n args: DropAndReplaceUserOperationParameters<TAccount, TContext>\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n // TODO: for v4 we should combine override and context into an `opts` parameter\n // which wraps both of these properties so we can use GetContextParameter\n sendTransaction: <TChainOverride extends Chain | undefined = undefined>(\n args: SendTransactionParameters<TChain, TAccount, TChainOverride>,\n overrides?: UserOperationOverrides<TEntryPointVersion>,\n context?: TContext\n ) => Promise<Hex>;\n sendTransactions: (\n args: SendTransactionsParameters<TAccount, TContext>\n ) => Promise<Hex>;\n sendUserOperation: (\n args: SendUserOperationParameters<\n TAccount,\n TContext,\n GetEntryPointFromAccount<TAccount>\n >\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n waitForUserOperationTransaction: (\n args: WaitForUserOperationTxParameters\n ) => Promise<Hex>;\n upgradeAccount: (\n args: UpgradeAccountParams<TAccount, TContext>\n ) => Promise<Hex>;\n signMessage: (args: SignMessageParameters<TAccount>) => Promise<Hex>;\n signTypedData: <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string\n >(\n args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>\n ) => Promise<Hex>;\n} & (IsUndefined<TAccount> extends false\n ? { getAddress: () => Address }\n : {\n getAddress: (args: GetAccountParameter<TAccount>) => Address;\n });\n// #endregion SmartAccountClientActions\n\n/**\n * Provides a set of smart account client actions to decorate the provided client. These actions include building and signing user operations, sending transactions, and more.\n *\n * NOTE: this is already added to clients returned from `createSmartAccountClient`\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client to bind the smart account actions to\n * @returns {BaseSmartAccountClientActions<TChain, TAccount, TContext>} An object containing various smart account client actions\n */\nexport const smartAccountClientActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => BaseSmartAccountClientActions<TChain, TAccount, TContext> = (client) => ({\n buildUserOperation: (args) => buildUserOperation(client, args),\n buildUserOperationFromTx: (args, overrides, context) =>\n buildUserOperationFromTx(client, args, overrides, context),\n buildUserOperationFromTxs: (args) => buildUserOperationFromTxs(client, args),\n checkGasSponsorshipEligibility: (args) =>\n checkGasSponsorshipEligibility(client, args),\n signUserOperation: (args) => signUserOperation(client, args),\n dropAndReplaceUserOperation: (args) =>\n dropAndReplaceUserOperation(client, args),\n sendTransaction: (args, overrides, context) =>\n sendTransaction(client, args, overrides, context),\n sendTransactions: (args) => sendTransactions(client, args),\n sendUserOperation: (args) => sendUserOperation(client, args),\n waitForUserOperationTransaction: (args) =>\n waitForUserOperationTransaction.bind(client)(client, args),\n upgradeAccount: (args) => upgradeAccount(client, args),\n getAddress: (args) => getAddress(client, args),\n signMessage: (args) => signMessage(client, args),\n signTypedData: (args) => signTypedData(client, args),\n});\n\nexport const smartAccountClientMethodKeys = Object.keys(\n // @ts-expect-error we just want to get the keys\n smartAccountClientActions(undefined)\n).reduce((accum, curr) => {\n accum.add(curr);\n return accum;\n}, new Set<string>());\n"]}
|
|
1
|
+
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../../src/client/decorators/smartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAQN,MAAM,MAAM,CAAC;AAMd,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EACL,8BAA8B,GAE/B,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,OAAO,EACL,WAAW,GAEZ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,aAAa,GAEd,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAapF,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,gEAAgE,CAAC;AAoFjH,uCAAuC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAW2B,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5E,kBAAkB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC9D,wBAAwB,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CACrD,wBAAwB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;IAC5D,yBAAyB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5E,8BAA8B,EAAE,CAAC,IAAI,EAAE,EAAE,CACvC,8BAA8B,CAAC,MAAM,EAAE,IAAI,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5D,2BAA2B,EAAE,CAAC,IAAI,EAAE,EAAE,CACpC,2BAA2B,CAAC,MAAM,EAAE,IAAI,CAAC;IAC3C,eAAe,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CAC5C,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;IACnD,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5D,+BAA+B,EAAE,CAAC,IAAI,EAAE,EAAE,CACxC,+BAA+B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5D,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;IACtD,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC;IAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC;IAChD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI;AACrD,gDAAgD;AAChD,yBAAyB,CAAC,SAAS,CAAC,CACrC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACvB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChB,OAAO,KAAK,CAAC;AACf,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC","sourcesContent":["import {\n type Address,\n type Chain,\n type Client,\n type Hex,\n type SendTransactionParameters,\n type Transport,\n type TypedData,\n} from \"viem\";\nimport type {\n GetAccountParameter,\n GetEntryPointFromAccount,\n SmartContractAccount,\n} from \"../../account/smartContractAccount\";\nimport { buildUserOperation } from \"../../actions/smartAccount/buildUserOperation.js\";\nimport { buildUserOperationFromTx } from \"../../actions/smartAccount/buildUserOperationFromTx.js\";\nimport { buildUserOperationFromTxs } from \"../../actions/smartAccount/buildUserOperationFromTxs.js\";\nimport {\n checkGasSponsorshipEligibility,\n type CheckGasSponsorshipEligibilityResult,\n} from \"../../actions/smartAccount/checkGasSponsorshipEligibility.js\";\nimport { dropAndReplaceUserOperation } from \"../../actions/smartAccount/dropAndReplaceUserOperation.js\";\nimport { getAddress } from \"../../actions/smartAccount/getAddress.js\";\nimport { sendTransaction } from \"../../actions/smartAccount/sendTransaction.js\";\nimport { sendTransactions } from \"../../actions/smartAccount/sendTransactions.js\";\nimport { sendUserOperation } from \"../../actions/smartAccount/sendUserOperation.js\";\nimport {\n signMessage,\n type SignMessageParameters,\n} from \"../../actions/smartAccount/signMessage.js\";\nimport {\n signTypedData,\n type SignTypedDataParameters,\n} from \"../../actions/smartAccount/signTypedData.js\";\nimport { signUserOperation } from \"../../actions/smartAccount/signUserOperation.js\";\nimport type {\n BuildTransactionParameters,\n BuildUserOperationFromTransactionsResult,\n BuildUserOperationParameters,\n DropAndReplaceUserOperationParameters,\n SendTransactionsParameters,\n SendUserOperationParameters,\n SignUserOperationParameters,\n UpgradeAccountParams,\n UserOperationContext,\n WaitForUserOperationTxParameters,\n} from \"../../actions/smartAccount/types\";\nimport { upgradeAccount } from \"../../actions/smartAccount/upgradeAccount.js\";\nimport { waitForUserOperationTransaction } from \"../../actions/smartAccount/waitForUserOperationTransacation.js\";\nimport type {\n UserOperationOverrides,\n UserOperationRequest,\n UserOperationStruct,\n} from \"../../types\";\nimport type { IsUndefined } from \"../../utils\";\nimport type { SendUserOperationResult } from \"../types\";\n\n//#region SmartAccountClientActions\nexport type BaseSmartAccountClientActions<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n> = {\n buildUserOperation: (\n args: BuildUserOperationParameters<TAccount, TContext>,\n ) => Promise<UserOperationStruct<TEntryPointVersion>>;\n buildUserOperationFromTx: (\n args: SendTransactionParameters<TChain, TAccount>,\n overrides?: UserOperationOverrides<TEntryPointVersion>,\n context?: TContext,\n ) => Promise<UserOperationStruct<TEntryPointVersion>>;\n buildUserOperationFromTxs: (\n args: BuildTransactionParameters<TAccount, TContext>,\n ) => Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>>;\n checkGasSponsorshipEligibility: <\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TEntryPointVersion extends\n GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,\n >(\n args: SendUserOperationParameters<TAccount, TContext>,\n ) => Promise<\n CheckGasSponsorshipEligibilityResult<TAccount, TEntryPointVersion>\n >;\n signUserOperation: (\n args: SignUserOperationParameters<TAccount, TEntryPointVersion, TContext>,\n ) => Promise<UserOperationRequest<TEntryPointVersion>>;\n dropAndReplaceUserOperation: (\n args: DropAndReplaceUserOperationParameters<TAccount, TContext>,\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n // TODO: for v4 we should combine override and context into an `opts` parameter\n // which wraps both of these properties so we can use GetContextParameter\n sendTransaction: <TChainOverride extends Chain | undefined = undefined>(\n args: SendTransactionParameters<TChain, TAccount, TChainOverride>,\n overrides?: UserOperationOverrides<TEntryPointVersion>,\n context?: TContext,\n ) => Promise<Hex>;\n sendTransactions: (\n args: SendTransactionsParameters<TAccount, TContext>,\n ) => Promise<Hex>;\n sendUserOperation: (\n args: SendUserOperationParameters<\n TAccount,\n TContext,\n GetEntryPointFromAccount<TAccount>\n >,\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n waitForUserOperationTransaction: (\n args: WaitForUserOperationTxParameters,\n ) => Promise<Hex>;\n upgradeAccount: (\n args: UpgradeAccountParams<TAccount, TContext>,\n ) => Promise<Hex>;\n signMessage: (args: SignMessageParameters<TAccount>) => Promise<Hex>;\n signTypedData: <\n const TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n >(\n args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,\n ) => Promise<Hex>;\n} & (IsUndefined<TAccount> extends false\n ? { getAddress: () => Address }\n : {\n getAddress: (args: GetAccountParameter<TAccount>) => Address;\n });\n// #endregion SmartAccountClientActions\n\n/**\n * Provides a set of smart account client actions to decorate the provided client. These actions include building and signing user operations, sending transactions, and more.\n *\n * NOTE: this is already added to clients returned from `createSmartAccountClient`\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client to bind the smart account actions to\n * @returns {BaseSmartAccountClientActions<TChain, TAccount, TContext>} An object containing various smart account client actions\n */\nexport const smartAccountClientActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n>(\n client: Client<TTransport, TChain, TAccount>,\n) => BaseSmartAccountClientActions<TChain, TAccount, TContext> = (client) => ({\n buildUserOperation: (args) => buildUserOperation(client, args),\n buildUserOperationFromTx: (args, overrides, context) =>\n buildUserOperationFromTx(client, args, overrides, context),\n buildUserOperationFromTxs: (args) => buildUserOperationFromTxs(client, args),\n checkGasSponsorshipEligibility: (args) =>\n checkGasSponsorshipEligibility(client, args),\n signUserOperation: (args) => signUserOperation(client, args),\n dropAndReplaceUserOperation: (args) =>\n dropAndReplaceUserOperation(client, args),\n sendTransaction: (args, overrides, context) =>\n sendTransaction(client, args, overrides, context),\n sendTransactions: (args) => sendTransactions(client, args),\n sendUserOperation: (args) => sendUserOperation(client, args),\n waitForUserOperationTransaction: (args) =>\n waitForUserOperationTransaction.bind(client)(client, args),\n upgradeAccount: (args) => upgradeAccount(client, args),\n getAddress: (args) => getAddress(client, args),\n signMessage: (args) => signMessage(client, args),\n signTypedData: (args) => signTypedData(client, args),\n});\n\nexport const smartAccountClientMethodKeys = Object.keys(\n // @ts-expect-error we just want to get the keys\n smartAccountClientActions(undefined),\n).reduce((accum, curr) => {\n accum.add(curr);\n return accum;\n}, new Set<string>());\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSmartAccountClient.js","sourceRoot":"","sources":["../../../src/client/isSmartAccountClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAMlF;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAOlC,MAA4C;IAE5C,KAAK,MAAM,GAAG,IAAI,4BAA4B,EAAE,CAAC;QAC/C,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAOtC,MAA4C;IAE5C,OAAO,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AAC1C,CAAC","sourcesContent":["import type { Chain, Client, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../account/smartContractAccount\";\nimport { smartAccountClientMethodKeys } from \"./decorators/smartAccountClient.js\";\nimport type {\n BaseSmartAccountClient,\n SmartAccountClient,\n} from \"./smartAccountClient\";\n\n/**\n * Use this method to assert that a client is a BaseSmartAccountClient.\n * Useful for narrowing the type of the client down when used within the\n * smart account client decorators\n *\n * @param {Client<TTransport, TChain, TAccount>} client a viem client\n * @returns {boolean} true if the client is a SmartAccountClient\n */\nexport function isSmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined
|
|
1
|
+
{"version":3,"file":"isSmartAccountClient.js","sourceRoot":"","sources":["../../../src/client/isSmartAccountClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAMlF;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAOlC,MAA4C;IAE5C,KAAK,MAAM,GAAG,IAAI,4BAA4B,EAAE,CAAC;QAC/C,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAOtC,MAA4C;IAE5C,OAAO,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AAC1C,CAAC","sourcesContent":["import type { Chain, Client, Transport } from \"viem\";\nimport type { SmartContractAccount } from \"../account/smartContractAccount\";\nimport { smartAccountClientMethodKeys } from \"./decorators/smartAccountClient.js\";\nimport type {\n BaseSmartAccountClient,\n SmartAccountClient,\n} from \"./smartAccountClient\";\n\n/**\n * Use this method to assert that a client is a BaseSmartAccountClient.\n * Useful for narrowing the type of the client down when used within the\n * smart account client decorators\n *\n * @param {Client<TTransport, TChain, TAccount>} client a viem client\n * @returns {boolean} true if the client is a SmartAccountClient\n */\nexport function isSmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: Client<TTransport, TChain, TAccount>,\n): client is SmartAccountClient<TTransport, TChain, TAccount> {\n for (const key of smartAccountClientMethodKeys) {\n if (!(key in client)) {\n return false;\n }\n }\n\n return client && \"middleware\" in client;\n}\n\n/**\n * Use this method to assert that a client is a BaseSmartAccountClient.\n * Useful for narrowing the type of the client down when used within the\n * smart account action decorators\n *\n * @param {Client<TTransport, TChain, TAccount>} client a viem client\n * @returns {boolean} true if the account is a BaseSmartAccountClient\n */\nexport function isBaseSmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: Client<TTransport, TChain, TAccount>,\n): client is BaseSmartAccountClient<TTransport, TChain, TAccount> {\n return client && \"middleware\" in client;\n}\n"]}
|