Skip to content

Commit

Permalink
fix: Currencies info
Browse files Browse the repository at this point in the history
  • Loading branch information
desislavva committed Apr 5, 2024
1 parent 008ac9b commit 0c93565
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/contracts/types/CurrencyInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface CurrencyInfo {
bankSymbol: string,
decimalDigits: number,
dexSymbol: string,
group: string,
ticker: string
bankSymbol: string;
decimalDigits: number;
dexSymbol: string;
group: string;
ticker: string;
}
12 changes: 6 additions & 6 deletions src/utils/AssetUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AssetUtils {
public static findTickersByGroup(currenciesInfo: CurrencyInfo[], group: string): string[] {
const tickers: string[] = [];

currenciesInfo.forEach(currencyInfo => {
currenciesInfo.forEach((currencyInfo) => {
if (currencyInfo.group === group) {
tickers.push(currencyInfo.ticker);
}
Expand All @@ -43,15 +43,15 @@ export class AssetUtils {
}

public static findDexSymbolByTicker(currenciesInfo: CurrencyInfo[], ticker: string): string | null {
const dexSymbol = currenciesInfo.find(currencyInfo => currencyInfo.ticker === ticker);
const currencyInfo = currenciesInfo.find((currencyInfo) => currencyInfo.ticker === ticker);

return dexSymbol ? dexSymbol.dexSymbol : null;
return currencyInfo ? currencyInfo.dexSymbol : null;
}

public static findBankSymbolByTicker(currenciesInfo: CurrencyInfo[], ticker: string): string | null {
const bankSymbol = currenciesInfo.find(currencyInfo => currencyInfo.ticker === ticker);
const currencyInfo = currenciesInfo.find((currencyInfo) => currencyInfo.ticker === ticker);

return bankSymbol ? bankSymbol.dexSymbol : null;
return currencyInfo ? currencyInfo.bankSymbol : null;
}

/**
Expand All @@ -61,7 +61,7 @@ export class AssetUtils {
* "'ibc/' + sha256('transfer' + '/' + ibc_route[0] + '/' + ... + 'transfer' + '/' + ibc_route[n-1] + '/' + symbol) otherwise."
*/
public static makeIBCMinimalDenom(ticker: string, currenciesData: NetworkData, network: Networks, protocol: string): string {
let currency = currenciesData.networks.list[network].currencies[ticker];
const currency = currenciesData.networks.list[network].currencies[ticker];

if (currency?.native) {
return currency?.native.symbol;
Expand Down

0 comments on commit 0c93565

Please sign in to comment.