diff --git a/web-wallet/CHANGELOG.md b/web-wallet/CHANGELOG.md index becbc8a819..8e7b8eeaaa 100644 --- a/web-wallet/CHANGELOG.md +++ b/web-wallet/CHANGELOG.md @@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add wallet restore flow tests [#1416](https://github.com/dusk-network/rusk/issues/1416) ### Changed - +- Change Get Quote API Endpoint to env variable [#1311](https://github.com/dusk-network/rusk/issues/1311) - Change Holdings component design [#1361](https://github.com/dusk-network/rusk/issues/1361) - Change `fiatCurrency`, `locale`, `tokenCurrency`, `token` to required properties in Balance component [#1323](https://github.com/dusk-network/rusk/issues/1323) - Change `package.json` fields to reflect repo change [#1367](https://github.com/dusk-network/rusk/issues/1367) diff --git a/web-wallet/README.md b/web-wallet/README.md index 6df2b7eeba..1c4a749d54 100644 --- a/web-wallet/README.md +++ b/web-wallet/README.md @@ -46,6 +46,7 @@ VITE_STAKE_CONTRACT="02000000000000000000000000000000000000000000000000000000000 VITE_TESTNET_NODE="https://nodes.dusk.network/" VITE_TESTNET_PROVER_NODE="https://provers.dusk.network/" VITE_TRANSFER_CONTRACT="0100000000000000000000000000000000000000000000000000000000000000" +VITE_GET_QUOTE_API_ENDPOINT="https://api.dusk.network/v1/quote" ``` To run a local node different steps are needed, so please read the [related section](#running-a-local-rusk-node). diff --git a/web-wallet/src/routes/(app)/dashboard/+layout.js b/web-wallet/src/routes/(app)/dashboard/+layout.js index 0aaea1b120..552db936a2 100644 --- a/web-wallet/src/routes/(app)/dashboard/+layout.js +++ b/web-wallet/src/routes/(app)/dashboard/+layout.js @@ -7,7 +7,7 @@ const createEmptyObject = () => ({}); /** @type {import('./$types').LayoutLoad} */ export async function load ({ fetch }) { return { - currentPrice: fetch("https://api.dusk.network/v1/quote") + currentPrice: fetch(import.meta.env.VITE_GET_QUOTE_API_ENDPOINT) .then(failureToRejection) .then(res => res.json()) .then(getPath("market_data.current_price")) diff --git a/web-wallet/vite.config.js b/web-wallet/vite.config.js index 7981604ac7..fa7cad1177 100644 --- a/web-wallet/vite.config.js +++ b/web-wallet/vite.config.js @@ -39,6 +39,7 @@ export default defineConfig(({ mode }) => { VITE_GAS_PRICE_DEFAULT: env.VITE_GAS_PRICE_DEFAULT, VITE_GAS_PRICE_LOWER: env.VITE_GAS_PRICE_LOWER, VITE_GAS_PRICE_UPPER: env.VITE_GAS_PRICE_UPPER, + VITE_GET_QUOTE_API_ENDPOINT: env.VITE_GET_QUOTE_API_ENDPOINT, VITE_STAKING_ENABLED: env.VITE_STAKING_ENABLED, VITE_TRANSFER_ENABLED: env.VITE_TRANSFER_ENABLED } @@ -76,7 +77,8 @@ export default defineConfig(({ mode }) => { VITE_GAS_LIMIT_LOWER: "10000000", VITE_GAS_LIMIT_UPPER: "1000000000", VITE_GAS_PRICE_DEFAULT: "1", - VITE_GAS_PRICE_LOWER: "1" + VITE_GAS_PRICE_LOWER: "1", + VITE_GET_QUOTE_API_ENDPOINT: "https://api.dusk.network/v1/quote" }, environment: "jsdom", include: ["src/**/*.{test,spec}.{js,ts}"],