From 498b631b744c0d87ab8872e5d01c749467222499 Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Thu, 7 Nov 2024 17:19:26 +1100 Subject: [PATCH] fix: ref fixes --- apps/staking/app/faucet/actions.ts | 12 ++------ apps/staking/app/faucet/utils.tsx | 35 ++++++++++-------------- apps/staking/components/ActionModule.tsx | 2 +- 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/apps/staking/app/faucet/actions.ts b/apps/staking/app/faucet/actions.ts index 57b87e43..b2ab6095 100644 --- a/apps/staking/app/faucet/actions.ts +++ b/apps/staking/app/faucet/actions.ts @@ -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'; @@ -28,6 +21,7 @@ import { TABLE, TransactionHistory, } from './utils'; +import { formatSENTBigInt } from '@session/contracts/hooks/SENT'; class FaucetError extends Error { faucetError: FAUCET_ERROR; @@ -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)})` ); } diff --git a/apps/staking/app/faucet/utils.tsx b/apps/staking/app/faucet/utils.tsx index 27561bf8..7b0e3136 100644 --- a/apps/staking/app/faucet/utils.tsx +++ b/apps/staking/app/faucet/utils.tsx @@ -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', @@ -26,8 +25,8 @@ export enum TRANSACTIONS_TABLE { DISCORD = 'discord', TELEGRAM = 'telegram', OPERATOR = 'operator', - WALLET = 'wallet', CODE = 'code', + WALLET = 'wallet', ETHHASH = 'ethhash', ETHAMOUNT = 'ethamount', } @@ -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 = 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 = test.map(({ address, uses }) => ({ +// codes: new Set([encodeAddressToHashId(address)]), +// creatorWallet: address, +// maxUses: uses, +// drip: 5000000000000n, +// })); +// createWalletReferralCodes({ params }); +// } /* interface NodeOperatorScoreResponse { diff --git a/apps/staking/components/ActionModule.tsx b/apps/staking/components/ActionModule.tsx index 170adcfa..137d4210 100644 --- a/apps/staking/components/ActionModule.tsx +++ b/apps/staking/components/ActionModule.tsx @@ -47,7 +47,7 @@ export default function ActionModule({