From e92e708cf139121fb6c77814daf3e5d61780628e Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Wed, 23 Feb 2022 16:03:59 -0800 Subject: [PATCH] add vega wallet manager component and re add current single pubkey to provider state --- apps/trading/pages/index.page.tsx | 76 +++---------------- .../src/lib/vega-wallet/context.ts | 8 +- .../src/lib/vega-wallet/provider.tsx | 49 ++++++++++-- 3 files changed, 60 insertions(+), 73 deletions(-) diff --git a/apps/trading/pages/index.page.tsx b/apps/trading/pages/index.page.tsx index 40d7be503..e8b3291f2 100644 --- a/apps/trading/pages/index.page.tsx +++ b/apps/trading/pages/index.page.tsx @@ -6,11 +6,7 @@ import { Connectors, rest } from '../lib/connectors'; import { LocalStorage } from '@vegaprotocol/storage'; export function Index() { - // Get keys from vega wallet immediately - useEagerConnect(); - - const { publicKeys } = useVegaWallet(); - const { publicKey, onSelect } = useCurrentVegaKey(); + const { keypair, keypairs, selectPublicKey } = useVegaWallet(); return (
@@ -28,14 +24,17 @@ export function Index() {

Vega wallet

- {publicKey &&

Current: {publicKey.pub}

} - {publicKeys?.length && ( + {keypair &&

Current: {keypair.pub}

} + {keypairs?.length && (