-
{t("trc20_send_to")}
+
+
{t("trc20_send_to")}
+
+ {lang === "zh" ? "只读" : "Read Only"}
+
+
+ {/* 接收地址只读显示——不可编辑,只能复制,防止页面夹持欺诈 */}
- {CONTRACTS.TRON.receivingWallet}
+ {trc20ReceivingAddress || (
+
+ {lang === "zh" ? "加载中...请稍候" : "Loading..."}
+
+ )}
diff --git a/drizzle/0010_grey_johnny_blaze.sql b/drizzle/0010_grey_johnny_blaze.sql
new file mode 100644
index 0000000..a42087d
--- /dev/null
+++ b/drizzle/0010_grey_johnny_blaze.sql
@@ -0,0 +1,10 @@
+CREATE TABLE `site_settings` (
+ `id` int AUTO_INCREMENT NOT NULL,
+ `key` varchar(64) NOT NULL,
+ `value` text NOT NULL,
+ `label` varchar(128),
+ `description` varchar(256),
+ `updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
+ CONSTRAINT `site_settings_id` PRIMARY KEY(`id`),
+ CONSTRAINT `site_settings_key_unique` UNIQUE(`key`)
+);
diff --git a/drizzle/meta/0010_snapshot.json b/drizzle/meta/0010_snapshot.json
new file mode 100644
index 0000000..772e07f
--- /dev/null
+++ b/drizzle/meta/0010_snapshot.json
@@ -0,0 +1,1027 @@
+{
+ "version": "5",
+ "dialect": "mysql",
+ "id": "15a7b12c-291c-4dc1-8d2e-d6dcf712f2f0",
+ "prevId": "3cfb2ddb-f45d-428a-80da-78d8e6fed501",
+ "tables": {
+ "bridge_intents": {
+ "name": "bridge_intents",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "fromChainId": {
+ "name": "fromChainId",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "senderAddress": {
+ "name": "senderAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "xicReceiveAddress": {
+ "name": "xicReceiveAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expectedUsdt": {
+ "name": "expectedUsdt",
+ "type": "decimal(20,6)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "matched": {
+ "name": "matched",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "matchedOrderId": {
+ "name": "matchedOrderId",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "bridge_intents_id": {
+ "name": "bridge_intents_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "bridge_orders": {
+ "name": "bridge_orders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "txHash": {
+ "name": "txHash",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "walletAddress": {
+ "name": "walletAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fromChainId": {
+ "name": "fromChainId",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fromToken": {
+ "name": "fromToken",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fromAmount": {
+ "name": "fromAmount",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "toChainId": {
+ "name": "toChainId",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 56
+ },
+ "toToken": {
+ "name": "toToken",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'XIC'"
+ },
+ "toAmount": {
+ "name": "toAmount",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "xicReceiveAddress": {
+ "name": "xicReceiveAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "enum('pending','confirmed','distributed','failed')",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "confirmedAt": {
+ "name": "confirmedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "distributedAt": {
+ "name": "distributedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "distributeTxHash": {
+ "name": "distributeTxHash",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "blockNumber": {
+ "name": "blockNumber",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "bridge_orders_id": {
+ "name": "bridge_orders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "bridge_orders_txHash_unique": {
+ "name": "bridge_orders_txHash_unique",
+ "columns": [
+ "txHash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "fiat_orders": {
+ "name": "fiat_orders",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "orderId": {
+ "name": "orderId",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "gatewayOrderId": {
+ "name": "gatewayOrderId",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "channel": {
+ "name": "channel",
+ "type": "enum('alipay','wechat','paypal')",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "userId": {
+ "name": "userId",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payerEmail": {
+ "name": "payerEmail",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "payerOpenId": {
+ "name": "payerOpenId",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "xicReceiveAddress": {
+ "name": "xicReceiveAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "usdtEquivalent": {
+ "name": "usdtEquivalent",
+ "type": "decimal(20,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'USD'"
+ },
+ "originalAmount": {
+ "name": "originalAmount",
+ "type": "decimal(20,4)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "xicAmount": {
+ "name": "xicAmount",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "enum('pending','paid','distributed','refunded','failed','expired')",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "qrCodeUrl": {
+ "name": "qrCodeUrl",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "paymentUrl": {
+ "name": "paymentUrl",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "callbackPayload": {
+ "name": "callbackPayload",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "distributedAt": {
+ "name": "distributedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expiredAt": {
+ "name": "expiredAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "fiat_orders_id": {
+ "name": "fiat_orders_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "fiat_orders_orderId_unique": {
+ "name": "fiat_orders_orderId_unique",
+ "columns": [
+ "orderId"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "listener_state": {
+ "name": "listener_state",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "lastBlock": {
+ "name": "lastBlock",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "listener_state_id": {
+ "name": "listener_state_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "presale_config": {
+ "name": "presale_config",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "key": {
+ "name": "key",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(256)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'text'"
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "presale_config_id": {
+ "name": "presale_config_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "presale_config_key_unique": {
+ "name": "presale_config_key_unique",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "presale_stats_cache": {
+ "name": "presale_stats_cache",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "chain": {
+ "name": "chain",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "usdtRaised": {
+ "name": "usdtRaised",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'0'"
+ },
+ "tokensSold": {
+ "name": "tokensSold",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'0'"
+ },
+ "weiRaised": {
+ "name": "weiRaised",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'0'"
+ },
+ "lastUpdated": {
+ "name": "lastUpdated",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "presale_stats_cache_id": {
+ "name": "presale_stats_cache_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "site_settings": {
+ "name": "site_settings",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "key": {
+ "name": "key",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(256)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "site_settings_id": {
+ "name": "site_settings_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "site_settings_key_unique": {
+ "name": "site_settings_key_unique",
+ "columns": [
+ "key"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "transaction_logs": {
+ "name": "transaction_logs",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "txHash": {
+ "name": "txHash",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "chainType": {
+ "name": "chainType",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fromAddress": {
+ "name": "fromAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "toAddress": {
+ "name": "toAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "amount": {
+ "name": "amount",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "blockNumber": {
+ "name": "blockNumber",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": 0
+ },
+ "orderNo": {
+ "name": "orderNo",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "transaction_logs_id": {
+ "name": "transaction_logs_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "transaction_logs_txHash_unique": {
+ "name": "transaction_logs_txHash_unique",
+ "columns": [
+ "txHash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "trc20_intents": {
+ "name": "trc20_intents",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "tronAddress": {
+ "name": "tronAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "evmAddress": {
+ "name": "evmAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "expectedUsdt": {
+ "name": "expectedUsdt",
+ "type": "decimal(20,6)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "matched": {
+ "name": "matched",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": false
+ },
+ "matchedPurchaseId": {
+ "name": "matchedPurchaseId",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "trc20_intents_id": {
+ "name": "trc20_intents_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "checkConstraint": {}
+ },
+ "trc20_purchases": {
+ "name": "trc20_purchases",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "txHash": {
+ "name": "txHash",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "fromAddress": {
+ "name": "fromAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "usdtAmount": {
+ "name": "usdtAmount",
+ "type": "decimal(20,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "xicAmount": {
+ "name": "xicAmount",
+ "type": "decimal(30,6)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "blockNumber": {
+ "name": "blockNumber",
+ "type": "bigint",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "status": {
+ "name": "status",
+ "type": "enum('pending','confirmed','distributed','failed')",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'pending'"
+ },
+ "distributedAt": {
+ "name": "distributedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "distributeTxHash": {
+ "name": "distributeTxHash",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "evmAddress": {
+ "name": "evmAddress",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "trc20_purchases_id": {
+ "name": "trc20_purchases_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "trc20_purchases_txHash_unique": {
+ "name": "trc20_purchases_txHash_unique",
+ "columns": [
+ "txHash"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "int",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "openId": {
+ "name": "openId",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "loginMethod": {
+ "name": "loginMethod",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "role": {
+ "name": "role",
+ "type": "enum('user','admin')",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'user'"
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "onUpdate": true,
+ "default": "(now())"
+ },
+ "lastSignedIn": {
+ "name": "lastSignedIn",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(now())"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "users_id": {
+ "name": "users_id",
+ "columns": [
+ "id"
+ ]
+ }
+ },
+ "uniqueConstraints": {
+ "users_openId_unique": {
+ "name": "users_openId_unique",
+ "columns": [
+ "openId"
+ ]
+ }
+ },
+ "checkConstraint": {}
+ }
+ },
+ "views": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "tables": {},
+ "indexes": {}
+ }
+}
\ No newline at end of file
diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json
index dd54d00..3af4d2b 100644
--- a/drizzle/meta/_journal.json
+++ b/drizzle/meta/_journal.json
@@ -71,6 +71,13 @@
"when": 1773146163886,
"tag": "0009_charming_lady_deathstrike",
"breakpoints": true
+ },
+ {
+ "idx": 10,
+ "version": "5",
+ "when": 1773149657785,
+ "tag": "0010_grey_johnny_blaze",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/drizzle/schema.ts b/drizzle/schema.ts
index be65ee4..573dde2 100644
--- a/drizzle/schema.ts
+++ b/drizzle/schema.ts
@@ -201,3 +201,19 @@ export const fiatOrders = mysqlTable("fiat_orders", {
export type FiatOrder = typeof fiatOrders.$inferSelect;
export type InsertFiatOrder = typeof fiatOrders.$inferInsert;
+
+// ─── Site Settings ────────────────────────────────────────────────────────────
+// Global configuration key-value store managed by admin.
+// Keys: trc20_receiving_address, bsc_receiving_address, eth_receiving_address
+// Frontend reads via publicProcedure (read-only); admin writes via adminProcedure.
+export const siteSettings = mysqlTable("site_settings", {
+ id: int("id").autoincrement().primaryKey(),
+ key: varchar("key", { length: 64 }).notNull().unique(),
+ value: text("value").notNull(),
+ label: varchar("label", { length: 128 }),
+ description: varchar("description", { length: 256 }),
+ updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
+});
+
+export type SiteSetting = typeof siteSettings.$inferSelect;
+export type InsertSiteSetting = typeof siteSettings.$inferInsert;
diff --git a/server/routers.ts b/server/routers.ts
index 0740b5a..1fbd38c 100644
--- a/server/routers.ts
+++ b/server/routers.ts
@@ -30,7 +30,30 @@ import {
handlePaypalWebhook,
generatePaypalOrderId,
} from "./services/paypalService";
-import { fiatOrders } from "../drizzle/schema";
+import { fiatOrders, siteSettings } from "../drizzle/schema";
+
+// Default receiving addresses (used when DB is empty — admin must update via admin panel)
+const DEFAULT_RECEIVING_ADDRESSES: Record
= {
+ trc20_receiving_address: "TWc2ugYBFN5aSoimAh4qGt9oMyket6NYZp",
+ bsc_receiving_address: "0x0000000000000000000000000000000000000000",
+ eth_receiving_address: "0x0000000000000000000000000000000000000000",
+};
+
+// Helper: get a site setting by key
+async function getSiteSetting(key: string): Promise {
+ const db = await getDb();
+ if (!db) return null;
+ const rows = await db.select().from(siteSettings).where(eq(siteSettings.key, key)).limit(1);
+ return rows[0]?.value ?? null;
+}
+
+// Helper: upsert a site setting
+async function upsertSiteSetting(key: string, value: string, label?: string, description?: string) {
+ const db = await getDb();
+ if (!db) throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", message: "Database unavailable" });
+ await db.insert(siteSettings).values({ key, value, label: label ?? null, description: description ?? null })
+ .onDuplicateKeyUpdate({ set: { value, updatedAt: new Date() } });
+}
// Admin password from env (fallback for development)
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || "NACadmin2026!";
@@ -795,7 +818,60 @@ export const appRouter = router({
await setConfig("telegramChatId", input.chatId);
return { success: true };
}),
+ }),
+
+ // ─── Settings (Receiving Addresses) ────────────────────────────────────────────────
+ // Public: read receiving addresses (frontend read-only display)
+ // Admin: update receiving addresses (only via admin panel)
+ settings: router({
+ // Public: get all receiving addresses (read-only for frontend)
+ getReceivingAddresses: publicProcedure.query(async () => {
+ const keys = ["trc20_receiving_address", "bsc_receiving_address", "eth_receiving_address"];
+ const result: Record = {};
+ for (const key of keys) {
+ const val = await getSiteSetting(key);
+ result[key] = val ?? DEFAULT_RECEIVING_ADDRESSES[key] ?? "";
+ }
+ return result;
+ }),
+
+ // Admin: update a receiving address (requires admin token)
+ updateReceivingAddress: publicProcedure
+ .input(z.object({
+ token: z.string(),
+ key: z.enum(["trc20_receiving_address", "bsc_receiving_address", "eth_receiving_address"]),
+ value: z.string().min(10).max(128),
+ }))
+ .mutation(async ({ input }) => {
+ if (!input.token.startsWith("bmFjLWFkbWlu")) {
+ throw new TRPCError({ code: "UNAUTHORIZED", message: "Invalid admin token" });
+ }
+ const labels: Record = {
+ trc20_receiving_address: "TRC20 USDT 接收地址",
+ bsc_receiving_address: "BSC ERC20 USDT 接收地址",
+ eth_receiving_address: "ETH ERC20 USDT 接收地址",
+ };
+ await upsertSiteSetting(
+ input.key,
+ input.value,
+ labels[input.key],
+ "仅管理员可修改,前端只读显示"
+ );
+ console.log(`[Admin] Receiving address updated: ${input.key} = ${input.value}`);
+ return { success: true };
+ }),
+
+ // Admin: get all site settings
+ getAllSettings: publicProcedure
+ .input(z.object({ token: z.string() }))
+ .query(async ({ input }) => {
+ if (!input.token.startsWith("bmFjLWFkbWlu")) {
+ throw new TRPCError({ code: "UNAUTHORIZED", message: "Invalid admin token" });
+ }
+ const db = await getDb();
+ if (!db) return [];
+ return await db.select().from(siteSettings);
+ }),
}),
});
-
export type AppRouter = typeof appRouter;
diff --git a/todo.md b/todo.md
index b0e8d5c..318ee6b 100644
--- a/todo.md
+++ b/todo.md
@@ -248,3 +248,36 @@
- [x] 前端:支付状态轮询(每 5 秒查询订单状态)
- [ ] 获取商户账号后填入密钥并进行真实支付测试
- [ ] 构建部署到 AI 服务器并同步 Git 库
+
+## v18 跨链桥独立域名 trc-ico.newassetchain.io
+
+- [ ] 分析当前 Bridge 路由和 Nginx 配置
+- [ ] 前端:访问 trc-ico.newassetchain.io 时直接显示 Bridge 页面
+- [ ] 服务器:配置 Nginx trc-ico.newassetchain.io 反向代理
+- [ ] 构建部署并验证域名访问
+- [ ] 同步 Gitea
+
+## v18 三域名配置
+
+- [ ] 前端:hostname 检测,trc-ico.newassetchain.io 自动跳转 /bridge
+- [ ] Nginx:合并 pre-sale + ico 到同一 server block
+- [ ] Nginx:trc-ico 独立 server block,代理到 /bridge
+- [ ] 构建部署并验证三个域名
+- [ ] 同步 Gitea
+
+## v18 彻底清除 Manus 内联
+
+- [ ] 扫描所有 manus.im / manus.computer / manus.space 来源
+- [ ] 清除 const.ts 中 OAuth manus.im 回退逻辑
+- [ ] 清除 _core 模块中所有 Manus API 硬编码 URL
+- [ ] 构建验证 bundle 零 Manus 内联
+- [ ] 部署并验证三个域名
+
+## Bug 修复
+
+- [ ] TRC20 接收地址显示区域应为灰色只读,不可编辑(当前可能可以点击修改)
+
+- [ ] 数据库新增 site_settings 表存储 TRC20/BSC/ETH 接收地址
+- [ ] 后端新增 settings 路由读取/更新接收地址
+- [ ] 前端接收地址从 API 读取,灰色只读可复制不可编辑
+- [ ] Admin 后台新增接收地址配置入口