On this page

## Methods

### (inner) fetch(publicKey, withAccountDataopt, transactionIdopt)

Fetches an exchange.

Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`publicKey` | String |  |  | The Public key of an Exchange account.
`withAccountData` | Boolean | <optional> | false | Include full on-chain Exchange account.
`transactionId` | String | <optional> |  | A transaction id from an interaction with an account - cancelling and completing Exchanges closes their on-chain accounts - by fetching a transaction we can have more context around interactions with an Exchange - useful for indexing.

Source
  - resources/exchanges.js, line 24

Example

    const exchange = await NinaClient.Exchange.fetch('Fxv2G4cQQAeEXN2WkaSAusbNV7E1ouV9W6XHXf3DEfQ8');

### (inner) fetchAll(paginationopt, withAccountDataopt)

Fetches all exchanges.

Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`pagination` | Object | <optional> | {limit: 20, offset: 0, sort: 'desc'} | Pagination options.
`withAccountData` | Boolean | <optional> | false | Include full on-chain Exchange accounts.

Source
  - resources/exchanges.js, line 8

Example

    const exchanges = await NinaClient.Exchange.fetchAll();

Type anything to view search result