From cc4021bfbfb9c8b3fd6a193db14815215e4d080a Mon Sep 17 00:00:00 2001 From: Matt <90358481+xbtmatt@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:45:23 -0700 Subject: [PATCH] Add the `local` case to the network string conversion function and narrow `Account` type to `Ed25519Account` in example (#298) * Narrow `Account` typing and add the `local` case to the network string conversion function. * Remove `Account` => `Ed25519` account as it's already in another PR Update changeset --------- Co-authored-by: matt Co-authored-by: Maayan --- .changeset/honest-monkeys-shake.md | 5 +++++ .../src/LegacyWalletPlugins/conversion.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/honest-monkeys-shake.md diff --git a/.changeset/honest-monkeys-shake.md b/.changeset/honest-monkeys-shake.md new file mode 100644 index 00000000..c152f669 --- /dev/null +++ b/.changeset/honest-monkeys-shake.md @@ -0,0 +1,5 @@ +--- +"@aptos-labs/wallet-adapter-core": patch +--- + +Add the `local` case to the switch statement that converts a string to a Network. diff --git a/packages/wallet-adapter-core/src/LegacyWalletPlugins/conversion.ts b/packages/wallet-adapter-core/src/LegacyWalletPlugins/conversion.ts index f1ecba34..d4ada1e0 100644 --- a/packages/wallet-adapter-core/src/LegacyWalletPlugins/conversion.ts +++ b/packages/wallet-adapter-core/src/LegacyWalletPlugins/conversion.ts @@ -25,6 +25,8 @@ export function convertNetwork( return Network.TESTNET; case "devnet" as Network: return Network.DEVNET; + case "local" as Network: + return Network.LOCAL; default: throw new Error("Invalid Aptos network name"); }