Skip to content

Commit

Permalink
Merge pull request #2348 from decentdao/release/v0.3.2
Browse files Browse the repository at this point in the history
Release/v0.3.2
  • Loading branch information
adamgall committed Sep 12, 2024
2 parents abcfb32 + 6f48578 commit 4970ff5
Show file tree
Hide file tree
Showing 20 changed files with 940 additions and 785 deletions.
24 changes: 16 additions & 8 deletions netlify/functions/tokenBalances.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,24 @@ export default async function getTokenBalancesWithPrices(request: Request) {

const fetchFromMoralis = async (scope: { chain: string; address: Address }) => {
const tokensResponse = await Moralis.EvmApi.wallets.getWalletTokenBalancesPrice(scope);

const mappedTokensData = tokensResponse.result
.filter(tokenBalance => tokenBalance.balance.value.toBigInt() > 0n)
.map(
tokenBalance =>
({
...camelCaseKeys(tokenBalance.toJSON()),
decimals: Number(tokenBalance.decimals),
}) as unknown as TokenBalance,
);
.map(tokenBalance => {
const tokenData = {
...camelCaseKeys(tokenBalance.toJSON()),
} as unknown as TokenBalance;

if (
scope.chain === '1' &&
tokenData.tokenAddress === '0x8e870d67f660d95d5be530380d0ec0bd388289e1'
) {
// USDP and just hardcode it to $1 because Moralis is saying (as of Sept 11 2024) that the price is $0
tokenData.usdPrice = 1;
tokenData.usdValue = Number(tokenData.balanceFormatted) * tokenData.usdPrice;
}

return tokenData;
});

return mappedTokensData;
};
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "decent-interface",
"version": "0.3.1",
"version": "0.3.2",
"private": true,
"dependencies": {
"@amplitude/analytics-browser": "^2.11.1",
Expand Down
4 changes: 3 additions & 1 deletion src/components/pages/Roles/RoleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,12 @@ export function RoleCardEdit({
editStatus,
handleRoleClick,
}: RoleEditProps) {
const isRemovedRole = editStatus === EditBadgeStatus.Removed;
return (
<Card
mb="1rem"
onClick={handleRoleClick}
onClick={!isRemovedRole ? handleRoleClick : undefined}
cursor={!isRemovedRole ? 'pointer' : 'not-allowed'}
>
<Flex justifyContent="space-between">
<AvatarAndRoleName
Expand Down
Loading

0 comments on commit 4970ff5

Please sign in to comment.