mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-25 07:48:08 +01:00
21 lines
616 B
TypeScript
21 lines
616 B
TypeScript
import { useContext } from 'react';
|
|
import { StorageContext } from '../../components/Context/StorageProvider';
|
|
|
|
export const useStorage = () => {
|
|
const context = useContext(StorageContext);
|
|
|
|
const fetchAndSaveWalletTransactions = async (walletID: string) => {
|
|
// ...existing implementation to fetch and save transactions...
|
|
};
|
|
|
|
const getTransactions = (walletID: string): Transaction[] => {
|
|
const wallet = wallets.find(w => w.getID() === walletID);
|
|
return wallet ? wallet.getTransactions() : [];
|
|
};
|
|
|
|
return {
|
|
...context,
|
|
fetchAndSaveWalletTransactions,
|
|
getTransactions,
|
|
};
|
|
};
|