Selaa lähdekoodia

查看历史记录更改接口

wkw 2 päivää sitten
vanhempi
sitoutus
633230d57d

+ 2 - 2
.env

@@ -12,11 +12,11 @@ VITE_IM_PATH_FIlE ='https://nim.angeltokens.io/api/v1/file/'
 VITE_PRO_IM_WSS ='wss://nim.angeltokens.io/api/v1/socket.io'
 VITE_PRO_IM_PATH='https://nim.angeltokens.io' 
 
-# VITE_DEV_IM_PATH='https://nim.angeltokens.io'
+VITE_DEV_IM_PATH='https://nim.angeltokens.io'
 
 # VITE_PRO_IM_WSS ='ws://192.168.0.59:8888/api/v1/socket.io'
 # VITE_IM_PATH_FIlE ='http://192.168.0.59:8888/api/v1/file/'
-VITE_DEV_IM_PATH='http://192.168.0.59:8888'
+# VITE_DEV_IM_PATH='http://192.168.0.59:8888'
 
 
 VITE_PRO_BACKEND_PATH='https://backend.angeltoken.net'

+ 1 - 1
src/api/axios.backend.js

@@ -11,7 +11,7 @@ const requestCountMap = new Map(); // 用于记录请求的次数
 const isNativeApp = Capacitor.isNativePlatform();
  
 const axiosInstance = axios.create({ 
-  baseURL: (isNativeApp ? import.meta.env.VITE_PRO_BACKEND_PATH : import.meta.env.VITE_PRO_BACKEND_PATH) + "/api/v2", // 设置 API 基础 URL
+  baseURL: (isNativeApp ? import.meta.env.VITE_PRO_BACKEND_PATH : import.meta.env.VITE_PRO_BACKEND_PATH) + "/api", // 设置 API 基础 URL
   timeout: 300000, // 设置请求超时时间
 });
 

+ 2 - 2
src/api/path/backend.api.js

@@ -2,12 +2,12 @@ import service from "../axios.backend";
 
 // 获取交易列表
 export function transactions(account) {
-  return service.get(`addresses/${account}/transactions`);
+  return service.get(`v2/addresses/${account}/transactions`);
 }
 
 // 获取代币列表
 export function tokenTransfers(account, DBaddress) {
-  const url = `addresses/${account}/token-transfers?type=ERC-20%2CERC-721%2CERC-1155&filter=to%20%7C%20from&token=${DBaddress}`;
+  const url = `?module=account&action=tokentx&address=${account}&contractaddress=${DBaddress}&startblock=0&endblock=99999999&sort=desc&page=1&offset=50`;
   return service.get(url);
 }
 

+ 13 - 0
src/assets/svg/bmd.svg

@@ -0,0 +1,13 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="Frame" clip-path="url(#clip0_339_1345)">
+<rect id="Rectangle 1067" x="3.5" y="2.5" width="13" height="14" rx="2.5" stroke="black"/>
+<path id="Vector 41" d="M6 6H12" stroke="black" stroke-linecap="round"/>
+<path id="Vector 42" d="M6 9H9" stroke="black" stroke-linecap="round"/>
+<path id="Vector 43" d="M8.5 12L10.5 14L14.5 9.99989" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
+</g>
+<defs>
+<clipPath id="clip0_339_1345">
+<rect width="20" height="20" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 5 - 1
src/i18n/zhHk/me.js

@@ -52,5 +52,9 @@ export default {
     MinerIsfee:"礦工費",
     IsItCertainToBeRevoked:"確定撤銷嗎?",
     ReceivedSuccessfully:"領取成功",
-    NodeDividend:"節點分紅"
+    NodeDividend:"節點分紅",
+    AddAddressWhitelist:"添加地址白名單",
+    AddedSuccessfully:"添加成功",
+    AdditionFailed:"添加失敗",
+    Adding:"添加中..."
 };

+ 2 - 1
src/i18n/zhHk/router.js

@@ -37,5 +37,6 @@ export default {
   GroupChatList:"羣聊列表",
   PersonalInformation:"個人信息",
   Search:"搜索",
-  CreateGroupChat:"創建羣聊"
+  CreateGroupChat:"創建羣聊",
+  WhiteSettings:"白名單設置"
 };

+ 11 - 0
src/router/system.js

@@ -385,6 +385,17 @@ export const systemRoutes = [
         }, //  搜索页面
         component: () => import("@/views/im/search/index.vue"),
       },
+      {
+        path: "whitelist",
+        name: "whitelist",
+        meta: {
+          title: "router.WhiteSettings",
+          keepAlive: false,
+          navbar: true,
+          leftArrow: true,
+        }, //  白名单设置页面
+        component: () => import("@/views/me/whitelist/index.vue"),
+      },
     ],
   },
 ];

+ 3 - 3
src/updater/update.json

@@ -1,7 +1,7 @@
 {
-  "version": "1.0.6",
-  "releaseDate": "2025-08-12 11:02:34",
-  "checksum": "43cbd8ded1da4fad91d33b69ee0588be0ba6daed0e8c9d7669b46033d3780218",
+  "version": "1.0.8",
+  "releaseDate": "2025-08-13 03:33:55",
+  "checksum": "4c4aa96ab7983089d0e540f11c520395c6b7124cf19f9fe32453f84c5b9dea0b",
   "minBinaryVersion": "1.0.0",
   "mandatory": false,
   "upDataDescription": "✨修正一些錯誤。。。。!!!"

+ 666 - 0
src/utils/feesabi.json

@@ -0,0 +1,666 @@
+[
+    {
+        "inputs": [],
+        "stateMutability": "nonpayable",
+        "type": "constructor"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "AddressAlreadyInWhitelist",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "AddressNotInWhitelist",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "_address",
+                "type": "address"
+            }
+        ],
+        "name": "addToWhitelist",
+        "outputs": [],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "spender",
+                "type": "address"
+            },
+            {
+                "internalType": "uint256",
+                "name": "value",
+                "type": "uint256"
+            }
+        ],
+        "name": "approve",
+        "outputs": [
+            {
+                "internalType": "bool",
+                "name": "",
+                "type": "bool"
+            }
+        ],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "spender",
+                "type": "address"
+            },
+            {
+                "internalType": "uint256",
+                "name": "allowance",
+                "type": "uint256"
+            },
+            {
+                "internalType": "uint256",
+                "name": "needed",
+                "type": "uint256"
+            }
+        ],
+        "name": "ERC20InsufficientAllowance",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "sender",
+                "type": "address"
+            },
+            {
+                "internalType": "uint256",
+                "name": "balance",
+                "type": "uint256"
+            },
+            {
+                "internalType": "uint256",
+                "name": "needed",
+                "type": "uint256"
+            }
+        ],
+        "name": "ERC20InsufficientBalance",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "approver",
+                "type": "address"
+            }
+        ],
+        "name": "ERC20InvalidApprover",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "receiver",
+                "type": "address"
+            }
+        ],
+        "name": "ERC20InvalidReceiver",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "sender",
+                "type": "address"
+            }
+        ],
+        "name": "ERC20InvalidSender",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "spender",
+                "type": "address"
+            }
+        ],
+        "name": "ERC20InvalidSpender",
+        "type": "error"
+    },
+    {
+        "inputs": [],
+        "name": "FeeRateCannotBe100Percent",
+        "type": "error"
+    },
+    {
+        "inputs": [],
+        "name": "FeeReceiverCannotBeContract",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "owner",
+                "type": "address"
+            }
+        ],
+        "name": "OwnableInvalidOwner",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "OwnableUnauthorizedAccount",
+        "type": "error"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "_address",
+                "type": "address"
+            }
+        ],
+        "name": "removeFromWhitelist",
+        "outputs": [],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "renounceOwnership",
+        "outputs": [],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "uint256",
+                "name": "_feeRate",
+                "type": "uint256"
+            }
+        ],
+        "name": "setFeeRate",
+        "outputs": [],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "_feeReceiver",
+                "type": "address"
+            }
+        ],
+        "name": "setFeeReceiver",
+        "outputs": [],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "to",
+                "type": "address"
+            },
+            {
+                "internalType": "uint256",
+                "name": "amount",
+                "type": "uint256"
+            }
+        ],
+        "name": "transfer",
+        "outputs": [
+            {
+                "internalType": "bool",
+                "name": "",
+                "type": "bool"
+            }
+        ],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "TransferAmountMustBePositive",
+        "type": "error"
+    },
+    {
+        "inputs": [],
+        "name": "TransferAmountTooSmallAfterFee",
+        "type": "error"
+    },
+    {
+        "inputs": [],
+        "name": "ZeroAddress",
+        "type": "error"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "owner",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "spender",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "value",
+                "type": "uint256"
+            }
+        ],
+        "name": "Approval",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "deployer",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "initialFeeReceiver",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "initialSupply",
+                "type": "uint256"
+            }
+        ],
+        "name": "ContractDeployed",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "oldRate",
+                "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "newRate",
+                "type": "uint256"
+            }
+        ],
+        "name": "FeeRateChanged",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "oldReceiver",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "newReceiver",
+                "type": "address"
+            }
+        ],
+        "name": "FeeReceiverSet",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "previousOwner",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "newOwner",
+                "type": "address"
+            }
+        ],
+        "name": "OwnershipTransferred",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "from",
+                "type": "address"
+            },
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "to",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "value",
+                "type": "uint256"
+            }
+        ],
+        "name": "Transfer",
+        "type": "event"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "from",
+                "type": "address"
+            },
+            {
+                "internalType": "address",
+                "name": "to",
+                "type": "address"
+            },
+            {
+                "internalType": "uint256",
+                "name": "amount",
+                "type": "uint256"
+            }
+        ],
+        "name": "transferFrom",
+        "outputs": [
+            {
+                "internalType": "bool",
+                "name": "",
+                "type": "bool"
+            }
+        ],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "newOwner",
+                "type": "address"
+            }
+        ],
+        "name": "transferOwnership",
+        "outputs": [],
+        "stateMutability": "nonpayable",
+        "type": "function"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "from",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "address",
+                "name": "to",
+                "type": "address"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "amountAfterFee",
+                "type": "uint256"
+            },
+            {
+                "indexed": false,
+                "internalType": "uint256",
+                "name": "fee",
+                "type": "uint256"
+            }
+        ],
+        "name": "TransferWithFee",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "WhitelistAdded",
+        "type": "event"
+    },
+    {
+        "anonymous": false,
+        "inputs": [
+            {
+                "indexed": true,
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "WhitelistRemoved",
+        "type": "event"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "owner",
+                "type": "address"
+            },
+            {
+                "internalType": "address",
+                "name": "spender",
+                "type": "address"
+            }
+        ],
+        "name": "allowance",
+        "outputs": [
+            {
+                "internalType": "uint256",
+                "name": "",
+                "type": "uint256"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "account",
+                "type": "address"
+            }
+        ],
+        "name": "balanceOf",
+        "outputs": [
+            {
+                "internalType": "uint256",
+                "name": "",
+                "type": "uint256"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "decimals",
+        "outputs": [
+            {
+                "internalType": "uint8",
+                "name": "",
+                "type": "uint8"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "FEE_BASE",
+        "outputs": [
+            {
+                "internalType": "uint256",
+                "name": "",
+                "type": "uint256"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "feeRate",
+        "outputs": [
+            {
+                "internalType": "uint256",
+                "name": "",
+                "type": "uint256"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "feeReceiver",
+        "outputs": [
+            {
+                "internalType": "address",
+                "name": "",
+                "type": "address"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "name",
+        "outputs": [
+            {
+                "internalType": "string",
+                "name": "",
+                "type": "string"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "owner",
+        "outputs": [
+            {
+                "internalType": "address",
+                "name": "",
+                "type": "address"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "symbol",
+        "outputs": [
+            {
+                "internalType": "string",
+                "name": "",
+                "type": "string"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [],
+        "name": "totalSupply",
+        "outputs": [
+            {
+                "internalType": "uint256",
+                "name": "",
+                "type": "uint256"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    },
+    {
+        "inputs": [
+            {
+                "internalType": "address",
+                "name": "",
+                "type": "address"
+            }
+        ],
+        "name": "whitelist",
+        "outputs": [
+            {
+                "internalType": "bool",
+                "name": "",
+                "type": "bool"
+            }
+        ],
+        "stateMutability": "view",
+        "type": "function"
+    }
+]

+ 2 - 0
src/views/me/index.vue

@@ -95,6 +95,7 @@ const filteredVanList = computed(() => {
     { title: $t('router.AboutUs'), icon:"me",  url: 'aboutUs', status:true },
     { title: $t('router.SystemSettings'), icon:"set",  url: 'systemSettings', status:true },
     { title: $t('router.AdministratorSettings'), icon:"admin-set",  url: 'administratorSettings', status: systemStore.Administrator.is_super },
+    { title: $t('router.WhiteSettings'), icon:"bmd",  url: 'whitelist', status: systemStore.Administrator.is_exclusive }
   ].filter(item => item.status !== false);
 });
 const formatAddress = (address) => {
@@ -208,6 +209,7 @@ const goToaPage = (url) => {
     width: 21px;
     height: 21px;
     margin-right: 4px;
+    margin-top: 2px;
   }
 }
 </style>

+ 125 - 0
src/views/me/whitelist/index.vue

@@ -0,0 +1,125 @@
+<template>
+    <div>
+        <div class="title">{{ $t('me.AddAddressWhitelist') }}</div>
+        <div class="input-box">
+            <van-field v-model="message" :placeholder="$t('me.PleaseProvideTheCompleteAddressOfYourWallet')" />
+        </div>
+        <div class="admin-btn">
+            <van-button class="add" color="#4765DD" @click="changeFun">{{ $t('me.AddToTheWhitelist') }}</van-button>
+            <!-- <van-button class="delete" color="#4765DD" @click="changeFun(2)">{{ $t('me.RemoveTheWhitelist') }}</van-button> -->
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { useWalletStore } from "@/stores/modules/walletStore";
+import { showToast,showLoadingToast } from 'vant';
+import Web3 from "web3";
+import feesabiData from "@/utils/feesabi.json";
+const walletStore = useWalletStore();
+const web3 = new Web3(walletStore.rpcUrl);
+
+const message = ref('');
+const changeFun = async () => {
+    if (!message.value) {
+        showToast($t('me.PleaseEnterTheAddress'));
+	    return;
+	}
+    showLoadingToast({
+        message: $t('me.Adding'),
+        forbidClick: true,
+        duration: 0,
+    });
+    const contractAddress = '0x1b7fE9d431a8357dBf7BB1621df9e7Bd2973eBB2'; //wgt
+    const contract = new web3.eth.Contract(feesabiData, contractAddress);
+    const senderAccount = web3.eth.accounts.privateKeyToAccount(walletStore.privateKey);//onlyOwner 的私钥
+    const ownerAddress = senderAccount.address;
+    const targetAddress = message.value;//目标地址
+
+    try {
+        const contractOwner = await contract.methods.owner().call();
+        console.log('合约 owner:', contractOwner);
+        console.log('你当前使用的地址:', ownerAddress);
+        console.log('需要加入白名单的地址', targetAddress)
+        const nonce = await web3.eth.getTransactionCount(ownerAddress, 'pending');
+        const gasPrice = await web3.eth.getGasPrice();
+        const gasLimit = await contract.methods.addToWhitelist(targetAddress, true).estimateGas({ from: ownerAddress });
+
+        const tx = {
+            from: ownerAddress,
+            to: contractAddress,
+            nonce: nonce,
+            gas: gasLimit,
+            gasPrice,
+            data: contract.methods.addToWhitelist(targetAddress, true).encodeABI()
+        };
+
+        const signedTx = await web3.eth.accounts.signTransaction(tx, walletStore.privateKey);
+        web3.eth.sendSignedTransaction(signedTx.rawTransaction)
+            .on('transactionHash', (hash) => {
+                console.log(`交易已提交,等待确认...`);
+            })
+            .on('receipt', (receipt) => {
+                showToast($t('me.AddedSuccessfully'));
+                console.log(`✅ 交易成功!`);
+                
+            })
+            .on('error', (error) => {
+                showToast($t('me.AdditionFailed'));
+                console.error(`❌ 交易失败: ${error.message}`);
+            });
+
+    } catch (error) {
+        showToast($t('me.AdditionFailed'));
+        console.error('交易失败:', error);
+    }
+}
+</script>
+
+<style lang="less" scoped>
+.title{
+    margin: 20px 0 16px;
+    text-align: center;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 15px;
+    color: #000000;
+}
+.input-box{
+    background: #F2F2F2;
+    border-radius: 8px;
+    border: 1px solid #D8D8D8;
+    margin: 0 30px;
+    height: 64px;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 15px;
+    color: #8D8D8D;
+    :deep(.van-cell){
+        background: initial !important;
+        height: 64px;
+        box-sizing: border-box;
+        line-height: 64px;
+        padding: 0 16px !important;
+    }
+}
+.admin-btn{
+    margin: 32px 30px 0;
+    display: flex;
+    .add,.delete{
+        width: calc(95% / 2);
+        margin: 0 auto;
+        height: 32px;
+        line-height: 32px;
+        border-radius: 17px;
+        font-family: PingFang SC, PingFang SC;
+        font-weight: 400;
+        font-size: 15px;
+        color: #FFFFFF;
+        border: none !important;
+    }
+    // .add{
+    //     background: #869EFF;
+    // }
+}
+</style>

+ 135 - 58
src/views/wallet/index.vue

@@ -233,66 +233,130 @@
         </div>
         <!-- 2 -->
         <div class="pop-list" v-if="type == 2">
-          <div class="pop-list-box" v-for="(item, i) in historyList">
-            <svg-icon
-              style="width: 24px; height: 24px; color: #fff"
-              :name="item.from?.hash == walletStore.account ? 'fs' : 'js'"
-            />
-            <div class="pop-list-ul">
-              <div class="pop-list-li">
-                <div class="pop-list-li-title">
-                  {{
-                    item.from?.hash == walletStore.account
-                      ? $t("wallet.Send")
-                      : $t("wallet.Receive")
-                  }}
+          <template v-if="historyList.length > 0">
+            <div class="pop-list-box" v-for="(item, i) in historyList">
+              <svg-icon
+                style="width: 24px; height: 24px; color: #fff"
+                :name="item.from?.hash == walletStore.account ? 'fs' : 'js'"
+              />
+              <div class="pop-list-ul">
+                <div class="pop-list-li">
+                  <div class="pop-list-li-title">
+                    {{
+                      item.from?.hash == walletStore.account
+                        ? $t("wallet.Send")
+                        : $t("wallet.Receive")
+                    }}
+                  </div>
+                  <div class="pop-list-li-status">{{ $t("wallet.Success") }}</div>
                 </div>
-                <div class="pop-list-li-status">{{ $t("wallet.Success") }}</div>
-              </div>
-              <div class="pop-list-li">
-                <div>{{ $t("wallet.TransferAmount") }}</div>
-                <div>{{ item.value }}{{ selectUrl.name }}</div>
-              </div>
-              <div class="pop-list-li">
-                <div>
-                  {{
-                    item.from?.hash == walletStore.account
-                      ? $t("wallet.Send")
-                      : $t("wallet.Receive")
-                  }}{{ $t("wallet.Time") }}
+                <div class="pop-list-li">
+                  <div>{{ $t("wallet.TransferAmount") }}</div>
+                  <div>{{ item.value }}{{ selectUrl.name }}</div>
                 </div>
-                <div>{{ item.timestamp }}</div>
-              </div>
-              <div class="pop-list-li">
-                <div>{{ $t("wallet.ReceivingAddress") }}</div>
-                <div>
-                  {{ formatAddress(item.to?.hash) }}
-                  <svg-icon
-                    class="im-copy-btn"
-                    style="width: 16px; height: 16px"
-                    name="copy"
-                    :data-clipboard-text="item.to?.hash"
-                  />
+                <div class="pop-list-li">
+                  <div>
+                    {{
+                      item.from?.hash == walletStore.account
+                        ? $t("wallet.Send")
+                        : $t("wallet.Receive")
+                    }}{{ $t("wallet.Time") }}
+                  </div>
+                  <div>{{ item.timestamp }}</div>
                 </div>
-              </div>
-              <div class="pop-list-li">
-                <div>hash</div>
-                <div>
-                  {{ formatAddress(item.hash) }}
-                  <svg-icon
-                    class="im-copy-btn"
-                    style="width: 16px; height: 16px"
-                    name="copy"
-                    :data-clipboard-text="item.hash"
-                  />
+                <div class="pop-list-li">
+                  <div>{{ $t("wallet.ReceivingAddress") }}</div>
+                  <div>
+                    {{ formatAddress(item.to?.hash) }}
+                    <svg-icon
+                      class="im-copy-btn"
+                      style="width: 16px; height: 16px"
+                      name="copy"
+                      :data-clipboard-text="item.to?.hash"
+                    />
+                  </div>
+                </div>
+                <div class="pop-list-li">
+                  <div>hash</div>
+                  <div>
+                    {{ formatAddress(item.hash) }}
+                    <svg-icon
+                      class="im-copy-btn"
+                      style="width: 16px; height: 16px"
+                      name="copy"
+                      :data-clipboard-text="item.hash"
+                    />
+                  </div>
+                </div>
+                <div class="pop-list-li" v-if="selectUrl.name == 'ACC'">
+                  <div>{{ $t("wallet.MinerIsFee") }}</div>
+                  <div>{{ item.gas_price }}ACC</div>
                 </div>
               </div>
-              <div class="pop-list-li" v-if="selectUrl.name == 'ACC'">
-                <div>{{ $t("wallet.MinerIsFee") }}</div>
-                <div>{{ item.gas_price }}ACC</div>
+            </div>
+          </template>
+          <template v-if="DBhistoryList.length > 0">
+            <div class="pop-list-box" v-for="(item, i) in DBhistoryList">
+              <svg-icon
+                style="width: 24px; height: 24px; color: #fff"
+                :name="item.from.toLowerCase() == walletStore.account.toLowerCase() ? 'fs' : 'js'"
+              />
+              <div class="pop-list-ul">
+                <div class="pop-list-li">
+                  <div class="pop-list-li-title">
+                    {{
+                      item.from.toLowerCase() == walletStore.account.toLowerCase()
+                        ? $t("wallet.Send")
+                        : $t("wallet.Receive")
+                    }}
+                  </div>
+                  <div class="pop-list-li-status">{{ $t("wallet.Success") }}</div>
+                </div>
+                <div class="pop-list-li">
+                  <div>{{ $t("wallet.TransferAmount") }}</div>
+                  <div>{{ item.value }}{{ selectUrl.name }}</div>
+                </div>
+                <div class="pop-list-li">
+                  <div>
+                    {{
+                      item.from.toLowerCase() == walletStore.account.toLowerCase()
+                        ? $t("wallet.Send")
+                        : $t("wallet.Receive")
+                    }}{{ $t("wallet.Time") }}
+                  </div>
+                  <div>{{ item.timeStamp }}</div>
+                </div>
+                <div class="pop-list-li">
+                  <div>{{ $t("wallet.ReceivingAddress") }}</div>
+                  <div>
+                    {{ formatAddress(item.to) }}
+                    <svg-icon
+                      class="im-copy-btn"
+                      style="width: 16px; height: 16px"
+                      name="copy"
+                      :data-clipboard-text="item.to?.hash"
+                    />
+                  </div>
+                </div>
+                <div class="pop-list-li">
+                  <div>hash</div>
+                  <div>
+                    {{ formatAddress(item.hash) }}
+                    <svg-icon
+                      class="im-copy-btn"
+                      style="width: 16px; height: 16px"
+                      name="copy"
+                      :data-clipboard-text="item.hash"
+                    />
+                  </div>
+                </div>
+                <div class="pop-list-li" v-if="selectUrl.name == 'ACC'">
+                  <div>{{ $t("wallet.MinerIsFee") }}</div>
+                  <div>{{ item.gas_price }}ACC</div>
+                </div>
               </div>
             </div>
-          </div>
+          </template>
         </div>
       </div>
     </van-popup>
@@ -322,6 +386,7 @@ const networkList = ref([]);
 const netWorkIndex = ref(0);
 const type = ref("");
 const historyList = ref([]);
+const DBhistoryList = ref([]);
 const selectUrl = ref({});
 const goToPage = (url) => {
   router.push(url);
@@ -353,6 +418,7 @@ const changePop = (val, item) => {
 // 查看历史记录
 const getDetail = (item) => {
   historyList.value = [];
+  DBhistoryList.value = [];
   if (item.name == "ACC") {
     getList();
   } else {
@@ -376,14 +442,14 @@ const getList = async () => {
 };
 const getDBList = async (DBaddress) => {
   const res = await tokenTransfers(walletStore.account,DBaddress);
-  const items = res.items || [];
+  const items = res.result || [];
   if (items.length > 0) {
     items.forEach((val) => {
-      val.timestamp = getDateTime(val.timestamp);
-      val.value = getPrice(val.total.value).toFixed(6);
-      val.hash = val.transaction_hash;
+      val.timeStamp = formatTime(val.timeStamp);
+      val.value = getPrice(val.value).toFixed(6);
+      val.hash = val.hash;
     });
-    historyList.value = items;
+    DBhistoryList.value = items;
   }
 };
 // 计算总和
@@ -471,6 +537,17 @@ const getDateTime = (isoString) => {
   const formattedDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")} ${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}:${String(date.getSeconds()).padStart(2, "0")}`;
   return formattedDate;
 };
+function formatTime(ts) {
+  const date = new Date(ts * 1000);
+  const y = date.getFullYear();
+  const m = String(date.getMonth() + 1).padStart(2, '0');
+  const d = String(date.getDate()).padStart(2, '0');
+  const hh = String(date.getHours()).padStart(2, '0');
+  const mm = String(date.getMinutes()).padStart(2, '0');
+  const ss = String(date.getSeconds()).padStart(2, '0');
+  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
+}
+
 onMounted(async () => {
   initNetwork();
   gethotTokens();