预估是否需要消耗trx

This commit is contained in:
lu7213 committed 2026-10-12 05:26:59 -04:00
1 parent 40088cd0f0
commit 0ed50c6ddd
5 files changed
+227 -8

No files matched your search

@@ -10,6 +10,8 @@ public class WalletOperationRequest {
private BigDecimal amount;
private Integer resourceCode;
private Boolean broadcast;
/** 为 true 时资源不足立即拒绝,禁止通过燃烧 TRX 补足资源。 */
private Boolean resourceOnly;
/** 配置密码仅用于本次请求解锁助记词,禁止持久化或输出日志。 */
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private String configurationPassword;
@@ -24,6 +26,8 @@ public class WalletOperationRequest {
public void setResourceCode(Integer resourceCode) { this.resourceCode = resourceCode; }
public Boolean getBroadcast() { return broadcast; }
public void setBroadcast(Boolean broadcast) { this.broadcast = broadcast; }
public Boolean getResourceOnly() { return resourceOnly; }
public void setResourceOnly(Boolean resourceOnly) { this.resourceOnly = resourceOnly; }
public String getConfigurationPassword() { return configurationPassword; }
public void setConfigurationPassword(String configurationPassword) { this.configurationPassword = configurationPassword; }
}
@@ -0,0 +1,50 @@
package com.ruoyi.system.domain.vo;
import java.io.Serializable;
import java.math.BigDecimal;
/** 钱包链上操作资源估算结果。 */
public class WalletResourceEstimateVo implements Serializable {
private static final long serialVersionUID = 1L;
private long estimatedEnergy;
private long estimatedBandwidth;
private long safeEnergy;
private long safeBandwidth;
private long availableEnergy;
private long availableBandwidth;
private long energyGap;
private long bandwidthGap;
private int redundancyPercent;
private long energyFeeSun;
private long bandwidthFeeSun;
private BigDecimal estimatedBurnTrx;
private boolean burnRequired;
public long getEstimatedEnergy() { return estimatedEnergy; }
public void setEstimatedEnergy(long estimatedEnergy) { this.estimatedEnergy = estimatedEnergy; }
public long getEstimatedBandwidth() { return estimatedBandwidth; }
public void setEstimatedBandwidth(long estimatedBandwidth) { this.estimatedBandwidth = estimatedBandwidth; }
public long getSafeEnergy() { return safeEnergy; }
public void setSafeEnergy(long safeEnergy) { this.safeEnergy = safeEnergy; }
public long getSafeBandwidth() { return safeBandwidth; }
public void setSafeBandwidth(long safeBandwidth) { this.safeBandwidth = safeBandwidth; }
public long getAvailableEnergy() { return availableEnergy; }
public void setAvailableEnergy(long availableEnergy) { this.availableEnergy = availableEnergy; }
public long getAvailableBandwidth() { return availableBandwidth; }
public void setAvailableBandwidth(long availableBandwidth) { this.availableBandwidth = availableBandwidth; }
public long getEnergyGap() { return energyGap; }
public void setEnergyGap(long energyGap) { this.energyGap = energyGap; }
public long getBandwidthGap() { return bandwidthGap; }
public void setBandwidthGap(long bandwidthGap) { this.bandwidthGap = bandwidthGap; }
public int getRedundancyPercent() { return redundancyPercent; }
public void setRedundancyPercent(int redundancyPercent) { this.redundancyPercent = redundancyPercent; }
public long getEnergyFeeSun() { return energyFeeSun; }
public void setEnergyFeeSun(long energyFeeSun) { this.energyFeeSun = energyFeeSun; }
public long getBandwidthFeeSun() { return bandwidthFeeSun; }
public void setBandwidthFeeSun(long bandwidthFeeSun) { this.bandwidthFeeSun = bandwidthFeeSun; }
public BigDecimal getEstimatedBurnTrx() { return estimatedBurnTrx; }
public void setEstimatedBurnTrx(BigDecimal estimatedBurnTrx) { this.estimatedBurnTrx = estimatedBurnTrx; }
public boolean isBurnRequired() { return burnRequired; }
public void setBurnRequired(boolean burnRequired) { this.burnRequired = burnRequired; }
}