Add Bitcoin wallet withdraw and seed reveal UI in CMS.

Wire admin actions to the backend API with client-side address validation and configurable max fee rate.
This commit is contained in:
2026-09-07 02:08:17 +02:00
parent 626f2ea4f0
commit de52534271
7 changed files with 316 additions and 5 deletions
+19 -1
View File
@@ -1,7 +1,11 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
import { api } from '@/plugins/axios';
import type { BitcoinWalletRevealSeedPayload } from '@/types/bitcoinWallet/BitcoinWalletRevealSeedPayload';
import type { BitcoinWalletRevealSeedResult } from '@/types/bitcoinWallet/BitcoinWalletRevealSeedResult';
import type { BitcoinWalletStatus } from '@/types/bitcoinWallet/BitcoinWalletStatus';
import type { BitcoinWalletWithdrawPayload } from '@/types/bitcoinWallet/BitcoinWalletWithdrawPayload';
import type { BitcoinWalletWithdrawResult } from '@/types/bitcoinWallet/BitcoinWalletWithdrawResult';
export const useBitcoinWalletStore = defineStore('bitcoinWallet', () => {
const status = ref<BitcoinWalletStatus | null>(null);
@@ -14,8 +18,22 @@ export const useBitcoinWalletStore = defineStore('bitcoinWallet', () => {
return data;
};
const withdrawAll = async (payload: BitcoinWalletWithdrawPayload): Promise<BitcoinWalletWithdrawResult> => {
const { data } = await api.post<BitcoinWalletWithdrawResult>('/bitcoin-wallet/withdraw', payload);
return data;
};
const revealSeed = async (payload: BitcoinWalletRevealSeedPayload): Promise<BitcoinWalletRevealSeedResult> => {
const { data } = await api.post<BitcoinWalletRevealSeedResult>('/bitcoin-wallet/reveal-seed', payload);
return data;
};
return {
status,
fetchStatus
fetchStatus,
withdrawAll,
revealSeed
};
});