Skip to content

Commit 690cb6f

Browse files
Mario22060xnikter
andauthored
feat: cede store new implementation (#1709)
* feat: cede store new implementation * fix: version fix and changing mocked chain to the existing one --------- Co-authored-by: Nikita TEREKHOV <[email protected]>
1 parent e89982e commit 690cb6f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

packages/cede-store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/cede-store",
3-
"version": "2.0.1",
3+
"version": "2.0.2-alpha.1",
44
"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.",
55
"keywords": [
66
"Ethereum",

packages/cede-store/src/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,19 @@ function cedeStoreWallet(): WalletInit {
2626
return Promise.resolve({
2727
provider: createEIP1193Provider(window.cede, {
2828
eth_requestAccounts: async ({ baseRequest }) => {
29-
const vaults = (await baseRequest({
29+
const accounts = (await baseRequest({
3030
method: 'connect'
31-
})) as []
32-
return vaults.length > 0
33-
? ['To access cede.store vaults and accounts, use cede provider']
34-
: []
31+
})) as any[]
32+
33+
if (!accounts.length) {
34+
return []
35+
}
36+
37+
const activeVault = accounts.find(account => account.isActive)
38+
39+
return [activeVault?.name || accounts[0].name] as string[]
3540
},
36-
eth_chainId: () => Promise.resolve('0x0'), // cede.store doesn't support chains, but we have to provide a value to complete the connection
41+
eth_chainId: () => Promise.resolve('0x1'), // cede.store doesn't support chains, but we have to provide a value to complete the connection
3742
wallet_switchEthereumChain: null,
3843
wallet_addEthereumChain: null,
3944
eth_getBalance: null,

0 commit comments

Comments
 (0)