Skip to content

Commit

Permalink
SOV-3416: Use mempool.space instead of BlockCypher for bitcoin block …
Browse files Browse the repository at this point in the history
…explorer links (#711)

* feat: change btc explorer to mempool

* fix: Replace useTranslation() hook usage with direct "t" import

* Create ten-shirts-act.md

* chore: update changeset message

* trigger rebuild

---------

Co-authored-by: soulBit <[email protected]>
  • Loading branch information
rick23p and soulBit authored Dec 19, 2023
1 parent 6705fa2 commit 48b0437
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 21 deletions.
6 changes: 6 additions & 0 deletions .changeset/ten-shirts-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"frontend": patch
---

SOV-3416: Use mempool.space instead of BlockCypher for bitcoin block explorer links
Fix broken localisations in history tables
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

import {
NotificationType,
Expand Down Expand Up @@ -40,7 +40,6 @@ import { useGetFundingHistory } from './hooks/useGetFundingHistory';
const pageSize = DEFAULT_HISTORY_FRAME_PAGE_SIZE;

export const FundingHistoryFrame: FC = () => {
const { t } = useTranslation();
const { account } = useAccount();
const { addNotification } = useNotificationContext();
const { value: block } = useBlockNumber();
Expand Down Expand Up @@ -123,7 +122,6 @@ export const FundingHistoryFrame: FC = () => {

const fundingData = funding.reduce((acc: FundingHistoryType[], item) => {
const rows = parseData(item as BitcoinTransfer);

// make sure rows has at least 2 elements before using spread operator
if (rows.length >= 2) {
acc.push(
Expand Down Expand Up @@ -152,7 +150,7 @@ export const FundingHistoryFrame: FC = () => {
token: BITCOIN,
txHash: item.txHash,
}));
}, [t, account, addNotification, getFundingHistory, orderOptions]);
}, [account, addNotification, getFundingHistory, orderOptions]);

useEffect(() => {
setPage(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

import {
ErrorBadge,
Expand Down Expand Up @@ -41,7 +41,6 @@ export const StakingDelegateChanges: FC<StakingHistoryProps> = ({
onChangeHistoryType,
selectedHistoryType,
}) => {
const { t } = useTranslation();
const { account } = useAccount();
const { addNotification } = useNotificationContext();

Expand Down Expand Up @@ -117,7 +116,6 @@ export const StakingDelegateChanges: FC<StakingHistoryProps> = ({
orderOptions.orderBy,
orderOptions.orderDirection,
addNotification,
t,
]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

import {
ErrorBadge,
Expand Down Expand Up @@ -42,7 +42,6 @@ export const StakingExtendedDuration: FC<StakingHistoryProps> = ({
onChangeHistoryType,
selectedHistoryType,
}) => {
const { t } = useTranslation();
const { account } = useAccount();
const { addNotification } = useNotificationContext();

Expand Down Expand Up @@ -120,7 +119,6 @@ export const StakingExtendedDuration: FC<StakingHistoryProps> = ({
orderOptions.orderBy,
orderOptions.orderDirection,
addNotification,
t,
]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

import {
ErrorBadge,
Expand Down Expand Up @@ -42,7 +42,6 @@ export const StakingHistory: FC<StakingHistoryProps> = ({
onChangeHistoryType,
selectedHistoryType,
}) => {
const { t } = useTranslation();
const { account } = useAccount();
const { addNotification } = useNotificationContext();

Expand Down Expand Up @@ -119,7 +118,6 @@ export const StakingHistory: FC<StakingHistoryProps> = ({
orderOptions.orderBy,
orderOptions.orderDirection,
addNotification,
t,
]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

import {
ErrorBadge,
Expand Down Expand Up @@ -42,7 +42,6 @@ export const StakingWithdraws: FC<StakingHistoryProps> = ({
onChangeHistoryType,
selectedHistoryType,
}) => {
const { t } = useTranslation();
const { account } = useAccount();
const { addNotification } = useNotificationContext();

Expand Down Expand Up @@ -119,7 +118,6 @@ export const StakingWithdraws: FC<StakingHistoryProps> = ({
orderOptions.orderBy,
orderOptions.orderDirection,
addNotification,
t,
]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { nanoid } from 'nanoid';
import { useTranslation } from 'react-i18next';

import {
ErrorBadge,
Expand Down Expand Up @@ -41,7 +41,6 @@ export const VestingDelegateChanges: FC<StakingHistoryProps> = ({
onChangeHistoryType,
selectedHistoryType,
}) => {
const { t } = useTranslation();
const { account } = useAccount();
const { addNotification } = useNotificationContext();

Expand Down Expand Up @@ -116,7 +115,6 @@ export const VestingDelegateChanges: FC<StakingHistoryProps> = ({
orderOptions.orderBy,
orderOptions.orderDirection,
addNotification,
t,
]);

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/constants/infrastructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const RSK_EXPLORER = {
};

export const BTC_EXPLORER = {
[Environments.Mainnet]: 'https://live.blockcypher.com/btc',
[Environments.Testnet]: 'https://live.blockcypher.com/btc-testnet',
[Environments.Mainnet]: 'https://mempool.space',
[Environments.Testnet]: 'https://mempool.space/testnet',
};

export const GRAPH_WRAPPER = {
Expand Down

0 comments on commit 48b0437

Please sign in to comment.