Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-5683 feat(launchpad,1ui,graphql): update network page based on new designs #1094

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address comments and cleanup
  • Loading branch information
Vitalsine85 committed Feb 6, 2025
commit 9dd04b3e5b48af05393151104094c71e937b8524
8 changes: 4 additions & 4 deletions apps/launchpad/app/lib/graphql/client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { GraphQLClient } from 'graphql-request'

// if (process.env.HASURA_POINTS_ENDPOINT === undefined) {
// throw new Error('Points API endpoint not defined')
// }
if (process.env.HASURA_POINTS_ENDPOINT === undefined) {
throw new Error('Points API endpoint not defined')
}

export const pointsClient = new GraphQLClient(
'https://intuition-points-api.onrender.com/v1/graphql',
process.env.HASURA_POINTS_ENDPOINT,
)
11 changes: 7 additions & 4 deletions apps/launchpad/app/routes/_app+/rewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,21 @@ export default function Rewards() {
})

const feesPaidBeforeCutoff = formatUnits(
protocolFees?.before_cutoff?.aggregate?.sum?.amount,
protocolFees?.before_cutoff?.aggregate?.sum?.amount ?? 0n,
18,
)
const feesPaidAfterCutoff = formatUnits(
protocolFees?.after_cutoff?.aggregate?.sum?.amount,
protocolFees?.after_cutoff?.aggregate?.sum?.amount ?? 0n,
18,
)
const protocolPointsBeforeCutoff = Number(feesPaidBeforeCutoff) * 10000000
const protocolPoitnsAfterCutoff = Number(feesPaidAfterCutoff) * 2000000

const protocolPointsBeforeCutoff =
Number(feesPaidBeforeCutoff || '0') * 10000000
const protocolPoitnsAfterCutoff = Number(feesPaidAfterCutoff || '0') * 2000000
const protocolPointsTotal = Math.round(
protocolPointsBeforeCutoff + protocolPoitnsAfterCutoff,
)

const combinedTotal =
(relicPoints?.totalPoints ?? 0) +
(points?.totalPoints ?? 0) +
Expand Down