Possibilty to change gateway ws listener (#1779)

* add: set gatewayListener

* Update types.ts

* Update worker.ts
This commit is contained in:
cgi-bin/
2022-11-23 16:14:43 +01:00
committed by Jon Häggblad
parent 4ff741ed9a
commit 39ca9c22af
2 changed files with 10 additions and 1 deletions
@@ -27,6 +27,11 @@ export interface NymClientConfig {
* Optional. The identity key of the preferred gateway to connect to.
*/
preferredGatewayIdentityKey?: string;
/**
* Optional. The listener websocket of the preferred gateway to connect to.
*/
gatewayListener?: string;
/**
* Optional. Settings for the WASM client.
@@ -133,7 +133,11 @@ wasm_bindgen(wasmUrl)
config.validatorApiUrl,
config.preferredGatewayIdentityKey,
);
// set a different gatewayListener in order to avoid workaround ws over https error
if (config.gatewayListener)
gatewayEndpoint.gateway_listener = config.gatewayListener;
// create the client, passing handlers for events
wrapper.init(
new wasm_bindgen.Config(