Skip to content

Commit

Permalink
Release 2.24.5 (docs) (#1847)
Browse files Browse the repository at this point in the history
* Fix file imports for validation within WC to handle ESM envs (#1833)

* Cede store new implementation (#1804)

* feat: cede store new implementation

* fix: version fix and changing mocked chain to the existing one

* feat: cede-store-provider-upgrade-1.0.3

* fix: remove yarn.lock files

* Format and yarn it

* Revert deletion of yarn.lock from demo

---------

Co-authored-by: Mathieu <[email protected]>
Co-authored-by: Nikita TEREKHOV <[email protected]>
Co-authored-by: Adam Carpenter <[email protected]>

* feat: add Fordefi wallet (#1820)

* feat: add Fordefi wallet

* fix: remove comma

* Update packages/injected/src/types.ts

---------

Co-authored-by: Adam Carpenter <[email protected]>

* Update: Return bn_protect protect btn to update the user's RPC (#1841)

* Add back in btn protect btn that was accidentally removed during the AC redesign

* Bump core version in docs

* Cleanup onboard service in docs

* Update frame icon

* Bump frame version

* Update global version

* Remove alpha flags

---------

Co-authored-by: clementjuventin <[email protected]>
Co-authored-by: Mathieu <[email protected]>
Co-authored-by: Nikita TEREKHOV <[email protected]>
Co-authored-by: Rony Fragin <[email protected]>
  • Loading branch information
5 people authored Jul 20, 2023
1 parent fe72e19 commit 2d0b7dc
Show file tree
Hide file tree
Showing 30 changed files with 671 additions and 332 deletions.
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
"type": "module",
"dependencies": {
"@web3-onboard/blocto": "^2.0.0",
"@web3-onboard/cede-store": "^2.0.2",
"@web3-onboard/cede-store": "^2.1.0-alpha.1",
"@web3-onboard/coinbase": "^2.2.5-alpha.1",
"@web3-onboard/core": "^2.20.4",
"@web3-onboard/core": "^2.20.5-alpha.1",
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.4",
"@web3-onboard/fortmatic": "^2.0.19",
"@web3-onboard/frame": "^2.0.1",
"@web3-onboard/frame": "^2.0.2-alpha.1",
"@web3-onboard/frontier": "^2.0.4",
"@web3-onboard/gas": "^2.1.8",
"@web3-onboard/gnosis": "^2.1.10",
Expand Down
1 change: 1 addition & 0 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const intiOnboard = async (theme) => {
})

return Onboard({
connect: { autoConnectAllPreviousWallet: true },
wallets: [
injected,
walletConnect,
Expand Down
8 changes: 7 additions & 1 deletion docs/src/routes/docs/[...3]modules/[...1]core/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,15 @@ type ConnectModalOptions = {
*/
wheresMyWalletLink?: string
/**
* Hide the where is my wallet link notice displayed in the connect modal
* Hide the "Where is my wallet?" link notice displayed in the connect modal
* at the bottom of the wallets list
*/
removeWhereIsMyWalletWarning?: boolean
/**
* Hide the "I don't have a wallet" link displayed
* on the left panel of the connect modal
*/
removeIDontHaveAWalletInfoLink?: boolean
/**
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
* package has been added and passed into the web3-onboard initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ const injected = injectedModule({
- Safeheron - _Desktop_
- Talisman - _Desktop_
- OneKey - _Desktop & Mobile_
- Fordefi - _Desktop_

## Build Environments

Expand Down
413 changes: 246 additions & 167 deletions docs/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-onboard-monorepo",
"version": "2.24.4",
"version": "2.24.5",
"private": true,
"workspaces": {
"packages": [
Expand Down
26 changes: 15 additions & 11 deletions packages/cede-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ console.log(connectedWallets)

## Vault management

Vaults allow creating bundles of CEX accounts. The extension connects with CEX through CEX API keys and everything is stored in the Local Storage of the browser, on a mobile or on a Ledger (more coming soon...). We can compare Vaults with the [Keyring concept](https://www.wispwisp.com/index.php/2020/12/25/how-metamask-stores-your-wallet-secret/) of Metamask.
Vaults allow creating bundles of CEX accounts. The extension connects with CEX through CEX API keys and everything is stored in the Local Storage of the browser. Mobile and Ledger storage are coming soon.
We can compare Vaults with the [Keyring concept](https://www.wispwisp.com/index.php/2020/12/25/how-metamask-stores-your-wallet-secret/) of
Metamask.

A user can have multiple vaults with different CEX accounts inside.
This system allows the user to give a dApp custom access to his accounts depending on the degree of trust he has in the dApp in question.
A user can have multiple vaults with different CEX accounts inside. This system allows the user to give a dApp custom
access to his accounts depending on the degree of trust he has in the dApp in question.

Let's say the user has three vaults: a main one with full access (track, trade, withdraw) to all his CEX, one just for tracking and one just for trading.
If the user does not know the reputation of the dApp he is using, the most logical solution would be to give access
only to the tracking vault so the dApp will not be able to initiate trade requests.
Let's say the user has three vaults: a main one with full access (track, trade, withdraw) to all his CEX, one just for
tracking and one just for trading. If the user does not know the reputation of the dApp he is using, the most logical
solution would be to give access only to the tracking vault so the dApp will not be able to initiate trade requests.

## CEX connection

Expand All @@ -47,17 +49,19 @@ All requests are divided into two categories:
- private requests
- public requests

All public data, such as prices, volumes, historical data are collected from different exchanges and
provided with our API.
All public data, such as prices, volumes, historical data are collected from different exchanges and streamed in real
time through our API.

All private requests, such as user balances, trades, open positions are coming from cede.store (from the user's machine).
All private requests, such as user balances, trades, open positions are coming from cede.store (from the user's
machine).

You can access both public and private data through the extension's API. cede.store handles all exchanges requests, as well as API keys secure storage.
You can access both public and private data through the extension's API. Cede.store handles all exchanges requests, as
well as API keys secure storage.

## Example of a workflow (fetch user's balances and transactions)

```typescript
// get available vaults and accounts
// Get available vaults and accounts
const { vaultPreview } = provider.getVaultPreviews()
console.log(vaultPreview)

Expand Down
4 changes: 2 additions & 2 deletions packages/cede-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/cede-store",
"version": "2.0.2",
"version": "2.1.0",
"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",
Expand Down Expand Up @@ -69,7 +69,7 @@
"window": "^4.2.7"
},
"dependencies": {
"@cedelabs/providers": "^0.0.7",
"@cedelabs/providers": "^1.1.0",
"@web3-onboard/common": "^2.3.3"
}
}
22 changes: 12 additions & 10 deletions packages/cede-store/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { detectCedeProvider } from '@cedelabs/providers'
import { CedeProvider, detectCedeProvider } from '@cedelabs/providers'
import type { WalletInit } from '@web3-onboard/common'
import { createEIP1193Provider } from '@web3-onboard/common'
import { CustomWindow } from './types'
declare const window: CustomWindow

type CustomWindow = typeof window & {
cede: CedeProvider
}

function cedeStoreWallet(): WalletInit {
if (typeof window === 'undefined') return () => null
Expand All @@ -12,7 +14,7 @@ function cedeStoreWallet(): WalletInit {
checkProviderIdentity: () => (window as CustomWindow).cede,
getIcon: async () => (await import('./icon.js')).default,
getInterface: async () => {
const provider: any = await detectCedeProvider()
const provider = await detectCedeProvider()
if (!provider) {
window.open('https://cede.store', '_blank')
throw new Error('Please, install cede.store to use this wallet')
Expand All @@ -24,24 +26,24 @@ function cedeStoreWallet(): WalletInit {
})

return Promise.resolve({
provider: createEIP1193Provider(window.cede, {
eth_requestAccounts: async ({ baseRequest }) => {
const accounts = (await baseRequest({
provider: createEIP1193Provider(provider, {
eth_requestAccounts: async () => {
const accounts = await provider.request({
method: 'connect'
})) as any[]
})

if (!accounts.length) {
return []
}

const activeVault = accounts.find(account => account.isActive)

return [activeVault?.name || accounts[0].name] as string[]
return [activeVault?.name || accounts[0].name]
},
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,
eth_getBalance: () => Promise.resolve('0x0'),
eth_selectAccounts: null
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/cede-store/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ExternalProvider } from '@ethersproject/providers'
export interface CustomWindow extends Window {
cede: ExternalProvider
}
}
8 changes: 7 additions & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,15 @@ type ConnectModalOptions = {
*/
wheresMyWalletLink?: string
/**
* Hide the where is my wallet link notice displayed in the connect modal
* Hide the "Where is my wallet?" link notice displayed in the connect modal
* at the bottom of the wallets list
*/
removeWhereIsMyWalletWarning?: boolean
/**
* Hide the "I don't have a wallet" link displayed
* on the left panel of the connect modal
*/
removeIDontHaveAWalletInfoLink?: boolean
/**
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
* package has been added and passed into the web3-onboard initialization
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.20.4",
"version": "2.20.5",
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized 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",
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,15 @@ export type ConnectModalOptions = {
*/
wheresMyWalletLink?: string
/**
* Hide the where is my wallet link notice displayed in the connect modal
* Hide the "Where is my wallet?" link notice displayed in the connect modal
* at the bottom of the wallets list
*/
removeWhereIsMyWalletWarning?: boolean
/**
* Hide the "I don't have a wallet" link displayed
* on the left panel of the connect modal
*/
removeIDontHaveAWalletInfoLink?: boolean
/**
* @deprecated Has no effect unless `@web3-onboard/unstoppable-resolution`
* package has been added and passed into the web3-onboard initialization
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ const connectModalOptions = Joi.object({
iDontHaveAWalletLink: Joi.string(),
wheresMyWalletLink: Joi.string(),
removeWhereIsMyWalletWarning: Joi.boolean(),
removeIDontHaveAWalletInfoLink: Joi.boolean(),
disableUDResolution: Joi.boolean()
})

Expand Down
Loading

0 comments on commit 2d0b7dc

Please sign in to comment.