Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Sep 5, 2024
1 parent 1795622 commit 6007c38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions packages/extension/src/providers/solana/types/sol-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ export class SolanaNetwork extends BaseNetwork {
const market = new MarketData();
marketData = await market.getMarketData([this.coingeckoID]);
}
const currentPrice = marketData.length
? marketData[0]!.current_price || 0
: 0;
const userBalance = fromBase(balance, this.decimals);
const usdBalance = new BigNumber(userBalance).times(
marketData.length ? marketData[0]!.current_price : 0
);
const usdBalance = new BigNumber(userBalance).times(currentPrice);
const nativeAsset: AssetsType = {
balance: balance,
balancef: formatFloatingPointValue(userBalance).value,
Expand All @@ -128,11 +129,9 @@ export class SolanaNetwork extends BaseNetwork {
icon: this.icon,
name: this.name_long,
symbol: this.currencyName,
value: marketData.length
? marketData[0]!.current_price.toString()
: "0",
value: marketData.length ? currentPrice.toString() : "0",
valuef: formatFiatValue(
marketData.length ? marketData[0]!.current_price.toString() : "0"
marketData.length ? currentPrice.toString() : "0"
).value,
contract: "",
decimals: this.decimals,
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/src/providers/solana/ui/libs/decode-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ const decodeTransaction = async (
res.isNegative = false;
if (token.cgId) {
const val = await marketData.getMarketData([token.cgId]);
res.USDval = new BigNumber(val[0]!.current_price)
res.USDval = new BigNumber(val[0]!.current_price ?? 0)
.times(fromBase(res.change.toString(), res.decimals))
.toString();
res.price = val[0]!.current_price.toString();
res.price = (val[0]!.current_price ?? 0).toString();
}
}
if (token.decimals === 0) {
Expand Down

2 comments on commit 6007c38

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.