From ef33eb25fd586274711106bbd95d643ff1653ff4 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Tue, 16 Apr 2024 08:08:39 +0200 Subject: [PATCH] fix mutating the btc_providers array --- src/provider/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/provider/index.ts b/src/provider/index.ts index b527a84..83ac837 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -42,10 +42,11 @@ export function removeDefaultProvider() { export function getSupportedWallets(): SupportedWallet[] { const btc_providers = getProviders(); + const allProviders = [...btc_providers]; for (const key in omit(DefaultAdaptersInfo, ['xverse'])) { - btc_providers.push(DefaultAdaptersInfo[key]); + allProviders.push(DefaultAdaptersInfo[key]); } - const wallets: SupportedWallet[] = btc_providers.map((provider) => { + const wallets: SupportedWallet[] = allProviders.map((provider) => { { return { ...provider,