mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-12-16 00:33:56 -05:00
update dist
This commit is contained in:
parent
42656e2d63
commit
38ee63cdf4
13 changed files with 1425 additions and 1386 deletions
10
dist/HavenoClient.d.ts
vendored
10
dist/HavenoClient.d.ts
vendored
|
|
@ -219,11 +219,11 @@ export default class HavenoClient {
|
|||
*/
|
||||
stopCheckingConnection(): Promise<void>;
|
||||
/**
|
||||
* Get the best available connection in order of priority then response time.
|
||||
* Get the best connection in order of priority then response time.
|
||||
*
|
||||
* @return {UrlConnection | undefined} the best available connection in order of priority then response time, undefined if no connections available
|
||||
* @return {UrlConnection | undefined} the best connection in order of priority then response time, undefined if no connections
|
||||
*/
|
||||
getBestAvailableConnection(): Promise<UrlConnection | undefined>;
|
||||
getBestConnection(): Promise<UrlConnection | undefined>;
|
||||
/**
|
||||
* Automatically switch to the best available connection if current connection is disconnected after being checked.
|
||||
*
|
||||
|
|
@ -328,9 +328,9 @@ export default class HavenoClient {
|
|||
* Get the current market price per 1 XMR in the given currency.
|
||||
*
|
||||
* @param {string} assetCode - asset code to get the price of
|
||||
* @return {number} the price of the asset per 1 XMR
|
||||
* @return {number|undefined} the price of the asset per 1 XMR
|
||||
*/
|
||||
getPrice(assetCode: string): Promise<number>;
|
||||
getPrice(assetCode: string): Promise<number | undefined>;
|
||||
/**
|
||||
* Get the current market prices of all a.
|
||||
*
|
||||
|
|
|
|||
23
dist/HavenoClient.js
vendored
23
dist/HavenoClient.js
vendored
|
|
@ -537,13 +537,13 @@ class HavenoClient {
|
|||
}
|
||||
}
|
||||
/**
|
||||
* Get the best available connection in order of priority then response time.
|
||||
* Get the best connection in order of priority then response time.
|
||||
*
|
||||
* @return {UrlConnection | undefined} the best available connection in order of priority then response time, undefined if no connections available
|
||||
* @return {UrlConnection | undefined} the best connection in order of priority then response time, undefined if no connections
|
||||
*/
|
||||
async getBestAvailableConnection() {
|
||||
async getBestConnection() {
|
||||
try {
|
||||
return (await this._xmrConnectionsClient.getBestAvailableConnection(new grpc_pb_1.GetBestAvailableConnectionRequest(), { password: this._password })).getConnection();
|
||||
return (await this._xmrConnectionsClient.getBestConnection(new grpc_pb_1.GetBestConnectionRequest(), { password: this._password })).getConnection();
|
||||
}
|
||||
catch (e) {
|
||||
throw new HavenoError_1.default(e.message, e.code);
|
||||
|
|
@ -775,13 +775,15 @@ class HavenoClient {
|
|||
* Get the current market price per 1 XMR in the given currency.
|
||||
*
|
||||
* @param {string} assetCode - asset code to get the price of
|
||||
* @return {number} the price of the asset per 1 XMR
|
||||
* @return {number|undefined} the price of the asset per 1 XMR
|
||||
*/
|
||||
async getPrice(assetCode) {
|
||||
try {
|
||||
return (await this._priceClient.getMarketPrice(new grpc_pb_1.MarketPriceRequest().setCurrencyCode(assetCode), { password: this._password })).getPrice();
|
||||
}
|
||||
catch (e) {
|
||||
if (e.message.indexOf("not found") >= 0)
|
||||
return undefined; // TODO: return unknown price server side (0?)
|
||||
throw new HavenoError_1.default(e.message, e.code);
|
||||
}
|
||||
}
|
||||
|
|
@ -1305,7 +1307,16 @@ class HavenoClient {
|
|||
await HavenoUtils_1.default.kill(this._process);
|
||||
}
|
||||
catch (e) {
|
||||
throw new HavenoError_1.default(e.message, e.code);
|
||||
console_1.default.error("Error gracefully shutting down havenod: " + e.message);
|
||||
if (this._process) {
|
||||
try {
|
||||
await HavenoUtils_1.default.kill(this._process);
|
||||
}
|
||||
catch (e) {
|
||||
console_1.default.error("Error terminating havenod process: " + e.message + ". Stopping forcefully");
|
||||
await HavenoUtils_1.default.kill(this._process, "SIGKILL");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ------------------------------- HELPERS ----------------------------------
|
||||
|
|
|
|||
2
dist/HavenoClient.js.map
vendored
2
dist/HavenoClient.js.map
vendored
File diff suppressed because one or more lines are too long
6
dist/protobuf/GrpcServiceClientPb.d.ts
vendored
6
dist/protobuf/GrpcServiceClientPb.d.ts
vendored
|
|
@ -197,9 +197,9 @@ export declare class XmrConnectionsClient {
|
|||
methodDescriptorStopCheckingConnection: grpcWeb.MethodDescriptor<grpc_pb.StopCheckingConnectionRequest, grpc_pb.StopCheckingConnectionReply>;
|
||||
stopCheckingConnection(request: grpc_pb.StopCheckingConnectionRequest, metadata?: grpcWeb.Metadata | null): Promise<grpc_pb.StopCheckingConnectionReply>;
|
||||
stopCheckingConnection(request: grpc_pb.StopCheckingConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.StopCheckingConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.StopCheckingConnectionReply>;
|
||||
methodDescriptorGetBestAvailableConnection: grpcWeb.MethodDescriptor<grpc_pb.GetBestAvailableConnectionRequest, grpc_pb.GetBestAvailableConnectionReply>;
|
||||
getBestAvailableConnection(request: grpc_pb.GetBestAvailableConnectionRequest, metadata?: grpcWeb.Metadata | null): Promise<grpc_pb.GetBestAvailableConnectionReply>;
|
||||
getBestAvailableConnection(request: grpc_pb.GetBestAvailableConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetBestAvailableConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetBestAvailableConnectionReply>;
|
||||
methodDescriptorGetBestConnection: grpcWeb.MethodDescriptor<grpc_pb.GetBestConnectionRequest, grpc_pb.GetBestConnectionReply>;
|
||||
getBestConnection(request: grpc_pb.GetBestConnectionRequest, metadata?: grpcWeb.Metadata | null): Promise<grpc_pb.GetBestConnectionReply>;
|
||||
getBestConnection(request: grpc_pb.GetBestConnectionRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetBestConnectionReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetBestConnectionReply>;
|
||||
methodDescriptorSetAutoSwitch: grpcWeb.MethodDescriptor<grpc_pb.SetAutoSwitchRequest, grpc_pb.SetAutoSwitchReply>;
|
||||
setAutoSwitch(request: grpc_pb.SetAutoSwitchRequest, metadata?: grpcWeb.Metadata | null): Promise<grpc_pb.SetAutoSwitchReply>;
|
||||
setAutoSwitch(request: grpc_pb.SetAutoSwitchRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.SetAutoSwitchReply) => void): grpcWeb.ClientReadableStream<grpc_pb.SetAutoSwitchReply>;
|
||||
|
|
|
|||
12
dist/protobuf/GrpcServiceClientPb.js
vendored
12
dist/protobuf/GrpcServiceClientPb.js
vendored
|
|
@ -32,7 +32,7 @@ exports.WalletsClient = exports.TradesClient = exports.ShutdownServerClient = ex
|
|||
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-grpc-web v1.5.0
|
||||
// protoc v3.20.3
|
||||
// protoc v5.29.3
|
||||
// source: grpc.proto
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
|
@ -374,9 +374,9 @@ class XmrConnectionsClient {
|
|||
this.methodDescriptorStopCheckingConnection = new grpcWeb.MethodDescriptor('/io.haveno.protobuffer.XmrConnections/StopCheckingConnection', grpcWeb.MethodType.UNARY, grpc_pb.StopCheckingConnectionRequest, grpc_pb.StopCheckingConnectionReply, (request) => {
|
||||
return request.serializeBinary();
|
||||
}, grpc_pb.StopCheckingConnectionReply.deserializeBinary);
|
||||
this.methodDescriptorGetBestAvailableConnection = new grpcWeb.MethodDescriptor('/io.haveno.protobuffer.XmrConnections/GetBestAvailableConnection', grpcWeb.MethodType.UNARY, grpc_pb.GetBestAvailableConnectionRequest, grpc_pb.GetBestAvailableConnectionReply, (request) => {
|
||||
this.methodDescriptorGetBestConnection = new grpcWeb.MethodDescriptor('/io.haveno.protobuffer.XmrConnections/GetBestConnection', grpcWeb.MethodType.UNARY, grpc_pb.GetBestConnectionRequest, grpc_pb.GetBestConnectionReply, (request) => {
|
||||
return request.serializeBinary();
|
||||
}, grpc_pb.GetBestAvailableConnectionReply.deserializeBinary);
|
||||
}, grpc_pb.GetBestConnectionReply.deserializeBinary);
|
||||
this.methodDescriptorSetAutoSwitch = new grpcWeb.MethodDescriptor('/io.haveno.protobuffer.XmrConnections/SetAutoSwitch', grpcWeb.MethodType.UNARY, grpc_pb.SetAutoSwitchRequest, grpc_pb.SetAutoSwitchReply, (request) => {
|
||||
return request.serializeBinary();
|
||||
}, grpc_pb.SetAutoSwitchReply.deserializeBinary);
|
||||
|
|
@ -465,13 +465,13 @@ class XmrConnectionsClient {
|
|||
return this.client_.unaryCall(this.hostname_ +
|
||||
'/io.haveno.protobuffer.XmrConnections/StopCheckingConnection', request, metadata || {}, this.methodDescriptorStopCheckingConnection);
|
||||
}
|
||||
getBestAvailableConnection(request, metadata, callback) {
|
||||
getBestConnection(request, metadata, callback) {
|
||||
if (callback !== undefined) {
|
||||
return this.client_.rpcCall(this.hostname_ +
|
||||
'/io.haveno.protobuffer.XmrConnections/GetBestAvailableConnection', request, metadata || {}, this.methodDescriptorGetBestAvailableConnection, callback);
|
||||
'/io.haveno.protobuffer.XmrConnections/GetBestConnection', request, metadata || {}, this.methodDescriptorGetBestConnection, callback);
|
||||
}
|
||||
return this.client_.unaryCall(this.hostname_ +
|
||||
'/io.haveno.protobuffer.XmrConnections/GetBestAvailableConnection', request, metadata || {}, this.methodDescriptorGetBestAvailableConnection);
|
||||
'/io.haveno.protobuffer.XmrConnections/GetBestConnection', request, metadata || {}, this.methodDescriptorGetBestConnection);
|
||||
}
|
||||
setAutoSwitch(request, metadata, callback) {
|
||||
if (callback !== undefined) {
|
||||
|
|
|
|||
2
dist/protobuf/GrpcServiceClientPb.js.map
vendored
2
dist/protobuf/GrpcServiceClientPb.js.map
vendored
File diff suppressed because one or more lines are too long
32
dist/protobuf/grpc_pb.d.ts
vendored
32
dist/protobuf/grpc_pb.d.ts
vendored
|
|
@ -1117,35 +1117,35 @@ export namespace StopCheckingConnectionReply {
|
|||
}
|
||||
}
|
||||
|
||||
export class GetBestAvailableConnectionRequest extends jspb.Message {
|
||||
export class GetBestConnectionRequest extends jspb.Message {
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): GetBestAvailableConnectionRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetBestAvailableConnectionRequest): GetBestAvailableConnectionRequest.AsObject;
|
||||
static serializeBinaryToWriter(message: GetBestAvailableConnectionRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetBestAvailableConnectionRequest;
|
||||
static deserializeBinaryFromReader(message: GetBestAvailableConnectionRequest, reader: jspb.BinaryReader): GetBestAvailableConnectionRequest;
|
||||
toObject(includeInstance?: boolean): GetBestConnectionRequest.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetBestConnectionRequest): GetBestConnectionRequest.AsObject;
|
||||
static serializeBinaryToWriter(message: GetBestConnectionRequest, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetBestConnectionRequest;
|
||||
static deserializeBinaryFromReader(message: GetBestConnectionRequest, reader: jspb.BinaryReader): GetBestConnectionRequest;
|
||||
}
|
||||
|
||||
export namespace GetBestAvailableConnectionRequest {
|
||||
export namespace GetBestConnectionRequest {
|
||||
export type AsObject = {
|
||||
}
|
||||
}
|
||||
|
||||
export class GetBestAvailableConnectionReply extends jspb.Message {
|
||||
export class GetBestConnectionReply extends jspb.Message {
|
||||
getConnection(): UrlConnection | undefined;
|
||||
setConnection(value?: UrlConnection): GetBestAvailableConnectionReply;
|
||||
setConnection(value?: UrlConnection): GetBestConnectionReply;
|
||||
hasConnection(): boolean;
|
||||
clearConnection(): GetBestAvailableConnectionReply;
|
||||
clearConnection(): GetBestConnectionReply;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): GetBestAvailableConnectionReply.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetBestAvailableConnectionReply): GetBestAvailableConnectionReply.AsObject;
|
||||
static serializeBinaryToWriter(message: GetBestAvailableConnectionReply, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetBestAvailableConnectionReply;
|
||||
static deserializeBinaryFromReader(message: GetBestAvailableConnectionReply, reader: jspb.BinaryReader): GetBestAvailableConnectionReply;
|
||||
toObject(includeInstance?: boolean): GetBestConnectionReply.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: GetBestConnectionReply): GetBestConnectionReply.AsObject;
|
||||
static serializeBinaryToWriter(message: GetBestConnectionReply, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): GetBestConnectionReply;
|
||||
static deserializeBinaryFromReader(message: GetBestConnectionReply, reader: jspb.BinaryReader): GetBestConnectionReply;
|
||||
}
|
||||
|
||||
export namespace GetBestAvailableConnectionReply {
|
||||
export namespace GetBestConnectionReply {
|
||||
export type AsObject = {
|
||||
connection?: UrlConnection.AsObject,
|
||||
}
|
||||
|
|
|
|||
96
dist/protobuf/grpc_pb.js
vendored
96
dist/protobuf/grpc_pb.js
vendored
|
|
@ -13,7 +13,13 @@
|
|||
|
||||
var jspb = require('google-protobuf');
|
||||
var goog = jspb;
|
||||
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
|
||||
var global =
|
||||
(typeof globalThis !== 'undefined' && globalThis) ||
|
||||
(typeof window !== 'undefined' && window) ||
|
||||
(typeof global !== 'undefined' && global) ||
|
||||
(typeof self !== 'undefined' && self) ||
|
||||
(function () { return this; }).call(null) ||
|
||||
Function('return this')();
|
||||
|
||||
var pb_pb = require('./pb_pb.js');
|
||||
goog.object.extend(proto, pb_pb);
|
||||
|
|
@ -62,8 +68,8 @@ goog.exportSymbol('proto.io.haveno.protobuffer.GetAutoSwitchReply', null, global
|
|||
goog.exportSymbol('proto.io.haveno.protobuffer.GetAutoSwitchRequest', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetBalancesReply', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetBalancesRequest', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetBestAvailableConnectionReply', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetBestConnectionReply', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetBestConnectionRequest', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetChatMessagesReply', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetChatMessagesRequest', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.GetConnectionReply', null, global);
|
||||
|
|
@ -1486,16 +1492,16 @@ if (goog.DEBUG && !COMPILED) {
|
|||
* @extends {jspb.Message}
|
||||
* @constructor
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest = function(opt_data) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest, jspb.Message);
|
||||
goog.inherits(proto.io.haveno.protobuffer.GetBestConnectionRequest, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.displayName = 'proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest';
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.displayName = 'proto.io.haveno.protobuffer.GetBestConnectionRequest';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
|
|
@ -1507,16 +1513,16 @@ if (goog.DEBUG && !COMPILED) {
|
|||
* @extends {jspb.Message}
|
||||
* @constructor
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply = function(opt_data) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.io.haveno.protobuffer.GetBestAvailableConnectionReply, jspb.Message);
|
||||
goog.inherits(proto.io.haveno.protobuffer.GetBestConnectionReply, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
/**
|
||||
* @public
|
||||
* @override
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.displayName = 'proto.io.haveno.protobuffer.GetBestAvailableConnectionReply';
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.displayName = 'proto.io.haveno.protobuffer.GetBestConnectionReply';
|
||||
}
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
|
|
@ -11951,8 +11957,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
|
|||
* http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.toObject(opt_includeInstance, this);
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.io.haveno.protobuffer.GetBestConnectionRequest.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -11961,11 +11967,11 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.prototype.toObject
|
|||
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||
* the JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest} msg The msg instance to transform.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestConnectionRequest} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.toObject = function(includeInstance, msg) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
|
||||
};
|
||||
|
|
@ -11981,23 +11987,23 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.toObject = functio
|
|||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest}
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestConnectionRequest}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.deserializeBinary = function(bytes) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest;
|
||||
return proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.deserializeBinaryFromReader(msg, reader);
|
||||
var msg = new proto.io.haveno.protobuffer.GetBestConnectionRequest;
|
||||
return proto.io.haveno.protobuffer.GetBestConnectionRequest.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest} msg The message object to deserialize into.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestConnectionRequest} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest}
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestConnectionRequest}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.deserializeBinaryFromReader = function(msg, reader) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
|
|
@ -12017,9 +12023,9 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.deserializeBinaryF
|
|||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.prototype.serializeBinary = function() {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.serializeBinaryToWriter(this, writer);
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.serializeBinaryToWriter(this, writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
|
@ -12027,11 +12033,11 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.prototype.serializ
|
|||
/**
|
||||
* Serializes the given message to binary data (in protobuf wire
|
||||
* format), writing to the given BinaryWriter.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest} message
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestConnectionRequest} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionRequest.serializeBinaryToWriter = function(message, writer) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionRequest.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
};
|
||||
|
||||
|
|
@ -12052,8 +12058,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
|
|||
* http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.toObject(opt_includeInstance, this);
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.io.haveno.protobuffer.GetBestConnectionReply.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -12062,11 +12068,11 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.toObject =
|
|||
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||
* the JSPB instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply} msg The msg instance to transform.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestConnectionReply} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.toObject = function(includeInstance, msg) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
connection: (f = msg.getConnection()) && proto.io.haveno.protobuffer.UrlConnection.toObject(includeInstance, f)
|
||||
};
|
||||
|
|
@ -12082,23 +12088,23 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.toObject = function(
|
|||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply}
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestConnectionReply}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.deserializeBinary = function(bytes) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.io.haveno.protobuffer.GetBestAvailableConnectionReply;
|
||||
return proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.deserializeBinaryFromReader(msg, reader);
|
||||
var msg = new proto.io.haveno.protobuffer.GetBestConnectionReply;
|
||||
return proto.io.haveno.protobuffer.GetBestConnectionReply.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply} msg The message object to deserialize into.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestConnectionReply} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply}
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestConnectionReply}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.deserializeBinaryFromReader = function(msg, reader) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
|
|
@ -12123,9 +12129,9 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.deserializeBinaryFro
|
|||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.serializeBinary = function() {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.serializeBinaryToWriter(this, writer);
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.serializeBinaryToWriter(this, writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
|
@ -12133,11 +12139,11 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.serializeB
|
|||
/**
|
||||
* Serializes the given message to binary data (in protobuf wire
|
||||
* format), writing to the given BinaryWriter.
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply} message
|
||||
* @param {!proto.io.haveno.protobuffer.GetBestConnectionReply} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.serializeBinaryToWriter = function(message, writer) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.serializeBinaryToWriter = function(message, writer) {
|
||||
var f = undefined;
|
||||
f = message.getConnection();
|
||||
if (f != null) {
|
||||
|
|
@ -12154,7 +12160,7 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.serializeBinaryToWri
|
|||
* optional UrlConnection connection = 1;
|
||||
* @return {?proto.io.haveno.protobuffer.UrlConnection}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.getConnection = function() {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.prototype.getConnection = function() {
|
||||
return /** @type{?proto.io.haveno.protobuffer.UrlConnection} */ (
|
||||
jspb.Message.getWrapperField(this, proto.io.haveno.protobuffer.UrlConnection, 1));
|
||||
};
|
||||
|
|
@ -12162,18 +12168,18 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.getConnect
|
|||
|
||||
/**
|
||||
* @param {?proto.io.haveno.protobuffer.UrlConnection|undefined} value
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply} returns this
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestConnectionReply} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.setConnection = function(value) {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.prototype.setConnection = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestAvailableConnectionReply} returns this
|
||||
* @return {!proto.io.haveno.protobuffer.GetBestConnectionReply} returns this
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.clearConnection = function() {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.prototype.clearConnection = function() {
|
||||
return this.setConnection(undefined);
|
||||
};
|
||||
|
||||
|
|
@ -12182,7 +12188,7 @@ proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.clearConne
|
|||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.io.haveno.protobuffer.GetBestAvailableConnectionReply.prototype.hasConnection = function() {
|
||||
proto.io.haveno.protobuffer.GetBestConnectionReply.prototype.hasConnection = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
|
|
|||
2
dist/protobuf/grpc_pb.js.map
vendored
2
dist/protobuf/grpc_pb.js.map
vendored
File diff suppressed because one or more lines are too long
56
dist/protobuf/pb_pb.js
vendored
56
dist/protobuf/pb_pb.js
vendored
|
|
@ -13,7 +13,13 @@
|
|||
|
||||
var jspb = require('google-protobuf');
|
||||
var goog = jspb;
|
||||
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
|
||||
var global =
|
||||
(typeof globalThis !== 'undefined' && globalThis) ||
|
||||
(typeof window !== 'undefined' && window) ||
|
||||
(typeof global !== 'undefined' && global) ||
|
||||
(typeof self !== 'undefined' && self) ||
|
||||
(function () { return this; }).call(null) ||
|
||||
Function('return this')();
|
||||
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.AccountAgeWitness', null, global);
|
||||
goog.exportSymbol('proto.io.haveno.protobuffer.AccountAgeWitnessStore', null, global);
|
||||
|
|
@ -8775,7 +8781,8 @@ proto.io.haveno.protobuffer.GetInventoryResponse.prototype.getInventoryMap = fun
|
|||
*/
|
||||
proto.io.haveno.protobuffer.GetInventoryResponse.prototype.clearInventoryMap = function() {
|
||||
this.getInventoryMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -20771,7 +20778,8 @@ proto.io.haveno.protobuffer.RemovedPayloadsMap.prototype.getDateByHashesMap = fu
|
|||
*/
|
||||
proto.io.haveno.protobuffer.RemovedPayloadsMap.prototype.clearDateByHashesMap = function() {
|
||||
this.getDateByHashesMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -20904,7 +20912,8 @@ proto.io.haveno.protobuffer.IgnoredMailboxMap.prototype.getDataMap = function(op
|
|||
*/
|
||||
proto.io.haveno.protobuffer.IgnoredMailboxMap.prototype.clearDataMap = function() {
|
||||
this.getDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -22034,7 +22043,8 @@ proto.io.haveno.protobuffer.Alert.prototype.getExtraDataMap = function(opt_noLaz
|
|||
*/
|
||||
proto.io.haveno.protobuffer.Alert.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -22517,7 +22527,8 @@ proto.io.haveno.protobuffer.Arbitrator.prototype.getExtraDataMap = function(opt_
|
|||
*/
|
||||
proto.io.haveno.protobuffer.Arbitrator.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -22982,7 +22993,8 @@ proto.io.haveno.protobuffer.Mediator.prototype.getExtraDataMap = function(opt_no
|
|||
*/
|
||||
proto.io.haveno.protobuffer.Mediator.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -23447,7 +23459,8 @@ proto.io.haveno.protobuffer.RefundAgent.prototype.getExtraDataMap = function(opt
|
|||
*/
|
||||
proto.io.haveno.protobuffer.RefundAgent.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -24062,7 +24075,8 @@ proto.io.haveno.protobuffer.Filter.prototype.getExtraDataMap = function(opt_noLa
|
|||
*/
|
||||
proto.io.haveno.protobuffer.Filter.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -25096,7 +25110,8 @@ proto.io.haveno.protobuffer.TradeStatistics3.prototype.getExtraDataMap = functio
|
|||
*/
|
||||
proto.io.haveno.protobuffer.TradeStatistics3.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -25388,7 +25403,8 @@ proto.io.haveno.protobuffer.MailboxStoragePayload.prototype.getExtraDataMap = fu
|
|||
*/
|
||||
proto.io.haveno.protobuffer.MailboxStoragePayload.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -26648,7 +26664,8 @@ proto.io.haveno.protobuffer.OfferPayload.prototype.getExtraDataMap = function(op
|
|||
*/
|
||||
proto.io.haveno.protobuffer.OfferPayload.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -28677,7 +28694,8 @@ proto.io.haveno.protobuffer.Dispute.prototype.getExtraDataMap = function(opt_noL
|
|||
*/
|
||||
proto.io.haveno.protobuffer.Dispute.prototype.clearExtraDataMap = function() {
|
||||
this.getExtraDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -31407,7 +31425,8 @@ proto.io.haveno.protobuffer.PaymentAccountPayload.prototype.getExcludeFromJsonDa
|
|||
*/
|
||||
proto.io.haveno.protobuffer.PaymentAccountPayload.prototype.clearExcludeFromJsonDataMap = function() {
|
||||
this.getExcludeFromJsonDataMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -56593,7 +56612,8 @@ proto.io.haveno.protobuffer.PreferencesPayload.prototype.getDontShowAgainMapMap
|
|||
*/
|
||||
proto.io.haveno.protobuffer.PreferencesPayload.prototype.clearDontShowAgainMapMap = function() {
|
||||
this.getDontShowAgainMapMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -56904,7 +56924,8 @@ proto.io.haveno.protobuffer.PreferencesPayload.prototype.getPeerTagMapMap = func
|
|||
*/
|
||||
proto.io.haveno.protobuffer.PreferencesPayload.prototype.clearPeerTagMapMap = function() {
|
||||
this.getPeerTagMapMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -59182,7 +59203,8 @@ proto.io.haveno.protobuffer.UserPayload.prototype.getCookieMap = function(opt_no
|
|||
*/
|
||||
proto.io.haveno.protobuffer.UserPayload.prototype.clearCookieMap = function() {
|
||||
this.getCookieMap().clear();
|
||||
return this;};
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
2
dist/protobuf/pb_pb.js.map
vendored
2
dist/protobuf/pb_pb.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/utils/HavenoUtils.js
vendored
8
dist/utils/HavenoUtils.js
vendored
|
|
@ -98,7 +98,7 @@ class HavenoUtils {
|
|||
* @return {bigint} amount in atomic units
|
||||
*/
|
||||
static xmrToAtomicUnits(amountXmr) {
|
||||
return BigInt(new decimal_js_1.default(amountXmr).mul(HavenoUtils.AU_PER_XMR.toString()).toFixed(0));
|
||||
return BigInt(new decimal_js_1.default(amountXmr).mul(HavenoUtils.AU_PER_XMR.toString()).toDecimalPlaces(0, decimal_js_1.default.ROUND_HALF_UP).toFixed(0));
|
||||
}
|
||||
/**
|
||||
* Convert atomic units to XMR.
|
||||
|
|
@ -107,7 +107,7 @@ class HavenoUtils {
|
|||
* @return {number} amount in XMR
|
||||
*/
|
||||
static atomicUnitsToXmr(amountAtomicUnits) {
|
||||
return new decimal_js_1.default(amountAtomicUnits.toString()).div(HavenoUtils.AU_PER_XMR.toString()).toNumber();
|
||||
return new decimal_js_1.default(amountAtomicUnits.toString()).div(HavenoUtils.AU_PER_XMR.toString()).toDecimalPlaces(12, decimal_js_1.default.ROUND_HALF_UP).toNumber();
|
||||
}
|
||||
/**
|
||||
* Divide one atomic units by another.
|
||||
|
|
@ -117,7 +117,7 @@ class HavenoUtils {
|
|||
* @returns {number} the result
|
||||
*/
|
||||
static divide(au1, au2) {
|
||||
return this.atomicUnitsToXmr(au1) / this.atomicUnitsToXmr(au2);
|
||||
return new decimal_js_1.default(au1.toString()).div(new decimal_js_1.default(au2.toString())).toDecimalPlaces(12, decimal_js_1.default.ROUND_HALF_UP).toNumber();
|
||||
}
|
||||
/**
|
||||
* Multiply a bigint by a number or bigint.
|
||||
|
|
@ -127,7 +127,7 @@ class HavenoUtils {
|
|||
* @returns the product as a bigint
|
||||
*/
|
||||
static multiply(a, b) {
|
||||
return BigInt((new decimal_js_1.default(a.toString()).mul(new decimal_js_1.default(b.toString())).toFixed(0)));
|
||||
return BigInt(new decimal_js_1.default(a.toString()).mul(new decimal_js_1.default(b.toString())).toDecimalPlaces(0, decimal_js_1.default.ROUND_HALF_UP).toString());
|
||||
}
|
||||
/**
|
||||
* Calculate the difference from a first bigint to a second, as a percentage (float).
|
||||
|
|
|
|||
2
dist/utils/HavenoUtils.js.map
vendored
2
dist/utils/HavenoUtils.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue