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

Increase utxo fetch #508

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Changes from all commits
Commits
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
31 changes: 27 additions & 4 deletions src/extension/wallet/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ import { SendFlowStep } from '../../../domain/repository';
import type { Asset } from 'marina-provider';
import { networks } from 'liquidjs-lib';
import { useStorageContext } from '../../context/storage-context';
import { UpdaterService } from '../../../application/updater';
import zkp from '@vulpemventures/secp256k1-zkp';

const Home: React.FC = () => {
const history = useHistory();
const { appRepository, sendFlowRepository, cache } = useStorageContext();
const {
walletRepository,
assetRepository,
blockHeadersRepository,
appRepository,
sendFlowRepository,
cache,
} = useStorageContext();
const [sortedAssets, setSortedAssets] = React.useState<Asset[]>([]);

useEffect(() => {
Expand Down Expand Up @@ -56,12 +65,26 @@ const Home: React.FC = () => {
});
};

const handleReceive = () => {
history.push(RECEIVE_SELECT_ASSET_ROUTE);
};
const handleReceive = () => history.push(RECEIVE_SELECT_ASSET_ROUTE);

const handleSend = () => history.push(SEND_SELECT_ASSET_ROUTE);

// update everytime the user comes back to home
// this also works when user re-opens the wallet
useEffect(() => {
(async () => {
const updater = new UpdaterService(
walletRepository,
appRepository,
blockHeadersRepository,
assetRepository,
await zkp()
);
if (!cache?.network) throw new Error('Network not found');
await updater.checkAndFixMissingTransactionsData(cache.network);
})().catch(console.error);
}, [cache?.authenticated]);

useEffect(() => {
(async () => {
const safeHistoryPush = (pathname: string) => {
Expand Down
Loading