From 3f9d47f12742dcde32a9fa16dedaf83ff5eca130 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 12 May 2023 17:30:42 +0200 Subject: [PATCH 1/2] feat: cede store new implementation --- packages/cede-store/package.json | 2 +- packages/cede-store/src/index.ts | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/cede-store/package.json b/packages/cede-store/package.json index 3ced5a3fa..1928e6748 100644 --- a/packages/cede-store/package.json +++ b/packages/cede-store/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/cede-store", - "version": "2.0.1", + "version": "2.1.1-alpha.1", "description": "cede.store SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", diff --git a/packages/cede-store/src/index.ts b/packages/cede-store/src/index.ts index fd5cc99dc..3795f8676 100644 --- a/packages/cede-store/src/index.ts +++ b/packages/cede-store/src/index.ts @@ -26,12 +26,17 @@ function cedeStoreWallet(): WalletInit { return Promise.resolve({ provider: createEIP1193Provider(window.cede, { eth_requestAccounts: async ({ baseRequest }) => { - const vaults = (await baseRequest({ + const accounts = (await baseRequest({ method: 'connect' - })) as [] - return vaults.length > 0 - ? ['To access cede.store vaults and accounts, use cede provider'] - : [] + })) as any[] + + if (!accounts.length) { + return [] + } + + const activeVault = accounts.find(account => account.isActive) + + return [activeVault?.name || accounts[0].name] as string[] }, eth_chainId: () => Promise.resolve('0x0'), // cede.store doesn't support chains, but we have to provide a value to complete the connection wallet_switchEthereumChain: null, From 64e13449cbfe9373da8dcd0466be26b3019412c4 Mon Sep 17 00:00:00 2001 From: Nikita TEREKHOV Date: Fri, 12 May 2023 20:14:34 +0200 Subject: [PATCH 2/2] fix: version fix and changing mocked chain to the existing one --- packages/cede-store/package.json | 2 +- packages/cede-store/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cede-store/package.json b/packages/cede-store/package.json index 1928e6748..edb4a4cd7 100644 --- a/packages/cede-store/package.json +++ b/packages/cede-store/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/cede-store", - "version": "2.1.1-alpha.1", + "version": "2.0.2-alpha.1", "description": "cede.store SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", diff --git a/packages/cede-store/src/index.ts b/packages/cede-store/src/index.ts index 3795f8676..27db6dc8e 100644 --- a/packages/cede-store/src/index.ts +++ b/packages/cede-store/src/index.ts @@ -38,7 +38,7 @@ function cedeStoreWallet(): WalletInit { return [activeVault?.name || accounts[0].name] as string[] }, - eth_chainId: () => Promise.resolve('0x0'), // cede.store doesn't support chains, but we have to provide a value to complete the connection + eth_chainId: () => Promise.resolve('0x1'), // cede.store doesn't support chains, but we have to provide a value to complete the connection wallet_switchEthereumChain: null, wallet_addEthereumChain: null, eth_getBalance: null,