offer min amount defaults to fixed amount

This commit is contained in:
woodser 2022-04-26 14:29:37 -04:00
parent 0e612aec74
commit e18d0ea2c2
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ const TestConfig = {
price: undefined, // use market price if undefined // TODO: converted to long on backend price: undefined, // use market price if undefined // TODO: converted to long on backend
paymentAccountId: undefined, paymentAccountId: undefined,
priceMargin: 0.0, priceMargin: 0.0,
minAmount: BigInt("150000000000"), // TODO: disable by default, test somewhere minAmount: undefined,
buyerSecurityDeposit: 0.15, buyerSecurityDeposit: 0.15,
awaitUnlockedBalance: false, awaitUnlockedBalance: false,
triggerPrice: undefined // TODO: fails if there is a decimal, converted to long on backend triggerPrice: undefined // TODO: fails if there is a decimal, converted to long on backend

View File

@ -990,9 +990,9 @@ class HavenoClient {
.setBuyerSecurityDeposit(buyerSecurityDeposit) .setBuyerSecurityDeposit(buyerSecurityDeposit)
.setPrice(price ? price.toString() : "1.0") // TOOD (woodser): positive price required even if using market price? .setPrice(price ? price.toString() : "1.0") // TOOD (woodser): positive price required even if using market price?
.setUseMarketBasedPrice(price === undefined) // TODO (woodser): this field is redundant; remove from api .setUseMarketBasedPrice(price === undefined) // TODO (woodser): this field is redundant; remove from api
.setMinAmount(minAmount ? minAmount.toString() : amount.toString());
if (marketPriceMargin) request.setMarketPriceMargin(marketPriceMargin); if (marketPriceMargin) request.setMarketPriceMargin(marketPriceMargin);
if (triggerPrice) request.setTriggerPrice(triggerPrice.toString()); if (triggerPrice) request.setTriggerPrice(triggerPrice.toString());
if (minAmount) request.setMinAmount(minAmount.toString());
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
that._offersClient.createOffer(request, {password: that._password}, function(err: grpcWeb.RpcError, response: CreateOfferReply) { that._offersClient.createOffer(request, {password: that._password}, function(err: grpcWeb.RpcError, response: CreateOfferReply) {
if (err) reject(err); if (err) reject(err);