File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 3
3
import { NextPage } from 'next' ;
4
4
import React from 'react' ;
5
5
6
- import { Badge } from '../../../common/components/Badge' ;
7
- import { DropIcon } from '../../../common/components/icons/drop' ;
8
6
import { useFaucet } from '../../../common/queries/useFaucet' ;
9
- import { Box } from '../../../ui/Box' ;
10
7
import { Button } from '../../../ui/Button' ;
11
- import { Flex } from '../../../ui/Flex' ;
12
- import { Grid } from '../../../ui/Grid' ;
13
8
import { HStack } from '../../../ui/HStack' ;
14
9
import { Icon } from '../../../ui/Icon' ;
15
10
import { Stack } from '../../../ui/Stack' ;
@@ -44,7 +39,7 @@ const Faucet: NextPage = () => {
44
39
if ( stackingIndex <= 3 ) {
45
40
setIndex ( i => ++ i ) ;
46
41
if ( stackingIndex === 3 && ! ! stxAddress ) {
47
- void runFaucetStx ( { address : stxAddress , staking : true } ) ;
42
+ void runFaucetStx ( { address : stxAddress , stacking : true } ) ;
48
43
}
49
44
}
50
45
} ;
Original file line number Diff line number Diff line change @@ -6,11 +6,21 @@ import { useApiClient } from '../../api/useApiClient';
6
6
export function useFaucet ( ) {
7
7
const apiClient = useApiClient ( ) ;
8
8
return useMutation ( {
9
- mutationFn : async ( { address, staking } : { address : string ; staking ?: boolean } ) => {
9
+ mutationFn : async ( { address, stacking } : { address : string ; stacking ?: boolean } ) => {
10
10
if ( ! address ) return undefined ;
11
- const { data, error } = await apiClient . POST ( '/extended/v1/faucets/stx' , {
12
- body : { address, ...( staking ? { staking : true } : { } ) } ,
11
+ const { data, error } = await apiClient . POST ( `/extended/v1/faucets/stx` , {
12
+ params : {
13
+ query : {
14
+ address,
15
+ stacking,
16
+ } ,
17
+ } ,
18
+ body : {
19
+ // @ts -expect-error
20
+ content : 'application/json' ,
21
+ } ,
13
22
} ) ;
23
+
14
24
if ( error ) {
15
25
throw new Error ( getErrorMessage ( error ) ) ;
16
26
}
You can’t perform that action at this time.
0 commit comments