feat: 更新 '@capp/eden' 依赖至 0.0.15,优化兑换和转账功能的 API 调用

This commit is contained in:
2026-01-19 01:30:42 +07:00
parent 9bcfe1d8fe
commit 8f7fa41cb8
6 changed files with 23 additions and 27 deletions

14
pnpm-lock.yaml generated
View File

@@ -52,8 +52,8 @@ catalogs:
specifier: 8.0.0
version: 8.0.0
'@capp/eden':
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz
version: 0.0.14
specifier: http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz
version: 0.0.15
'@cloudflare/workers-types':
specifier: ^4.20260113.0
version: 4.20260116.0
@@ -298,7 +298,7 @@ importers:
version: 8.0.0(@capacitor/core@8.0.0)
'@capp/eden':
specifier: 'catalog:'
version: http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))
version: http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))
'@elysiajs/eden':
specifier: 'catalog:'
version: 1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3))
@@ -1182,9 +1182,9 @@ packages:
'@capacitor/synapse@1.0.4':
resolution: {integrity: sha512-/C1FUo8/OkKuAT4nCIu/34ny9siNHr9qtFezu4kxm6GY1wNFxrCFWjfYx5C1tUhVGz3fxBABegupkpjXvjCHrw==}
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz':
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz}
version: 0.0.14
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz':
resolution: {tarball: http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz}
version: 0.0.15
peerDependencies:
'@elysiajs/eden': ^1.4.6
@@ -6903,7 +6903,7 @@ snapshots:
'@capacitor/synapse@1.0.4': {}
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))':
'@capp/eden@http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz(@elysiajs/eden@1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)))':
dependencies:
'@elysiajs/eden': 1.4.6(elysia@1.4.22(@sinclair/typebox@0.34.47)(exact-mirror@0.2.6(@sinclair/typebox@0.34.47))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3))

View File

@@ -18,7 +18,7 @@ catalog:
'@capacitor/keyboard': 8.0.0
'@capacitor/share': ^8.0.0
'@capacitor/status-bar': 8.0.0
'@capp/eden': http://192.168.1.2:9538/api/capp-eden-0.0.14.tgz
'@capp/eden': http://192.168.1.2:9538/api/capp-eden-0.0.15.tgz
'@cloudflare/workers-types': ^4.20260113.0
'@elysiajs/eden': ^1.4.6
'@faker-js/faker': ^10.2.0

View File

@@ -1,9 +1,8 @@
<script lang='ts' setup>
import type { Treaty } from "@elysiajs/eden";
import type { client } from "@/api";
import { alertController, toastController } from "@ionic/vue";
import { checkmarkCircleOutline, documentTextOutline, keyOutline, swapHorizontalOutline, walletOutline } from "ionicons/icons";
import { safeClient } from "@/api";
import { client, safeClient } from "@/api";
type Wallet = Treaty.Data<typeof client.api.wallet.wallets.get>[number];
@@ -160,13 +159,12 @@ async function handleSubmit() {
{
text: "确认兑换",
handler: async () => {
// TODO: 调用兑换 API
// const { error } = await safeClient(client.api.exchange.post({
// fromWalletId: fromWallet.value.id,
// toWalletId: toWallet.value.id,
// amount,
// transactionPassword: transactionPassword.value,
// }));
await safeClient(client.api.wallet_transfer.post({
amount: amount.toString(),
sourceWalletTypeCode: fromWallet.value?.walletType.code,
targetWalletTypeCode: "balance",
transactionPassword: transactionPassword.value,
}));
await showToast("兑换成功");
exchangeAmount.value = "";

View File

@@ -1,6 +1,7 @@
<script lang='ts' setup>
import { alertController, toastController } from "@ionic/vue";
import { cardOutline, checkmarkCircleOutline, documentTextOutline, logoAlipay, logoWechat, walletOutline } from "ionicons/icons";
import { safeClient } from "@/api";
const walletStore = useWalletStore();
const balanceWallet = await walletStore.getWalletByType("balance");

View File

@@ -1,9 +1,8 @@
<script lang='ts' setup>
import type { Treaty } from "@elysiajs/eden";
import type { client } from "@/api";
import { alertController, toastController } from "@ionic/vue";
import { callOutline, checkmarkCircleOutline, documentTextOutline, keyOutline, personOutline, walletOutline } from "ionicons/icons";
import { safeClient } from "@/api";
import { client, safeClient } from "@/api";
type Wallet = Treaty.Data<typeof client.api.wallet.wallets.get>[number];
@@ -133,13 +132,12 @@ async function handleSubmit() {
{
text: "确认转账",
handler: async () => {
// TODO: 调用转账 API
// const { error } = await safeClient(client.api.transfer.post({
// walletId: selectedWallet.value.id,
// amount,
// recipientPhone: recipientPhone.value,
// transactionPassword: transactionPassword.value,
// }));
await safeClient(client.api.transfer.post({
walletTypeCode: selectedWallet.value?.walletType.code,
amount: amount.toString(),
targetUsername: recipientPhone.value,
transactionPassword: transactionPassword.value,
}));
await showToast("转账成功");
transferAmount.value = "";

View File

@@ -121,7 +121,6 @@ async function handleSubmit() {
{
text: "确认提现",
handler: async () => {
// TODO: 调用提现 API
// const { error } = await safeClient(client.api.withdraw.post({
// walletId: selectedWallet.value.id,
// amount,