mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-07-22 14:30:51 -04:00
add test to bootstrap network with random offers and trades
This commit is contained in:
parent
974362cd23
commit
a33c7fd830
2 changed files with 147 additions and 41 deletions
|
@ -802,12 +802,13 @@ export default class HavenoClient {
|
|||
* Get the current market price per 1 XMR in the given currency.
|
||||
*
|
||||
* @param {string} assetCode - asset code to get the price of
|
||||
* @return {number} the price of the asset per 1 XMR
|
||||
* @return {number|undefined} the price of the asset per 1 XMR
|
||||
*/
|
||||
async getPrice(assetCode: string): Promise<number> {
|
||||
async getPrice(assetCode: string): Promise<number|undefined> {
|
||||
try {
|
||||
return (await this._priceClient.getMarketPrice(new MarketPriceRequest().setCurrencyCode(assetCode), {password: this._password})).getPrice();
|
||||
} catch (e: any) {
|
||||
if (e.message.indexOf("not found") >= 0) return undefined;
|
||||
throw new HavenoError(e.message, e.code);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue