From f8144bd9a0a03c94c119dfd33075708ff4e9e11b Mon Sep 17 00:00:00 2001 From: Mononaut Date: Thu, 16 May 2024 18:36:33 +0000 Subject: [PATCH] Fetch faucet address from services backend --- frontend/src/app/components/faucet/faucet.component.html | 4 ++-- frontend/src/app/components/faucet/faucet.component.ts | 2 +- frontend/src/app/services/services-api.service.ts | 2 +- frontend/src/app/services/state.service.ts | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/components/faucet/faucet.component.html b/frontend/src/app/components/faucet/faucet.component.html index f1787505b..b9f1161a3 100644 --- a/frontend/src/app/components/faucet/faucet.component.html +++ b/frontend/src/app/components/faucet/faucet.component.html @@ -84,8 +84,8 @@ } }
-
- If you no longer need your testnet4 coins, please consider sending them back to {{ recycleAddress }} to replenish the faucet. +
+ If you no longer need your testnet4 coins, please consider sending them back to {{ status.address }} to replenish the faucet.
diff --git a/frontend/src/app/components/faucet/faucet.component.ts b/frontend/src/app/components/faucet/faucet.component.ts index d021a1427..19269cb2a 100644 --- a/frontend/src/app/components/faucet/faucet.component.ts +++ b/frontend/src/app/components/faucet/faucet.component.ts @@ -18,6 +18,7 @@ export class FaucetComponent implements OnInit, OnDestroy { user: any; loading: boolean = true; status: { + address?: string, access: boolean min: number, user_max: number, @@ -26,7 +27,6 @@ export class FaucetComponent implements OnInit, OnDestroy { error = ''; faucetForm: FormGroup; txid = ''; - recycleAddress = this.stateService.env.TESTNET4_FAUCET_ADDRESS || 'tb1q548z58kqvwyjqwy8vc2ntmg33d7s2wyfv7ukq4'; mempoolPositionSubscription: Subscription; confirmationSubscription: Subscription; diff --git a/frontend/src/app/services/services-api.service.ts b/frontend/src/app/services/services-api.service.ts index f0e68ca53..480d39f92 100644 --- a/frontend/src/app/services/services-api.service.ts +++ b/frontend/src/app/services/services-api.service.ts @@ -161,7 +161,7 @@ export class ServicesApiServices { } getFaucetStatus$() { - return this.httpClient.get<{access: boolean, min: number, user_max: number, user_requests: number }>(`${SERVICES_API_PREFIX}/testnet4/faucet/status`, { responseType: 'json' }); + return this.httpClient.get<{ address?: string, access: boolean, min: number, user_max: number, user_requests: number }>(`${SERVICES_API_PREFIX}/testnet4/faucet/status`, { responseType: 'json' }); } requestTestnet4Coins$(address: string, sats: number) { diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index dccb34b79..742ca7ab1 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -72,7 +72,6 @@ export interface Env { ADDITIONAL_CURRENCIES: boolean; GIT_COMMIT_HASH_MEMPOOL_SPACE?: string; PACKAGE_JSON_VERSION_MEMPOOL_SPACE?: string; - TESTNET4_FAUCET_ADDRESS: string; customize?: Customization; } @@ -105,7 +104,6 @@ const defaultEnv: Env = { 'ACCELERATOR': false, 'PUBLIC_ACCELERATIONS': false, 'ADDITIONAL_CURRENCIES': false, - 'TESTNET4_FAUCET_ADDRESS': '', }; @Injectable({