mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-07-23 15:00:43 -04:00
test security deposit based on trade amount
This commit is contained in:
parent
cfdec7115c
commit
35c0cf9301
11 changed files with 176 additions and 181 deletions
|
@ -995,7 +995,7 @@ export default class HavenoClient {
|
|||
* @param {bigint} amount - amount of XMR to trade
|
||||
* @param {string} assetCode - asset code to trade for XMR
|
||||
* @param {string} paymentAccountId - payment account id
|
||||
* @param {number} buyerSecurityDepositPct - buyer security deposit as % of trade amount
|
||||
* @param {number} securityDepositPct - security deposit as % of trade amount for buyer and seller
|
||||
* @param {number} price - trade price (optional, default to market price)
|
||||
* @param {number} marketPriceMarginPct - if using market price, % from market price to accept (optional, default 0%)
|
||||
* @param {number} triggerPrice - price to remove offer (optional)
|
||||
|
@ -1007,19 +1007,20 @@ export default class HavenoClient {
|
|||
amount: bigint,
|
||||
assetCode: string,
|
||||
paymentAccountId: string,
|
||||
buyerSecurityDepositPct: number,
|
||||
securityDepositPct: number,
|
||||
price?: number,
|
||||
marketPriceMarginPct?: number,
|
||||
triggerPrice?: number,
|
||||
minAmount?: bigint,
|
||||
reserveExactAmount?: boolean): Promise<OfferInfo> {
|
||||
console.log("Posting offer with security deposit %: " + securityDepositPct)
|
||||
try {
|
||||
const request = new PostOfferRequest()
|
||||
.setDirection(direction)
|
||||
.setAmount(amount.toString())
|
||||
.setCurrencyCode(assetCode)
|
||||
.setPaymentAccountId(paymentAccountId)
|
||||
.setBuyerSecurityDepositPct(buyerSecurityDepositPct)
|
||||
.setBuyerSecurityDepositPct(securityDepositPct)
|
||||
.setUseMarketBasedPrice(price === undefined)
|
||||
.setMinAmount(minAmount ? minAmount.toString() : amount.toString());
|
||||
if (price) request.setPrice(price.toString());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue