Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
cfranceschi-ledger committed Jan 23, 2024
2 parents ea0e71b + 2fd7cfb commit 75aeb01
Show file tree
Hide file tree
Showing 34 changed files with 1,393 additions and 5,693 deletions.
2 changes: 1 addition & 1 deletion components/Homepage/Numbers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Numbers = () => {
<NumberItem_2 number="200+" text="compatible DApps" />
<VerticalSeparator />
<HorizontalSeparator />
<NumberItem_3 number="6500000+" text="devices sold worldwide" />
<NumberItem_3 number="6052678+" text="devices sold worldwide" />
</div>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ export default withAuth(
}
)

// 2023-10-19 - To access all protected pages locally, when the github app is not available,
// comment out the line below
export const config = { matcher: ["/docs/exchange/integration/:path*", "/docs/exchange/flow/:path*"] }
// 2024-01-17 - To add login protection to your page, add the path in the ["...."] below,
export const config = { matcher: ["/docs/folder/page/:path*", "/docs/folder/page/:path*"] }
3 changes: 0 additions & 3 deletions pages/docs/connectivity/connect-kit/button-behaviour.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,5 @@ The DApp Connect Kit can be used to check the level of support for the Ledger Ex

More examples to come.

## Demo

<iframe src="https://legder-connect-kit.netlify.app/" style={{width:"100%", height:"700px"}} frameBorder="0">
</iframe>

2 changes: 1 addition & 1 deletion pages/docs/connectivity/connect-kit/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ export default function App() {
}
```
For more information take a look at the [wagmi](https://wagmi.sh/docs/getting-started) documentation.
For more information take a look at the [wagmi](https://wagmi.sh/react/getting-started) documentation.
### Web3-React
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'react-medium-image-zoom/dist/styles.css'

## Introduction
In this section you will see how to create a React Native application using the [@ledgerhq/react-native-hw-transport-ble](https://github.com/LedgerHQ/ledger-live/tree/develop/libs/ledgerjs/packages/react-native-hw-transport-ble).
For this project some general prerequisites are mandatory and you can find them [here](../prerequisites/).
For this project some general prerequisites are mandatory and you can find them [here](../).

Then you can now go through the prerequisite for Android development below.

Expand Down
40 changes: 37 additions & 3 deletions pages/docs/exchange.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
# Get your Swap service in Ledger Live
import { Card, Cards } from 'nextra/components'
import Zoom from 'react-medium-image-zoom'
import { Callout } from 'nextra/components'

As an exchange, it is possible to integrate your Swap service into Ledger Live as a native function of Ledger Live. To see what this integration is a good fit for your service, please get in touch with Ledger.
# Get your exchange services in Ledger Live

The following documentation is only accessible with a login after meeting with Ledger.
As a centralized exchange, it is possible to integrate your Swap/Sell/Buy/Fund services into Ledger Live as a native function of Ledger Live, thus offering security, ease and accessibility to millions of users!

With this integration, your services will appear directly under the corresponding section (Buy/Sell, Swap, Card) of Ledger Live.

<img
alt="Ledger Live screenshot"
src="/screen-ledger-live-native-integration.png"
/>

To see if this integration is a good fit for your service, please get in touch with Ledger beforehand.

<Callout type="info" emoji="👉">
There are two types of integration:
- Light autonomous first step integration: your LiveApp is accessible through the “Discover” section (like [Paraswap](https://www.ledger.com/blog/more-swapping-freedom-access-paraswap-directly-through-ledger-live)). For this integration, refer to the [Discover](/docs/discover) section instead.
- Main flow: your LiveApp can be integrated natively to Ledger Live. Better exposition but with additional API integration. More details in this section.
</Callout>


<Cards num={2}>
<Card
image
arrow
title="Flow breakdown"
href="/docs/exchange/flow">
<>![Cryptoassets Library](/blockchain-cover.jpg)</>
</Card>
<Card
image
arrow
title="How-to integrate"
href="/docs/exchange/integration">
<>![Cryptoassets Library](/crypto-cover.jpg)</>
</Card>
</Cards>
6 changes: 3 additions & 3 deletions pages/docs/exchange/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"flow": "Flow breakdown",
"integration": "How-to integrate"

"flow": "Swap - Flow breakdown",
"integration": "How-to integrate",
"glossary": "Glossary"
}
53 changes: 35 additions & 18 deletions pages/docs/exchange/flow.mdx
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
import Zoom from 'react-medium-image-zoom'
import 'react-medium-image-zoom/dist/styles.css'
import { Card, Cards } from 'nextra/components'

# Swap : CEX integrated as a Live App
# Swap : CEX integrated as a LiveApp

Our goal is to offer the best swap experience for our users in Ledger Live, by providing competitive quotes and security.

To offer our partner centralized exchanges the best time-to-market and and our users the best swap experience, we have built an hybrid solution:
To offer our centralize exchange partners the best time-to-market and and our users the best swap experience, we have built an hybrid solution:
- Native swap marketplace: An aggregator on Ledger Live listing our partners depending on the region, token coverage and prices.
- Partner Web app: A Live App experience (embedded web app) where users interact with the partner web app in Ledger Live, once they want to finalize the swap. The transaction is performed with ExchangeSDK.
- Partner Web app: A LiveApp experience (embedded web app) where users interact with the partner web app in Ledger Live, once they want to finalize the swap. The transaction is performed with ExchangeSDK.

This section of the documentation explains how the swap feature is displayed to the user in Ledger Live and how your web app is integrated into this hybrid solution.

<Cards num={2}>
<Card
image
arrow
title="Start Here"
href="./flow/start-here">
<>![Cryptoassets Library](/blockchain-cover.jpg)</>
</Card>
<Card
image
arrow
title="Flows"
href="./flow/flow-breakdown">
<>![Cryptoassets Library](/crypto-cover.jpg)</>
</Card>
## Full transaction flow

<Zoom>
<img
alt="Transaction flow"
src="/exchange/live-app-flow.png"
/>
</Zoom>

<Cards>
<Card
title="Quote display and user preferences"
href="./flow/quote"
/>
<Card
title="Partner LiveApp"
href="./flow/partner-live-app"
/>
<Card
title="Device transaction approval"
href="./flow/device-flow"
/>
<Card
title="Transaction status"
href="./flow/transaction-status"
/>
<Card
title="Edge Cases"
href="./flow/edge-cases"
/>
</Cards>
7 changes: 5 additions & 2 deletions pages/docs/exchange/flow/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"start-here": "Start here",
"flow-breakdown": "Flow breakdown"
"quote": "Quote display and user preferences",
"partner-live-app": "Partner LiveApp",
"device-flow": "Device transaction approval",
"transaction-status": "Transaction status",
"edge-cases": "Edge cases"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This payload contains the informations for the swap to be performed including:
- **Amount_to_wallet**: the amount of currency_to that the provider agrees to send to the client in exchange from amount_to_provider. This amount must also include the network fees that the provider will pay to send the crypto to the user.
- **Device_transaction_id**: the swap transaction nonce provided by the client at initialization (must be set to value of nonce from the API request)

More detail [here](../../integration/howto/providers-endpoints/#protobuf-message-payload).
More detail [here](../integration/providers-backend/#payload--signature).


## Transaction approval flow
Expand Down
File renamed without changes.
24 changes: 0 additions & 24 deletions pages/docs/exchange/flow/flow-breakdown.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions pages/docs/exchange/flow/flow-breakdown/_meta.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Zoom from 'react-medium-image-zoom'
import 'react-medium-image-zoom/dist/styles.css'

# Partner Live App
# Partner LiveApp

When the user selects a quote among partners and clicks on the exchange to access the selected partner’s app, the user is redirected to the Live App (embedded partner web app). The Live App is displayed in the LL browser as a webview.
When the user selects a quote among partners and clicks on the exchange to access the selected partner’s app, the user is redirected to the LiveApp (embedded partner web app). The LiveApp is displayed in the LL browser as a webview.

## Partner Live App flow
## Partner LiveApp flow

<Zoom>
<img
Expand All @@ -24,7 +24,7 @@ Following information is displayed:
- **Slippage** (only valid for floating rates): The acceptable slippage up to which a refund is requested. Slippage can either be fixed by the partner and/or set by the user
- **Fee**: The breakdown of the transaction (withdrawal fee, partner fee, Ledger fee)
- **To account**: The account name on which the user will receive the cryptocurrency
- **Account address**: The address of the account on which the user wikk receive cryptocurrency
- **Account address**: The address of the account on which the user will receive cryptocurrency

The user cannot change their choice on this page. For any change, they need to come back to the Ledger Live swap app.

Expand All @@ -34,13 +34,13 @@ To make sure the user has the last up to date quote, a timer must be set to upda

The login is on the summary screen. It allows the user to log in with email, password or OTP depending on the partner policy. If the user is already logged in, this step is passed.

The login page is on the partner Live App side only, and not handled by Ledger.
The login page is on the partner LiveApp side only, and not handled by Ledger.

### KYC screen

If a KYC is needed and the user has not performed it yet, the KYC onboarding must be included in the partner Live App.
If a KYC is needed and the user has not performed it yet, the KYC onboarding must be included in the partner LiveApp.

The KYC process is on the partner Live APp side only, and not handled by Ledger.
The KYC process is on the partner LiveApp side only, and not handled by Ledger.

### Summary screen after login

Expand All @@ -61,8 +61,8 @@ The partner provides navigation inside their app, so users can navigate from one
- To go back to the previous page
- To validate a screen and go forth in the process

Users can leave a partner Live App by clicking on the “X” button in the navigation bar. This action:
- Closes the partner Live App
Users can leave a partner LiveApp by clicking on the “X” button in the navigation bar. This action:
- Closes the partner LiveApp
- Brings the user back to the swap page with
- Last source and destination accounts
- Last source amount
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

To chose a swap service, the user selects:

1. A source cryptocurrency and a source [account](../start-here#glossary)
1. A source cryptocurrency and a source [account](../glossary)
2. An amount from the source account to swap
3. The destination cryptocurrency and the destination account
4. The maximum available amount in the selected source account. The displayed maximum includes the network fees to send the funds to the partner address (payinNetworkFees):
- **a.** In case they swap from the native coin, the maximum amount equals to : available balance - payinNetworkFees
- **b.** In case they swap from a token, it equals to : available balance (fees are paid in native coin)

## Output

Expand All @@ -18,7 +15,7 @@ According to the input amount, the partner's API is called to get a quote and ch
- Token (AVAILABLE / NOT AVAILABLE)
- Amount (TOO LOW / TOO HIGH)

If all of the above conditions are validated, the partners are displayed in Ledger Live, sorted by price (lowest price on top), with the following information:
If all of the above conditions are validated, the partners are displayed in Ledger Live with the following information. Between several CEX offers, `amountFrom` and network fee being the same, quotes are sorted by `amount to`, the first "best value" quote being the one offering the greatest `Receiving amount`:
1. Network fees to send crypto to partners - payinNetworkFees
2. Partner quote
- **a.** Partner image
Expand All @@ -38,19 +35,13 @@ If all of the above conditions are validated, the partners are displayed in Ledg
</ul>
Fees for sending the transaction payinNetworkFees (from Ledger to the partner) are not included in the displayed quote
</ul>
- **g.** time out = 5s. partner must reply in less that 10s, otherwise the quote is not displayed in the quote results. The user needs to trigger a quote again, or wait for timeout
- **g.** time out = 5s. partner must reply in less that 5s, otherwise the quote is not displayed in the quote results. The user needs to trigger a quote again, or wait for timeout


## User Preferences

The user can use filters and and change the network fee strategy to find the swap service fit to their need and preferences.

### Filters

The options are:
- Decentralized exchanges/ Centralized exchanges
- Fixed quotes/ Floating quotes

### Fees

The user can change network fees according to the speed of the transaction:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
import Zoom from 'react-medium-image-zoom'
import 'react-medium-image-zoom/dist/styles.css'

# Start here

## Full transaction flow

<Zoom>
<img
alt="Transaction flow"
src="/exchange/live-app-flow.png"
/>
</Zoom>


## Glossary
# Glossary

- **Coin**: The native currency on the blockchain.
- **Token**: Not the native currency on the blockchain. If the blockchain is “Ethereum”, then only “id”: “ETH” has the type “coin”. All the other currencies on the Ethereum network have the type “token”. Here is an example of USDC on the ethereum network.
Expand Down
Loading

0 comments on commit 75aeb01

Please sign in to comment.