Skip to content

Commit

Permalink
Merge branch 'price' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpiotzh committed Sep 18, 2023
2 parents b8c2610 + 35b1a1b commit 55f358a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions http_server/handle/config_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ type RespConfigInfo struct {
PaymentMinPrice int64 `json:"payment_min_price"`
ServiceFeeRatio string `json:"service_fee_ratio"`
} `json:"auto_mint"`
MintCostsManually uint64 `json:"mint_costs_manually"`
RenewCostsManually uint64 `json:"renew_costs_manually"`
MintCostsManually decimal.Decimal `json:"mint_costs_manually"`
RenewCostsManually decimal.Decimal `json:"renew_costs_manually"`
ManagementTimes uint64 `json:"management_times"`
MintPrice decimal.Decimal `json:"mint_price"`
RenewPrice decimal.Decimal `json:"renew_price"`
}

func (h *HttpHandle) ConfigInfo(ctx *gin.Context) {
Expand Down Expand Up @@ -62,16 +60,11 @@ func (h *HttpHandle) doConfigInfo(apiResp *api_code.ApiResp) error {
resp.SubAccountCommonFee, _ = molecule.Bytes2GoU64(builder.ConfigCellSubAccount.CommonFee().RawData())
resp.ManagementTimes = 10000

//resp.MintCostsManually, _ = molecule.Bytes2GoU64(builder.ConfigCellSubAccount.NewSubAccountPrice().RawData())
//resp.RenewCostsManually, _ = molecule.Bytes2GoU64(builder.ConfigCellSubAccount.RenewSubAccountPrice().RawData())
resp.MintCostsManually = 100000000
resp.RenewCostsManually = 100000000

mintPrice, _ := builder.NewSubAccountPrice()
renewPrice, _ := builder.RenewSubAccountPrice()

resp.MintPrice = decimal.NewFromInt(int64(mintPrice)).DivRound(decimal.NewFromInt(common.UsdRateBase), 2)
resp.RenewPrice = decimal.NewFromInt(int64(renewPrice)).DivRound(decimal.NewFromInt(common.UsdRateBase), 2)
resp.MintCostsManually = decimal.NewFromInt(int64(mintPrice)).DivRound(decimal.NewFromInt(common.UsdRateBase), 2)
resp.RenewCostsManually = decimal.NewFromInt(int64(renewPrice)).DivRound(decimal.NewFromInt(common.UsdRateBase), 2)

quoteCell, err := h.DasCore.GetQuoteCell()
if err != nil {
Expand Down

0 comments on commit 55f358a

Please sign in to comment.