From b23f8ef56cc5a1611739e60aa612fb1c223d5f0f Mon Sep 17 00:00:00 2001 From: Ramy EL BEHEDY <32883529+RamyEB@users.noreply.github.com> Date: Wed, 28 Jun 2023 14:58:21 +0200 Subject: [PATCH] Details to manifest page (#196) * feat: add details to manifest page --- apps/docs/pages/appendix/manifest.mdx | 155 ++++++++++++++++++ apps/docs/pages/appendix/manifest/_meta.json | 27 --- apps/docs/pages/appendix/manifest/index.mdx | 16 -- .../pages/appendix/manifest/manifestV1.mdx | 57 ------- .../pages/appendix/manifest/manifestV2.mdx | 89 ---------- .../pages/appendix/manifest/permissions.mdx | 30 ---- 6 files changed, 155 insertions(+), 219 deletions(-) create mode 100644 apps/docs/pages/appendix/manifest.mdx delete mode 100644 apps/docs/pages/appendix/manifest/_meta.json delete mode 100644 apps/docs/pages/appendix/manifest/index.mdx delete mode 100644 apps/docs/pages/appendix/manifest/manifestV1.mdx delete mode 100644 apps/docs/pages/appendix/manifest/manifestV2.mdx delete mode 100644 apps/docs/pages/appendix/manifest/permissions.mdx diff --git a/apps/docs/pages/appendix/manifest.mdx b/apps/docs/pages/appendix/manifest.mdx new file mode 100644 index 00000000..10cc995c --- /dev/null +++ b/apps/docs/pages/appendix/manifest.mdx @@ -0,0 +1,155 @@ +# Manifest + +_If you want to know more about the Discover tab and the Live Apps in general, you can read this page : [Start here](https://developers.ledger.com/docs/live-app/start-here/)_ + +### What is a manifest ? + +A Manifest is a config file that allows external applications and decentralized applications (dApps) to be integrated inside the Ledger Live software as a Live app and interact with all provided features. + +If you have followed instructions on the [How to create a Live app(comming soon)](/) page, you should now be ready to interact with the Dapp directly from Ledger Live interface to make sure all the basic features work as expected. + +### Ethereum Dapp Browser + +Your DApp will be ran inside the Ethereum Dapp Browser, which is a separate application loaded inside Ledger Live to handle interactions between a Dapp and the Ledger Live application. Don’t hesitate to have a look at this project’s Readme to have more information on how to use it and what are the currently supported RPC calls. + +### Manifest properties + +To test and integrate your application, you first need to write your application Manifest file. This file must contain some mandatory information, such as the app package names, the components, the permissions needed, the hardware and software features, etc. + +You don't have to fill in all the fields; we'll fill them in once your integration has been confirmed. + +However, here are a few elements you'll need to fill in yourself and their descriptions : + +_To be filled in by you_ + +| Properties | Descripton | Type | Requirements | +|------------------|-----------------|------------------|-----------------------------| +| id | uniq id of your app | string | a-z | 0-9 | | +| _author_ | Name of your organisation | string | optional | * | +| _name_ | Name of your live app (will be displayed and used to search your app inside the Discover section) | string | * | +| _url_ | Url of the live app homepage (users will be redirected to this link once they open your app) | string (URL) | * | +| _homepageUrl_ | Url of your organisation | string (URL) | optional | * | +| _supportUrl_ | Your support url | string (URL) | optional | * | +| _icon_ | Icon URL (will be displayed inside the Discover section) | string (URL) | optional | * | +| platforms | Platform compatibility | Array(enum) | "ios", "android", "desktop" | +| apiVersion | Specific manifest schema version (leave it as [default](#default-values)) | string | * | +| manifestVersion | Version supported by the app that the wallet needs to implement in order to support (leave it as [default](#default-values)) | enum | 2 | +| categories | List of category related to your Live App ([example](#default-values)) | Array(string) | items: min 1 → * | +| currencies | currencies supported by your Live App | Array(string) | items: min 1 → * | +| _content_ | Descripton of your Live App (will be displayed inside the Discover section) | Object | \{shortDescription: string, description: string\} | | +| [permissions](#permissions) | List of permissions you will need in order to interact with wallet-api | enum | | +| _domains_ | ___ | Array(string) | optional | * | +| [type](#params) | Type of you Live app | enum | "dapp", "walletApp", "webBrowser" | +| [params](#params) | ___| Object | depend on the type | +| visibility | Visibility of your live app inside Ledger Live. (Leave it as [default](#default-values)) | string | "complete", "searchable", "deep" | + +### Params + +#### params when `type = "dapp"` + +_Your app uses the [ETH DApp Browser](https://github.com/LedgerHQ/eth-dapp-browser)_ + +| Params | Type | Requirements | +|-----------|-----------------|-------------------------------------------| +| dappUrl | string (URL) | * | +| nanoApp | string | * | +| dappName | string | * | +| networks | Array (unique Object) | (chainID: number, nodeURL: string, currency: enum) | + + +#### params when `type = "walletApp"` + +_Your app uses the [Wallet API](https://github.com/LedgerHQ/wallet-api)_ + +| Params | Type | Requirements | +|-----------|-----------|--------------------| +| any param | any | optional | * | + + + +#### params when `type = "webBrowser"` + +_Your app uses the [Platform App Web Browser](https://github.com/LedgerHQ/platform-app-web-browser)_ + + +| Params | Type | Requirements | +|-------------|-----------------|-----------------| +| webUrl | string (URL) | * | +| webAppName | string | * | +| currencies | Array (enum) | "ethereum", "bitcoin", ... | + + +#### Permissions + +Permissions that allow your app to interact with methods : + +```javascript +"permissions": [ + + // Account and currencies + "account.list", + "account.receive", + "account.request", + "currency.list", + + // Device permissions + "device.close", + "device.exchange", + "device.transport", + + // Transaction + "message.sign", + "transaction.sign", + "transaction.signAndBroadcast", + + // Wallet Info + "wallet.capabilities", + "wallet.info", + "wallet.userId" + + ], + + ``` + + +#### Default values + +_Complete manifest.json file with default or examples values :_ + +```json +{ + "id": "ReplaceAppName", + "name": "ReplaceAppName", + "url": "http://localhost:3000/", + "params": { + "dappUrl": "http://localhost:3000/", + "nanoApp": "ReplaceAppName", + "dappName": "ReplaceAppName", + "networks": [ + { + "currency": "ethereum", + "chainID": 1, + "nodeURL": "..." + } + ] + }, + "homepageUrl": "http://localhost:3000/", + "platform": ["ios","android","desktop"], + "apiVersion": "^1.0.0", + "manifestVersion": "2", + "branch": "stable", + "categories": ["NFT", "Swap", "YourAppCategory"], + "currencies": "*", + "content": { + "shortDescription": { + "en": "Desc" + }, + "description": { + "en": "Desc" + } + }, + "permissions": [], + "domains": ["http://*"], + "visibility": "complete" +} +``` diff --git a/apps/docs/pages/appendix/manifest/_meta.json b/apps/docs/pages/appendix/manifest/_meta.json deleted file mode 100644 index 29b4db5a..00000000 --- a/apps/docs/pages/appendix/manifest/_meta.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "index": { - "title": "What is a manifest", - "theme": { - "breadcrumb": false, - "toc": true - } - }, - "manifestV1": { - "title": "Manifest v1", - "theme": { - "toc": true - } - }, - "manifestV2": { - "title": "Manifest v2 (soon)", - "theme": { - "toc": true - } - }, - "permissions": { - "title": "Permissions", - "theme": { - "toc": true - } - } -} diff --git a/apps/docs/pages/appendix/manifest/index.mdx b/apps/docs/pages/appendix/manifest/index.mdx deleted file mode 100644 index 1bee7086..00000000 --- a/apps/docs/pages/appendix/manifest/index.mdx +++ /dev/null @@ -1,16 +0,0 @@ -# Manifest - -##### Disclaimer -_If you want to know more about the Discover tab and the Live Apps in general, you can read this page : [Start here](https://developers.ledger.com/docs/live-app/start-here/)_ - -### What is a manifest ? - -A Manifest is an config file that allows external applications and decentralized applications (dApps) to be integrated inside the Ledger Live software as a Live app and interact with all provided feature. - -If you have followed instructions on the [How to create a Live app](/) page, you should now be ready to interact with the Dapp directly from Ledger Live interface to make sure all the basic features work as expected. - -### Ethereum Dapp Browser - -Your DApp will be ran inside the Ethereum Dapp Browser, which is a separate application loaded inside Ledger Live to handle interactions between a Dapp and the Ledger Live application. Don’t hesitate to have a look at this project’s Readme to have more information on how to use it and what are the currently supported RPC calls. - -To test and integrate your application, you first need to write your application Manifest file. This file must contain some mandatory information, such as the app package names, the components, the permissions needed, the hardware and software features, etc. diff --git a/apps/docs/pages/appendix/manifest/manifestV1.mdx b/apps/docs/pages/appendix/manifest/manifestV1.mdx deleted file mode 100644 index 2d88e7ff..00000000 --- a/apps/docs/pages/appendix/manifest/manifestV1.mdx +++ /dev/null @@ -1,57 +0,0 @@ -# Manifest V1 - - -_Template of a manifest.json file :_ - - -```json -{ - "id": "ReplaceAppName", - "name": "ReplaceAppName", - "url": "http://localhost:3000/", - "params": { - "dappUrl": "http://localhost:3000/", - "nanoApp": "ReplaceAppName", - "dappName": "ReplaceAppName", - "networks": [ - { - "currency": "ethereum", - "chainID": 1, - "nodeURL": "wss://eth-mainnet.ws.alchemyapi.io/v2/0fyudoTG94QWC0tEtfJViM9v2ZXJuij2" - } - ] - }, - "homepageUrl": "http://localhost:3000/", - "platform": ["ios","android","desktop"], - "apiVersion": "^2.0.0", - "manifestVersion": "1", - "branch": "stable", - "categories": ["ReplaceCatagories"], - "currencies": "*", - "content": { - "shortDescription": { - "en": "Desc" - }, - "description": { - "en": "Desc" - } - }, - "permissions": [ - "account.list", - "account.receive", - "account.request", - "currency.list", - "device.close", - "device.exchange", - "device.transport", - "message.sign", - "transaction.sign", - "transaction.signAndBroadcast", - "wallet.capabilities", - "wallet.info", - "wallet.userId" - ], - "domains": ["http://*"], - "visibility": "complete" -} -``` \ No newline at end of file diff --git a/apps/docs/pages/appendix/manifest/manifestV2.mdx b/apps/docs/pages/appendix/manifest/manifestV2.mdx deleted file mode 100644 index f0c4ba5f..00000000 --- a/apps/docs/pages/appendix/manifest/manifestV2.mdx +++ /dev/null @@ -1,89 +0,0 @@ -# Manifest V2 - -_Template of a manifest.json file :_ - -```json -{ - "id": "ReplaceAppName", - "name": "ReplaceAppName", - "url": "http://localhost:3000/", - "params": { - "dappUrl": "http://localhost:3000/", - "nanoApp": "ReplaceAppName", - "dappName": "ReplaceAppName", - "networks": [ - { - "currency": "ethereum", - "chainID": 1, - "nodeURL": "wss://eth-mainnet.ws.alchemyapi.io/v2/0fyudoTG94QWC0tEtfJViM9v2ZXJuij2" - } - ] - }, - "homepageUrl": "http://localhost:3000/", - "platform": ["ios","android","desktop"], - "apiVersion": "^2.0.0", - "manifestVersion": "1", - "branch": "stable", - "categories": ["ReplaceCatagories"], - "currencies": "*", - "content": { - "shortDescription": { - "en": "Desc" - }, - "description": { - "en": "Desc" - } - }, - "permissions": [], - "domains": ["http://*"], - "visibility": "complete" -} -``` - -## Manifest properties -| Properties | Type | Requirements | -|------------------|-----------------|-----------------------------| -| id | string | a-z | 0-9 | | -| author | string | optional | * | -| name | string | * | -| url | string (URL) | * | -| homepageUrl | string (URL) | optional | * | -| supportUrl | string (URL) | optional | * | -| icon | string (URL) | optional | * | -| platforms | Array(enum) | "ios", "android", "desktop" | -| apiVersion | string | * | -| manifestVersion | enum | 2 | -| categories | Array(string) | num items: min 1 → * | -| currencies | Array(string) | num items: min 1 → * | -| content | Object | \{shortDescription: string, description: string\} | | -| [permissions](/manifest/permissions)| enum | | -| domains | Array(string) | optional | * | -| type | enum | "dapp", "walletApp", "webBrowser" | -| params | Object | depend on the type | -| visibility | string | "complete", "searchable", "deep" | - -## params when type = "dapp" - -| Params | Type | Requirements | -|-----------|-----------------|-------------------------------------------| -| dappUrl | string (URL) | * | -| nanoApp | string | * | -| dappName | string | * | -| networks | Array (unique Object) | (chainID: number, nodeURL: string, currency: enum) | - - -## params when type = "walletApp" - -| Params | Type | Requirements | -|-----------|-----------|--------------------| -| *any param*| *any* | optional | * | - - - -## params when type = "webBrowser" - -| Params | Type | Requirements | -|-------------|-----------------|-----------------| -| webUrl | string (URL) | * | -| webAppName | string | * | -| currencies | Array (enum) | "ethereum", "bitcoin", ... | diff --git a/apps/docs/pages/appendix/manifest/permissions.mdx b/apps/docs/pages/appendix/manifest/permissions.mdx deleted file mode 100644 index 906d769c..00000000 --- a/apps/docs/pages/appendix/manifest/permissions.mdx +++ /dev/null @@ -1,30 +0,0 @@ -Permissions that allow you to use methods : - - -```javascript -"permissions": [ - - // Account and currencies - "account.list", - "account.receive", - "account.request", - "currency.list", - - // Device permissions - "device.close", - "device.exchange", - "device.transport", - - // Transaction - "message.sign", - "transaction.sign", - "transaction.signAndBroadcast", - - // Wallet Info - "wallet.capabilities", - "wallet.info", - "wallet.userId" - - ], - - ``` \ No newline at end of file