Skip to content

Commit

Permalink
fix: fix MAv2 React Hook client creation for 7702 (#1329)
Browse files Browse the repository at this point in the history
* fix: rename MAv2 type to mode, add 7702 middleware for react hook

* fix: don't switch MintCard to MAv2 yet

* fix: reconnect 7702 account after page refresh

* chore: remove comment

* docs: regen docs

* fix: fix docs

* fix: remove unnecessary optional chaining
  • Loading branch information
jakehobbs authored and howydev committed Feb 10, 2025
1 parent e17dc29 commit c6db327
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
6 changes: 5 additions & 1 deletion account-kit/core/src/actions/createAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ export async function createAccount<TAccount extends SupportedAccountTypes>(
return account;
});
case "ModularAccountV2":
const maV2Params = {
mode: "default",
...params,
};
return createModularAccountV2({
...(params as AccountConfig<"ModularAccountV2">),
...(maV2Params as AccountConfig<"ModularAccountV2">),
...(cachedConfig as OmitSignerTransportChain<CreateModularAccountV2Params>),
signer,
transport: (opts) => transport({ ...opts, retryCount: 0 }),
Expand Down
2 changes: 1 addition & 1 deletion account-kit/smart-contracts/src/ma-v2/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type CreateModularAccountV2ClientParams<
TTransport extends Transport = Transport,
TChain extends Chain = Chain,
TSigner extends SmartAccountSigner = SmartAccountSigner
> = OptionalFields<CreateModularAccountV2Params<TTransport, TSigner>, "type"> &
> = OptionalFields<CreateModularAccountV2Params<TTransport, TSigner>, "mode"> &
Omit<
SmartAccountClientConfig<TTransport, TChain>,
"transport" | "account" | "chain"
Expand Down

This file was deleted.

0 comments on commit c6db327

Please sign in to comment.