Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peter/chore lib update 2.4.0 #1512

Merged
merged 30 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
440872f
chore: update monetary to latest 0.7.3
peterslany May 19, 2023
0ef748d
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany May 22, 2023
41fc8c9
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany May 23, 2023
26de655
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany May 24, 2023
6ba14a5
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 1, 2023
e006f4f
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 5, 2023
8362aa6
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 8, 2023
d122720
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 8, 2023
3b60f16
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 12, 2023
e646740
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 12, 2023
12e8338
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 16, 2023
5e7ea8f
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 19, 2023
ecc8f4e
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 27, 2023
41b1b16
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 27, 2023
991e4f6
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 28, 2023
535f2c7
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jun 29, 2023
0f5114b
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 3, 2023
3135b6f
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 4, 2023
add2aa0
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 5, 2023
edfa106
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 6, 2023
ab79a7e
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 6, 2023
00bb86a
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 7, 2023
f64786d
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 10, 2023
b0d7786
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 13, 2023
b5836d7
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 18, 2023
55759a9
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 20, 2023
a54e79d
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Jul 26, 2023
6cab116
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Aug 1, 2023
e23f394
Merge branch 'master' of github.com:interlay/interbtc-ui
peterslany Aug 4, 2023
d37da39
chore: handle 2.4.0 upgrade
peterslany Aug 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@headlessui/react": "^1.1.1",
"@heroicons/react": "^2.0.18",
"@interlay/bridge": "^0.3.13",
"@interlay/interbtc-api": "2.3.7",
"@interlay/interbtc-api": "2.4.0",
"@interlay/monetary-js": "0.7.3",
"@polkadot/api": "9.14.2",
"@polkadot/extension-dapp": "0.44.1",
Expand Down
18 changes: 2 additions & 16 deletions src/components/AuthCTA/AuthCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ import { CTA, CTAProps } from '@/component-library';
import { SIGNER_API_URL } from '@/constants';
import { useSignMessage } from '@/hooks/use-sign-message';
import { useSubstrateSecureState } from '@/lib/substrate';
import { useGetParachainStatus } from '@/utils/hooks/api/system/use-get-parachain-status';

enum AuthStatus {
UNAUTH,
AUTH,
UNSIGNED,
BLOCKED
UNSIGNED
}

const useAuthCTAProps = (props: AuthCTAProps): AuthCTAProps => {
const { t } = useTranslation();
const { hasSignature, buttonProps } = useSignMessage();
const { data: parachainStatus } = useGetParachainStatus();

const { selectedAccount } = useSubstrateSecureState();

Expand All @@ -28,12 +25,8 @@ const useAuthCTAProps = (props: AuthCTAProps): AuthCTAProps => {
return AuthStatus.UNAUTH;
}

if (!parachainStatus?.isRunning) {
return AuthStatus.BLOCKED;
}

return !SIGNER_API_URL || hasSignature ? AuthStatus.AUTH : AuthStatus.UNSIGNED;
}, [hasSignature, parachainStatus, selectedAccount]);
}, [hasSignature, selectedAccount]);

const dispatch = useDispatch();

Expand All @@ -54,13 +47,6 @@ const useAuthCTAProps = (props: AuthCTAProps): AuthCTAProps => {
disabled: false,
children: t('sign_t&cs')
};
case AuthStatus.BLOCKED:
return {
...buttonProps,
type: 'button',
disabled: true,
children
};
case AuthStatus.UNAUTH:
default:
return {
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/api/oracle/use-get-oracle-status.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useQuery } from 'react-query';

import { RELAY_CHAIN_NATIVE_TOKEN } from '@/config/relay-chains';
import { REFETCH_INTERVAL } from '@/utils/constants/api';

interface UseGetOracleStatusResult {
Expand All @@ -13,7 +14,7 @@ enum OracleStatus {
}

const getOracleStatus = async (): Promise<OracleStatus> => {
const isOracleOnline = await window.bridge.oracle.isOnline();
const isOracleOnline = await window.bridge.oracle.isOnline(RELAY_CHAIN_NATIVE_TOKEN);
return isOracleOnline ? OracleStatus.ONLINE : OracleStatus.OFFLINE;
};

Expand Down
74 changes: 0 additions & 74 deletions src/pages/Dashboard/cards/ParachainSecurityCard/index.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/pages/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { PAGES } from '@/utils/constants/links';

const Home = React.lazy(() => import(/* webpackChunkName: 'home' */ './sub-pages/Home'));
const Vaults = React.lazy(() => import(/* webpackChunkName: 'vaults' */ './sub-pages/Vaults'));
const Parachain = React.lazy(() => import(/* webpackChunkName: 'parachain' */ './sub-pages/Parachain'));
const Oracles = React.lazy(() => import(/* webpackChunkName: 'oracles' */ './sub-pages/Oracles'));
const IssueRequests = React.lazy(() => import(/* webpackChunkName: 'issue-requests' */ './sub-pages/IssueRequests'));
const RedeemRequests = React.lazy(() => import(/* webpackChunkName: 'redeem-requests' */ './sub-pages/RedeemRequests'));
Expand All @@ -21,9 +20,6 @@ const Dashboard = (): JSX.Element => {
<Route path={PAGES.DASHBOARD_VAULTS}>
<Vaults />
</Route>
<Route path={PAGES.DASHBOARD_PARACHAIN}>
<Parachain />
</Route>
<Route path={PAGES.DASHBOARD_ORACLES}>
<Oracles />
</Route>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Dashboard/sub-pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import ActiveVaultsCard from '../../cards/ActiveVaultsCard';
import BTCRelayCard from '../../cards/BTCRelayCard';
import CollateralizationCard from '../../cards/CollateralizationCard';
import OracleStatusCard from '../../cards/OracleStatusCard';
import ParachainSecurityCard from '../../cards/ParachainSecurityCard';
import ActiveCollatorsCard from './ActiveCollatorsCard';
import LockedCollateralsCard from './LockedCollateralsCard';
import WrappedTokenCard from './WrappedTokenCard';
Expand All @@ -23,7 +22,6 @@ const Home = (): JSX.Element => {
<WrappedTokenCard />
<LockedCollateralsCard />
<CollateralizationCard hasLinks />
<ParachainSecurityCard hasLinks />
<BTCRelayCard hasLinks />
<OracleStatusCard hasLinks />
<ActiveVaultsCard hasLinks />
Expand Down
23 changes: 0 additions & 23 deletions src/pages/Dashboard/sub-pages/Parachain/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/test/mocks/@interlay/interbtc-api/parachain/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const MODULE: Record<keyof SystemAPI, jest.Mock<any, any>> = {
getCurrentActiveBlockNumber: jest.fn().mockResolvedValue(CURRENT_ACTIVE_BLOCK_NUMBER),
getCurrentBlockNumber: jest.fn().mockResolvedValue(CURRENT_BLOCK_NUMBER),
getFutureBlockNumber: jest.fn().mockResolvedValue(FUTURE_BLOCK_NUMBER),
getStatusCode: jest.fn().mockResolvedValue(STATUS_CODE),
getBlockHash: jest.fn(),
setCode: jest.fn(),
subscribeToCurrentBlockHeads: jest.fn(),
Expand Down
37 changes: 0 additions & 37 deletions src/utils/hooks/api/system/use-get-parachain-status.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2125,10 +2125,10 @@
dependencies:
axios "^0.21.1"

"@interlay/interbtc-api@2.3.7":
version "2.3.7"
resolved "https://registry.yarnpkg.com/@interlay/interbtc-api/-/interbtc-api-2.3.7.tgz#26d4fa574531fe9eea3f0d49364f7476da9713cf"
integrity sha512-w9xPaUa3wTTXOb83pHbSqlE3E8V2iA4WE4IlOu23Zqth4hnG0h819WynlfzUsAPGug6RkZkHWIKnu+85V95g5A==
"@interlay/interbtc-api@2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@interlay/interbtc-api/-/interbtc-api-2.4.0.tgz#097a5bc16364e9f5aaf18d2921f9bc6b98fef326"
integrity sha512-SJG2FBF9410YG3L6n6lluDmu0zUR5JyvE7HGDFD3osrXdckKGC47gEY4Xar7Qbf/Z+gI4KNwNbdUUfhtstjx+Q==
dependencies:
"@interlay/esplora-btc-api" "0.4.0"
"@interlay/interbtc-types" "1.12.0"
Expand Down