Skip to content

Commit 594dc17

Browse files
0xnikterAdamj1232
andauthored
FEATURE: Add cede.store wallet package (#1667)
* FEATURE: Add cede.store wallet package * Formatting and add to docs site * DOCS: Add cede.store detailed documentation with an example flow * Update formatting - looks good! --------- Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent 10c7cc5 commit 594dc17

File tree

13 files changed

+376
-3
lines changed

13 files changed

+376
-3
lines changed

.circleci/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,12 @@ jobs:
381381
working_directory: ~/web3-onboard-monorepo/packages/unstoppable-resolution
382382
steps:
383383
- node-build-steps
384+
build-cede-store:
385+
docker:
386+
- image: cimg/node:16.13.1
387+
working_directory: ~/web3-onboard-monorepo/packages/cede-store
388+
steps:
389+
- node-build-steps
384390

385391
# Build staging/Alpha releases
386392
build-staging-core:
@@ -599,6 +605,12 @@ jobs:
599605
working_directory: ~/web3-onboard-monorepo/packages/unstoppable-resolution
600606
steps:
601607
- node-staging-build-steps
608+
build-staging-cede-store:
609+
docker:
610+
- image: cimg/node:16.13.1
611+
working_directory: ~/web3-onboard-monorepo/packages/cede-store
612+
steps:
613+
- node-staging-build-steps
602614

603615
workflows:
604616
version: 2
@@ -819,3 +831,10 @@ workflows:
819831
<<: *deploy_production_filters
820832
- build-staging-unstoppable-resolution:
821833
<<: *deploy_staging_filters
834+
cede-store:
835+
jobs:
836+
- build-cede-store:
837+
<<: *deploy_production_filters
838+
- build-staging-cede-store:
839+
<<: *deploy_staging_filters
840+

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
},
5757
"type": "module",
5858
"dependencies": {
59+
"@web3-onboard/cede-store": "^2.0.0-alpha.1",
5960
"@web3-onboard/coinbase": "^2.2.2",
6061
"@web3-onboard/core": "^2.17.0-alpha.1",
6162
"@web3-onboard/dcent": "^2.2.5",

docs/src/lib/services/onboard.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const classMutationListener = () => {
2727
}
2828

2929
const intiOnboard = async (theme) => {
30+
const { default: cedeModule } = await import('@web3-onboard/cede-store')
3031
const { default: Onboard } = await import('@web3-onboard/core')
3132
const { default: injectedModule } = await import('@web3-onboard/injected-wallets')
3233
const { default: trezorModule } = await import('@web3-onboard/trezor')
@@ -75,6 +76,7 @@ const intiOnboard = async (theme) => {
7576
const torus = torusModule()
7677
const trust = trustModule()
7778
const xdefi = xdefiModule()
79+
const cede = cedeModule()
7880

7981
const portis = portisModule({
8082
apiKey: 'b2b7586f-2b1e-4c30-a7fb-c2d1533b153b'
@@ -117,19 +119,20 @@ const intiOnboard = async (theme) => {
117119
gnosis,
118120
uauth,
119121
taho,
122+
cede,
120123
xdefi,
121124
torus,
122125
sequence,
123126
web3auth,
124-
infinityWallet,
125127
dcent,
126128
enkrypt,
127129
mewWallet,
128130
magic,
129131
fortmatic,
130132
keystone,
131133
keepkey,
132-
portis
134+
portis,
135+
infinityWallet
133136
],
134137
chains: [
135138
{
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# cede.store
2+
3+
## Wallet module for connecting cede.store Wallet SDK to web3-onboard
4+
5+
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.
6+
7+
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.
8+
9+
See [cede.store Wallet Developer Docs](https://docs.cede.store)
10+
11+
### Install
12+
13+
<Tabs values={['yarn', 'npm']}>
14+
<TabPanel value="yarn">
15+
16+
```sh copy
17+
yarn add @web3-onboard/cede-store
18+
```
19+
20+
</TabPanel>
21+
<TabPanel value="npm">
22+
23+
```sh copy
24+
npm install @web3-onboard/cede-store
25+
```
26+
27+
</TabPanel>
28+
</Tabs>
29+
30+
## Usage
31+
32+
```typescript
33+
import Onboard from '@web3-onboard/core'
34+
import cedeStoreWalletModule from '@web3-onboard/cede-store'
35+
36+
const cedeStoreWallet = cedeStoreWalletModule()
37+
38+
const onboard = Onboard({
39+
// ... other Onboard options
40+
wallets: [
41+
cedeStoreWallet
42+
//... other wallets
43+
]
44+
})
45+
46+
const connectedWallets = await onboard.connectWallet()
47+
console.log(connectedWallets)
48+
```
49+
50+
## Vault management
51+
52+
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.
53+
54+
A user can have multiple vaults with different CEX accounts inside.
55+
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.
56+
57+
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.
58+
If the user does not know the reputation of the dApp he is using, the most logical solution would be to give access
59+
only to the tracking vault so the dApp will not be able to initiate trade requests.
60+
61+
## CEX connection
62+
63+
All requests are divided into two categories:
64+
65+
- private requests
66+
- public requests
67+
68+
All public data, such as prices, volumes, historical data are collected from different exchanges and provided with our API.
69+
70+
All private requests, such as user balances, trades, open positions are coming from cede.store (from the user's machine).
71+
72+
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.
73+
74+
## Example of a workflow (fetch user's balances and transactions)
75+
76+
```typescript
77+
// get available vaults and accounts
78+
const { vaultPreview } = provider.getVaultPreviews()
79+
console.log(vaultPreview)
80+
81+
// Fetch user's balances from Binance and Coinbase
82+
const vaultId = vaultPreview[0].id
83+
await provider.request({
84+
method: 'balances',
85+
params: {
86+
vaultId,
87+
accountNames: ['Binance 1', 'Coinbase 1']
88+
}
89+
})
90+
91+
// Fetch user's transactions
92+
await provider.request({
93+
method: 'transactions',
94+
params: {
95+
vaultId
96+
}
97+
})
98+
```

packages/cede-store/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# @web3-onboard/cede-store
2+
3+
## Wallet module for connecting cede.store Wallet SDK to web3-onboard
4+
5+
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.
6+
7+
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.
8+
9+
See [cede.store Wallet Developer Docs](https://docs.cede.store)
10+
11+
### Install
12+
13+
`npm i @web3-onboard/cede-store`
14+
15+
## Usage
16+
17+
```typescript
18+
import Onboard from '@web3-onboard/core'
19+
import cedeStoreWalletModule from '@web3-onboard/cede-store'
20+
21+
const cedeStoreWallet = cedeStoreWalletModule()
22+
23+
const onboard = Onboard({
24+
// ... other Onboard options
25+
wallets: [
26+
cedeStoreWallet
27+
//... other wallets
28+
]
29+
})
30+
31+
const connectedWallets = await onboard.connectWallet()
32+
console.log(connectedWallets)
33+
```
34+
35+
## Vault management
36+
37+
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.
38+
39+
A user can have multiple vaults with different CEX accounts inside.
40+
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.
41+
42+
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.
43+
If the user does not know the reputation of the dApp he is using, the most logical solution would be to give access
44+
only to the tracking vault so the dApp will not be able to initiate trade requests.
45+
46+
## CEX connection
47+
48+
All requests are divided into two categories:
49+
50+
- private requests
51+
- public requests
52+
53+
All public data, such as prices, volumes, historical data are collected from different exchanges and
54+
provided with our API.
55+
56+
All private requests, such as user balances, trades, open positions are coming from cede.store (from the user's machine).
57+
58+
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.
59+
60+
## Example of a workflow (fetch user's balances and transactions)
61+
62+
```typescript
63+
// get available vaults and accounts
64+
const { vaultPreview } = provider.getVaultPreviews()
65+
console.log(vaultPreview)
66+
67+
// Fetch user's balances from Binance and Coinbase
68+
const vaultId = vaultPreview[0].id
69+
await provider.request({
70+
method: 'balances',
71+
params: {
72+
vaultId,
73+
accountNames: ['Binance 1', 'Coinbase 1']
74+
}
75+
})
76+
77+
// Fetch user's transactions
78+
await provider.request({
79+
method: 'transactions',
80+
params: {
81+
vaultId
82+
}
83+
})
84+
```

packages/cede-store/package.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"name": "@web3-onboard/cede-store",
3+
"version": "2.0.0-alpha.1",
4+
"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.",
5+
"keywords": [
6+
"Ethereum",
7+
"Web3",
8+
"EVM",
9+
"dapp",
10+
"Multichain",
11+
"Wallet",
12+
"Transaction",
13+
"Provider",
14+
"Hardware Wallet",
15+
"Notifications",
16+
"React",
17+
"Svelte",
18+
"Vue",
19+
"Next",
20+
"Nuxt",
21+
"MetaMask",
22+
"Coinbase",
23+
"WalletConnect",
24+
"Ledger",
25+
"Trezor",
26+
"Connect Wallet",
27+
"Ethereum Hooks",
28+
"Blocknative",
29+
"Mempool",
30+
"pending",
31+
"confirmed",
32+
"Injected Wallet",
33+
"Crypto",
34+
"Crypto Wallet",
35+
"Tally Ho",
36+
"Taho",
37+
"Taho Wallet",
38+
"cede.store",
39+
"cede",
40+
"cedelabs"
41+
],
42+
"repository": {
43+
"type": "git",
44+
"url": "https://github.com/blocknative/web3-onboard.git",
45+
"directory": "packages/core"
46+
},
47+
"homepage": "https://onboard.blocknative.com",
48+
"bugs": "https://github.com/blocknative/web3-onboard/issues",
49+
"module": "dist/index.js",
50+
"browser": "dist/index.js",
51+
"main": "dist/index.js",
52+
"type": "module",
53+
"typings": "dist/index.d.ts",
54+
"files": [
55+
"dist"
56+
],
57+
"scripts": {
58+
"build": "tsc",
59+
"dev": "tsc -w",
60+
"type-check": "tsc --noEmit"
61+
},
62+
"license": "MIT",
63+
"devDependencies": {
64+
"@ethersproject/providers": "^5.5.0",
65+
"@types/lodash.uniqby": "^4.7.6",
66+
"@types/node": "^17.0.21",
67+
"ts-node": "^10.2.1",
68+
"typescript": "^4.5.5",
69+
"window": "^4.2.7"
70+
},
71+
"dependencies": {
72+
"@cedelabs/providers": "^0.0.7",
73+
"@web3-onboard/common": "^2.3.0-alpha.1"
74+
}
75+
}

packages/cede-store/src/icon.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export default `
2+
<svg width="100%" height="100%" viewBox="0 0 115 115" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<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)"/>
4+
<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"/>
5+
<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"/>
6+
<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"/>
7+
<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"/>
8+
<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"/>
9+
<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"/>
10+
<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"/>
11+
<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"/>
12+
<defs>
13+
<linearGradient id="paint0_linear_1990_147351" x1="79.5" y1="133.5" x2="80.5" y2="-67" gradientUnits="userSpaceOnUse">
14+
<stop stop-color="#5EA6FF"/>
15+
<stop offset="1" stop-color="#5EA6FF" stop-opacity="0.4"/>
16+
</linearGradient>
17+
</defs>
18+
</svg>
19+
`

0 commit comments

Comments
 (0)