Skip to content

Commit b0103af

Browse files
committed
Updating configs so that we can use config to get wallet base url from the .env
1 parent cf154d4 commit b0103af

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

.env.development

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
REACT_APP_BASE_URL=http://localhost:9002
2-
# REACT_APP_BASE_URL=https://11561ba2d27f.ngrok.app
2+
REACT_APP_WALLET_BASE_URL=http://localhost:9003 # New wallet base URL
33
REACT_APP_ASSETS_BUCKET=http://localhost
44
REACT_APP_DEMO_MODE=false
55

6-
# more info https://create-react-app.dev/docs/advanced-configuration
6+
# More info https://create-react-app.dev/docs/advanced-configuration
77
ESLINT_NO_DEV_ERRORS=true
88
TSC_COMPILE_ON_ERROR=true

src/components/nft-dashboard/Balance/components/SendForm/SendForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const SendForm: React.FC<SendFormProps> = ({ onSend }) => {
6565
await login(); // Perform login if not authenticated
6666
}
6767

68-
const response = await fetch('http://localhost:9003/calculate-tx-size', {
68+
const response = await fetch(`${config.walletBaseURL}/calculate-tx-size`, {
6969
method: 'POST',
7070
headers: {
7171
'Content-Type': 'application/json',
@@ -187,7 +187,7 @@ const SendForm: React.FC<SendFormProps> = ({ onSend }) => {
187187

188188

189189
// Step 2: Initiate the new transaction with the JWT token
190-
const response = await fetch('http://localhost:9003/transaction', {
190+
const response = await fetch(`${config.walletBaseURL}/transaction`, {
191191
method: 'POST',
192192
headers: {
193193
'Content-Type': 'application/json',

src/components/nft-dashboard/unconfirmed-transactions/components/ReplaceTransaction/ReplaceTransaction.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const ReplaceTransaction: React.FC<ReplaceTransactionProps> = ({ onCancel, onRep
5656
return;
5757
}
5858

59-
const response = await fetch('http://localhost:9003/calculate-tx-size', {
59+
const response = await fetch(`${config.walletBaseURL}/calculate-tx-size`, {
6060
method: 'POST',
6161
headers: {
6262
'Content-Type': 'application/json',
@@ -131,7 +131,7 @@ const ReplaceTransaction: React.FC<ReplaceTransactionProps> = ({ onCancel, onRep
131131
new_fee_rate: newFeeRate, // Send the updated fee rate
132132
};
133133

134-
const response = await fetch('http://localhost:9003/transaction', {
134+
const response = await fetch(`${config.walletBaseURL}/transaction`, {
135135
method: 'POST',
136136
headers: {
137137
'Content-Type': 'application/json',

src/config/config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ const config = {
55
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
66
/*@ts-ignore*/
77
baseURL: process.env.NODE_ENV === 'production' ? window.location.origin || 'http://localhost:9002' : process.env.REACT_APP_BASE_URL || 'http://localhost:9002', // Fallback in case the environment variable is not set
8-
8+
99
// Add this line to enable demo mode
1010
isDemoMode: process.env.REACT_APP_DEMO_MODE === 'true',
11+
12+
// Add this line for wallet base URL
13+
walletBaseURL: process.env.REACT_APP_WALLET_BASE_URL || 'http://localhost:9003', // Fallback in case the environment variable is not set
1114
};
1215

13-
export default config;
16+
export default config;

0 commit comments

Comments
 (0)