Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/unstoppable-resolution
steps:
- node-build-steps
build-cede-store:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/cede-store
steps:
- node-build-steps

# Build staging/Alpha releases
build-staging-core:
Expand Down Expand Up @@ -599,6 +605,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/unstoppable-resolution
steps:
- node-staging-build-steps
build-staging-cede-store:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/cede-store
steps:
- node-staging-build-steps

workflows:
version: 2
Expand Down Expand Up @@ -819,3 +831,10 @@ workflows:
<<: *deploy_production_filters
- build-staging-unstoppable-resolution:
<<: *deploy_staging_filters
cede-store:
jobs:
- build-cede-store:
<<: *deploy_production_filters
- build-staging-cede-store:
<<: *deploy_staging_filters

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
},
"type": "module",
"dependencies": {
"@web3-onboard/cede-store": "^2.0.0-alpha.1",
"@web3-onboard/coinbase": "^2.2.2",
"@web3-onboard/core": "^2.17.0-alpha.1",
"@web3-onboard/dcent": "^2.2.5",
Expand Down
7 changes: 5 additions & 2 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const classMutationListener = () => {
}

const intiOnboard = async (theme) => {
const { default: cedeModule } = await import('@web3-onboard/cede-store')
const { default: Onboard } = await import('@web3-onboard/core')
const { default: injectedModule } = await import('@web3-onboard/injected-wallets')
const { default: trezorModule } = await import('@web3-onboard/trezor')
Expand Down Expand Up @@ -75,6 +76,7 @@ const intiOnboard = async (theme) => {
const torus = torusModule()
const trust = trustModule()
const xdefi = xdefiModule()
const cede = cedeModule()

const portis = portisModule({
apiKey: 'b2b7586f-2b1e-4c30-a7fb-c2d1533b153b'
Expand Down Expand Up @@ -117,19 +119,20 @@ const intiOnboard = async (theme) => {
gnosis,
uauth,
taho,
cede,
xdefi,
torus,
sequence,
web3auth,
infinityWallet,
dcent,
enkrypt,
mewWallet,
magic,
fortmatic,
keystone,
keepkey,
portis
portis,
infinityWallet
],
chains: [
{
Expand Down
98 changes: 98 additions & 0 deletions docs/src/routes/docs/[...4]wallets/cede-store.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# cede.store

## Wallet module for connecting cede.store Wallet SDK to web3-onboard

cede.store is a non-custodial browser extension designed to store CEX (centralized exchange) API keys and to sign CEX requests from the client-side. It allows users to manage their cryptos in their CEX through a unified interface.

Any dApp can integrate cede.store in order to track and/or manage a user's CEX assets. In this way, we offer the dApp a way to monitor and manage a user's CEX assets while remaining non-custodial and maintaining the same user experience as any DeFi browser wallet.

See [cede.store Wallet Developer Docs](https://docs.cede.store)

### Install

<Tabs values={['yarn', 'npm']}>
<TabPanel value="yarn">

```sh copy
yarn add @web3-onboard/cede-store
```

</TabPanel>
<TabPanel value="npm">

```sh copy
npm install @web3-onboard/cede-store
```

</TabPanel>
</Tabs>

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import cedeStoreWalletModule from '@web3-onboard/cede-store'

const cedeStoreWallet = cedeStoreWalletModule()

const onboard = Onboard({
// ... other Onboard options
wallets: [
cedeStoreWallet
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
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.

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.

## CEX connection

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 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.

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

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

// Fetch user's balances from Binance and Coinbase
const vaultId = vaultPreview[0].id
await provider.request({
method: 'balances',
params: {
vaultId,
accountNames: ['Binance 1', 'Coinbase 1']
}
})

// Fetch user's transactions
await provider.request({
method: 'transactions',
params: {
vaultId
}
})
```
84 changes: 84 additions & 0 deletions packages/cede-store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# @web3-onboard/cede-store

## Wallet module for connecting cede.store Wallet SDK to web3-onboard

cede.store is a non-custodial browser extension designed to store CEX (centralized exchange) API keys and to sign CEX requests from the client-side. It allows users to manage their cryptos in their CEX through a unified interface.

Any dApp can integrate cede.store in order to track and/or manage a user's CEX assets. In this way, we offer the dApp a way to monitor and manage a user's CEX assets while remaining non-custodial and maintaining the same user experience as any DeFi browser wallet.

See [cede.store Wallet Developer Docs](https://docs.cede.store)

### Install

`npm i @web3-onboard/cede-store`

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import cedeStoreWalletModule from '@web3-onboard/cede-store'

const cedeStoreWallet = cedeStoreWalletModule()

const onboard = Onboard({
// ... other Onboard options
wallets: [
cedeStoreWallet
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
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.

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.

## CEX connection

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 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.

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

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

// Fetch user's balances from Binance and Coinbase
const vaultId = vaultPreview[0].id
await provider.request({
method: 'balances',
params: {
vaultId,
accountNames: ['Binance 1', 'Coinbase 1']
}
})

// Fetch user's transactions
await provider.request({
method: 'transactions',
params: {
vaultId
}
})
```
75 changes: 75 additions & 0 deletions packages/cede-store/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "@web3-onboard/cede-store",
"version": "2.0.0-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",
"Web3",
"EVM",
"dapp",
"Multichain",
"Wallet",
"Transaction",
"Provider",
"Hardware Wallet",
"Notifications",
"React",
"Svelte",
"Vue",
"Next",
"Nuxt",
"MetaMask",
"Coinbase",
"WalletConnect",
"Ledger",
"Trezor",
"Connect Wallet",
"Ethereum Hooks",
"Blocknative",
"Mempool",
"pending",
"confirmed",
"Injected Wallet",
"Crypto",
"Crypto Wallet",
"Tally Ho",
"Taho",
"Taho Wallet",
"cede.store",
"cede",
"cedelabs"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/core"
},
"homepage": "https://onboard.blocknative.com",
"bugs": "https://github.com/blocknative/web3-onboard/issues",
"module": "dist/index.js",
"browser": "dist/index.js",
"main": "dist/index.js",
"type": "module",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"type-check": "tsc --noEmit"
},
"license": "MIT",
"devDependencies": {
"@ethersproject/providers": "^5.5.0",
"@types/lodash.uniqby": "^4.7.6",
"@types/node": "^17.0.21",
"ts-node": "^10.2.1",
"typescript": "^4.5.5",
"window": "^4.2.7"
},
"dependencies": {
"@cedelabs/providers": "^0.0.7",
"@web3-onboard/common": "^2.3.0-alpha.1"
}
}
19 changes: 19 additions & 0 deletions packages/cede-store/src/icon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default `
<svg width="100%" height="100%" viewBox="0 0 115 115" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.00779067 27.599C0.00779067 12.3521 12.3668 0 27.605 0H87.4028C102.649 0 115 12.3599 115 27.599V87.4009C115 102.648 102.641 115 87.4028 115H27.4645C12.2966 115 0 102.703 0 87.5336V27.5913L0.00779067 27.599Z" fill="url(#paint0_linear_1990_147351)"/>
<path d="M6.64611 31.0476C6.64611 17.5641 17.5773 6.63214 31.0599 6.63214H83.9604C97.443 6.63214 108.374 17.5641 108.374 31.0476V83.9517C108.374 97.4352 97.443 108.367 83.9604 108.367H30.9351C17.5149 108.367 6.6383 97.4898 6.6383 84.0687V31.0398L6.64611 31.0476Z" fill="black"/>
<path d="M13.2766 34.4968C13.2766 22.769 22.78 13.265 34.507 13.265H80.5101C92.2372 13.265 101.741 22.769 101.741 34.4968V80.5031C101.741 92.231 92.2372 101.735 80.5101 101.735H34.4056C22.741 101.735 13.2844 92.2778 13.2844 80.6045V34.4968H13.2766Z" fill="white"/>
<path d="M47.815 61.914C52.1457 54.4124 50.9067 45.5889 45.0477 42.2059C39.1887 38.823 30.9284 42.1618 26.5977 49.6633C22.267 57.1648 23.5059 65.9884 29.3649 69.3713C35.2239 72.7542 43.4843 69.4155 47.815 61.914Z" fill="black"/>
<path d="M43.179 55.1448C45.7257 55.1448 47.7902 53.0801 47.7902 50.5332C47.7902 47.9863 45.7257 45.9217 43.179 45.9217C40.6323 45.9217 38.5678 47.9863 38.5678 50.5332C38.5678 53.0801 40.6323 55.1448 43.179 55.1448Z" fill="white"/>
<path d="M85.8952 69.4338C91.7542 66.0508 92.9931 57.2273 88.6624 49.7258C84.3317 42.2243 76.0713 38.8855 70.2123 42.2684C64.3533 45.6513 63.1144 54.4749 67.4451 61.9764C71.7758 69.4779 80.0362 72.8167 85.8952 69.4338Z" fill="black"/>
<path d="M72.0841 55.2146C74.6308 55.2146 76.6953 53.15 76.6953 50.6031C76.6953 48.0562 74.6308 45.9915 72.0841 45.9915C69.5374 45.9915 67.4729 48.0562 67.4729 50.6031C67.4729 53.15 69.5374 55.2146 72.0841 55.2146Z" fill="white"/>
<path d="M57.629 74.6895C57.629 74.6895 54.3363 74.5569 53.1582 75.3996C51.98 76.2423 52.058 77.5454 52.058 77.5454C52.058 77.5454 51.902 78.8797 52.2921 79.7458C52.6822 80.612 54.9683 80.4637 56.0919 82.3911C56.0919 82.3911 57.1218 82.7422 57.629 82.6408" fill="black"/>
<path d="M57.629 74.6895C57.629 74.6895 60.9217 74.5567 62.0999 75.3994C63.2781 76.2421 63.2001 77.5452 63.2001 77.5452C63.2001 77.5452 63.3561 78.8795 62.966 79.7457C62.5759 80.6118 60.2897 80.4635 59.1662 82.3909C59.1662 82.3909 58.1361 82.7422 57.629 82.6408" fill="black"/>
<defs>
<linearGradient id="paint0_linear_1990_147351" x1="79.5" y1="133.5" x2="80.5" y2="-67" gradientUnits="userSpaceOnUse">
<stop stop-color="#5EA6FF"/>
<stop offset="1" stop-color="#5EA6FF" stop-opacity="0.4"/>
</linearGradient>
</defs>
</svg>
`
Loading