MCPcopy Create free account

hub / github.com/TGlimmer/TG_walletbot / functions

Functions2,200 in github.com/TGlimmer/TG_walletbot

↓ 5 callersMethodgetLastProcessedBlock
--- 区块进度持久化 (Redis) --- getLastProcessedBlock 从 Redis 获取上次处理的区块号
internal/infrastructure/tron/monitor.go:432
↓ 5 callersMethodincrementalRefreshAddressCache
incrementalRefreshAddressCache 增量更新地址缓存 只查询上次刷新之后新创建的充值地址,减少数据库查询开销 增量查询异常时自动降级为全量刷新
internal/infrastructure/tron/monitor.go:488
↓ 5 callersMethodscanBlocksBatch
scanBlocksBatch 批量模式: 使用 GetBlockRange 一次获取多块 追赶场景下比逐块模式快 20-50 倍
internal/infrastructure/tron/monitor.go:174
↓ 5 callersMethodscanBlocksSequential
scanBlocksSequential 逐块模式: 稳态时使用,每块单独获取
internal/infrastructure/tron/monitor.go:235
↓ 5 callersMethodscanNewBlocks
scanNewBlocks 扫描新产生的区块 落后 <= batchThreshold 块时逐块扫描,落后更多时批量拉取
internal/infrastructure/tron/monitor.go:139
↓ 5 callersMethodsendNotification
sendNotification 发送充值到账通知
internal/infrastructure/tron/monitor.go:398
↓ 5 callersFunctionsetupAdminOnlyRouter
========== AdminOnly 中间件测试 ========== setupAdminOnlyRouter 创建带有 AdminOnly 中间件的测试路由
internal/adapter/middleware/jwt_test.go:291
↓ 5 callersFunctionsetupSuperAdminRouter
========== SuperAdminOnly 中间件测试 ========== setupSuperAdminRouter 创建带有 SuperAdminOnly 中间件的测试路由
internal/adapter/middleware/jwt_test.go:378
↓ 5 callersFunctionsignTransaction
signTransaction 对交易进行签名 rawTx: 原始交易 JSON privateKeyHex: 私钥 hex 返回: 包含签名的交易 JSON
internal/infrastructure/tron/transaction.go:148
↓ 5 callersMethodstartExchange
startExchange 开始兑换流程 (选择方向后输入金额)
internal/adapter/telegram/handler/exchange.go:153
↓ 4 callersMethodApproveWithdrawal
ApproveWithdrawal 审核通过提币 (管理后台调用)
internal/domain/service/withdrawal_service.go:156
↓ 4 callersMethodAvailableBalance
AvailableBalance 可用余额 (可用 = 总余额 - 冻结)
internal/domain/entity/wallet.go:34
↓ 4 callersFunctionCORS
CORS 跨域资源共享中间件
internal/adapter/middleware/cors.go:10
↓ 4 callersMethodFindRecipientByID
FindRecipientByID 通过数字 ID (尝试作为 Telegram ID) 查找收款人
internal/app/transfer_usecase.go:53
↓ 4 callersMethodFindRecipientByUsername
FindRecipientByUsername 通过用户名查找收款人
internal/app/transfer_usecase.go:39
↓ 4 callersMethodFreezeBalance
FreezeBalance 冻结余额
internal/domain/port/repository.go:46
↓ 4 callersMethodGetByTelegramID
GetByTelegramID 根据 Telegram ID 获取用户
internal/domain/service/user_service.go:196
↓ 4 callersMethodGetCoversByUserID
GetCoversByUserID 获取用户的红包封面列表
internal/domain/service/redpacket_service.go:593
↓ 4 callersMethodGetDepositInfo
GetDepositInfo 获取充值信息 (地址 + 二维码)
internal/app/deposit_usecase.go:37
↓ 4 callersMethodGetTransferByID
GetTransferByID 根据 ID 查询转账记录
internal/app/transfer_usecase.go:154
↓ 4 callersMethodGetUserDepositAddress
GetUserDepositAddress 获取用户的充值地址
internal/domain/service/deposit_service.go:180
↓ 4 callersMethodGetUserInvestmentSummary
GetUserInvestmentSummary 获取用户投资汇总统计
internal/domain/service/finance_service.go:292
↓ 4 callersMethodGetUserRedPackets
GetUserRedPackets 获取用户待发送红包列表
internal/domain/service/redpacket_service.go:435
↓ 4 callersFunctionHashPassword
HashPassword 密码哈希
internal/domain/service/admin_service.go:134
↓ 4 callersMethodIsFullyClaimed
IsFullyClaimed 判断是否已全部领取
internal/domain/entity/red_packet.go:57
↓ 4 callersMethodIsIncome
IsIncome 判断是否为收入类型交易
internal/domain/entity/transaction.go:47
↓ 4 callersFunctionIsWeakJWTSecret
IsWeakJWTSecret 检查 JWT Secret 是否为常见弱密钥 返回 true 表示密钥不安全,应发出警告
internal/infrastructure/config/config.go:170
↓ 4 callersFunctionJWTAuth
JWTAuth JWT 认证中间件
internal/adapter/middleware/jwt.go:53
↓ 4 callersFunctionLoad
Load 加载配置文件 配置优先级: 环境变量 > 配置文件 > 默认值
internal/infrastructure/config/config.go:121
↓ 4 callersMethodNeedPIN
NeedPIN 判断指定金额操作是否需要 PIN 验证
internal/domain/service/user_service.go:206
↓ 4 callersFunctionNewAdminUseCase
NewAdminUseCase 创建管理后台用例
internal/app/admin_usecase.go:32
↓ 4 callersFunctionNewDepositService
NewDepositService 创建充值领域服务
internal/domain/service/deposit_service.go:24
↓ 4 callersFunctionNewExchangeService
NewExchangeService 创建闪兑领域服务
internal/domain/service/exchange_service.go:30
↓ 4 callersFunctionNewProfileService
NewProfileService 创建个人中心领域服务
internal/domain/service/profile_service.go:23
↓ 4 callersFunctionNewTransferService
NewTransferService 创建转账领域服务
internal/domain/service/transfer_service.go:27
↓ 4 callersFunctionNewWithdrawalService
NewWithdrawalService 创建提币领域服务
internal/domain/service/withdrawal_service.go:23
↓ 4 callersFunctionNotFound
NotFound 返回 404 错误
pkg/response/response.go:92
↓ 4 callersMethodRejectWithdrawal
RejectWithdrawal 拒绝提币 (退回余额)
internal/app/admin_usecase.go:507
↓ 4 callersMethodResetAPIKey
ResetAPIKey 重置商户 API 密钥 (管理员或用户调用,兼容旧接口)
internal/domain/service/merchant_service.go:352
↓ 4 callersMethodSetPIN
SetPIN 设置支付密码
internal/app/user_usecase.go:192
↓ 4 callersMethodStartPINSetup
StartPINSetup 发起 PIN 设置流程 (供其他模块调用) messageID > 0 时使用 EditMessage,否则发送新消息 callbackModule/callbackAction: PIN 设置完成后回到的模块和动作
internal/adapter/telegram/handler/pin.go:112
↓ 4 callersMethodUpdateUserStatus
UpdateUserStatus 更新用户状态 (冻结/解冻)
internal/app/admin_usecase.go:324
↓ 4 callersFunctionbase58DecodeTx
base58DecodeTx 将 Base58 编码字符串解码为字节数组
internal/infrastructure/tron/transaction.go:283
↓ 4 callersFunctionclearBytes
clearBytes 清零字节数组 (安全: 用完私钥后清除内存)
internal/infrastructure/tron/transaction.go:311
↓ 4 callersFunctioncurrencyShort
currencyShort 获取币种短显示名 USDT → "U" (参考格式), TRX → "TRX", CNY → "CNY"
internal/adapter/telegram/handler/inline_query.go:101
↓ 4 callersFunctionextractChatID
--- 辅助函数 --- extractChatID 从 update 中提取 chat ID
internal/adapter/telegram/middleware.go:220
↓ 4 callersFunctionfilterButton
--- 辅助函数 --- filterButton 构建筛选按钮 (当前选中加标记)
internal/adapter/telegram/handler/profile.go:449
↓ 4 callersFunctionloadDetail
()
web/src/pages/RedPacketManagement.tsx:137
↓ 4 callersFunctionparseUint64FromAction
parseUint64FromAction 从 action 字符串中解析 uint64 ID 例如 "shop_info--123" => prefix="shop_info--", 返回 123
internal/adapter/telegram/handler/merchant.go:669
↓ 4 callersMethodpostRaw
postRaw 发送 POST 请求 (原始 body)
internal/infrastructure/tron/transaction.go:223
↓ 4 callersMethodrandomAmount
randomAmount 二倍均值随机算法 范围: [0.01, 2 * remaining / remainingCount)
internal/domain/service/redpacket_service.go:634
↓ 4 callersMethodsendAsync
sendAsync 异步发送消息,带重试机制
internal/adapter/notification/telegram_notifier.go:140
↓ 4 callersMethodshowDetail
==================== 商户详情 ==================== showDetail 显示商户详情页
internal/adapter/telegram/handler/merchant.go:244
↓ 3 callersMethodBuildConfirmInfo
BuildConfirmInfo 构建提币确认信息
internal/app/withdrawal_usecase.go:80
↓ 3 callersFunctionBuildSimpleMenuKeyboard
BuildSimpleMenuKeyboard 构建 /settings 精简版菜单键盘 7 个按钮,带 emoji 图标
internal/adapter/telegram/handler/menu.go:100
↓ 3 callersMethodChangePIN
ChangePIN 修改支付密码 (需要旧 PIN 验证)
internal/domain/service/user_service.go:184
↓ 3 callersMethodCreateReceiveRequest
CreateReceiveRequest 创建收款请求
internal/domain/service/transfer_service.go:185
↓ 3 callersMethodDailyProfit
DailyProfit 计算每日收益: 持仓金额 * 年化 / 365
internal/domain/entity/finance.go:34
↓ 3 callersMethodDelete
Delete 删除缓存
internal/domain/port/cache.go:15
↓ 3 callersMethodExpireRedPackets
ExpireRedPackets 过期红包批量退款
internal/domain/service/redpacket_service.go:339
↓ 3 callersMethodFindByTelegramID
FindByTelegramID 根据 Telegram ID 查询用户
internal/domain/port/repository.go:20
↓ 3 callersMethodGetAdminByID
GetAdminByID 根据 ID 获取管理员
internal/domain/service/admin_service.go:66
↓ 3 callersMethodGetAdminByID
GetAdminByID 获取管理员信息
internal/app/admin_usecase.go:66
↓ 3 callersMethodGetAllRatesDisplay
GetAllRatesDisplay 获取所有汇率展示
internal/app/exchange_usecase.go:89
↓ 3 callersMethodGetBills
GetBills 获取账单列表
internal/app/profile_usecase.go:34
↓ 3 callersMethodGetByID
GetByID 根据 ID 获取用户
internal/domain/service/user_service.go:201
↓ 3 callersMethodGetClaimsByPacketID
GetClaimsByPacketID 获取红包的所有领取记录
internal/domain/service/redpacket_service.go:588
↓ 3 callersMethodGetData
GetData 获取临时数据
pkg/telegram/session.go:88
↓ 3 callersMethodGetDataFloat
GetDataFloat 获取临时数据为浮点数
pkg/telegram/session.go:108
↓ 3 callersMethodGetProfileDashboard
GetProfileDashboard 获取个人中心主页数据
internal/app/profile_usecase.go:29
↓ 3 callersMethodGetRedPacketByID
GetRedPacketByID 根据 ID 查询红包
internal/domain/service/redpacket_service.go:562
↓ 3 callersMethodGetSmallFreeInfo
GetSmallFreeInfo 获取小额免密额度
internal/domain/service/profile_service.go:159
↓ 3 callersMethodGetTransferByID
GetTransferByID 根据 ID 查询转账记录
internal/domain/service/transfer_service.go:220
↓ 3 callersMethodGetUserInvestments
GetUserInvestments 获取用户持有中的投资列表
internal/domain/service/finance_service.go:283
↓ 3 callersMethodGetUserTransactions
GetUserTransactions 获取用户交易记录
internal/app/admin_usecase.go:337
↓ 3 callersMethodGetWithdrawalHistory
GetWithdrawalHistory 获取提币历史 (分页)
internal/domain/service/profile_service.go:124
↓ 3 callersMethodIsCredited
IsCredited 判断是否已到账
internal/domain/entity/deposit.go:38
↓ 3 callersMethodLogin
--- 认证 --- Login 管理员登录
internal/app/admin_usecase.go:61
↓ 3 callersFunctionNewDepositUseCase
NewDepositUseCase 创建充值用例
internal/app/deposit_usecase.go:22
↓ 3 callersFunctionNewExchangeUseCase
NewExchangeUseCase 创建闪兑用例
internal/app/exchange_usecase.go:22
↓ 3 callersFunctionNewMerchantService
NewMerchantService 创建商户领域服务
internal/domain/service/merchant_service.go:26
↓ 3 callersFunctionNewProfileUseCase
NewProfileUseCase 创建个人中心用例
internal/app/profile_usecase.go:20
↓ 3 callersFunctionNewTransferUseCase
NewTransferUseCase 创建转账用例
internal/app/transfer_usecase.go:24
↓ 3 callersFunctionNewUserUseCase
NewUserUseCase 创建用户用例 depositSvc/addrGen/walletKeyRepo/cryptoSvc/encryptionKey 可传 nil (TRON 未启用时)
internal/app/user_usecase.go:28
↓ 3 callersFunctionNewWithdrawalUseCase
NewWithdrawalUseCase 创建提币用例 withdrawalSender 可传 nil (TRON 未启用时不自动发送)
internal/app/withdrawal_usecase.go:28
↓ 3 callersMethodSetIPList
SetIPList 设置 IP 白名单列表
internal/domain/entity/merchant.go:96
↓ 3 callersMethodSetNX
SetNX 仅在 key 不存在时设置 (用于分布式锁)
internal/domain/port/cache.go:23
↓ 3 callersMethodSetUserDepositAddress
SetUserDepositAddress 设置用户充值地址 (注册时调用) 更新该用户所有链上钱包 (USDT/TRX) 的充值地址
internal/domain/service/deposit_service.go:194
↓ 3 callersMethodStart
Start 启动充值监控 (阻塞运行,直到 ctx 取消)
internal/infrastructure/tron/monitor.go:87
↓ 3 callersFunctionSwitchInlineCurrentChatButton
SwitchInlineCurrentChatButton 创建当前聊天内联查询按钮 注意: go-telegram/bot 的 SwitchInlineQueryCurrentChat 字段使用 omitempty, 空字符串会被 JSON 序列化丢弃导致按钮无效。使用零宽空格作为 workaro
pkg/telegram/keyboard.go:47
↓ 3 callersMethodUpdateSmallFreeLimit
UpdateSmallFreeLimit 更新小额免密额度 (需要先验证 PIN)
internal/app/profile_usecase.go:62
↓ 3 callersFunctionValidateAddress
ValidateAddress 验证 TRON 地址格式 规则: T 开头, 34 字符, Base58Check 编码
pkg/tron/address.go:16
↓ 3 callersMethodValidateAddress
ValidateAddress 验证提币地址
internal/app/withdrawal_usecase.go:59
↓ 3 callersMethodValidateForAPI
ValidateForAPI 验证 API 服务必需的配置项 检查 JWT Secret 长度和弱密钥,验证失败返回错误
internal/infrastructure/config/config.go:161
↓ 3 callersMethodVerifyPIN
VerifyPIN 验证支付密码
internal/app/user_usecase.go:202
↓ 3 callersFunctionWrap
Wrap 包装已有错误为 AppError
pkg/errors/errors.go:69
↓ 3 callersFunctionbase58Decode
base58Decode 将 Base58 编码字符串解码为字节数组
pkg/tron/address.go:62
↓ 3 callersFunctionbase58ToHex
base58ToHex 将 TRON Base58Check 地址转为 20 字节 hex (不含 0x41 前缀)
internal/infrastructure/tron/transaction.go:271
↓ 3 callersMethodbotDeepLink
botDeepLink 构建 Bot 深度链接 URL (https://t.me/BOT?start=PARAM)
internal/adapter/telegram/handler/inline_query.go:70
↓ 3 callersMethodbroadcastTransaction
broadcastTransaction 广播已签名的交易
internal/infrastructure/tron/transaction.go:190
← previousnext →201–300 of 2,200, ranked by callers