Skip to content

Commit

Permalink
adding faucet_url
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaghettiOverload committed Feb 16, 2023
1 parent 9dee535 commit c3f89b8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# LOCAL
VITE_APP_LOCAL_CAPTCHA_SITE_KEY=''
VITE_APP_LOCAL_FAUCET_URL=''
VITE_APP_LOCAL_FAUCET_ADDRESS=''
VITE_APP_LOCAL_BRIDGE_URL=''
VITE_APP_LOCAL_GRAPHQL_URL=''
Expand All @@ -13,6 +14,7 @@ VITE_APP_LOCAL_CHAIN_ID=''

# DEV
VITE_APP_DEV_CAPTCHA_SITE_KEY=''
VITE_APP_DEV_FAUCET_URL=''
VITE_APP_DEV_FAUCET_ADDRESS=''
VITE_APP_DEV_BRIDGE_URL=''
VITE_APP_DEV_GRAPHQL_URL=''
Expand All @@ -26,6 +28,7 @@ VITE_APP_DEV_CHAIN_ID=''

# PRIVATE
VITE_APP_PRIVATE_CAPTCHA_SITE_KEY=''
VITE_APP_PRIVATE_FAUCET_URL=''
VITE_APP_PRIVATE_FAUCET_ADDRESS=''
VITE_APP_PRIVATE_BRIDGE_URL=''
VITE_APP_PRIVATE_GRAPHQL_URL=''
Expand All @@ -39,6 +42,7 @@ VITE_APP_PRIVATE_CHAIN_ID=''

# PUBLIC
VITE_APP_PUBLIC_CAPTCHA_SITE_KEY=''
VITE_APP_PUBLIC_FAUCET_URL=''
VITE_APP_PUBLIC_FAUCET_ADDRESS=''
VITE_APP_PUBLIC_BRIDGE_URL=''
VITE_APP_PUBLIC_GRAPHQL_UR=''
Expand Down
4 changes: 2 additions & 2 deletions src/api/getFaucetTokens.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios from 'axios'

const getFaucetTokens = async (faucetAddress: string, data: {
const getFaucetTokens = async (faucedUrl: string, data: {
address: string
coins: Array<string>
captchaResponse: string
}) => {
return axios.post(faucetAddress, data)
return axios.post(faucedUrl, data)
}

export default getFaucetTokens
2 changes: 1 addition & 1 deletion src/containers/Faucet/components/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Form = () => {
handleModal({ open: true, status: ModalStatus.LOADING })

const response = await getFaucetTokens(
CHAIN_DETAILS.FAUCET_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_ADDRESS],
CHAIN_DETAILS.FAUCET_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_URL],
data
)

Expand Down
7 changes: 7 additions & 0 deletions src/utils/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ export const CHAIN_DETAILS = {
PUBLIC: import.meta.env.VITE_APP_PUBLIC_CAPTCHA_SITE_KEY || process.env.VITE_APP_PUBLIC_CAPTCHA_SITE_KEY || "",
MAINNET: ''
},
FAUCET_URL: {
LOCAL: import.meta.env.VITE_APP_LOCAL_FAUCET_URL || process.env.VITE_APP_LOCAL_FAUCET_URL || "",
DEV: import.meta.env.VITE_APP_DEV_FAUCET_URL || process.env.VITE_APP_DEV_FAUCET_URL || "",
PRIVATE: import.meta.env.VITE_APP_PRIVATE_FAUCET_URL || process.env.VITE_APP_PRIVATE_FAUCET_URL || "",
PUBLIC: import.meta.env.VITE_APP_PUBLIC_FAUCET_URL || process.env.VITE_APP_PUBLIC_FAUCET_URL || "",
MAINNET: ''
},
FAUCET_ADDRESS: {
LOCAL: import.meta.env.VITE_APP_LOCAL_FAUCET_ADDRESS || process.env.VITE_APP_LOCAL_FAUCET_ADDRESS || "",
DEV: import.meta.env.VITE_APP_DEV_FAUCET_ADDRESS || process.env.VITE_APP_DEV_FAUCET_ADDRESS || "",
Expand Down

0 comments on commit c3f89b8

Please sign in to comment.