Skip to content

Commit

Permalink
web-wallet: Change Get Quote API to ENV variable
Browse files Browse the repository at this point in the history
Resolves: #1311
  • Loading branch information
nortonandreev committed Feb 20, 2024
1 parent 0a73f3a commit 982e044
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions web-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion web-wallet/src/routes/(app)/dashboard/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
4 changes: 3 additions & 1 deletion web-wallet/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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}"],
Expand Down

0 comments on commit 982e044

Please sign in to comment.