diff --git a/src/app/sandbox/faucet/PageClient.tsx b/src/app/sandbox/faucet/PageClient.tsx index fedd8c11a..0cf0856cf 100644 --- a/src/app/sandbox/faucet/PageClient.tsx +++ b/src/app/sandbox/faucet/PageClient.tsx @@ -3,13 +3,8 @@ import { NextPage } from 'next'; import React from 'react'; -import { Badge } from '../../../common/components/Badge'; -import { DropIcon } from '../../../common/components/icons/drop'; import { useFaucet } from '../../../common/queries/useFaucet'; -import { Box } from '../../../ui/Box'; import { Button } from '../../../ui/Button'; -import { Flex } from '../../../ui/Flex'; -import { Grid } from '../../../ui/Grid'; import { HStack } from '../../../ui/HStack'; import { Icon } from '../../../ui/Icon'; import { Stack } from '../../../ui/Stack'; @@ -44,7 +39,7 @@ const Faucet: NextPage = () => { if (stackingIndex <= 3) { setIndex(i => ++i); if (stackingIndex === 3 && !!stxAddress) { - void runFaucetStx({ address: stxAddress, staking: true }); + void runFaucetStx({ address: stxAddress, stacking: true }); } } }; diff --git a/src/common/queries/useFaucet.ts b/src/common/queries/useFaucet.ts index 5e89bf9e7..3a9a96ff5 100644 --- a/src/common/queries/useFaucet.ts +++ b/src/common/queries/useFaucet.ts @@ -6,11 +6,21 @@ import { useApiClient } from '../../api/useApiClient'; export function useFaucet() { const apiClient = useApiClient(); return useMutation({ - mutationFn: async ({ address, staking }: { address: string; staking?: boolean }) => { + mutationFn: async ({ address, stacking }: { address: string; stacking?: boolean }) => { if (!address) return undefined; - const { data, error } = await apiClient.POST('/extended/v1/faucets/stx', { - body: { address, ...(staking ? { staking: true } : {}) }, + const { data, error } = await apiClient.POST(`/extended/v1/faucets/stx`, { + params: { + query: { + address, + stacking, + }, + }, + body: { + // @ts-expect-error + content: 'application/json', + }, }); + if (error) { throw new Error(getErrorMessage(error)); }