Skip to content

Commit

Permalink
fix: ref fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Nov 7, 2024
1 parent dded84a commit 498b631
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
12 changes: 3 additions & 9 deletions apps/staking/app/faucet/actions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
'use server';

import { COMMUNITY_DATE, FAUCET, FAUCET_ERROR, TICKER } from '@/lib/constants';
import {
addresses,
CHAIN,
formatSENT,
isChain,
SENT_DECIMALS,
SENT_SYMBOL,
} from '@session/contracts';
import { addresses, CHAIN, isChain, SENT_DECIMALS, SENT_SYMBOL } from '@session/contracts';
import { SENTAbi } from '@session/contracts/abis';
import { ETH_DECIMALS } from '@session/wallet/lib/eth';
import { createPublicWalletClient, createServerWallet } from '@session/wallet/lib/server-wallet';
Expand All @@ -28,6 +21,7 @@ import {
TABLE,
TransactionHistory,
} from './utils';
import { formatSENTBigInt } from '@session/contracts/hooks/SENT';

class FaucetError extends Error {
faucetError: FAUCET_ERROR;
Expand Down Expand Up @@ -196,7 +190,7 @@ export async function transferTestTokens({
*/
if (faucetTokenBalance < faucetTokenWarning) {
console.warn(
`Faucet wallet ${SENT_SYMBOL} balance (${formatSENT(faucetTokenBalance)} ${SENT_SYMBOL}) is below the warning threshold (${formatSENT(faucetTokenWarning)})`
`Faucet wallet ${SENT_SYMBOL} balance (${formatSENTBigInt(faucetTokenBalance)}) is below the warning threshold (${formatSENTBigInt(faucetTokenWarning)})`
);
}

Expand Down
35 changes: 15 additions & 20 deletions apps/staking/app/faucet/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Database, * as BetterSql3 from 'better-sqlite3-multiple-ciphers';
import path from 'path';
import { Address } from 'viem';
import { isProduction } from '@/lib/env';
import { encodeAddressToHashId } from '@/lib/hashid';

export enum TABLE {
TRANSACTIONS = 'transactions',
Expand All @@ -26,8 +25,8 @@ export enum TRANSACTIONS_TABLE {
DISCORD = 'discord',
TELEGRAM = 'telegram',
OPERATOR = 'operator',
WALLET = 'wallet',
CODE = 'code',
WALLET = 'wallet',
ETHHASH = 'ethhash',
ETHAMOUNT = 'ethamount',
}
Expand Down Expand Up @@ -677,24 +676,20 @@ export function createWalletReferralCodes({ params }: CreateWalletReferralCodesP
}
}

const test: Array<{ address: Address; uses: number }> = [
{ address: '0x501bcb8d257b8115dc6c5048bA34A4B9E668d46e', uses: 1 },
{ address: '0xd2A954dE41b04E999d1B94dB56B27AFaF4389053', uses: 1 },
{ address: '0x9EbDB42452eA9c01BeBaA4955ad3b875C461E065', uses: 1 },
{ address: '0x6Be297b19d6dEDDC4Cd61a54A01f054670F8703E', uses: 2 },
{ address: '0x349c2968926fdE3bb357eBD92519cE5Ec35E270A', uses: 3 },
{ address: '0xEaA90e3f8801B9797435C6A026deB1f4A018B83f', uses: 4 },
];

export function createWalletCodes() {
const params: Array<AddReferralCodesParams> = test.map(({ address, uses }) => ({
codes: new Set([encodeAddressToHashId(address)]),
creatorWallet: address,
maxUses: uses,
drip: 5000000000000n,
}));
createWalletReferralCodes({ params });
}
//
// const test: Array<{ address: Address; uses: number }> = [
//
// ];
//
// export function createWalletCodes() {
// const params: Array<AddReferralCodesParams> = test.map(({ address, uses }) => ({
// codes: new Set([encodeAddressToHashId(address)]),
// creatorWallet: address,
// maxUses: uses,
// drip: 5000000000000n,
// }));
// createWalletReferralCodes({ params });
// }

/*
interface NodeOperatorScoreResponse {
Expand Down
2 changes: 1 addition & 1 deletion apps/staking/components/ActionModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function ActionModule({
</ModuleGridContent>
<div
className={cn(
'absolute -z-10 h-full w-full bg-gradient-to-b from-[#0A0C0C] to-[#081512] opacity-70 bg-blend-lighten blur-lg xl:opacity-100 xl:blur-0'
'absolute -z-10 -ml-2 -mt-2 h-full w-full bg-gradient-to-b from-[#0A0C0C] to-[#081512] opacity-70 bg-blend-lighten blur-lg lg:-ml-10 lg:-mt-10 xl:opacity-100 xl:blur-0'
)}
style={background ? actionModuleBackground[background] : undefined}
/>
Expand Down

0 comments on commit 498b631

Please sign in to comment.