From 41e3a7711a0ba817a0f35c5ac06ff26a760e54ab Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Tue, 20 Jun 2023 14:27:05 +0200 Subject: [PATCH 1/2] v1.5.0-rc2 --- README.md | 42 +++++++++---------- .../BreakdownTable/BreakdownTable.tsx | 4 +- src/hooks/queries/useEditPosition.tsx | 8 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index b333212..e36bc8e 100644 --- a/README.md +++ b/README.md @@ -28,18 +28,17 @@ Copy `.env.example` to `.env` and modify the values to suit your needs. We allow the use of environment variables to be passed to the Docker container to specify custom endpoints for the app. The variables are: - -|Variable|Description|Default| -|--------|-----------|-------| -|URL_OSMOSIS_GQL|The Osmosis Hive GraphQL endpoint to use|https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-hive-front/graphql| -|URL_OSMOSIS_REST|The Osmosis node REST endpoint to use|https://lcd-osmosis.blockapsis.com| -|URL_OSMOSIS_RPC|The Osmosis node RPC endpoint to use|https://rpc-osmosis.blockapsis.com| -|URL_OSMOSIS_TEST_GQL|The Osmosis Testnet Hive GraphQL endpoint to use|https://testnet-osmosis-node.marsprotocol.io/XF32UOOU55CX/osmosis-hive-front/graphql| -|URL_OSMOSIS_TEST_REST|The Osmosis Testnet node REST endpoint to use|https://lcd.osmotest5.osmosis.zone| -|URL_OSMOSIS_TEST_RPC|The Osmosis Testnet node RPC endpoint to use|https://rpc.osmotest5.osmosis.zone| -|URL_NEUTRON_TEST_GQL|The Neutron Testnet Hive GraphQL endpoint to use|https://testnet-neutron-gql.marsprotocol.io/graphql| -|URL_NEUTRON_TEST_REST|The Neutron Testnet node REST endpoint to use|https://rest-palvus.pion-1.ntrn.tech| -|URL_NEUTRON_TEST_RPC|The Neutron Testnet node RPC endpoint to use|https://rpc-palvus.pion-1.ntrn.tech| +| Variable | Description | Default | +| --------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------ | +| URL_OSMOSIS_GQL | The Osmosis Hive GraphQL endpoint to use | https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-hive-front/graphql | +| URL_OSMOSIS_REST | The Osmosis node REST endpoint to use | https://lcd-osmosis.blockapsis.com | +| URL_OSMOSIS_RPC | The Osmosis node RPC endpoint to use | https://rpc-osmosis.blockapsis.com | +| URL_OSMOSIS_TEST_GQL | The Osmosis Testnet Hive GraphQL endpoint to use | https://testnet-osmosis-node.marsprotocol.io/XF32UOOU55CX/osmosis-hive-front/graphql | +| URL_OSMOSIS_TEST_REST | The Osmosis Testnet node REST endpoint to use | https://lcd.osmotest5.osmosis.zone | +| URL_OSMOSIS_TEST_RPC | The Osmosis Testnet node RPC endpoint to use | https://rpc.osmotest5.osmosis.zone | +| URL_NEUTRON_TEST_GQL | The Neutron Testnet Hive GraphQL endpoint to use | https://testnet-neutron-gql.marsprotocol.io/graphql | +| URL_NEUTRON_TEST_REST | The Neutron Testnet node REST endpoint to use | https://rest-palvus.pion-1.ntrn.tech | +| URL_NEUTRON_TEST_RPC | The Neutron Testnet node RPC endpoint to use | https://rpc-palvus.pion-1.ntrn.tech | **Sample Docker run command** @@ -47,16 +46,15 @@ This command will start the container in interactive mode with port 3000 bound t ```sh docker run -it -p 3000:3000 \ - -e NETWORK=mainnet \ - -e URL_OSMOSIS_GQL=https://your-osmosis-hive-endpoint.com \ - -e URL_OSMOSIS_REST=https://your-osmosis-rest-endpoint.com \ - -e URL_OSMOSIS_RPC=https://your-osmosis-rpc-endpoint.com \ - -e URL_OSMOSIS_TEST_GQL=https://your-osmosis-testnet-hive-endpoint.com \ - -e URL_OSMOSIS_TEST_REST=https://your-osmosis-testnet-rest-endpoint.com \ - -e URL_OSMOSIS_TEST_RPC=https://your-osmosis-testnet-rpc-endpoint.com \ - -e URL_NEUTRON_TEST_GQL=https://your-neutron-testnet-hive-endpoint.com \ - -e URL_NEUTRON_TEST_REST=https://your-neutron-testnet-rest-endpoint.com \ - -e URL_NEUTRON_TEST_RPC=https://your-neutron-testnet-rpc-endpoint.com marsprotocol/interface:latest + -e URL_OSMOSIS_GQL=https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-hive-front/graphql \ + -e URL_OSMOSIS_REST=https://lcd-osmosis.blockapsis.com \ + -e URL_OSMOSIS_RPC=https://rpc-osmosis.blockapsis.com \ + -e URL_OSMOSIS_TEST_GQL=https://testnet-osmosis-node.marsprotocol.io/XF32UOOU55CX/osmosis-hive-front/graphql \ + -e URL_OSMOSIS_TEST_REST=https://lcd.osmotest5.osmosis.zone \ + -e URL_OSMOSIS_TEST_RPC=https://rpc.osmotest5.osmosis.zone \ + -e URL_NEUTRON_TEST_GQL=https://testnet-neutron-gql.marsprotocol.io/graphql \ + -e URL_NEUTRON_TEST_REST=https://rest-palvus.pion-1.ntrn.tech \ + -e URL_NEUTRON_TEST_RPC=https://rpc-palvus.pion-1.ntrn.tech marsprotocol/interface:latest ``` ## 3. Text and translations diff --git a/src/components/fields/Breakdown/BreakdownTable/BreakdownTable.tsx b/src/components/fields/Breakdown/BreakdownTable/BreakdownTable.tsx index 8a6f6ed..90c450f 100644 --- a/src/components/fields/Breakdown/BreakdownTable/BreakdownTable.tsx +++ b/src/components/fields/Breakdown/BreakdownTable/BreakdownTable.tsx @@ -58,6 +58,8 @@ export const BreakdownTable = (props: Props) => { : 'borrowedSecondary' const borrowedChange = props.newPosition.amounts[borrowKey] - props.prevPosition.amounts[borrowKey] + const borrowDenom = + borrowKey === 'borrowedPrimary' ? props.vault.denoms.primary : props.vault.denoms.secondary const containerClasses = classNames([ props.className, @@ -79,7 +81,7 @@ export const BreakdownTable = (props: Props) => { break case AmountType.DEBT: amount = props.newPosition.amounts[borrowKey] - denom = props.vault.denoms.secondary + denom = borrowDenom break case AmountType.POSITION_PRIMARY: amount = props.newPosition.amounts.primary + props.newPosition.amounts.borrowedPrimary diff --git a/src/hooks/queries/useEditPosition.tsx b/src/hooks/queries/useEditPosition.tsx index 63e643c..6638203 100644 --- a/src/hooks/queries/useEditPosition.tsx +++ b/src/hooks/queries/useEditPosition.tsx @@ -59,8 +59,8 @@ export const useEditPosition = (props: Props) => { amount: (secondaryAmount + borrowedSecondaryAmount).toString(), }) - let primaryAfterSwap = primaryAmount + borrowedPrimaryAmount - let secondaryAfterSwap = secondaryAmount + borrowedSecondaryAmount + let primaryAfterSwap = new BigNumber(primaryAmount).plus(borrowedPrimaryAmount) + let secondaryAfterSwap = new BigNumber(secondaryAmount).plus(borrowedSecondaryAmount) // If difference is larger than threshold, initiate a swap const difference = primaryBaseAmount - secondaryBaseAmount @@ -91,8 +91,8 @@ export const useEditPosition = (props: Props) => { }), ) - primaryAfterSwap = primaryAfterSwap + primaryAmountChange - secondaryAfterSwap = secondaryAfterSwap + secondaryAmountChange + primaryAfterSwap = primaryAfterSwap.plus(primaryAmountChange) + secondaryAfterSwap = secondaryAfterSwap.plus(secondaryAmountChange) } const coins: Coin[] = [ { From 70e22a829a0315513bdd37e6d1e7862c23474856 Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Tue, 20 Jun 2023 14:43:33 +0200 Subject: [PATCH 2/2] v1.5.1 --- package.json | 2 +- src/hooks/queries/useMarsOracle.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c57615a..1fd7bf0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mars", "homepage": "./", - "version": "1.5.0", + "version": "1.5.1", "license": "SEE LICENSE IN LICENSE FILE", "private": false, "scripts": { diff --git a/src/hooks/queries/useMarsOracle.tsx b/src/hooks/queries/useMarsOracle.tsx index 3522c97..99eb81b 100644 --- a/src/hooks/queries/useMarsOracle.tsx +++ b/src/hooks/queries/useMarsOracle.tsx @@ -18,7 +18,7 @@ export const useMarsOracle = () => { const priceSourcesQuery = getContractQuery( 'price_sources', oracleAddress || '', - '{ price_sources: {} }', + '{ price_sources: {limit: 20} }', ) whitelistedAssets