Methods
(inner) exchangeAccept(client, exchangeAccount, releasePublicKey)
Initializes an Exchange account.
Name | Type | Description |
---|---|---|
client | Object | The NinaClient instance. |
exchangeAccount | String | The public key of the Exchange account. |
releasePublicKey | String | The public key of the Release account. |
- Source
(inner) exchangeCancel(client, exchangeAccount) → {Object}
Cancels an initialized Exchange.
Name | Type | Description |
---|---|---|
client | Object | The NinaClient instance. |
exchangeAccount | String | The public key of the Exchange account. |
- Source
The transaction id and the public key of the Exchange.
- Type:
- Object
const canceledExchange = await exchangeCancel(client, exchangeAccount);
(inner) exchangeInit(client, exchangeAccount, isSelling, releasePublicKey) → {Object}
Initializes an Exchange account.
Name | Type | Description |
---|---|---|
client | Object | The NinaClient instance. |
exchangeAccount | String | The public key of the Exchange account. |
isSelling | Boolean | Whether the Exchange is selling or buying. |
releasePublicKey | String | The public key of the Release account. |
- Source
The transaction id, the Exchange account, the Release Public Key, and the Exchange Signer.
- Type:
- Object
(inner) fetch(publicKey, withAccountDataopt, transactionIdopt)
Fetches an exchange.
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
const exchange = await NinaClient.Exchange.fetch('Fxv2G4cQQAeEXN2WkaSAusbNV7E1ouV9W6XHXf3DEfQ8');
(inner) fetchAll(paginationopt, withAccountDataopt)
Fetches all exchanges.
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
const exchanges = await NinaClient.Exchange.fetchAll();