Merge branch 'feat/beta-public' of github.com:RSSNext/Follow into feat/beta-public

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2024-10-17 19:55:16 +08:00
25 changed files with 515 additions and 140 deletions
+2
View File
@@ -120,3 +120,5 @@ export type ActionsInput = {
}[]
export const TransactionTypes = ["mint", "purchase", "tip", "withdraw"] as const
export type WalletModel = ExtractBizResponse<typeof apiClient.wallets.$get>["data"][number]
@@ -4,9 +4,10 @@ import { Trans, useTranslation } from "react-i18next"
import { Button } from "~/components/ui/button"
import { Tooltip, TooltipContent } from "~/components/ui/tooltip"
import { DAILY_CLAIM_AMOUNT } from "~/constants"
import { Level } from "~/modules/wallet/level"
import { useClaimCheck, useClaimWalletDailyRewardMutation } from "~/queries/wallet"
export const ClaimDailyReward = () => {
export const ClaimDailyReward = ({ level }: { level: number }) => {
const mutation = useClaimWalletDailyRewardMutation()
const { t } = useTranslation("settings")
@@ -23,6 +24,7 @@ export const ClaimDailyReward = () => {
disabled={!canClaim}
>
{canClaim ? t("wallet.claim.button.claim") : t("wallet.claim.button.claimed")}
<Level className="ml-3" level={level} hideIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
@@ -3,7 +3,6 @@ import { Trans, useTranslation } from "react-i18next"
import { Button } from "~/components/ui/button"
import { CopyButton } from "~/components/ui/code-highlighter"
import { Divider } from "~/components/ui/divider"
import { LoadingWithIcon } from "~/components/ui/loading"
import { Tooltip, TooltipContent, TooltipPortal, TooltipTrigger } from "~/components/ui/tooltip"
import { DAILY_CLAIM_AMOUNT } from "~/constants"
@@ -11,6 +10,7 @@ import { apiClient } from "~/lib/api-fetch"
import { cn } from "~/lib/utils"
import { SettingSectionTitle } from "~/modules/settings/section"
import { Balance } from "~/modules/wallet/balance"
import { Level } from "~/modules/wallet/level"
import { useWallet, wallet as walletActions } from "~/queries/wallet"
import { ClaimDailyReward } from "./claim-daily-reward"
@@ -48,87 +48,85 @@ export const MyWalletSection = () => {
}
return (
<>
<div className="space-y-8">
<div>
<div className="text-sm">
<i className="i-mgc-power mr-0.5 size-3.5 translate-y-px text-accent" />
<Trans
i18nKey="wallet.power.description"
ns="settings"
values={{ blockchainName: "VSL" }}
components={{
Link: (
<a
className="underline"
target="_blank"
href="https://scan.rss3.io/token/0xE06Af68F0c9e819513a6CD083EF6848E76C28CD8"
rel="noreferrer noopener"
/>
),
}}
/>
<p>{t("wallet.power.dailyClaim", { amount: DAILY_CLAIM_AMOUNT })}</p>
</div>
<SettingSectionTitle margin="compact" title={t("wallet.address.title")} />
<div className="group flex items-center gap-2 text-sm">
<a
href={`https://scan.rss3.io/address/${myWallet.address}`}
target="_blank"
className="underline"
>
{myWallet.address}
</a>
<CopyButton
value={myWallet.address!}
className="p-1 opacity-0 duration-200 group-hover:opacity-100 [&_i]:size-2.5"
/>
</div>
<SettingSectionTitle title={t("wallet.balance.title")} margin="compact" />
<div className="mb-2 flex items-end justify-between">
<div className="flex items-center gap-1">
<Balance className="text-xl font-bold text-accent">
{BigInt(myWallet.dailyPowerToken || 0n) + BigInt(myWallet.cashablePowerToken || 0n)}
</Balance>
<Button
variant="ghost"
onClick={() => refreshMutation.mutate()}
disabled={refreshMutation.isPending}
>
<i
className={cn(
"i-mgc-refresh-2-cute-re",
refreshMutation.isPending && "animate-spin",
)}
<div>
<div className="text-sm">
<i className="i-mgc-power mr-0.5 size-3.5 translate-y-px text-accent" />
<Trans
i18nKey="wallet.power.description"
ns="settings"
values={{ blockchainName: "VSL" }}
components={{
Link: (
<a
className="underline"
target="_blank"
href="https://scan.rss3.io/token/0xE06Af68F0c9e819513a6CD083EF6848E76C28CD8"
rel="noreferrer noopener"
/>
</Button>
</div>
<div className="flex gap-2">
<WithdrawButton />
<ClaimDailyReward />
</div>
</div>
<Tooltip>
<TooltipTrigger className="block">
<div className="flex flex-row items-center gap-x-2 text-xs text-zinc-600 dark:text-neutral-400">
<span className="flex items-center gap-1 text-left">
{t("wallet.balance.withdrawable")} <i className="i-mingcute-question-line" />
</span>
<Balance className="center text-[12px] font-medium">
{myWallet.cashablePowerToken}
</Balance>
</div>
</TooltipTrigger>
<TooltipPortal>
<TooltipContent align="start" className="z-[999]">
<p>{t("wallet.balance.withdrawableTooltip")}</p>
</TooltipContent>
</TooltipPortal>
</Tooltip>
),
}}
/>
<p>{t("wallet.power.dailyClaim", { amount: DAILY_CLAIM_AMOUNT })}</p>
</div>
</div>
<SettingSectionTitle margin="compact" title={t("wallet.address.title")} />
<div className="group flex items-center gap-2 text-sm">
<a
href={`https://scan.rss3.io/address/${myWallet.address}`}
target="_blank"
className="underline"
>
{myWallet.address}
</a>
<CopyButton
value={myWallet.address!}
className="p-1 opacity-0 duration-200 group-hover:opacity-100 [&_i]:size-2.5"
/>
</div>
<SettingSectionTitle title={t("wallet.balance.level")} margin="compact" />
<Level level={myWallet.level?.level || 0} />
<SettingSectionTitle title={t("wallet.balance.title")} margin="compact" />
<div className="mb-2 flex items-end justify-between">
<div className="flex items-center gap-1">
<Balance className="text-xl font-bold text-accent">
{BigInt(myWallet.dailyPowerToken || 0n) + BigInt(myWallet.cashablePowerToken || 0n)}
</Balance>
<Button
variant="ghost"
onClick={() => refreshMutation.mutate()}
disabled={refreshMutation.isPending}
>
<i
className={cn(
"i-mgc-refresh-2-cute-re",
refreshMutation.isPending && "animate-spin",
)}
/>
</Button>
</div>
<div className="flex gap-2">
<WithdrawButton />
<ClaimDailyReward level={myWallet.level?.level || 0} />
</div>
</div>
<Tooltip>
<TooltipTrigger className="block">
<div className="flex flex-row items-center gap-x-2 text-xs text-zinc-600 dark:text-neutral-400">
<span className="flex items-center gap-1 text-left">
{t("wallet.balance.withdrawable")} <i className="i-mingcute-question-line" />
</span>
<Divider className="my-8" />
<Balance className="center text-[12px] font-medium">
{myWallet.cashablePowerToken}
</Balance>
</div>
</TooltipTrigger>
<TooltipPortal>
<TooltipContent align="start" className="z-[999]">
<p>{t("wallet.balance.withdrawableTooltip")}</p>
</TooltipContent>
</TooltipPortal>
</Tooltip>
</div>
</>
)
}
@@ -0,0 +1,137 @@
import { Fragment } from "react"
import { useTranslation } from "react-i18next"
import { useWhoami } from "~/atoms/user"
import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar"
import { MotionButtonBase } from "~/components/ui/button"
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "~/components/ui/table"
import { EllipsisHorizontalTextWithTooltip } from "~/components/ui/typography"
import { replaceImgUrlIfNeed } from "~/lib/img-proxy"
import { cn } from "~/lib/utils"
import { usePresentUserProfileModal } from "~/modules/profile/hooks"
import { SettingSectionTitle } from "~/modules/settings/section"
import { Balance } from "~/modules/wallet/balance"
import { Level } from "~/modules/wallet/level"
import type { useWalletTransactions } from "~/queries/wallet"
import { useWalletRanking } from "~/queries/wallet"
const medals = ["", "🥇", "🥈", "🥉"]
const rankNumber = (index: number) => {
if (index < medals.length) {
return <span className="-ml-[3px]">{medals[index]}</span>
}
return <span>{index}</span>
}
export const PowerRanking: Component = ({ className }) => {
const { t } = useTranslation("settings")
const ranking = useWalletRanking()
return (
<div className="relative flex min-w-0 grow flex-col">
<SettingSectionTitle title={t("wallet.ranking.title")} />
<div className={cn("w-fit min-w-0 grow overflow-x-auto", className)}>
<Table className="w-full table-fixed text-sm">
<TableHeader className="sticky top-0 bg-theme-background">
<TableRow className="[&_*]:!font-semibold">
<TableHead className="w-20">#</TableHead>
<TableHead>{t("wallet.ranking.name")}</TableHead>
<TableHead>{t("wallet.ranking.power")}</TableHead>
<TableHead>{t("wallet.ranking.level")}</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{ranking.data?.map((row, index) => {
const lastRow = ranking.data?.[index - 1]
const hasGap = lastRow?.rank && row.rank && row.rank - lastRow.rank !== 1
return (
<Fragment key={row.userId}>
{!!hasGap && (
<>
<TableRow>
<TableCell className="py-2">...</TableCell>
</TableRow>
<TableRow>
<div className="h-px w-full" />
</TableRow>
</>
)}
<TableRow>
<TableCell className="py-2">{!!row.rank && rankNumber(row.rank)}</TableCell>
<TableCell className="py-2">
<UserRenderer
user={row.user}
avatarClassName={!!row.rank && row.rank <= 3 ? "size-5" : "size-4"}
/>
</TableCell>
<TableCell className="py-2">
<div className="flex items-center gap-1">
<i className="i-mgc-power align-text-bottom text-accent" />
<Balance>{row.powerToken}</Balance>
</div>
</TableCell>
<TableCell className="py-2">
{!!row.level && <Level level={row.level} />}
</TableCell>
</TableRow>
</Fragment>
)
})}
<TableRow>
<TableCell className="py-2">...</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</div>
)
}
const UserRenderer = ({
user,
avatarClassName,
}: {
user?: NonNullable<ReturnType<typeof useWalletTransactions>["data"]>[number][
| "fromUser"
| "toUser"]
avatarClassName?: string
}) => {
const { t } = useTranslation("settings")
const me = useWhoami()
const isMe = user?.id === me?.id
const name = isMe ? t("wallet.transactions.you") : user?.name || APP_NAME
const presentUserModal = usePresentUserProfileModal("drawer")
return (
<MotionButtonBase
onClick={() => {
if (user?.id) presentUserModal(user.id)
}}
className="flex w-full min-w-0 cursor-button items-center gap-2"
>
<Avatar className={cn("aspect-square duration-200 animate-in fade-in-0", avatarClassName)}>
<AvatarImage src={replaceImgUrlIfNeed(user?.image || undefined)} />
<AvatarFallback>{name?.slice(0, 2)}</AvatarFallback>
</Avatar>
<div className="ml-1 w-0 grow truncate">
<EllipsisHorizontalTextWithTooltip className="text-left">
{isMe ? (
<span className="font-bold">{t("wallet.transactions.you")}</span>
) : (
<span>{name}</span>
)}
</EllipsisHorizontalTextWithTooltip>
</div>
</MotionButtonBase>
)
}
@@ -10,6 +10,7 @@ import { useMeasure } from "~/hooks/common"
import { nextFrame } from "~/lib/dom"
import { UserRole } from "~/lib/enum"
import { cn } from "~/lib/utils"
import type { WalletModel } from "~/models"
import { useAchievementModal } from "~/modules/achievement/hooks"
import { usePresentUserProfileModal } from "~/modules/profile/hooks"
import { useSettingModal } from "~/modules/settings/modal/hooks"
@@ -27,7 +28,7 @@ import {
DropdownMenuTrigger,
} from "../../components/ui/dropdown-menu/dropdown-menu"
import { RootPortal } from "../../components/ui/portal"
import { useActivationModal } from "../activation"
import { Level } from "../wallet/level"
import type { LoginProps } from "./LoginButton"
import { LoginButton } from "./LoginButton"
import { UserAvatar } from "./UserAvatar"
@@ -46,6 +47,9 @@ export const ProfileButton: FC<LoginProps> = memo((props) => {
const navigate = useNavigate()
const role = useUserRole()
const wallet = useWallet()
const { isLoading: isLoadingWallet } = wallet
const myWallet = wallet.data?.[0]
if (status !== "authenticated") {
return <LoginButton {...props} />
@@ -79,8 +83,8 @@ export const ProfileButton: FC<LoginProps> = memo((props) => {
}}
>
<div className="flex w-full items-center justify-between gap-6 px-1.5 font-semibold">
<PowerButton />
<LevelButton />
<PowerButton isLoading={isLoadingWallet} myWallet={myWallet} />
<Level level={myWallet?.level?.level || 0} isLoading={isLoadingWallet} />
</div>
</DropdownMenuItem>
@@ -204,51 +208,15 @@ const TransitionAvatar = forwardRef<
)
})
function PowerButton() {
const wallet = useWallet()
const { isLoading } = wallet
const myWallet = wallet.data?.[0]
function PowerButton({ isLoading, myWallet }: { isLoading: boolean; myWallet?: WalletModel }) {
return (
<div className="flex items-center gap-1">
<i className="i-mgc-power text-accent" />
{isLoading ? (
<span className="h-3 w-8 animate-pulse rounded-xl bg-theme-inactive" />
) : (
<Balance>
{BigInt(myWallet?.dailyPowerToken || 0n) + BigInt(myWallet?.cashablePowerToken || 0n)}
</Balance>
<Balance>{BigInt(myWallet?.powerToken || 0n)}</Balance>
)}
</div>
)
}
function LevelButton() {
const role = useUserRole()
const { t } = useTranslation()
const presentActivationModal = useActivationModal()
if (role === UserRole.Trial) {
return (
<div className="group relative flex items-center gap-1">
<span className="duration-100 group-hover:opacity-0">Trial User</span>
<button
type="button"
className="center absolute inset-0 opacity-0 duration-200 group-hover:opacity-100"
onClick={(e) => {
e.stopPropagation()
presentActivationModal()
}}
>
{t("activation.activate")}
</button>
</div>
)
}
return (
<div className="flex items-center gap-1">
<i className="i-mgc-vip-2-cute-fi text-accent" />
<span>Lv.1</span>
<sub className="-translate-y-px text-[0.6rem] font-normal">x1</sub>
</div>
)
}
@@ -0,0 +1,29 @@
import { cn } from "~/lib/utils"
export const multiples = [0.1, 1, 2, 5, 18]
export const Level = ({
level,
isLoading,
hideIcon,
className,
}: {
level: number
isLoading?: boolean
hideIcon?: boolean
className?: string
}) => {
return (
<div className={cn("flex items-center gap-1", className)}>
{!hideIcon && <i className="i-mgc-vip-2-cute-fi text-accent" />}
{isLoading ? (
<span className="h-3 w-8 animate-pulse rounded-xl bg-theme-inactive" />
) : (
<>
<span>Lv.{level}</span>
<sub className="-translate-y-px text-[0.6rem] font-normal">x{multiples[level]}</sub>
</>
)}
</div>
)
}
@@ -1,6 +1,8 @@
import { useTranslation } from "react-i18next"
import { Divider } from "~/components/ui/divider"
import { MyWalletSection } from "~/modules/power/my-wallet-section"
import { PowerRanking } from "~/modules/power/ranking"
import { TransactionsSection } from "~/modules/power/transaction-section"
import { useSubViewTitle } from "../hooks"
@@ -23,6 +25,10 @@ export function Component() {
</div>
<MyWalletSection />
<Divider className="my-8" />
<PowerRanking />
<Divider className="my-8" />
<TransactionsSection />
</div>
)
+16
View File
@@ -42,6 +42,20 @@ export const wallet = {
},
),
},
ranking: {
get: () =>
defineQuery(
["wallet", "ranking"],
async () => {
const res = await apiClient.wallets.ranking.$get()
return res.data
},
{
rootKey: ["wallet", "ranking"],
},
),
},
}
export const useWallet = () => useAuthQuery(wallet.get())
@@ -49,6 +63,8 @@ export const useWallet = () => useAuthQuery(wallet.get())
export const useWalletTransactions = (query: Parameters<typeof wallet.transactions.get>[0] = {}) =>
useAuthQuery(wallet.transactions.get(query))
export const useWalletRanking = () => useAuthQuery(wallet.ranking.get())
export const useCreateWalletMutation = () =>
useMutation({
mutationKey: ["createWallet"],
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "مسار RSSHub",
"discover.rss_url": "رابط RSS",
"discover.select_placeholder": "اختر",
"early_access": "الوصول المبكر",
"entry_actions.copy_link": "نسخ الرابط",
"entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.",
"entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "مسار RSSHub",
"discover.rss_url": "رابط RSS",
"discover.select_placeholder": "اختر",
"early_access": "الوصول المبكر",
"entry_actions.copy_link": "نسخ الرابط",
"entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.",
"entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "مسار RSSHub",
"discover.rss_url": "رابط RSS",
"discover.select_placeholder": "اختر",
"early_access": "الوصول المبكر",
"entry_actions.copy_link": "نسخ الرابط",
"entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.",
"entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "مسار RSSHub",
"discover.rss_url": "رابط RSS",
"discover.select_placeholder": "اختر",
"early_access": "الوصول المبكر",
"entry_actions.copy_link": "نسخ الرابط",
"entry_actions.failed_to_save_to_eagle": "فشل الحفظ إلى Eagle.",
"entry_actions.failed_to_save_to_instapaper": "فشل الحفظ إلى Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "مسار RSSHub",
"discover.rss_url": "عنوان URL لخلاصة RSS",
"discover.select_placeholder": "اختيار",
"early_access": "الوصول المبكر",
"entry_actions.copy_link": "نسخ الرابط",
"entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.",
"entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "مسار RSSHub",
"discover.rss_url": "رابط RSS",
"discover.select_placeholder": "اختر",
"early_access": "الوصول المبكر",
"entry_actions.copy_link": "نسخ الرابط",
"entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.",
"entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "RSSHub-Route",
"discover.rss_url": "RSS-URL",
"discover.select_placeholder": "Auswählen",
"early_access": "Früher Zugriff",
"entry_actions.copy_link": "Link kopieren",
"entry_actions.failed_to_save_to_eagle": "Speichern in Eagle fehlgeschlagen.",
"entry_actions.failed_to_save_to_instapaper": "Speichern in Instapaper fehlgeschlagen.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "Ruta RSSHub",
"discover.rss_url": "RSS URL",
"discover.select_placeholder": "Seleccionar",
"early_access": "Versión de acceso anticipado",
"entry_actions.copy_link": "Copiar enlace",
"entry_actions.mark_as_read": "Marcar como leído",
"entry_actions.mark_as_unread": "Marcar como no leído",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "RSSHub-reitti",
"discover.rss_url": "RSS-URL",
"discover.select_placeholder": "Valitse",
"early_access": "Varhainen pääsy",
"entry_actions.copy_link": "Kopioi linkki",
"entry_actions.failed_to_save_to_eagle": "Tallennus Eagleen epäonnistui.",
"entry_actions.failed_to_save_to_instapaper": "Tallennus Instapaperiin epäonnistui.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "Itinéraire RSSHub",
"discover.rss_url": "URL du RSS",
"discover.select_placeholder": "Sélectionner",
"early_access": "Accès Anticipé",
"entry_actions.copy_link": "Copier le lien",
"entry_actions.failed_to_save_to_eagle": "Échec de l'enregistrement sur Eagle.",
"entry_actions.failed_to_save_to_instapaper": "Échec de l'enregistrement sur Instapaper.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "Percorso RSSHub",
"discover.rss_url": "URL RSS",
"discover.select_placeholder": "Seleziona",
"early_access": "Accesso Anticipato",
"entry_actions.copy_link": "Copia link",
"entry_actions.failed_to_save_to_eagle": "Salvataggio su Eagle non riuscito.",
"entry_actions.failed_to_save_to_instapaper": "Salvataggio su Instapaper non riuscito.",
-1
View File
@@ -27,7 +27,6 @@
"discover.target.feeds": "피드",
"discover.target.label": "검색 대상",
"discover.target.lists": "목록",
"early_access": "얼리 액세스",
"entry_actions.copy_link": "링크 복사",
"entry_actions.failed_to_save_to_eagle": "Eagle 에 저장하지 못했습니다.",
"entry_actions.failed_to_save_to_instapaper": "Instapaper 에 저장하지 못했습니다.",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "RSSHub ルート",
"discover.rss_url": "RSS URL",
"discover.select_placeholder": "選択",
"early_access": "アーリーアクセス",
"entry_actions.copy_link": "リンクをコピー",
"entry_actions.failed_to_save_to_eagle": "Eagle への保存に失敗しました。",
"entry_actions.failed_to_save_to_instapaper": "Instapaper への保存に失敗しました。",
-1
View File
@@ -14,7 +14,6 @@
"discover.rss_hub_route": "Маршрут RSSHub",
"discover.rss_url": "RSS URL",
"discover.select_placeholder": "Выбрать",
"early_access": "Ранний доступ",
"entry_actions.copy_link": "Копировать ссылку",
"entry_actions.failed_to_save_to_eagle": "Не удалось сохранить в Eagle.",
"entry_actions.failed_to_save_to_instapaper": "Не удалось сохранить в Instapaper.",
-1
View File
@@ -27,7 +27,6 @@
"discover.target.feeds": "Beslemeler",
"discover.target.label": "Arama hedefi",
"discover.target.lists": "Listeler",
"early_access": "Erken Erişim",
"entry_actions.copy_link": "Bağlantıyı kopyala",
"entry_actions.failed_to_save_to_eagle": "Eagle'a kaydetme başarısız oldu.",
"entry_actions.failed_to_save_to_instapaper": "Instapaper'a kaydetme başarısız oldu.",
+6
View File
@@ -218,6 +218,7 @@
"titles.profile": "Profile",
"titles.shortcuts": "Shortcuts",
"wallet.address.title": "Your Address",
"wallet.balance.level": "Your Level",
"wallet.balance.title": "Your Balance",
"wallet.balance.withdrawable": "Withdrawable",
"wallet.balance.withdrawableTooltip": "Withdrawable Power includes both the tips you've received and the Power you've recharged.",
@@ -229,6 +230,11 @@
"wallet.create.description": "Create a free wallet to receive <PowerIcon /> <strong>Power</strong>, which can be used to reward creators and also get rewarded for your content contributions.",
"wallet.power.dailyClaim": "You can claim {{amount}} free Power daily, which can be used to tip RSS entries on Follow.",
"wallet.power.description": "Power is an <Link>ERC-20 token</Link> on the {{blockchainName}} blockchain.",
"wallet.ranking.level": "Level",
"wallet.ranking.name": "Name",
"wallet.ranking.power": "Power",
"wallet.ranking.rank": "Rank",
"wallet.ranking.title": "Power Ranking",
"wallet.sidebar_title": "Power",
"wallet.transactions.amount": "Amount",
"wallet.transactions.date": "Date",
+230 -4
View File
@@ -3925,6 +3925,22 @@ declare const wallets: drizzle_orm_pg_core.PgTableWithColumns<{
baseColumn: never;
generated: undefined;
}, {}, {}>;
powerToken: drizzle_orm_pg_core.PgColumn<{
name: "power_token";
tableName: "wallets";
dataType: "string";
columnType: "PgNumeric";
data: string;
driverParam: string;
notNull: true;
hasDefault: true;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
dailyPowerToken: drizzle_orm_pg_core.PgColumn<{
name: "daily_power_token";
tableName: "wallets";
@@ -3965,6 +3981,7 @@ declare const walletsOpenAPISchema: zod.ZodObject<{
address: zod.ZodNullable<zod.ZodString>;
userId: zod.ZodString;
createdAt: zod.ZodString;
powerToken: zod.ZodString;
dailyPowerToken: zod.ZodString;
cashablePowerToken: zod.ZodString;
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
@@ -3972,6 +3989,7 @@ declare const walletsOpenAPISchema: zod.ZodObject<{
userId: string;
addressIndex: number;
address: string | null;
powerToken: string;
dailyPowerToken: string;
cashablePowerToken: string;
}, {
@@ -3979,6 +3997,7 @@ declare const walletsOpenAPISchema: zod.ZodObject<{
userId: string;
addressIndex: number;
address: string | null;
powerToken: string;
dailyPowerToken: string;
cashablePowerToken: string;
}>;
@@ -3986,6 +4005,7 @@ declare const walletsRelations: drizzle_orm.Relations<"wallets", {
user: drizzle_orm.One<"user", true>;
transactionsFrom: drizzle_orm.Many<"transactions">;
transactionTo: drizzle_orm.Many<"transactions">;
level: drizzle_orm.One<"levels", false>;
}>;
declare const transactionType: drizzle_orm_pg_core.PgEnum<["tip", "mint", "burn", "withdraw", "purchase"]>;
declare const transactions: drizzle_orm_pg_core.PgTableWithColumns<{
@@ -4172,10 +4192,10 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{
fromUserId: string | null;
toUserId: string | null;
hash: string;
powerToken: string;
toFeedId: string | null;
toListId: string | null;
toEntryId: string | null;
powerToken: string;
comment: string | null;
}, {
type: "tip" | "mint" | "burn" | "withdraw" | "purchase";
@@ -4183,10 +4203,10 @@ declare const transactionsOpenAPISchema: zod.ZodObject<{
fromUserId: string | null;
toUserId: string | null;
hash: string;
powerToken: string;
toFeedId: string | null;
toListId: string | null;
toEntryId: string | null;
powerToken: string;
comment: string | null;
}>;
declare const transactionsRelations: drizzle_orm.Relations<"transactions", {
@@ -4248,6 +4268,173 @@ declare const feedPowerTokensOpenAPISchema: zod.ZodObject<{
declare const feedPowerTokensRelations: drizzle_orm.Relations<"feedPowerTokens", {
feed: drizzle_orm.One<"feeds", true>;
}>;
declare const levels: drizzle_orm_pg_core.PgTableWithColumns<{
name: "levels";
schema: undefined;
columns: {
address: drizzle_orm_pg_core.PgColumn<{
name: "address";
tableName: "levels";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: true;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
generated: undefined;
}, {}, {}>;
rank: drizzle_orm_pg_core.PgColumn<{
name: "rank";
tableName: "levels";
dataType: "number";
columnType: "PgInteger";
data: number;
driverParam: string | number;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
level: drizzle_orm_pg_core.PgColumn<{
name: "level";
tableName: "levels";
dataType: "number";
columnType: "PgInteger";
data: number;
driverParam: string | number;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
preActivePoints: drizzle_orm_pg_core.PgColumn<{
name: "pre_active_points";
tableName: "levels";
dataType: "number";
columnType: "PgInteger";
data: number;
driverParam: string | number;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
activePoints: drizzle_orm_pg_core.PgColumn<{
name: "active_points";
tableName: "levels";
dataType: "number";
columnType: "PgInteger";
data: number;
driverParam: string | number;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
statusUpdatedAt: drizzle_orm_pg_core.PgColumn<{
name: "status_updated_at";
tableName: "levels";
dataType: "date";
columnType: "PgTimestamp";
data: Date;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
powerToken: drizzle_orm_pg_core.PgColumn<{
name: "power_token";
tableName: "levels";
dataType: "string";
columnType: "PgNumeric";
data: string;
driverParam: string;
notNull: true;
hasDefault: true;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
generated: undefined;
}, {}, {}>;
userId: drizzle_orm_pg_core.PgColumn<{
name: "userId";
tableName: "levels";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: true;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
generated: undefined;
}, {}, {}>;
};
dialect: "pg";
}>;
declare const levelsOpenAPISchema: zod.ZodObject<{
address: zod.ZodString;
rank: zod.ZodNullable<zod.ZodNumber>;
level: zod.ZodNullable<zod.ZodNumber>;
preActivePoints: zod.ZodNullable<zod.ZodNumber>;
activePoints: zod.ZodNullable<zod.ZodNumber>;
statusUpdatedAt: zod.ZodNullable<zod.ZodString>;
powerToken: zod.ZodString;
userId: zod.ZodString;
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
userId: string;
address: string;
powerToken: string;
rank: number | null;
level: number | null;
preActivePoints: number | null;
activePoints: number | null;
statusUpdatedAt: string | null;
}, {
userId: string;
address: string;
powerToken: string;
rank: number | null;
level: number | null;
preActivePoints: number | null;
activePoints: number | null;
statusUpdatedAt: string | null;
}>;
declare const levelsRelations: drizzle_orm.Relations<"levels", {
wallet: drizzle_orm.One<"wallets", true>;
user: drizzle_orm.One<"user", true>;
}>;
declare const _routes: hono_hono_base.HonoBase<Env, {
"/messaging": {
@@ -4785,10 +4972,10 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
fromUserId: string | null;
toUserId: string | null;
hash: string;
powerToken: string;
toFeedId: string | null;
toListId: string | null;
toEntryId: string | null;
powerToken: string;
comment: string | null;
fromUser?: {
name: string | null;
@@ -4905,8 +5092,19 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
userId: string;
addressIndex: number;
address: string | null;
powerToken: string;
dailyPowerToken: string;
cashablePowerToken: string;
level: {
userId: string;
address: string;
powerToken: string;
rank: number | null;
level: number | null;
preActivePoints: number | null;
activePoints: number | null;
statusUpdatedAt: string | null;
} | null;
}[];
};
outputFormat: "json" | "text";
@@ -4932,6 +5130,34 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
status: 200;
};
};
"/wallets/ranking": {
$get: {
input: {};
output: {
code: 0;
data: {
user: {
name: string | null;
id: string;
emailVerified: string | null;
image: string | null;
handle: string | null;
createdAt: string;
};
userId: string;
address: string;
powerToken: string;
rank: number | null;
level: number | null;
preActivePoints: number | null;
activePoints: number | null;
statusUpdatedAt: string | null;
}[];
};
outputFormat: "json" | "text";
status: 200;
};
};
} & {
"/subscriptions": {
$get: {
@@ -6464,4 +6690,4 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
}, "/">;
type AppType = typeof _routes;
export { type ActionsModel, type AppType, type AttachmentsModel, CommonEntryFields, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, attachmentsZodSchema, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations };
export { type ActionsModel, type AppType, type AttachmentsModel, CommonEntryFields, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, accounts, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, attachmentsZodSchema, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations };