Skip to content

Commit

Permalink
Release v1.0.1 (#147)
Browse files Browse the repository at this point in the history
* Prep for v1.0.1

* Misc fixes (#138)

* Use the new icon for CENNZnet

* Remove the `public/images` folder

* Ensure all icons are matching in sizes

* Take into account staking lock when fetching the balance

* Address PR-135 feedbacks (#139)

* Avoid checking `ethBridge.bridgePaused` status when it's Deposit

* Explicitly using assetId to check if it's CPAY

* Move BRIDGE / PEG contract addresses to `constants.ts`

* Add default timeout value to be `1000` instead of zero

* Use `sellAsset` extrinsic to allow fluctuating the receiving token

* Update Slippage value and message to match with the `sellAsset` extrinsic

* Add >= and <= symbols in front of Slippage

* Update messaging around Slippage

* Ensure clearing the interval before rejecting error

* Update CHANGELOG
  • Loading branch information
ken-futureverse authored Mar 31, 2022
1 parent 9baec46 commit 293ed69
Show file tree
Hide file tree
Showing 32 changed files with 152 additions and 75 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## [Unreleased]

## [1.0.1] - 2022-03-31

- Update correct icons for CENNZnet
- Take into account of staking lock amount when retrieving user balance
- Avoid checking `ethBridge.bridgePaused` status when it's Deposit
- Explicitly using `assetId` to check if it's CPAY
- Move BRIDGE / PEG contract address to `constants.ts`
- Add default timeout value to be 1000 instead of zero
- Use `sellAsset` extrinsic instead
- Update Slippage in Swap to target the receiving token
- Add ">=" or "<=" to Slippage in Swap and Pool

## [1.0.0] - 2022-03-30

- Initial release of the App Hub
6 changes: 3 additions & 3 deletions assets/tokens/cennz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions assets/tokens/cpay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
9 changes: 0 additions & 9 deletions assets/vectors/cennznet-blue.svg

This file was deleted.

4 changes: 4 additions & 0 deletions assets/vectors/cennznet-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
9 changes: 5 additions & 4 deletions components/PoolStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const PoolStats: VFC<IntrinsicElements["div"] & PoolStatsProps> = (props) => {
<strong>Slippage:</strong>{" "}
{poolAction === "Add" && (
<span>
{"<= "}
{Balance.fromInput(tradeInput?.value, tradeAsset)
.increase(slippage)
.toBalance()}{" "}
Expand All @@ -117,6 +118,7 @@ const PoolStats: VFC<IntrinsicElements["div"] & PoolStatsProps> = (props) => {
)}
{poolAction === "Remove" && (
<span>
{">= "}
{Balance.fromInput(tradeInput?.value, tradeAsset)
.decrease(slippage)
.toBalance()}{" "}
Expand All @@ -133,10 +135,9 @@ const PoolStats: VFC<IntrinsicElements["div"] & PoolStatsProps> = (props) => {
title={
<div>
If the amount of <strong>{tradeAsset.symbol}</strong> used for
liquidity pool is{" "}
{poolAction === "Remove" ? "lesser" : "greater"} than Slippage
value, the transaction will not proceed. You can update your
preferred Slippage percentage under Settings.
liquidity pool is {poolAction === "Remove" ? "less" : "greater"}{" "}
than Slippage value, the transaction will fail. You can update
your preferred Slippage percentage under Settings.
</div>
}
arrow
Expand Down
4 changes: 2 additions & 2 deletions components/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SubmitButton from "@/components/shared/SubmitButton";
import { useSwap } from "@/providers/SwapProvider";
import { useCENNZApi } from "@/providers/CENNZApiProvider";
import { useCENNZWallet } from "@/providers/CENNZWalletProvider";
import { Balance, getBuyAssetExtrinsic, signAndSendTx } from "@/utils";
import { Balance, getSellAssetExtrinsic, signAndSendTx } from "@/utils";

interface SwapFormProps {}

Expand Down Expand Up @@ -36,7 +36,7 @@ const SwapForm: FC<IntrinsicElements["form"] & SwapFormProps> = ({
if (!api) return;
setProgressStatus();

const extrinsic = getBuyAssetExtrinsic(
const extrinsic = getSellAssetExtrinsic(
api,
exchangeAsset.assetId,
Balance.fromInput(exValue, exchangeAsset),
Expand Down
24 changes: 15 additions & 9 deletions components/SwapStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import { useSwapExchangeRate, useSwapGasFee } from "@/hooks";
interface SwapStatsProps {}

const SwapStats: VFC<IntrinsicElements["div"] & SwapStatsProps> = (props) => {
const { exchangeInput, exchangeAsset, receiveAsset, slippage, txStatus } =
useSwap();
const {
exchangeInput,
exchangeAsset,
receiveAsset,
slippage,
txStatus,
receiveInput,
} = useSwap();

const { exchangeRate, updatingExchangeRate, updateExchangeRate } =
useSwapExchangeRate("1");
Expand Down Expand Up @@ -52,10 +58,11 @@ const SwapStats: VFC<IntrinsicElements["div"] & SwapStatsProps> = (props) => {
<li>
<strong>Slippage:</strong>{" "}
<span>
{Balance.fromInput(exchangeInput?.value, exchangeAsset)
.increase(slippage)
{">= "}
{Balance.fromInput(receiveInput?.value, exchangeAsset)
.decrease(slippage)
.toBalance()}{" "}
{exchangeAsset.symbol}
{receiveAsset.symbol}
</span>
<Tooltip
disableFocusListener
Expand All @@ -66,10 +73,9 @@ const SwapStats: VFC<IntrinsicElements["div"] & SwapStatsProps> = (props) => {
}
title={
<div>
If the amount of <strong>{exchangeAsset.symbol}</strong> used
for swapping is greater than Slippage value, the transaction
will not proceed. You can update your preferred Slippage
percentage under Settings.
If the amount of <strong>{receiveAsset.symbol}</strong> received
is less than Slippage value, the transaction will fail. You can
update your preferred Slippage percentage under Settings.
</div>
}
arrow
Expand Down
Loading

1 comment on commit 293ed69

@vercel
Copy link

@vercel vercel bot commented on 293ed69 Mar 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.