mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-07-24 07:21:05 -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
7
dist/HavenoClient.js
vendored
7
dist/HavenoClient.js
vendored
|
@ -975,7 +975,7 @@ 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)
|
||||
|
@ -983,14 +983,15 @@ class HavenoClient {
|
|||
* @param {number} reserveExactAmount - reserve exact amount needed for offer, incurring on-chain transaction and 10 confirmations before the offer goes live (default = false)
|
||||
* @return {OfferInfo} the posted offer
|
||||
*/
|
||||
async postOffer(direction, amount, assetCode, paymentAccountId, buyerSecurityDepositPct, price, marketPriceMarginPct, triggerPrice, minAmount, reserveExactAmount) {
|
||||
async postOffer(direction, amount, assetCode, paymentAccountId, securityDepositPct, price, marketPriceMarginPct, triggerPrice, minAmount, reserveExactAmount) {
|
||||
console_1.default.log("Posting offer with security deposit %: " + securityDepositPct);
|
||||
try {
|
||||
const request = new grpc_pb_1.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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue