From 82932ce7c84547b22cab50b3c07dba7169ebd1e4 Mon Sep 17 00:00:00 2001 From: nobswebdev Date: Sun, 6 Sep 2026 16:07:56 +0200 Subject: [PATCH] add Bitcoin wallet status tab in CMS. --- cms/src/components/wallet/BitcoinWallet.vue | 93 +++++++++++++++++++ cms/src/stores/bitcoinWallet.ts | 21 +++++ cms/src/types/bitcoinWallet/BitcoinNetwork.ts | 1 + .../bitcoinWallet/BitcoinWalletStatus.ts | 12 +++ cms/src/views/CmsWalletView.vue | 27 +++++- 5 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 cms/src/components/wallet/BitcoinWallet.vue create mode 100644 cms/src/stores/bitcoinWallet.ts create mode 100644 cms/src/types/bitcoinWallet/BitcoinNetwork.ts create mode 100644 cms/src/types/bitcoinWallet/BitcoinWalletStatus.ts diff --git a/cms/src/components/wallet/BitcoinWallet.vue b/cms/src/components/wallet/BitcoinWallet.vue new file mode 100644 index 0000000..c1a9dd5 --- /dev/null +++ b/cms/src/components/wallet/BitcoinWallet.vue @@ -0,0 +1,93 @@ + + + diff --git a/cms/src/stores/bitcoinWallet.ts b/cms/src/stores/bitcoinWallet.ts new file mode 100644 index 0000000..011c7f8 --- /dev/null +++ b/cms/src/stores/bitcoinWallet.ts @@ -0,0 +1,21 @@ +import { defineStore } from 'pinia'; +import { ref } from 'vue'; +import { api } from '@/plugins/axios'; +import type { BitcoinWalletStatus } from '@/types/bitcoinWallet/BitcoinWalletStatus'; + +export const useBitcoinWalletStore = defineStore('bitcoinWallet', () => { + const status = ref(null); + + const fetchStatus = async (): Promise => { + const { data } = await api.get('/bitcoin-wallet'); + + status.value = data; + + return data; + }; + + return { + status, + fetchStatus + }; +}); diff --git a/cms/src/types/bitcoinWallet/BitcoinNetwork.ts b/cms/src/types/bitcoinWallet/BitcoinNetwork.ts new file mode 100644 index 0000000..5005392 --- /dev/null +++ b/cms/src/types/bitcoinWallet/BitcoinNetwork.ts @@ -0,0 +1 @@ +export type BitcoinNetwork = 'mainnet' | 'testnet4'; diff --git a/cms/src/types/bitcoinWallet/BitcoinWalletStatus.ts b/cms/src/types/bitcoinWallet/BitcoinWalletStatus.ts new file mode 100644 index 0000000..4728f48 --- /dev/null +++ b/cms/src/types/bitcoinWallet/BitcoinWalletStatus.ts @@ -0,0 +1,12 @@ +import type { BitcoinNetwork } from './BitcoinNetwork'; +import type { WalletSyncStatus } from '../wallet/WalletSyncStatus'; + +export interface BitcoinWalletStatus { + network: BitcoinNetwork; + rpcVersion: string; + blockHeight: number | null; + serverHeight: number | null; + syncStatus: WalletSyncStatus; + balanceBtc: string; + confirmedBalanceBtc: string; +} diff --git a/cms/src/views/CmsWalletView.vue b/cms/src/views/CmsWalletView.vue index d0655e4..f8bc083 100644 --- a/cms/src/views/CmsWalletView.vue +++ b/cms/src/views/CmsWalletView.vue @@ -2,6 +2,31 @@

Wallet

- + + + + + +
+ +