AmsConstant.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package com.ichaoj.ams.constant;
  2. import cn.hutool.core.util.HexUtil;
  3. import cn.hutool.core.util.StrUtil;
  4. import cn.hutool.crypto.SecureUtil;
  5. import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
  6. import lombok.extern.slf4j.Slf4j;
  7. import org.apache.catalina.security.SecurityUtil;
  8. import java.io.File;
  9. /**
  10. * @author cjwen
  11. */
  12. @Slf4j
  13. public class AmsConstant {
  14. /**
  15. * 地址缓存前缀
  16. */
  17. public static final String CACHE_ADDRESS_PREFIX = "ams:address";
  18. public static String aesKey;
  19. public static long aesUpdateTime = System.currentTimeMillis();
  20. // public static void reloadAesKey() {
  21. // int updateKeySplit = 1000 * 60 * 30;
  22. // String currentKey = AmsConstant.aesKey;
  23. // if (System.currentTimeMillis() - aesUpdateTime > updateKeySplit) {
  24. // synchronized (AmsConstant.class) {
  25. // if (AmsConstant.aesKey.equals(currentKey)) {
  26. // AmsConstant.aesKey = HexUtil.encodeHexStr(SecureUtil.generateKey(SymmetricAlgorithm.AES.getValue()).getEncoded());
  27. // aesUpdateTime = System.currentTimeMillis();
  28. // log.info("update aes key : {}", AmsConstant.aesKey);
  29. // }
  30. // }
  31. // }
  32. // }
  33. public static final String WALLET_FILE_PATH =
  34. StrUtil.format("{}home{}pao{}ams{}wallet{}", File.separator, File.separator, File.separator, File.separator, File.separator);
  35. public enum TaskType {
  36. /**
  37. * Bridge
  38. */
  39. BRIDGE,
  40. /**
  41. * NFT
  42. */
  43. NFT,
  44. /**
  45. * MuteSwap
  46. */
  47. SWAP;
  48. TaskType() {
  49. }
  50. }
  51. public enum AirdropStatus {
  52. /**
  53. * 未开始
  54. */
  55. NOT_STARTED,
  56. /**
  57. * 运行中
  58. */
  59. ONGOING,
  60. /**
  61. * 未空投
  62. */
  63. NOT_DROPPED,
  64. /**
  65. * 已空投
  66. */
  67. DROPPED;
  68. AirdropStatus() {
  69. }
  70. }
  71. }