123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package com.ichaoj.ams.constant;
- import cn.hutool.core.util.HexUtil;
- import cn.hutool.core.util.StrUtil;
- import cn.hutool.crypto.SecureUtil;
- import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
- import lombok.extern.slf4j.Slf4j;
- import org.apache.catalina.security.SecurityUtil;
- import java.io.File;
- /**
- * @author cjwen
- */
- @Slf4j
- public class AmsConstant {
- /**
- * 地址缓存前缀
- */
- public static final String CACHE_ADDRESS_PREFIX = "ams:address";
- public static String aesKey;
- public static long aesUpdateTime = System.currentTimeMillis();
- // public static void reloadAesKey() {
- // int updateKeySplit = 1000 * 60 * 30;
- // String currentKey = AmsConstant.aesKey;
- // if (System.currentTimeMillis() - aesUpdateTime > updateKeySplit) {
- // synchronized (AmsConstant.class) {
- // if (AmsConstant.aesKey.equals(currentKey)) {
- // AmsConstant.aesKey = HexUtil.encodeHexStr(SecureUtil.generateKey(SymmetricAlgorithm.AES.getValue()).getEncoded());
- // aesUpdateTime = System.currentTimeMillis();
- // log.info("update aes key : {}", AmsConstant.aesKey);
- // }
- // }
- // }
- // }
- public static final String WALLET_FILE_PATH =
- StrUtil.format("{}home{}pao{}ams{}wallet{}", File.separator, File.separator, File.separator, File.separator, File.separator);
- public enum TaskType {
- /**
- * Bridge
- */
- BRIDGE,
- /**
- * NFT
- */
- NFT,
- /**
- * MuteSwap
- */
- SWAP;
- TaskType() {
- }
- }
- public enum AirdropStatus {
- /**
- * 未开始
- */
- NOT_STARTED,
- /**
- * 运行中
- */
- ONGOING,
- /**
- * 未空投
- */
- NOT_DROPPED,
- /**
- * 已空投
- */
- DROPPED;
- AirdropStatus() {
- }
- }
- }
|