Skip to content

Commit

Permalink
DOCS: Add cede.store detailed documentation with an example flow
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnikter committed May 2, 2023
1 parent bd8ec18 commit 00ddaae
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 2 deletions.
56 changes: 54 additions & 2 deletions docs/src/routes/docs/[...4]wallets/cede-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 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
Expand All @@ -10,14 +14,14 @@ See [cede.store Wallet Developer Docs](https://docs.cede.store)
<TabPanel value="yarn">

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

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

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

</TabPanel>
Expand All @@ -42,3 +46,51 @@ const onboard = Onboard({
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 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
}
});
```
55 changes: 55 additions & 0 deletions packages/cede-store/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# @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
Expand All @@ -26,3 +31,53 @@ const onboard = Onboard({
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 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
}
});
```

0 comments on commit 00ddaae

Please sign in to comment.