Skip to content

Commit

Permalink
doc: add perms (#354)
Browse files Browse the repository at this point in the history
* doc: add perms
  • Loading branch information
RamyEB authored May 21, 2024
1 parent 47547e4 commit 123af98
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 1 deletion.
8 changes: 8 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ walletApiClient.account.list(params?: { currencyIds?: string[] }): Promise<Accou

**Returns**: A promise that resolves with an array of Account objects.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`account.list`

##### Example:

```javascript
Expand Down Expand Up @@ -52,6 +55,8 @@ walletApiClient.account.request(params?: { currencyIds?: string[] }): Promise<Ac

**Returns**: A promise that resolves with the selected Account object.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions) `account.request`

##### Example:

```javascript
Expand All @@ -78,6 +83,9 @@ walletApiClient.account.receive(accountId: string): Promise<string>

**Returns**: A promise that resolves with the verified address as a string.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`account.receive`

##### Example:

```javascript
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/bitcoin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ walletApiClient.bitcoin.getXPub(accountId: string): Promise<string>

**Returns**: A promise that resolves with the xPub as a string.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`bitcoin.getXPub`

##### Example:

```javascript
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/currency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ walletApiClient.currency.list(params?: { currencyIds?: string[] }): Promise<Curr

**Returns**: A promise that resolves with an array of Currency objects.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`currency.list`

##### Example:

```javascript
Expand Down
9 changes: 9 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/device.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ walletApiClient.device.transport(params: DeviceTransport["params"]): Promise<HWT

**Returns**: A promise that resolves with an instance of Transport compatible with `@ledgerhq/hw-transport`.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`device.transport`

##### Example:

```javascript
Expand All @@ -47,6 +50,9 @@ walletApiClient.device.open(params: DeviceOpen["params"]): Promise<HWTransport>

**Returns**: A promise that resolves with an instance of Transport compatible with `@ledgerhq/hw-transport`.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`device.open`

##### Example:

```javascript
Expand All @@ -73,6 +79,9 @@ walletApiClient.device.select(params: DeviceSelect["params"]): Promise<DeviceSel

**Returns**: A promise that resolves with a `deviceId` which can be used with the `device.open` method.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`device.select`

##### Example:

```javascript
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/exchange.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ walletApiClient.exchange.start(exchangeType: 'SWAP' | 'SELL' | 'FUND'): Promise<

**Returns**: A promise that resolves with an object containing the `transactionId` which is used to complete the exchange process.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`exchange.start`

##### Example:

```javascript
Expand Down Expand Up @@ -69,6 +72,9 @@ walletApiClient.exchange.complete(params: {

**Returns**: A promise that resolves with an object containing the `transactionHash` of the broadcasted transaction.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`exchange.complete`

##### Example:

```javascript
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ walletApiClient.message.sign(accountId: string, message: Buffer, meta?: Record<s

**Errors**: This method can throw an `RpcError` if an error occurs on the server-side.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`message.sign`

##### Example:

```javascript
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ walletApiClient.storage.get(key: string, storeId?: string): Promise<string | und

**Returns**: A promise that resolves with the value as a string or `undefined` if the key does not exist.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`storage.get`

##### Example:

```javascript
Expand Down Expand Up @@ -50,6 +53,9 @@ walletApiClient.storage.set(key: string, value: string, storeId?: string): Promi

**Returns**: A promise that resolves when the data is successfully stored. There is no return value.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`storage.set`

##### Example:

```javascript
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/pages/APIs/wallet-api/core/modules/transaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ walletApiClient.transaction.sign(

**Returns**: A promise that resolves with the raw signed transaction as a Buffer.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`transaction.sign`

##### Example:

```javascript
Expand Down Expand Up @@ -63,6 +66,9 @@ walletApiClient.transaction.signAndBroadcast(

**Returns**: A promise that resolves with the transaction hash as a string.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`transaction.signAndBroadcast`

##### Example:

```javascript
Expand Down
11 changes: 10 additions & 1 deletion apps/docs/pages/APIs/wallet-api/core/modules/wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ walletApiClient.wallet.userId(): Promise<string>

- **Returns**: A promise that resolves with the user ID as a string.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`wallet.userId`

##### Example:

```javascript
Expand All @@ -39,7 +42,10 @@ Retrieve information about the connected wallet.
walletApiClient.wallet.info(): Promise<WalletInfo["result"]>
```

- **Returns**: A promise that resolves with an object containing information about the connected wallet.
**Returns**: A promise that resolves with an object containing information about the connected wallet.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`wallet.info`

##### Example:

Expand All @@ -64,6 +70,9 @@ walletApiClient.wallet.capabilities(): Promise<string[]>

- **Returns**: A promise that resolves with an array of strings representing the method IDs.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`wallet.capabilities`

##### Example:

```javascript
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/react/hooks/useAccounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Each account object in the array contains essential information such as its type

Here is an example that shows how to use the `useAccounts` hook inside a React component:

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`account.list`

```jsx
import React from "react";
import { useAccounts } from "@ledgerhq/wallet-api-client-react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The `useCapabilities` hook is part of the `@ledgerhq/wallet-api-client-react` pa
### Sample Code

Here is an example that shows how to use the `useCapabilities` hook inside a React component:

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`wallet.capabilities`

```jsx

Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/react/hooks/useCurrencies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ In addition, you can filter the currencies accessible by setting the `"currencie

Here is an example that shows how to use the `useCurrencies` hook inside a React component:

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`currency.list`

```jsx
import React, { useState } from "react";
import { useCurrencies } from "@ledgerhq/wallet-api-client-react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The `useRequestAccount` hook facilitates requesting access to a user’s account

Here is an example of how to use the `useRequestAccount` hook within a simple React application:

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`account.request`

```javascript
import React, { useEffect, useState } from "react";
import { useRequestAccount } from "@ledgerhq/wallet-api-client-react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The `useSignAndBroadcastTransaction` hook is part of the Ledger Wallet API Clien

Below is an example demonstrating how to use the `useSignAndBroadcastTransaction` hook to sign and broadcast an Ethereum transaction.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`transaction.signAndBroadcast`

```jsx
import React, { useEffect, useState, useCallback } from 'react';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The `useSignMessage` hook facilitates the process of signing a message using a u

Here's an example of how to use the `useSignMessage` hook within a simple React application:

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`message.sign`

```javascript
import React, { useEffect, useState } from "react";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The `useSignTransaction` hook is part of the Ledger Wallet API Client for React.

Below is an example demonstrating how to use the `useSignTransaction` hook to sign an Ethereum transaction.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`transaction.sign`

```jsx
import React, { useEffect, useState, useCallback } from 'react';
import {
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/react/hooks/useUserId.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The `useUserId` hook is part of the Ledger Wallet API Client for React. It allow

Below is an example demonstrating how to use the `useUserId` hook to fetch and display the User ID.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`wallet.userId`

```jsx
import React, { useEffect } from 'react';
import { useUserId } from '@ledgerhq/wallet-api-client-react';
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/pages/APIs/wallet-api/react/hooks/useWalletInfo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The `useWalletInfo` hook is part of the Ledger Wallet API Client for React. It a

Below is an example demonstrating how to use the `useWalletInfo` hook to fetch and display the wallet information.

[**Required permission**:](https://developers.ledger.com/APIs/wallet-api/appendix/manifest#permissions)
`wallet.info`

```jsx
import React, { useEffect } from 'react';
import { useWalletInfo } from '@ledgerhq/wallet-api-client-react';
Expand Down

0 comments on commit 123af98

Please sign in to comment.