mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-02-22 23:49:58 -05:00
support and test splitting output for offer
This commit is contained in:
parent
055f2dd5d2
commit
3cfb83d252
3
dist/HavenoClient.d.ts
vendored
3
dist/HavenoClient.d.ts
vendored
@ -423,9 +423,10 @@ export default class HavenoClient {
|
||||
* @param {number} marketPriceMarginPct - if using market price, % from market price to accept (optional, default 0%)
|
||||
* @param {bigint} minAmount - minimum amount to trade (optional, default to fixed amount)
|
||||
* @param {number} triggerPrice - price to remove offer (optional)
|
||||
* @param {number} splitOutput - create a new output reserved for the offer, incurring an on-chain transaction and 10 confirmations before the offer goes live (default = false)
|
||||
* @return {OfferInfo} the posted offer
|
||||
*/
|
||||
postOffer(direction: string, amount: bigint, assetCode: string, paymentAccountId: string, buyerSecurityDepositPct: number, price?: number, marketPriceMarginPct?: number, triggerPrice?: number, minAmount?: bigint): Promise<OfferInfo>;
|
||||
postOffer(direction: string, amount: bigint, assetCode: string, paymentAccountId: string, buyerSecurityDepositPct: number, price?: number, marketPriceMarginPct?: number, triggerPrice?: number, splitOutput?: boolean, minAmount?: bigint): Promise<OfferInfo>;
|
||||
/**
|
||||
* Remove a posted offer, releasing its reserved funds.
|
||||
*
|
||||
|
5
dist/HavenoClient.js
vendored
5
dist/HavenoClient.js
vendored
@ -979,9 +979,10 @@ class HavenoClient {
|
||||
* @param {number} marketPriceMarginPct - if using market price, % from market price to accept (optional, default 0%)
|
||||
* @param {bigint} minAmount - minimum amount to trade (optional, default to fixed amount)
|
||||
* @param {number} triggerPrice - price to remove offer (optional)
|
||||
* @param {number} splitOutput - create a new output reserved for the offer, incurring an 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) {
|
||||
async postOffer(direction, amount, assetCode, paymentAccountId, buyerSecurityDepositPct, price, marketPriceMarginPct, triggerPrice, splitOutput, minAmount) {
|
||||
try {
|
||||
const request = new grpc_pb_1.PostOfferRequest()
|
||||
.setDirection(direction)
|
||||
@ -997,6 +998,8 @@ class HavenoClient {
|
||||
request.setMarketPriceMarginPct(marketPriceMarginPct);
|
||||
if (triggerPrice)
|
||||
request.setTriggerPrice(triggerPrice.toString());
|
||||
if (splitOutput)
|
||||
request.setSplitOutput(splitOutput);
|
||||
return (await this._offersClient.postOffer(request, { password: this._password })).getOffer();
|
||||
}
|
||||
catch (e) {
|
||||
|
2
dist/HavenoClient.js.map
vendored
2
dist/HavenoClient.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/protobuf/grpc_pb.d.ts
vendored
4
dist/protobuf/grpc_pb.d.ts
vendored
@ -1499,6 +1499,9 @@ export class PostOfferRequest extends jspb.Message {
|
||||
getTriggerPrice(): string;
|
||||
setTriggerPrice(value: string): PostOfferRequest;
|
||||
|
||||
getSplitOutput(): boolean;
|
||||
setSplitOutput(value: boolean): PostOfferRequest;
|
||||
|
||||
getPaymentAccountId(): string;
|
||||
setPaymentAccountId(value: string): PostOfferRequest;
|
||||
|
||||
@ -1521,6 +1524,7 @@ export namespace PostOfferRequest {
|
||||
minAmount: string,
|
||||
buyerSecurityDepositPct: number,
|
||||
triggerPrice: string,
|
||||
splitOutput: boolean,
|
||||
paymentAccountId: string,
|
||||
}
|
||||
}
|
||||
|
40
dist/protobuf/grpc_pb.js
vendored
40
dist/protobuf/grpc_pb.js
vendored
@ -14510,7 +14510,8 @@ proto.io.haveno.protobuffer.PostOfferRequest.toObject = function(includeInstance
|
||||
minAmount: jspb.Message.getFieldWithDefault(msg, 7, "0"),
|
||||
buyerSecurityDepositPct: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 0.0),
|
||||
triggerPrice: jspb.Message.getFieldWithDefault(msg, 9, ""),
|
||||
paymentAccountId: jspb.Message.getFieldWithDefault(msg, 10, "")
|
||||
splitOutput: jspb.Message.getBooleanFieldWithDefault(msg, 10, false),
|
||||
paymentAccountId: jspb.Message.getFieldWithDefault(msg, 11, "")
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -14584,6 +14585,10 @@ proto.io.haveno.protobuffer.PostOfferRequest.deserializeBinaryFromReader = funct
|
||||
msg.setTriggerPrice(value);
|
||||
break;
|
||||
case 10:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setSplitOutput(value);
|
||||
break;
|
||||
case 11:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setPaymentAccountId(value);
|
||||
break;
|
||||
@ -14679,10 +14684,17 @@ proto.io.haveno.protobuffer.PostOfferRequest.serializeBinaryToWriter = function(
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getSplitOutput();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
10,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getPaymentAccountId();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
10,
|
||||
11,
|
||||
f
|
||||
);
|
||||
}
|
||||
@ -14852,11 +14864,29 @@ proto.io.haveno.protobuffer.PostOfferRequest.prototype.setTriggerPrice = functio
|
||||
|
||||
|
||||
/**
|
||||
* optional string payment_account_id = 10;
|
||||
* optional bool split_output = 10;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.PostOfferRequest.prototype.getSplitOutput = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.io.haveno.protobuffer.PostOfferRequest} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.PostOfferRequest.prototype.setSplitOutput = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 10, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string payment_account_id = 11;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.PostOfferRequest.prototype.getPaymentAccountId = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, ""));
|
||||
};
|
||||
|
||||
|
||||
@ -14865,7 +14895,7 @@ proto.io.haveno.protobuffer.PostOfferRequest.prototype.getPaymentAccountId = fun
|
||||
* @return {!proto.io.haveno.protobuffer.PostOfferRequest} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.PostOfferRequest.prototype.setPaymentAccountId = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 10, value);
|
||||
return jspb.Message.setProto3StringField(this, 11, value);
|
||||
};
|
||||
|
||||
|
||||
|
24
dist/protobuf/pb_pb.d.ts
vendored
24
dist/protobuf/pb_pb.d.ts
vendored
@ -5688,12 +5688,10 @@ export namespace XmrAddressEntry {
|
||||
export enum Context {
|
||||
PB_ERROR = 0,
|
||||
ARBITRATOR = 1,
|
||||
AVAILABLE = 2,
|
||||
OFFER_FUNDING = 3,
|
||||
RESERVED_FOR_TRADE = 4,
|
||||
MULTI_SIG = 5,
|
||||
TRADE_PAYOUT = 6,
|
||||
BASE_ADDRESS = 7,
|
||||
BASE_ADDRESS = 2,
|
||||
AVAILABLE = 3,
|
||||
OFFER_FUNDING = 4,
|
||||
TRADE_PAYOUT = 5,
|
||||
}
|
||||
}
|
||||
|
||||
@ -5877,8 +5875,8 @@ export class OpenOffer extends jspb.Message {
|
||||
getTriggerPrice(): number;
|
||||
setTriggerPrice(value: number): OpenOffer;
|
||||
|
||||
getAutoSplit(): boolean;
|
||||
setAutoSplit(value: boolean): OpenOffer;
|
||||
getSplitOutput(): boolean;
|
||||
setSplitOutput(value: boolean): OpenOffer;
|
||||
|
||||
getScheduledTxHashesList(): Array<string>;
|
||||
setScheduledTxHashesList(value: Array<string>): OpenOffer;
|
||||
@ -5888,6 +5886,9 @@ export class OpenOffer extends jspb.Message {
|
||||
getScheduledAmount(): string;
|
||||
setScheduledAmount(value: string): OpenOffer;
|
||||
|
||||
getSplitOutputTxHash(): string;
|
||||
setSplitOutputTxHash(value: string): OpenOffer;
|
||||
|
||||
getReserveTxHash(): string;
|
||||
setReserveTxHash(value: string): OpenOffer;
|
||||
|
||||
@ -5910,9 +5911,10 @@ export namespace OpenOffer {
|
||||
offer?: Offer.AsObject,
|
||||
state: OpenOffer.State,
|
||||
triggerPrice: number,
|
||||
autoSplit: boolean,
|
||||
splitOutput: boolean,
|
||||
scheduledTxHashesList: Array<string>,
|
||||
scheduledAmount: string,
|
||||
splitOutputTxHash: string,
|
||||
reserveTxHash: string,
|
||||
reserveTxHex: string,
|
||||
reserveTxKey: string,
|
||||
@ -6935,6 +6937,9 @@ export class PreferencesPayload extends jspb.Message {
|
||||
getSellScreenCryptoCurrencyCode(): string;
|
||||
setSellScreenCryptoCurrencyCode(value: string): PreferencesPayload;
|
||||
|
||||
getSplitOfferOutput(): boolean;
|
||||
setSplitOfferOutput(value: boolean): PreferencesPayload;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): PreferencesPayload.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: PreferencesPayload): PreferencesPayload.AsObject;
|
||||
@ -7006,6 +7011,7 @@ export namespace PreferencesPayload {
|
||||
clearDataAfterDays: number,
|
||||
buyScreenCryptoCurrencyCode: string,
|
||||
sellScreenCryptoCurrencyCode: string,
|
||||
splitOfferOutput: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
|
118
dist/protobuf/pb_pb.js
vendored
118
dist/protobuf/pb_pb.js
vendored
@ -46880,12 +46880,10 @@ proto.io.haveno.protobuffer.XmrAddressEntry.serializeBinaryToWriter = function(m
|
||||
proto.io.haveno.protobuffer.XmrAddressEntry.Context = {
|
||||
PB_ERROR: 0,
|
||||
ARBITRATOR: 1,
|
||||
AVAILABLE: 2,
|
||||
OFFER_FUNDING: 3,
|
||||
RESERVED_FOR_TRADE: 4,
|
||||
MULTI_SIG: 5,
|
||||
TRADE_PAYOUT: 6,
|
||||
BASE_ADDRESS: 7
|
||||
BASE_ADDRESS: 2,
|
||||
AVAILABLE: 3,
|
||||
OFFER_FUNDING: 4,
|
||||
TRADE_PAYOUT: 5
|
||||
};
|
||||
|
||||
/**
|
||||
@ -48270,12 +48268,13 @@ proto.io.haveno.protobuffer.OpenOffer.toObject = function(includeInstance, msg)
|
||||
offer: (f = msg.getOffer()) && proto.io.haveno.protobuffer.Offer.toObject(includeInstance, f),
|
||||
state: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
||||
triggerPrice: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
||||
autoSplit: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
|
||||
splitOutput: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
|
||||
scheduledTxHashesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f,
|
||||
scheduledAmount: jspb.Message.getFieldWithDefault(msg, 6, ""),
|
||||
reserveTxHash: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
||||
reserveTxHex: jspb.Message.getFieldWithDefault(msg, 8, ""),
|
||||
reserveTxKey: jspb.Message.getFieldWithDefault(msg, 9, "")
|
||||
splitOutputTxHash: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
||||
reserveTxHash: jspb.Message.getFieldWithDefault(msg, 8, ""),
|
||||
reserveTxHex: jspb.Message.getFieldWithDefault(msg, 9, ""),
|
||||
reserveTxKey: jspb.Message.getFieldWithDefault(msg, 10, "")
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -48327,7 +48326,7 @@ proto.io.haveno.protobuffer.OpenOffer.deserializeBinaryFromReader = function(msg
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setAutoSplit(value);
|
||||
msg.setSplitOutput(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
@ -48339,13 +48338,17 @@ proto.io.haveno.protobuffer.OpenOffer.deserializeBinaryFromReader = function(msg
|
||||
break;
|
||||
case 7:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setReserveTxHash(value);
|
||||
msg.setSplitOutputTxHash(value);
|
||||
break;
|
||||
case 8:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setReserveTxHex(value);
|
||||
msg.setReserveTxHash(value);
|
||||
break;
|
||||
case 9:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setReserveTxHex(value);
|
||||
break;
|
||||
case 10:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setReserveTxKey(value);
|
||||
break;
|
||||
@ -48400,7 +48403,7 @@ proto.io.haveno.protobuffer.OpenOffer.serializeBinaryToWriter = function(message
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getAutoSplit();
|
||||
f = message.getSplitOutput();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
4,
|
||||
@ -48421,27 +48424,34 @@ proto.io.haveno.protobuffer.OpenOffer.serializeBinaryToWriter = function(message
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getReserveTxHash();
|
||||
f = message.getSplitOutputTxHash();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
7,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getReserveTxHex();
|
||||
f = message.getReserveTxHash();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
8,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getReserveTxKey();
|
||||
f = message.getReserveTxHex();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
9,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getReserveTxKey();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
10,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -48532,10 +48542,10 @@ proto.io.haveno.protobuffer.OpenOffer.prototype.setTriggerPrice = function(value
|
||||
|
||||
|
||||
/**
|
||||
* optional bool auto_split = 4;
|
||||
* optional bool split_output = 4;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getAutoSplit = function() {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getSplitOutput = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
||||
};
|
||||
|
||||
@ -48544,7 +48554,7 @@ proto.io.haveno.protobuffer.OpenOffer.prototype.getAutoSplit = function() {
|
||||
* @param {boolean} value
|
||||
* @return {!proto.io.haveno.protobuffer.OpenOffer} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setAutoSplit = function(value) {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setSplitOutput = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 4, value);
|
||||
};
|
||||
|
||||
@ -48605,10 +48615,10 @@ proto.io.haveno.protobuffer.OpenOffer.prototype.setScheduledAmount = function(va
|
||||
|
||||
|
||||
/**
|
||||
* optional string reserve_tx_hash = 7;
|
||||
* optional string split_output_tx_hash = 7;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxHash = function() {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getSplitOutputTxHash = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
|
||||
};
|
||||
|
||||
@ -48617,16 +48627,16 @@ proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxHash = function() {
|
||||
* @param {string} value
|
||||
* @return {!proto.io.haveno.protobuffer.OpenOffer} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setReserveTxHash = function(value) {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setSplitOutputTxHash = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 7, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string reserve_tx_hex = 8;
|
||||
* optional string reserve_tx_hash = 8;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxHex = function() {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxHash = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
|
||||
};
|
||||
|
||||
@ -48635,16 +48645,16 @@ proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxHex = function() {
|
||||
* @param {string} value
|
||||
* @return {!proto.io.haveno.protobuffer.OpenOffer} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setReserveTxHex = function(value) {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setReserveTxHash = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 8, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string reserve_tx_key = 9;
|
||||
* optional string reserve_tx_hex = 9;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxKey = function() {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxHex = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
|
||||
};
|
||||
|
||||
@ -48653,11 +48663,29 @@ proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxKey = function() {
|
||||
* @param {string} value
|
||||
* @return {!proto.io.haveno.protobuffer.OpenOffer} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setReserveTxKey = function(value) {
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setReserveTxHex = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 9, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string reserve_tx_key = 10;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.getReserveTxKey = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @return {!proto.io.haveno.protobuffer.OpenOffer} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.OpenOffer.prototype.setReserveTxKey = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 10, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Oneof group definitions for this message. Each group defines the field
|
||||
@ -54543,7 +54571,8 @@ proto.io.haveno.protobuffer.PreferencesPayload.toObject = function(includeInstan
|
||||
moneroNodeSettings: (f = msg.getMoneroNodeSettings()) && proto.io.haveno.protobuffer.MoneroNodeSettings.toObject(includeInstance, f),
|
||||
clearDataAfterDays: jspb.Message.getFieldWithDefault(msg, 59, 0),
|
||||
buyScreenCryptoCurrencyCode: jspb.Message.getFieldWithDefault(msg, 60, ""),
|
||||
sellScreenCryptoCurrencyCode: jspb.Message.getFieldWithDefault(msg, 61, "")
|
||||
sellScreenCryptoCurrencyCode: jspb.Message.getFieldWithDefault(msg, 61, ""),
|
||||
splitOfferOutput: jspb.Message.getBooleanFieldWithDefault(msg, 62, false)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -54837,6 +54866,10 @@ proto.io.haveno.protobuffer.PreferencesPayload.deserializeBinaryFromReader = fun
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setSellScreenCryptoCurrencyCode(value);
|
||||
break;
|
||||
case 62:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setSplitOfferOutput(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@ -55296,6 +55329,13 @@ proto.io.haveno.protobuffer.PreferencesPayload.serializeBinaryToWriter = functio
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getSplitOfferOutput();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
62,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -56617,6 +56657,24 @@ proto.io.haveno.protobuffer.PreferencesPayload.prototype.setSellScreenCryptoCurr
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool split_offer_output = 62;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.PreferencesPayload.prototype.getSplitOfferOutput = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 62, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.io.haveno.protobuffer.PreferencesPayload} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.PreferencesPayload.prototype.setSplitOfferOutput = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 62, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
|
2
dist/utils/HavenoUtils.js
vendored
2
dist/utils/HavenoUtils.js
vendored
@ -127,7 +127,7 @@ class HavenoUtils {
|
||||
* @returns {number} the result
|
||||
*/
|
||||
static divideBI(a, b) {
|
||||
return Number(a * 100n / b) / 100;
|
||||
return Number(a * 10000000000000n / b) / 10000000000000;
|
||||
}
|
||||
/**
|
||||
* Convert XMR to atomic units.
|
||||
|
2
dist/utils/HavenoUtils.js.map
vendored
2
dist/utils/HavenoUtils.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"HavenoUtils.js","sourceRoot":"","sources":["../../src/utils/HavenoUtils.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,sDAA8B;AAG9B;;GAEG;AACH,MAAqB,WAAW;IAO9B;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACpC,IAAA,gBAAM,EAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,mCAAmC,CAAC,CAAC;QAC9F,WAAW,CAAC,QAAQ,GAAG,KAA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="tsd-index-list"><a href="protobuf_pb_pb.OpenOffer-1.html#addScheduledTxHashes" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-2048-path"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)" id="icon-2048-text"></path></svg><span>add<wbr/>Scheduled<wbr/>Tx<wbr/>Hashes</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#clearOffer" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>clear<wbr/>Offer</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#clearScheduledTxHashesList" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>clear<wbr/>Scheduled<wbr/>Tx<wbr/>Hashes<wbr/>List</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#getAutoSplit" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Auto<wbr/>Split</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#getSplitOutput" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Auto<wbr/>Split</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#getOffer" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Offer</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#getReserveTxHash" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Reserve<wbr/>Tx<wbr/>Hash</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#getReserveTxHex" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Reserve<wbr/>Tx<wbr/>Hex</span></a>
|
||||
@ -50,7 +50,7 @@
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#getTriggerPrice" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Trigger<wbr/>Price</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#hasOffer" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>has<wbr/>Offer</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#serializeBinary" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>serialize<wbr/>Binary</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#setAutoSplit" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Auto<wbr/>Split</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#setSplitOutput" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Auto<wbr/>Split</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#setOffer" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Offer</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#setReserveTxHash" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Reserve<wbr/>Tx<wbr/>Hash</span></a>
|
||||
<a href="protobuf_pb_pb.OpenOffer-1.html#setReserveTxHex" class="tsd-index-link tsd-kind-method tsd-parent-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Reserve<wbr/>Tx<wbr/>Hex</span></a>
|
||||
@ -107,10 +107,10 @@
|
||||
<h4 class="tsd-returns-title">Returns <a href="protobuf_pb_pb.OpenOffer-1.html" class="tsd-signature-type" data-tsd-kind="Class">OpenOffer</a></h4><aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in src/protobuf/pb_pb.d.ts:5859</li></ul></aside></li></ul></section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="getAutoSplit" class="tsd-anchor"></a>
|
||||
<h3 class="tsd-anchor-link"><span>get<wbr/>Auto<wbr/>Split</span><a href="#getAutoSplit" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="getSplitOutput" class="tsd-anchor"></a>
|
||||
<h3 class="tsd-anchor-link"><span>get<wbr/>Auto<wbr/>Split</span><a href="#getSplitOutput" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
||||
<li class="tsd-signature tsd-anchor-link" id="getAutoSplit.getAutoSplit-1">get<wbr/>Auto<wbr/>Split<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#getAutoSplit.getAutoSplit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
||||
<li class="tsd-signature tsd-anchor-link" id="getSplitOutput.getSplitOutput-1">get<wbr/>Auto<wbr/>Split<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#getSplitOutput.getSplitOutput-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
||||
<li class="tsd-description">
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
|
||||
<ul>
|
||||
@ -195,10 +195,10 @@
|
||||
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Uint8Array</span></h4><aside class="tsd-sources">
|
||||
<ul>
|
||||
<li>Defined in src/protobuf/pb_pb.d.ts:5874</li></ul></aside></li></ul></section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="setAutoSplit" class="tsd-anchor"></a>
|
||||
<h3 class="tsd-anchor-link"><span>set<wbr/>Auto<wbr/>Split</span><a href="#setAutoSplit" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
||||
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="setSplitOutput" class="tsd-anchor"></a>
|
||||
<h3 class="tsd-anchor-link"><span>set<wbr/>Auto<wbr/>Split</span><a href="#setSplitOutput" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
||||
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
||||
<li class="tsd-signature tsd-anchor-link" id="setAutoSplit.setAutoSplit-1">set<wbr/>Auto<wbr/>Split<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="protobuf_pb_pb.OpenOffer-1.html" class="tsd-signature-type" data-tsd-kind="Class">OpenOffer</a><a href="#setAutoSplit.setAutoSplit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
||||
<li class="tsd-signature tsd-anchor-link" id="setSplitOutput.setSplitOutput-1">set<wbr/>Auto<wbr/>Split<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="protobuf_pb_pb.OpenOffer-1.html" class="tsd-signature-type" data-tsd-kind="Class">OpenOffer</a><a href="#setSplitOutput.setSplitOutput-1" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
||||
<li class="tsd-description">
|
||||
<div class="tsd-parameters">
|
||||
<h4 class="tsd-parameters-title">Parameters</h4>
|
||||
@ -783,7 +783,7 @@
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#addScheduledTxHashes" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>add<wbr/>Scheduled<wbr/>Tx<wbr/>Hashes</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#clearOffer" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>clear<wbr/>Offer</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#clearScheduledTxHashesList" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>clear<wbr/>Scheduled<wbr/>Tx<wbr/>Hashes<wbr/>List</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#getAutoSplit" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>get<wbr/>Auto<wbr/>Split</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#getSplitOutput" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>get<wbr/>Auto<wbr/>Split</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#getOffer" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>get<wbr/>Offer</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#getReserveTxHash" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>get<wbr/>Reserve<wbr/>Tx<wbr/>Hash</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#getReserveTxHex" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>get<wbr/>Reserve<wbr/>Tx<wbr/>Hex</a></li>
|
||||
@ -794,7 +794,7 @@
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#getTriggerPrice" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>get<wbr/>Trigger<wbr/>Price</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#hasOffer" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>has<wbr/>Offer</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#serializeBinary" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>serialize<wbr/>Binary</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#setAutoSplit" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>set<wbr/>Auto<wbr/>Split</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#setSplitOutput" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>set<wbr/>Auto<wbr/>Split</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#setOffer" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>set<wbr/>Offer</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#setReserveTxHash" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>set<wbr/>Reserve<wbr/>Tx<wbr/>Hash</a></li>
|
||||
<li class="tsd-kind-method tsd-parent-kind-class"><a href="protobuf_pb_pb.OpenOffer-1.html#setReserveTxHex" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>set<wbr/>Reserve<wbr/>Tx<wbr/>Hex</a></li>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<li><a href="../modules/protobuf_pb_pb.OpenOffer.html">OpenOffer</a></li>
|
||||
<li><a href="protobuf_pb_pb.OpenOffer.AsObject.html">AsObject</a></li></ul>
|
||||
<h1>Type alias AsObject</h1></div>
|
||||
<div class="tsd-signature">As<wbr/>Object<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>autoSplit<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span> </span>offer<span class="tsd-signature-symbol">?: </span><a href="../modules/protobuf_pb_pb.Offer.html" class="tsd-signature-type" data-tsd-kind="Namespace">Offer</a><span class="tsd-signature-symbol">.</span><a href="protobuf_pb_pb.Offer.AsObject.html" class="tsd-signature-type" data-tsd-kind="Type alias">AsObject</a><span class="tsd-signature-symbol">; </span><br/><span> </span>reserveTxHash<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>reserveTxHex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>reserveTxKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>scheduledAmount<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>scheduledTxHashesList<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span>state<span class="tsd-signature-symbol">: </span><a href="../modules/protobuf_pb_pb.OpenOffer.html" class="tsd-signature-type" data-tsd-kind="Namespace">OpenOffer</a><span class="tsd-signature-symbol">.</span><a href="../enums/protobuf_pb_pb.OpenOffer.State.html" class="tsd-signature-type" data-tsd-kind="Enumeration">State</a><span class="tsd-signature-symbol">; </span><br/><span> </span>triggerPrice<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div>
|
||||
<div class="tsd-signature">As<wbr/>Object<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>splitOutput<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span> </span>offer<span class="tsd-signature-symbol">?: </span><a href="../modules/protobuf_pb_pb.Offer.html" class="tsd-signature-type" data-tsd-kind="Namespace">Offer</a><span class="tsd-signature-symbol">.</span><a href="protobuf_pb_pb.Offer.AsObject.html" class="tsd-signature-type" data-tsd-kind="Type alias">AsObject</a><span class="tsd-signature-symbol">; </span><br/><span> </span>reserveTxHash<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>reserveTxHex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>reserveTxKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>scheduledAmount<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>scheduledTxHashesList<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span>state<span class="tsd-signature-symbol">: </span><a href="../modules/protobuf_pb_pb.OpenOffer.html" class="tsd-signature-type" data-tsd-kind="Namespace">OpenOffer</a><span class="tsd-signature-symbol">.</span><a href="../enums/protobuf_pb_pb.OpenOffer.State.html" class="tsd-signature-type" data-tsd-kind="Enumeration">State</a><span class="tsd-signature-symbol">; </span><br/><span> </span>triggerPrice<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div>
|
||||
<div class="tsd-type-declaration">
|
||||
<h4>Type declaration</h4>
|
||||
<ul class="tsd-parameters">
|
||||
|
@ -227,6 +227,7 @@ interface TradeContext {
|
||||
price?: number,
|
||||
priceMargin?: number,
|
||||
triggerPrice?: number,
|
||||
splitOutput?: boolean,
|
||||
|
||||
// take offer
|
||||
taker?: HavenoClient,
|
||||
@ -1235,7 +1236,6 @@ test("Can post and remove an offer (CI, sanity check)", async () => {
|
||||
expect(BigInt((await user1.getBalances()).getAvailableBalance())).toEqual(availableBalanceBefore);
|
||||
});
|
||||
|
||||
// TODO: support splitting outputs
|
||||
// TODO: provide number of confirmations in offer status
|
||||
test("Can schedule offers with locked funds (CI)", async () => {
|
||||
let user3: HavenoClient|undefined;
|
||||
@ -1299,7 +1299,7 @@ test("Can schedule offers with locked funds (CI)", async () => {
|
||||
await wait(TestConfig.trade.maxTimePeerNoticeMs);
|
||||
if (getOffer(await user1.getOffers(assetCode, direction), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in peer's offers before posted");
|
||||
|
||||
// wait for deposit txs to unlock
|
||||
// wait for funding txs to unlock
|
||||
await waitForAvailableBalance(outputAmt, user3);
|
||||
|
||||
// one output is reserved, one is unlocked
|
||||
@ -1338,6 +1338,17 @@ test("Can schedule offers with locked funds (CI)", async () => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
test("Can split offer outputs (CI)", async () => {
|
||||
let randomOfferAmount = 1.0 + (Math.random() * 1.0); // random amount between 1 and 2 xmr
|
||||
await executeTrade({
|
||||
price: 150,
|
||||
offerAmount: HavenoUtils.xmrToAtomicUnits(randomOfferAmount),
|
||||
offerMinAmount: HavenoUtils.xmrToAtomicUnits(.15),
|
||||
tradeAmount: HavenoUtils.xmrToAtomicUnits(.92),
|
||||
splitOutput: true
|
||||
});
|
||||
});
|
||||
|
||||
test("Cannot post offer exceeding trade limit (CI, sanity check)", async () => {
|
||||
const revolutAccount = await createRevolutPaymentAccount(user1);
|
||||
try {
|
||||
@ -1988,7 +1999,7 @@ async function executeTrade(ctx?: TradeContext): Promise<string> {
|
||||
// make offer if configured
|
||||
if (makingOffer) {
|
||||
ctx.offer = await makeOffer(ctx);
|
||||
expect(ctx.offer.getState()).toEqual("AVAILABLE");
|
||||
expect(ctx.offer.getState()).toEqual(ctx.splitOutput ? "SCHEDULED" : "AVAILABLE");
|
||||
ctx.offerId = ctx.offer.getId();
|
||||
await wait(ctx.maxTimePeerNoticeMs!);
|
||||
} else {
|
||||
@ -2003,6 +2014,12 @@ async function executeTrade(ctx?: TradeContext): Promise<string> {
|
||||
|
||||
// TODO (woodser): test error message taking offer before posted
|
||||
|
||||
// wait for split output tx to unlock
|
||||
if (ctx.splitOutput) {
|
||||
await mineToHeight(await monerod.getHeight() + 10); // TODO: wait for offer to be available (dandilion)
|
||||
await wait(TestConfig.daemonPollPeriodMs * 2);
|
||||
}
|
||||
|
||||
// take offer or get existing trade
|
||||
let trade: TradeInfo|undefined = undefined;
|
||||
if (ctx.isOfferTaken) trade = await ctx.taker!.getTrade(ctx.offerId!);
|
||||
@ -2301,6 +2318,7 @@ async function makeOffer(ctx?: TradeContext): Promise<OfferInfo> {
|
||||
ctx.price,
|
||||
ctx.priceMargin,
|
||||
ctx.triggerPrice,
|
||||
ctx.splitOutput,
|
||||
ctx.offerMinAmount);
|
||||
testOffer(offer, ctx);
|
||||
|
||||
@ -2315,7 +2333,7 @@ async function makeOffer(ctx?: TradeContext): Promise<OfferInfo> {
|
||||
// unlocked balance has decreased
|
||||
let unlockedBalanceAfter = BigInt((await ctx.maker!.getBalances()).getAvailableBalance());
|
||||
if (offer.getState() === "SCHEDULED") {
|
||||
if (unlockedBalanceAfter !== unlockedBalanceBefore) throw new Error("Unlocked balance should not change for scheduled offer " + offer.getId());
|
||||
if (!ctx.splitOutput && unlockedBalanceAfter !== unlockedBalanceBefore) throw new Error("Unlocked balance should not change for scheduled offer " + offer.getId());
|
||||
} else if (offer.getState() === "AVAILABLE") {
|
||||
if (unlockedBalanceAfter === unlockedBalanceBefore) {
|
||||
console.warn("Unlocked balance did not change after posting offer, waiting a sync period");
|
||||
@ -3308,8 +3326,16 @@ function testOffer(offer: OfferInfo, ctx?: TradeContext) {
|
||||
if (BigInt(offer.getBuyerSecurityDeposit()) == TestConfig.minSecurityDeposit) {
|
||||
expect(BigInt(offer.getSellerSecurityDeposit())).toEqual(BigInt(offer.getBuyerSecurityDeposit()));
|
||||
} else {
|
||||
expect(HavenoUtils.divideBI(BigInt(offer.getBuyerSecurityDeposit()), BigInt(offer.getAmount()))).toEqual(ctx.buyerSecurityDepositPct);
|
||||
expect(HavenoUtils.divideBI(BigInt(offer.getSellerSecurityDeposit()), BigInt(offer.getAmount()))).toEqual(ctx.buyerSecurityDepositPct); // TODO: using same security deposit config for buyer and seller
|
||||
let buyerSecurityDepositPct = HavenoUtils.divideBI(BigInt(offer.getBuyerSecurityDeposit()), BigInt(offer.getAmount()));
|
||||
let sellerSecurityDepositPct = HavenoUtils.divideBI(BigInt(offer.getSellerSecurityDeposit()), BigInt(offer.getAmount()));
|
||||
if (ctx.splitOutput) {
|
||||
const tolerance = 0.000001;
|
||||
assert(ctx.buyerSecurityDepositPct! - buyerSecurityDepositPct < tolerance);
|
||||
assert(ctx.buyerSecurityDepositPct! - sellerSecurityDepositPct < tolerance);
|
||||
} else {
|
||||
expect(buyerSecurityDepositPct).toEqual(ctx.buyerSecurityDepositPct);
|
||||
expect(sellerSecurityDepositPct).toEqual(ctx.buyerSecurityDepositPct); // TODO: using same security deposit config for buyer and seller
|
||||
}
|
||||
}
|
||||
expect(offer.getUseMarketBasedPrice()).toEqual(!ctx?.price);
|
||||
expect(offer.getMarketPriceMarginPct()).toEqual(ctx?.priceMargin ? ctx?.priceMargin : 0);
|
||||
|
@ -999,7 +999,8 @@ export default class HavenoClient {
|
||||
* @param {number} marketPriceMarginPct - if using market price, % from market price to accept (optional, default 0%)
|
||||
* @param {bigint} minAmount - minimum amount to trade (optional, default to fixed amount)
|
||||
* @param {number} triggerPrice - price to remove offer (optional)
|
||||
* @return {OfferInfo} the posted offer
|
||||
* @param {number} splitOutput - create a new output reserved for the offer, incurring an on-chain transaction and 10 confirmations before the offer goes live (default = false)
|
||||
* @return {OfferInfo} the posted offer
|
||||
*/
|
||||
async postOffer(direction: string,
|
||||
amount: bigint,
|
||||
@ -1009,6 +1010,7 @@ export default class HavenoClient {
|
||||
price?: number,
|
||||
marketPriceMarginPct?: number,
|
||||
triggerPrice?: number,
|
||||
splitOutput?: boolean,
|
||||
minAmount?: bigint): Promise<OfferInfo> {
|
||||
try {
|
||||
const request = new PostOfferRequest()
|
||||
@ -1022,6 +1024,7 @@ export default class HavenoClient {
|
||||
if (price) request.setPrice(price.toString());
|
||||
if (marketPriceMarginPct) request.setMarketPriceMarginPct(marketPriceMarginPct);
|
||||
if (triggerPrice) request.setTriggerPrice(triggerPrice.toString());
|
||||
if (splitOutput) request.setSplitOutput(splitOutput);
|
||||
return (await this._offersClient.postOffer(request, {password: this._password})).getOffer()!;
|
||||
} catch (e: any) {
|
||||
throw new HavenoError(e.message, e.code);
|
||||
|
@ -138,7 +138,7 @@ export default class HavenoUtils {
|
||||
* @returns {number} the result
|
||||
*/
|
||||
static divideBI(a: bigint, b: bigint): number {
|
||||
return Number(a * 100n / b) / 100
|
||||
return Number(a * 10000000000000n / b) / 10000000000000;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user