Skip to content

Commit

Permalink
fix: zero locked balance
Browse files Browse the repository at this point in the history
  • Loading branch information
edu-stx authored and kyranjamie committed Apr 3, 2023
1 parent dcdce05 commit 528b5bc
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 318 deletions.
2 changes: 1 addition & 1 deletion app/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class Api {

async getMempoolTransactions(address: string): Promise<MempoolTransaction[]> {
const mempoolTxs = await axios.get(
urljoin(this.baseUrl, `/extended/v1/tx/mempool?limit=200&address=${address}`),
urljoin(this.baseUrl, `/extended/v1/tx/mempool?limit=50&address=${address}`),
{ params: { unanchored: true } }
);
return mempoolTxs.data.results;
Expand Down
7 changes: 4 additions & 3 deletions app/components/home/stacking-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BigNumber from 'bignumber.js';

import { RootState } from '@store/index';
import { formatPoxAddressToNetwork } from '@utils/stacking';
import { selectAccountBalanceLocked, selectStackerInfo } from '@store/stacking/stacking.reducer';
import { selectStackerInfo } from '@store/stacking/stacking.reducer';
import stackingImg from '@assets/images/abstract-btc-stx-bar-chart.svg';
import {
InfoCard,
Expand All @@ -19,12 +19,13 @@ import { Hr } from '@components/hr';
import { toHumanReadableStx } from '@utils/unit-convert';
import { truncateMiddle } from '@utils/tx-utils';
import { ExternalLink } from '@components/external-link';
import { useBalance } from '@hooks/use-balance';

export const StackingCard: FC = () => {
const { stackerInfo } = useSelector((state: RootState) => ({
stackerInfo: selectStackerInfo(state),
}));
const accountBalanceLocked = useSelector((state: RootState) => selectAccountBalanceLocked(state));
const { lockedBalance } = useBalance();

if (!stackerInfo?.isCurrentlyStacking) return null;

Expand All @@ -42,7 +43,7 @@ export const StackingCard: FC = () => {
fontFamily="Open Sauce"
letterSpacing="-0.02em"
>
{accountBalanceLocked !== null && toHumanReadableStx(Number(accountBalanceLocked))}
{lockedBalance !== null && toHumanReadableStx(Number(lockedBalance))}
</Text>
</Flex>
<Hr />
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
"@commitlint/config-conventional": "12.0.1",
"@octokit/types": "6.13.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.4.3",
"@stacks/eslint-config": "1.0.9",
"@stacks/prettier-config": "0.0.8",
"@stacks/stacks-blockchain-api-types": "0.63.0-beta.0",
"@stacks/eslint-config": "1.2.0",
"@stacks/prettier-config": "0.0.10",
"@stacks/stacks-blockchain-api-types": "7.1.2",
"@types/argon2-browser": "1.12.0",
"@types/bcryptjs": "2.4.2",
"@types/bn.js": "5.1.0",
Expand Down Expand Up @@ -218,9 +218,9 @@
"@segment/analytics-next": "1.48.0",
"@sentry/electron": "3.0.0",
"@sentry/react": "6.17.9",
"@stacks/blockchain-api-client": "0.62.3",
"@stacks/blockchain-api-client": "7.1.1",
"@stacks/common": "6.0.0",
"@stacks/ui": "7.8.0",
"@stacks/ui": "7.10.0",
"@stacks/ui-core": "7.3.0",
"@stacks/ui-theme": "7.5.0",
"@stacks/ui-utils": "7.5.0",
Expand Down
Loading

0 comments on commit 528b5bc

Please sign in to comment.