Skip to content

Commit

Permalink
chore: simplify getExecutionData interface
Browse files Browse the repository at this point in the history
  • Loading branch information
howydev committed Dec 18, 2024
1 parent ceff675 commit 800a5ac
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions account-kit/smart-contracts/src/ma-v2/account/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ export type ValidationDataView = {
validationFlags: number;
};

export type ExecutionDataParams = {
selector: Hex;
};

export type ValidationDataParams = {
validationModuleAddress?: Address;
entityId?: number;
Expand All @@ -62,7 +58,7 @@ export type ValidationDataParams = {
export type SMAV2Account<
TSigner extends SmartAccountSigner = SmartAccountSigner
> = SmartContractAccountWithSigner<"SMAV2Account", TSigner, "0.7.0"> & {
getExecutionData: (args: ExecutionDataParams) => Promise<ExecutionDataView>;
getExecutionData: (selector: Hex) => Promise<ExecutionDataView>;
getValidationData: (
args: ValidationDataParams
) => Promise<ValidationDataView>;
Expand Down Expand Up @@ -189,12 +185,11 @@ export async function createSMAV2Account(
client,
});

const getExecutionData = async (args: ExecutionDataParams) => {
const getExecutionData = async (selector: Hex) => {
if (!(await baseAccount.isAccountDeployed())) {
return {} as ExecutionDataView;
}

const { selector } = args;
return await accountContract.read.getExecutionData([selector]);
};

Expand Down

0 comments on commit 800a5ac

Please sign in to comment.