update dist

This commit is contained in:
woodser 2024-10-13 12:09:14 -04:00
parent e3ea1ca4bf
commit 3143e77ced
12 changed files with 448 additions and 6 deletions

View File

@ -230,6 +230,12 @@ export default class HavenoClient {
* @param {boolean} autoSwitch - whether auto switch is enabled or disabled
*/
setAutoSwitch(autoSwitch: boolean): Promise<void>;
/**
* Get the current auto switch setting.
*
* @return {boolean} whether auto switch is enabled or disabled
*/
getAutoSwitch(): Promise<boolean>;
/**
* Returns whether daemon is running a local monero node.
*/

13
dist/HavenoClient.js vendored
View File

@ -562,6 +562,19 @@ class HavenoClient {
throw new HavenoError_1.default(e.message, e.code);
}
}
/**
* Get the current auto switch setting.
*
* @return {boolean} whether auto switch is enabled or disabled
*/
async getAutoSwitch() {
try {
return (await this._xmrConnectionsClient.getAutoSwitch(new grpc_pb_1.GetAutoSwitchRequest(), { password: this._password })).getAutoSwitch();
}
catch (e) {
throw new HavenoError_1.default(e.message, e.code);
}
}
/**
* Returns whether daemon is running a local monero node.
*/

File diff suppressed because one or more lines are too long

View File

@ -203,6 +203,9 @@ export declare class XmrConnectionsClient {
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>;
methodDescriptorGetAutoSwitch: grpcWeb.MethodDescriptor<grpc_pb.GetAutoSwitchRequest, grpc_pb.GetAutoSwitchReply>;
getAutoSwitch(request: grpc_pb.GetAutoSwitchRequest, metadata?: grpcWeb.Metadata | null): Promise<grpc_pb.GetAutoSwitchReply>;
getAutoSwitch(request: grpc_pb.GetAutoSwitchRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.RpcError, response: grpc_pb.GetAutoSwitchReply) => void): grpcWeb.ClientReadableStream<grpc_pb.GetAutoSwitchReply>;
}
export declare class XmrNodeClient {
client_: grpcWeb.AbstractClientBase;

View File

@ -380,6 +380,9 @@ class XmrConnectionsClient {
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);
this.methodDescriptorGetAutoSwitch = new grpcWeb.MethodDescriptor('/io.haveno.protobuffer.XmrConnections/GetAutoSwitch', grpcWeb.MethodType.UNARY, grpc_pb.GetAutoSwitchRequest, grpc_pb.GetAutoSwitchReply, (request) => {
return request.serializeBinary();
}, grpc_pb.GetAutoSwitchReply.deserializeBinary);
if (!options)
options = {};
if (!credentials)
@ -478,6 +481,14 @@ class XmrConnectionsClient {
return this.client_.unaryCall(this.hostname_ +
'/io.haveno.protobuffer.XmrConnections/SetAutoSwitch', request, metadata || {}, this.methodDescriptorSetAutoSwitch);
}
getAutoSwitch(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(this.hostname_ +
'/io.haveno.protobuffer.XmrConnections/GetAutoSwitch', request, metadata || {}, this.methodDescriptorGetAutoSwitch, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/io.haveno.protobuffer.XmrConnections/GetAutoSwitch', request, metadata || {}, this.methodDescriptorGetAutoSwitch);
}
}
exports.XmrConnectionsClient = XmrConnectionsClient;
class XmrNodeClient {

File diff suppressed because one or more lines are too long

View File

@ -1183,6 +1183,38 @@ export namespace SetAutoSwitchReply {
}
}
export class GetAutoSwitchRequest extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAutoSwitchRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetAutoSwitchRequest): GetAutoSwitchRequest.AsObject;
static serializeBinaryToWriter(message: GetAutoSwitchRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetAutoSwitchRequest;
static deserializeBinaryFromReader(message: GetAutoSwitchRequest, reader: jspb.BinaryReader): GetAutoSwitchRequest;
}
export namespace GetAutoSwitchRequest {
export type AsObject = {
}
}
export class GetAutoSwitchReply extends jspb.Message {
getAutoSwitch(): boolean;
setAutoSwitch(value: boolean): GetAutoSwitchReply;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAutoSwitchReply.AsObject;
static toObject(includeInstance: boolean, msg: GetAutoSwitchReply): GetAutoSwitchReply.AsObject;
static serializeBinaryToWriter(message: GetAutoSwitchReply, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetAutoSwitchReply;
static deserializeBinaryFromReader(message: GetAutoSwitchReply, reader: jspb.BinaryReader): GetAutoSwitchReply;
}
export namespace GetAutoSwitchReply {
export type AsObject = {
autoSwitch: boolean,
}
}
export class IsXmrNodeOnlineRequest extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): IsXmrNodeOnlineRequest.AsObject;

View File

@ -58,6 +58,8 @@ goog.exportSymbol('proto.io.haveno.protobuffer.DeletePaymentAccountReply', null,
goog.exportSymbol('proto.io.haveno.protobuffer.DeletePaymentAccountRequest', null, global);
goog.exportSymbol('proto.io.haveno.protobuffer.GetAddressBalanceReply', null, global);
goog.exportSymbol('proto.io.haveno.protobuffer.GetAddressBalanceRequest', null, global);
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);
@ -1558,6 +1560,48 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.io.haveno.protobuffer.SetAutoSwitchReply.displayName = 'proto.io.haveno.protobuffer.SetAutoSwitchReply';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.io.haveno.protobuffer.GetAutoSwitchRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.displayName = 'proto.io.haveno.protobuffer.GetAutoSwitchRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.io.haveno.protobuffer.GetAutoSwitchReply, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.displayName = 'proto.io.haveno.protobuffer.GetAutoSwitchReply';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -12377,6 +12421,237 @@ proto.io.haveno.protobuffer.SetAutoSwitchReply.serializeBinaryToWriter = functio
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.prototype.toObject = function(opt_includeInstance) {
return proto.io.haveno.protobuffer.GetAutoSwitchRequest.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @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.GetAutoSwitchRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.io.haveno.protobuffer.GetAutoSwitchRequest}
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.io.haveno.protobuffer.GetAutoSwitchRequest;
return proto.io.haveno.protobuffer.GetAutoSwitchRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.io.haveno.protobuffer.GetAutoSwitchRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.io.haveno.protobuffer.GetAutoSwitchRequest}
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.io.haveno.protobuffer.GetAutoSwitchRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.io.haveno.protobuffer.GetAutoSwitchRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.io.haveno.protobuffer.GetAutoSwitchRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.prototype.toObject = function(opt_includeInstance) {
return proto.io.haveno.protobuffer.GetAutoSwitchReply.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @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.GetAutoSwitchReply} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.toObject = function(includeInstance, msg) {
var f, obj = {
autoSwitch: jspb.Message.getBooleanFieldWithDefault(msg, 1, false)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.io.haveno.protobuffer.GetAutoSwitchReply}
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.io.haveno.protobuffer.GetAutoSwitchReply;
return proto.io.haveno.protobuffer.GetAutoSwitchReply.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.io.haveno.protobuffer.GetAutoSwitchReply} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.io.haveno.protobuffer.GetAutoSwitchReply}
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {boolean} */ (reader.readBool());
msg.setAutoSwitch(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.io.haveno.protobuffer.GetAutoSwitchReply.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.io.haveno.protobuffer.GetAutoSwitchReply} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAutoSwitch();
if (f) {
writer.writeBool(
1,
f
);
}
};
/**
* optional bool auto_switch = 1;
* @return {boolean}
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.prototype.getAutoSwitch = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
};
/**
* @param {boolean} value
* @return {!proto.io.haveno.protobuffer.GetAutoSwitchReply} returns this
*/
proto.io.haveno.protobuffer.GetAutoSwitchReply.prototype.setAutoSwitch = function(value) {
return jspb.Message.setProto3BooleanField(this, 1, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.

File diff suppressed because one or more lines are too long

View File

@ -7053,6 +7053,12 @@ export class PreferencesPayload extends jspb.Message {
getSplitOfferOutput(): boolean;
setSplitOfferOutput(value: boolean): PreferencesPayload;
getUseSoundForNotifications(): boolean;
setUseSoundForNotifications(value: boolean): PreferencesPayload;
getUseSoundForNotificationsInitialized(): boolean;
setUseSoundForNotificationsInitialized(value: boolean): PreferencesPayload;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): PreferencesPayload.AsObject;
static toObject(includeInstance: boolean, msg: PreferencesPayload): PreferencesPayload.AsObject;
@ -7125,6 +7131,8 @@ export namespace PreferencesPayload {
buyScreenCryptoCurrencyCode: string,
sellScreenCryptoCurrencyCode: string,
splitOfferOutput: boolean,
useSoundForNotifications: boolean,
useSoundForNotificationsInitialized: boolean,
}
}
@ -7176,6 +7184,9 @@ export class XmrNodeSettings extends jspb.Message {
clearStartupFlagsList(): XmrNodeSettings;
addStartupFlags(value: string, index?: number): XmrNodeSettings;
getSyncBlockchain(): boolean;
setSyncBlockchain(value: boolean): XmrNodeSettings;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): XmrNodeSettings.AsObject;
static toObject(includeInstance: boolean, msg: XmrNodeSettings): XmrNodeSettings.AsObject;
@ -7189,6 +7200,7 @@ export namespace XmrNodeSettings {
blockchainPath: string,
bootstrapUrl: string,
startupFlagsList: Array<string>,
syncBlockchain: boolean,
}
}

View File

@ -55416,7 +55416,9 @@ proto.io.haveno.protobuffer.PreferencesPayload.toObject = function(includeInstan
clearDataAfterDays: jspb.Message.getFieldWithDefault(msg, 59, 0),
buyScreenCryptoCurrencyCode: jspb.Message.getFieldWithDefault(msg, 60, ""),
sellScreenCryptoCurrencyCode: jspb.Message.getFieldWithDefault(msg, 61, ""),
splitOfferOutput: jspb.Message.getBooleanFieldWithDefault(msg, 62, false)
splitOfferOutput: jspb.Message.getBooleanFieldWithDefault(msg, 62, false),
useSoundForNotifications: jspb.Message.getBooleanFieldWithDefault(msg, 63, false),
useSoundForNotificationsInitialized: jspb.Message.getBooleanFieldWithDefault(msg, 64, false)
};
if (includeInstance) {
@ -55714,6 +55716,14 @@ proto.io.haveno.protobuffer.PreferencesPayload.deserializeBinaryFromReader = fun
var value = /** @type {boolean} */ (reader.readBool());
msg.setSplitOfferOutput(value);
break;
case 63:
var value = /** @type {boolean} */ (reader.readBool());
msg.setUseSoundForNotifications(value);
break;
case 64:
var value = /** @type {boolean} */ (reader.readBool());
msg.setUseSoundForNotificationsInitialized(value);
break;
default:
reader.skipField();
break;
@ -56180,6 +56190,20 @@ proto.io.haveno.protobuffer.PreferencesPayload.serializeBinaryToWriter = functio
f
);
}
f = message.getUseSoundForNotifications();
if (f) {
writer.writeBool(
63,
f
);
}
f = message.getUseSoundForNotificationsInitialized();
if (f) {
writer.writeBool(
64,
f
);
}
};
@ -57519,6 +57543,42 @@ proto.io.haveno.protobuffer.PreferencesPayload.prototype.setSplitOfferOutput = f
};
/**
* optional bool use_sound_for_notifications = 63;
* @return {boolean}
*/
proto.io.haveno.protobuffer.PreferencesPayload.prototype.getUseSoundForNotifications = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 63, false));
};
/**
* @param {boolean} value
* @return {!proto.io.haveno.protobuffer.PreferencesPayload} returns this
*/
proto.io.haveno.protobuffer.PreferencesPayload.prototype.setUseSoundForNotifications = function(value) {
return jspb.Message.setProto3BooleanField(this, 63, value);
};
/**
* optional bool use_sound_for_notifications_initialized = 64;
* @return {boolean}
*/
proto.io.haveno.protobuffer.PreferencesPayload.prototype.getUseSoundForNotificationsInitialized = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 64, false));
};
/**
* @param {boolean} value
* @return {!proto.io.haveno.protobuffer.PreferencesPayload} returns this
*/
proto.io.haveno.protobuffer.PreferencesPayload.prototype.setUseSoundForNotificationsInitialized = function(value) {
return jspb.Message.setProto3BooleanField(this, 64, value);
};
/**
* List of repeated fields within this message type.
@ -57836,7 +57896,8 @@ proto.io.haveno.protobuffer.XmrNodeSettings.toObject = function(includeInstance,
var f, obj = {
blockchainPath: jspb.Message.getFieldWithDefault(msg, 1, ""),
bootstrapUrl: jspb.Message.getFieldWithDefault(msg, 2, ""),
startupFlagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f
startupFlagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
syncBlockchain: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
};
if (includeInstance) {
@ -57885,6 +57946,10 @@ proto.io.haveno.protobuffer.XmrNodeSettings.deserializeBinaryFromReader = functi
var value = /** @type {string} */ (reader.readString());
msg.addStartupFlags(value);
break;
case 4:
var value = /** @type {boolean} */ (reader.readBool());
msg.setSyncBlockchain(value);
break;
default:
reader.skipField();
break;
@ -57935,6 +58000,13 @@ proto.io.haveno.protobuffer.XmrNodeSettings.serializeBinaryToWriter = function(m
f
);
}
f = message.getSyncBlockchain();
if (f) {
writer.writeBool(
4,
f
);
}
};
@ -58011,6 +58083,24 @@ proto.io.haveno.protobuffer.XmrNodeSettings.prototype.clearStartupFlagsList = fu
};
/**
* optional bool sync_blockchain = 4;
* @return {boolean}
*/
proto.io.haveno.protobuffer.XmrNodeSettings.prototype.getSyncBlockchain = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
};
/**
* @param {boolean} value
* @return {!proto.io.haveno.protobuffer.XmrNodeSettings} returns this
*/
proto.io.haveno.protobuffer.XmrNodeSettings.prototype.setSyncBlockchain = function(value) {
return jspb.Message.setProto3BooleanField(this, 4, value);
};
/**
* List of repeated fields within this message type.

File diff suppressed because one or more lines are too long