feat: 更新 '@capp/eden' 依赖至 0.0.9,添加资产中心页面,优化钱包相关逻辑

This commit is contained in:
2026-01-18 20:48:02 +07:00
parent 7a17102141
commit afc806381e
14 changed files with 174 additions and 99 deletions

View File

@@ -5,21 +5,20 @@ export type Wallet = Treaty.Data<typeof client.api.wallet.wallets.get>[number];
export const useWalletStore = defineStore("wallet", () => {
const wallets = ref<Wallet[]>([]);
const balanceWallet = ref<Wallet | null>(null);
async function syncWallets() {
const { data } = await safeClient(client.api.wallet.wallets.get(), { silent: true });
wallets.value = data.value || [];
}
async function syncBalanceWallet() {
const { data } = await safeClient(client.api.wallet.wallet_by_code({ walletTypeCode: "balance" }).get(), { silent: true });
balanceWallet.value = data.value || null;
async function getWalletByType(type: Wallet["walletType"]["code"]) {
const { data } = await safeClient(client.api.wallet.wallet_by_code({ walletTypeCode: type }).get(), { silent: true });
return data;
}
return {
wallets,
balanceWallet,
syncWallets,
syncBalanceWallet,
getWalletByType,
};
});