From bfdce5930e1996585c0f3e1daf01beb3874f1720 Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Thu, 3 Aug 2023 14:35:51 +0200 Subject: [PATCH] v1.6.1 --- package.json | 5 ++--- src/components/redbank/BorrowColumns/useBorrowColumns.tsx | 6 ++++++ src/components/redbank/DepositColumns/useDepositColumns.tsx | 6 ++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6d137fa..bc70dbe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mars", "homepage": "./", - "version": "1.6.0", + "version": "1.6.1", "license": "SEE LICENSE IN LICENSE FILE", "private": false, "scripts": { @@ -22,11 +22,10 @@ "@cosmjs/launchpad": "^0.27.1", "@cosmjs/proto-signing": "^0.31.0", "@cosmjs/stargate": "^0.31.0", - "@marsprotocol/wallet-connector": "^1.9.6", + "@marsprotocol/wallet-connector": "^2.0.2", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@ramonak/react-progress-bar": "^5.0.3", - "@sentry/nextjs": "^7.36.0", "@tanstack/react-query": "^4.24.4", "@tanstack/react-table": "^8.7.9", "@testing-library/dom": "^8.20.0", diff --git a/src/components/redbank/BorrowColumns/useBorrowColumns.tsx b/src/components/redbank/BorrowColumns/useBorrowColumns.tsx index 53a9895..25e6a25 100644 --- a/src/components/redbank/BorrowColumns/useBorrowColumns.tsx +++ b/src/components/redbank/BorrowColumns/useBorrowColumns.tsx @@ -1,4 +1,5 @@ import { ColumnDef, createColumnHelper } from '@tanstack/react-table' +import BigNumber from 'bignumber.js' import { AnimatedNumber, Button, CellAmount, SVG, TextTooltip } from 'components/common' import Image from 'next/image' import { useMemo } from 'react' @@ -49,6 +50,11 @@ export const useBorrowColumns = () => { }), columnHelper.accessor('borrowBalance', { enableSorting: enableSorting, + sortingFn: (a, b): number => { + const balanceA = new BigNumber(a.original.borrowBalance).shiftedBy(-a.original.decimals) + const balanceB = new BigNumber(b.original.borrowBalance).shiftedBy(-b.original.decimals) + return balanceA.minus(balanceB).toNumber() + }, header: () => ( { }), columnHelper.accessor('depositBalance', { enableSorting: enableSorting, + sortingFn: (a, b): number => { + const balanceA = new BigNumber(a.original.depositBalance).shiftedBy(-a.original.decimals) + const balanceB = new BigNumber(b.original.depositBalance).shiftedBy(-b.original.decimals) + return balanceA.minus(balanceB).toNumber() + }, header: () => (