Skip to content

Commit

Permalink
Fix: Update the prefix of XAU and XAG (#2683)
Browse files Browse the repository at this point in the history
* Updated the prefix of xau and xag to metal

* Added a list to manage the metal assets
  • Loading branch information
LeifuChen authored Jul 27, 2023
1 parent 400dabd commit 3397a7d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kwenta",
"version": "7.4.9",
"version": "7.4.10",
"description": "Kwenta",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kwenta/app",
"version": "7.4.9",
"version": "7.4.10",
"scripts": {
"dev": "next",
"build": "next build",
Expand Down
4 changes: 3 additions & 1 deletion packages/app/src/queries/rates/useCandlesticksQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ export const requestCandlesticks = async (
) => {
const ratesEndpoint = getRatesEndpoint(networkId)
const pythTvEndpoint = DEFAULT_PYTH_TV_ENDPOINT
const metalAssets = ['XAU', 'XAG']

Check warning on line 21 in packages/app/src/queries/rates/useCandlesticksQuery.ts

View check run for this annotation

Codecov / codecov/patch

packages/app/src/queries/rates/useCandlesticksQuery.ts#L21

Added line #L21 was not covered by tests
const prefix = metalAssets.includes(currencyKey!) ? 'Metal' : 'Crypto'

if (period <= 3600) {
const response = await axios
.get(pythTvEndpoint, {
params: {
from: minTimestamp,
to: maxTimestamp,
symbol: `Crypto.${currencyKey}/USD`,
symbol: `${prefix}.${currencyKey}/USD`,
resolution: getSupportedResolution(period),
},
})
Expand Down

0 comments on commit 3397a7d

Please sign in to comment.