Skip to content

Commit

Permalink
chore: update sma type to include entity properties
Browse files Browse the repository at this point in the history
  • Loading branch information
howydev committed Dec 19, 2024
1 parent 5a24c40 commit 0bfcc59
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ import { InvalidEntityIdError, InvalidNonceKeyError } from "@aa-sdk/core";

export const DEFAULT_OWNER_ENTITY_ID = 0;

export type SignerEntity = {
isGlobalValidation: boolean;
entityId: number;
};

export type SMAV2Account<
TSigner extends SmartAccountSigner = SmartAccountSigner
> = SmartContractAccountWithSigner<"SMAV2Account", TSigner, "0.7.0">;
> = SmartContractAccountWithSigner<"SMAV2Account", TSigner, "0.7.0"> &
SignerEntity;

export type CreateSMAV2AccountParams<
TTransport extends Transport = Transport,
Expand All @@ -46,10 +52,7 @@ export type CreateSMAV2AccountParams<
initialOwner?: Address;
entryPoint?: EntryPointDef<"0.7.0", Chain>;
} & (
| {
isGlobalValidation: boolean;
entityId: number;
}
| SignerEntity
| {
isGlobalValidation?: never;
entityId?: never;
Expand Down Expand Up @@ -145,5 +148,7 @@ export async function createSMAV2Account(
...baseAccount,
getAccountNonce,
getSigner: () => signer,
isGlobalValidation,
entityId,
};
}

0 comments on commit 0bfcc59

Please sign in to comment.