node-btcpay icon indicating copy to clipboard operation
node-btcpay copied to clipboard

client.get_rates fails if store ID is not specified

Open CherryDT opened this issue 3 years ago • 1 comments

Calling get_rates without store ID should work, as it does in btcpay-python as well.

The problem is that node-btcpay literally passes undefined as store ID parameter if none is given, instead of just omitting the parameter in the URL.

Therefore, client.get_rates(['BTC_USD']) fails while it works to use client.signed_get_request('/rates', {currencyPairs: 'BTC_USD'}) instead.

I think in general signed_get_request should omit undefined values.

CherryDT avatar Feb 12 '22 12:02 CherryDT

if you fix it, I can merge and probably push a package. Though I am in the process of deprecating this repo in favor of one using btcpay greenfield.

NicolasDorier avatar Feb 13 '22 12:02 NicolasDorier