@xelis/sdk 0.10.12 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,254 +34,121 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
+ import to from "await-to-js";
38
+ import { parseJSON } from "./parse_json/parse_json.js";
37
39
  import WebSocket from 'isomorphic-ws';
38
- import { to } from 'await-to-js';
39
- import { parseJSON } from './parse_json/parse_json.js';
40
40
  var WSRPC = /** @class */ (function () {
41
- function WSRPC(options) {
42
- this.connectionTries = 0;
43
- this.methodIdIncrement = 0;
44
- this.endpoint = "";
45
- this.timeout = 15000; // default to 15s
46
- this.events = new Map();
47
- this.unsubscribeSuspense = 1000;
48
- this.maxConnectionTries = 3;
49
- this.reconnectOnConnectionLoss = true;
50
- this.options = options;
51
- }
52
- WSRPC.prototype.connect = function (endpoint) {
41
+ function WSRPC(endpoint, options) {
53
42
  var _this = this;
54
- // force disconnect if already connected
55
- if (this.socket && this.socket.readyState === WebSocket.OPEN) {
56
- this.socket.close();
57
- }
43
+ this.socket = new WebSocket(endpoint, options);
44
+ this.methodIdIncrement = 0;
45
+ this.callTimeout = 3000;
58
46
  this.events = new Map();
59
- this.connectionTries = 0;
60
- return new Promise(function (resolve, reject) {
61
- _this.socket = new WebSocket(endpoint, _this.options);
62
- _this.endpoint = endpoint;
63
- _this.socket.addEventListener("open", function (event) {
64
- resolve(event);
65
- });
66
- _this.socket.addEventListener("close", function (event) {
67
- if (_this.reconnectOnConnectionLoss && !event.wasClean) {
68
- _this.tryReconnect();
69
- reject(new Error("Unhandled close. Reconnecting..."));
70
- }
71
- else {
72
- reject(event);
73
- }
74
- });
75
- _this.socket.addEventListener("error", function (err) {
76
- reject(err);
77
- });
78
- });
79
- };
80
- WSRPC.prototype.tryReconnect = function () {
81
- var _this = this;
82
- this.connectionTries++;
83
- if (this.connectionTries > this.maxConnectionTries) {
84
- return;
85
- }
86
- this.socket = new WebSocket(this.endpoint, this.options);
87
- this.socket.addEventListener("open", function () {
88
- _this.connectionTries = 0;
47
+ this.socket.addEventListener("close", function () {
48
+ _this.events = new Map();
89
49
  });
90
- this.socket.addEventListener("close", function (event) {
91
- _this.tryReconnect();
92
- });
93
- };
94
- WSRPC.prototype.close = function () {
95
- if (!this.socket)
96
- return;
97
- this.socket.close();
98
- };
99
- WSRPC.prototype.clearEvent = function (event) {
100
- var _this = this;
101
- var eventData = this.events.get(event);
102
- if (eventData) {
103
- eventData.listeners.forEach(function (listener) {
104
- _this.socket && _this.socket.removeEventListener("message", listener);
105
- });
106
- this.events["delete"](event);
107
- }
108
- };
109
- WSRPC.prototype.closeAllListens = function (event) {
50
+ }
51
+ WSRPC.prototype.closeListener = function (event, listener) {
110
52
  return __awaiter(this, void 0, void 0, function () {
111
- var _a, err, _;
112
- return __generator(this, function (_b) {
113
- switch (_b.label) {
114
- case 0:
115
- if (!this.events.has(event)) return [3 /*break*/, 2];
116
- return [4 /*yield*/, to(this.dataCall("unsubscribe", { notify: event }))];
117
- case 1:
118
- _a = _b.sent(), err = _a[0], _ = _a[1];
119
- if (err)
120
- return [2 /*return*/, Promise.reject(err)];
121
- this.clearEvent(event);
122
- _b.label = 2;
123
- case 2: return [2 /*return*/, Promise.resolve()];
53
+ var eventData;
54
+ return __generator(this, function (_a) {
55
+ eventData = this.events.get(event);
56
+ if (eventData) {
57
+ if (eventData.listeners.length > 1) {
58
+ eventData.listeners = eventData.listeners.filter(function (l) { return l !== listener; });
59
+ this.events.set(event, eventData);
60
+ }
61
+ else {
62
+ this.events["delete"](event);
63
+ this.socket.removeEventListener("message", eventData.onMessage);
64
+ this.dataCall("unsubscribe", { notify: event });
65
+ }
124
66
  }
67
+ return [2 /*return*/];
125
68
  });
126
69
  });
127
70
  };
128
- WSRPC.prototype.listenEvent = function (event, onData) {
71
+ WSRPC.prototype.listen = function (event, listener) {
129
72
  return __awaiter(this, void 0, void 0, function () {
130
- var onMessage, eventData, idRefObject, _a, err, _, eventData_1, closeListen;
73
+ var eventData, idRefObject_1, onMessage;
131
74
  var _this = this;
132
- return __generator(this, function (_b) {
133
- switch (_b.label) {
134
- case 0:
135
- onMessage = function (msgEvent) {
136
- var eventData = _this.events.get(event);
137
- if (eventData && typeof msgEvent.data === "string") {
138
- try {
139
- var data = parseJSON(msgEvent.data);
140
- if (data.id === eventData.id) {
141
- if (data.error) {
142
- onData(msgEvent, undefined, new Error(data.error.message));
75
+ return __generator(this, function (_a) {
76
+ eventData = this.events.get(event);
77
+ if (eventData) {
78
+ eventData.listeners.push(listener);
79
+ this.events.set(event, eventData);
80
+ }
81
+ else {
82
+ idRefObject_1 = {};
83
+ this.dataCall("subscribe", { notify: event }, idRefObject_1)["catch"](function (err) {
84
+ listener(undefined, err);
85
+ });
86
+ onMessage = function (msgEvent) {
87
+ var eventData = _this.events.get(event);
88
+ if (eventData && typeof msgEvent.data === "string") {
89
+ try {
90
+ var data_1 = parseJSON(msgEvent.data);
91
+ if (data_1.id === idRefObject_1.id) {
92
+ eventData.listeners.forEach(function (listener) {
93
+ if (data_1.error) {
94
+ listener(undefined, new Error(data_1.error.message));
143
95
  }
144
96
  else {
145
- onData(msgEvent, data.result, undefined);
97
+ listener(data_1.result, undefined);
146
98
  }
147
- }
148
- }
149
- catch (_a) {
150
- // can't parse json -- do nothing
99
+ });
151
100
  }
152
101
  }
153
- };
154
- eventData = this.events.get(event);
155
- if (!eventData) return [3 /*break*/, 1];
156
- if (eventData.unsubscribeTimeoutId) {
157
- // clear timeout to unsubscribe
158
- // because we got a new registered event and want to cancel the pending unsubscribe grace period
159
- clearTimeout(eventData.unsubscribeTimeoutId);
160
- }
161
- eventData.listeners.push(onMessage);
162
- return [3 /*break*/, 3];
163
- case 1:
164
- // important if multiple listenEvent are called without await at least we store listener before getting id
165
- // avoid trying to subscribe the same event multiple times
166
- this.events.set(event, { listeners: [onMessage] });
167
- idRefObject = {};
168
- return [4 /*yield*/, to(this.dataCall("subscribe", { notify: event }, idRefObject))];
169
- case 2:
170
- _a = _b.sent(), err = _a[0], _ = _a[1];
171
- if (err) {
172
- this.clearEvent(event);
173
- return [2 /*return*/, Promise.reject(err)];
174
- }
175
- eventData_1 = this.events.get(event);
176
- if (eventData_1)
177
- eventData_1.id = idRefObject.id;
178
- _b.label = 3;
179
- case 3:
180
- this.socket && this.socket.addEventListener("message", onMessage);
181
- closeListen = function () {
182
- var eventData = _this.events.get(event);
183
- if (eventData) {
184
- var listeners = eventData.listeners;
185
- for (var i = 0; i < listeners.length; i++) {
186
- if (listeners[i] === onMessage) {
187
- listeners.splice(i, 1);
188
- break;
189
- }
190
- }
191
- // no more listener so we unsubscribe from daemon websocket if socket still open
192
- if (listeners.length === 0) {
193
- // we use a grace period to unsubscribe (mostly because of react useEffect and avoid unecessary subscribe)
194
- eventData.unsubscribeTimeoutId = setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
195
- return __generator(this, function (_a) {
196
- if (this.socket && this.socket.readyState === WebSocket.OPEN) {
197
- this.dataCall("unsubscribe", { notify: event });
198
- }
199
- this.events["delete"](event);
200
- return [2 /*return*/];
201
- });
202
- }); }, _this.unsubscribeSuspense);
203
- }
102
+ catch (_a) {
103
+ // can't parse json -- do nothing
204
104
  }
205
- _this.socket && _this.socket.removeEventListener("message", onMessage);
206
- return Promise.resolve();
207
- };
208
- return [2 /*return*/, Promise.resolve(closeListen)];
105
+ }
106
+ };
107
+ this.socket.addEventListener("message", onMessage);
108
+ this.events.set(event, { onMessage: onMessage, listeners: [listener] });
209
109
  }
110
+ return [2 /*return*/];
210
111
  });
211
112
  });
212
113
  };
213
- WSRPC.prototype.batchCall = function (requests) {
214
- var _this = this;
215
- return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
216
- var id, data, _a, err, res, items;
217
- return __generator(this, function (_b) {
218
- switch (_b.label) {
219
- case 0:
220
- id = this.methodIdIncrement++;
221
- requests.forEach(function (request) {
222
- request.id = id;
223
- request.jsonrpc = "2.0";
224
- });
225
- data = JSON.stringify(requests);
226
- return [4 /*yield*/, to(this.rawCall(id, data))];
227
- case 1:
228
- _a = _b.sent(), err = _a[0], res = _a[1];
229
- if (err)
230
- return [2 /*return*/, reject(err)];
231
- items = [];
232
- res.forEach(function (v) {
233
- if (v.error) {
234
- items.push(new Error(v.error.message));
235
- }
236
- else {
237
- items.push(v.result);
238
- }
239
- });
240
- return [2 /*return*/, resolve(items)];
241
- }
242
- });
243
- }); });
244
- };
245
114
  WSRPC.prototype.rawCall = function (id, body) {
246
115
  var _this = this;
247
116
  return new Promise(function (resolve, reject) {
248
- if (!_this.socket)
249
- return reject(new Error("Socket is not initialized."));
250
117
  if (_this.socket.readyState !== WebSocket.OPEN)
251
118
  return reject(new Error("Can't send msg. Socket is not opened."));
252
119
  var timeoutId = null;
253
120
  var onMessage = function (msgEvent) {
254
121
  if (typeof msgEvent.data === "string") {
255
- var data_1 = parseJSON(msgEvent.data);
122
+ var data_2 = parseJSON(msgEvent.data);
256
123
  var evaluate_data = function () {
257
124
  clearTimeout(timeoutId);
258
- _this.socket && _this.socket.removeEventListener("message", onMessage);
259
- if (data_1.error && data_1.error.message) {
260
- reject(new Error(data_1.error.message));
125
+ _this.socket.removeEventListener("message", onMessage);
126
+ if (data_2.error && data_2.error.message) {
127
+ reject(new Error(data_2.error.message));
261
128
  return;
262
129
  }
263
- return resolve(data_1);
130
+ return resolve(data_2);
264
131
  };
265
132
  // this is for batch call we match the id with first item id
266
- if (Array.isArray(data_1) && data_1.length > 0 && data_1[0].id === id) {
133
+ if (Array.isArray(data_2) && data_2.length > 0 && data_2[0].id === id) {
267
134
  return evaluate_data();
268
135
  }
269
136
  // the msg id is matching so we can evaluate the data
270
- if (data_1.id === id) {
137
+ if (data_2.id === id) {
271
138
  return evaluate_data();
272
139
  }
273
140
  // special XSWD case - sending first call will return null id
274
- if (data_1.id === null && id === 0) {
141
+ if (data_2.id === null && id === 0) {
275
142
  return evaluate_data();
276
143
  }
277
144
  }
278
145
  };
279
146
  _this.socket.addEventListener("message", onMessage);
280
- if (_this.timeout > 0) {
147
+ if (_this.callTimeout > 0) {
281
148
  timeoutId = setTimeout(function () {
282
149
  _this.socket && _this.socket.removeEventListener("message", onMessage);
283
150
  reject(new Error("timeout"));
284
- }, _this.timeout);
151
+ }, _this.callTimeout);
285
152
  }
286
153
  if (_this.socket.readyState === WebSocket.OPEN) {
287
154
  _this.socket.send(body);
@@ -315,6 +182,38 @@ var WSRPC = /** @class */ (function () {
315
182
  });
316
183
  }); });
317
184
  };
185
+ WSRPC.prototype.batchCall = function (requests) {
186
+ var _this = this;
187
+ return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
188
+ var id, data, _a, err, res, items;
189
+ return __generator(this, function (_b) {
190
+ switch (_b.label) {
191
+ case 0:
192
+ id = this.methodIdIncrement++;
193
+ requests.forEach(function (request) {
194
+ request.id = id;
195
+ request.jsonrpc = "2.0";
196
+ });
197
+ data = JSON.stringify(requests);
198
+ return [4 /*yield*/, to(this.rawCall(id, data))];
199
+ case 1:
200
+ _a = _b.sent(), err = _a[0], res = _a[1];
201
+ if (err)
202
+ return [2 /*return*/, reject(err)];
203
+ items = [];
204
+ res.forEach(function (v) {
205
+ if (v.error) {
206
+ items.push(new Error(v.error.message));
207
+ }
208
+ else {
209
+ items.push(v.result);
210
+ }
211
+ });
212
+ return [2 /*return*/, resolve(items)];
213
+ }
214
+ });
215
+ }); });
216
+ };
318
217
  return WSRPC;
319
218
  }());
320
219
  export { WSRPC };
@@ -24,29 +24,11 @@ var WalletMethods = /** @class */ (function () {
24
24
  WalletMethods.prototype.dataCall = function (method, params) {
25
25
  return this.ws.dataCall(this.prefix + method, params);
26
26
  };
27
- WalletMethods.prototype.onNewTopoheight = function (onData) {
28
- return this.ws.listenEvent(this.prefix + RPCEvent.NewTopoheight, onData);
27
+ WalletMethods.prototype.closeListener = function (event, listener) {
28
+ this.ws.closeListener(event, listener);
29
29
  };
30
- WalletMethods.prototype.onNewAsset = function (onData) {
31
- return this.ws.listenEvent(this.prefix + RPCEvent.NewAsset, onData);
32
- };
33
- WalletMethods.prototype.onNewTransaction = function (onData) {
34
- return this.ws.listenEvent(this.prefix + RPCEvent.NewTransaction, onData);
35
- };
36
- WalletMethods.prototype.onBalanceChanged = function (onData) {
37
- return this.ws.listenEvent(this.prefix + RPCEvent.BalanceChanged, onData);
38
- };
39
- WalletMethods.prototype.onRescan = function (onData) {
40
- return this.ws.listenEvent(this.prefix + RPCEvent.Rescan, onData);
41
- };
42
- WalletMethods.prototype.onHistorySynced = function (onData) {
43
- return this.ws.listenEvent(this.prefix + RPCEvent.HistorySynced, onData);
44
- };
45
- WalletMethods.prototype.onOnline = function (onData) {
46
- return this.ws.listenEvent(this.prefix + RPCEvent.Online, onData);
47
- };
48
- WalletMethods.prototype.onOffline = function (onData) {
49
- return this.ws.listenEvent(this.prefix + RPCEvent.Offline, onData);
30
+ WalletMethods.prototype.listen = function (event, listener) {
31
+ this.ws.listen(this.prefix + event, listener);
50
32
  };
51
33
  WalletMethods.prototype.getVersion = function () {
52
34
  return this.dataCall(RPCMethod.GetVersion);
@@ -174,8 +156,8 @@ var WalletMethods = /** @class */ (function () {
174
156
  export { WalletMethods };
175
157
  var WS = /** @class */ (function (_super) {
176
158
  __extends(WS, _super);
177
- function WS(username, password) {
178
- var _this = _super.call(this, { auth: "".concat(username, ":").concat(password) }) || this;
159
+ function WS(endpoint, username, password) {
160
+ var _this = _super.call(this, endpoint, { auth: "".concat(username, ":").concat(password) }) || this;
179
161
  _this.methods = new WalletMethods(_this);
180
162
  return _this;
181
163
  }
@@ -15,7 +15,7 @@ var App = /** @class */ (function () {
15
15
  this.errElement.classList.add("xelis-xswd-relayer-error");
16
16
  this.qrCodeElement = document.createElement("div");
17
17
  this.qrCodeElement.classList.add("xelis-xswd-relayer-qrcode");
18
- this.qrCodeElement.innerHTML = "\n <div>XSWD Relayer</div>\n <canvas></canvas>\n ";
18
+ this.qrCodeElement.innerHTML = "\n <div class=\"xelis-xswd-relayer-scan-logo\">\n <svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4,4h6v6H4V4M20,4v6H14V4h6M14,15h2V13H14V11h2v2h2V11h2v2H18v2h2v3H18v2H16V18H13v2H11V16h3V15m2,0v3h2V15H16M4,20V14h6v6H4M6,6V8H8V6H6M16,6V8h2V6H16M6,16v2H8V16H6M4,11H6v2H4V11m5,0h4v4H11V13H9V11m2-5h2v4H11V6M2,2V6H0V2A2,2,0,0,1,2,0H6V2H2M22,0a2,2,0,0,1,2,2V6H22V2H18V0h4M2,18v4H6v2H2a2,2,0,0,1-2-2V18H2m20,4V18h2v4a2,2,0,0,1-2,2H18V22Z\"/>\n </svg>\n </div>\n <div class=\"xelis-xswd-relayer-logo-wrap\">\n <div class=\"xelis-xswd-relayer-logo\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 778 743\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M388.909 742.872L777.817 353.964L424.056 0.202599L478.809 132.737L700.036 353.964L388.909 665.091L77.7817 353.964L299.507 129.121L353.964 0L0 353.964L388.909 742.872Z\" />\n <path d=\"M388.909 665.091L353.964 0L299.507 129.121L388.909 665.091Z\" />\n <path d=\"M424.056 0.202599L388.909 665.091L478.809 132.737L424.056 0.202599Z\" />\n </svg>\n </div>\n </div>\n <div class=\"xelis-xswd-relayer-title\">XSWD Relayer</div>\n <canvas></canvas>\n ";
19
19
  this.element.addEventListener("click", function (e) {
20
20
  // close the app if clicking outside
21
21
  if (_this.element.isEqualNode(e.target)) {
@@ -32,7 +32,7 @@ var App = /** @class */ (function () {
32
32
  };
33
33
  App.prototype.setError = function (msg) {
34
34
  this.clear();
35
- this.errElement.innerHTML = "error: ".concat(msg);
35
+ this.errElement.innerHTML = "\n <div class=\"xelis-xswd-relayer-error-text\">error: ".concat(msg, "</div>\n ");
36
36
  this.contentElement.appendChild(this.errElement);
37
37
  };
38
38
  App.prototype.setLoading = function () {
@@ -48,7 +48,12 @@ var App = /** @class */ (function () {
48
48
  relayer: this.relayer.props.url,
49
49
  encryption_mode: this.relayer.props.encryption_mode
50
50
  });
51
- QRCode.toCanvas(canvas, qrCodeData);
51
+ QRCode.toCanvas(canvas, qrCodeData, {
52
+ color: {
53
+ dark: "#fff",
54
+ light: "#000" // background
55
+ }
56
+ });
52
57
  this.contentElement.appendChild(this.qrCodeElement);
53
58
  };
54
59
  return App;
@@ -1,11 +1,21 @@
1
1
  .xelis-xswd-relayer {
2
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
2
3
  position: fixed;
3
4
  top: 0;
4
5
  left: 0;
5
6
  bottom: 0;
6
7
  right: 0;
7
- background-color: rgba(0, 0, 0, 0.5);
8
- backdrop-filter: blur(10px);
8
+ background-color: rgba(0, 0, 0, 0.8);
9
+ backdrop-filter: blur(30px);
10
+ opacity: 0;
11
+ animation: xelis-xswd-relayer-appear .25s forwards;
12
+ user-select: none;
13
+ }
14
+
15
+ @keyframes xelis-xswd-relayer-appear {
16
+ 100% {
17
+ opacity: 1;
18
+ }
9
19
  }
10
20
 
11
21
  .xelis-xswd-relayer-content {
@@ -13,16 +23,51 @@
13
23
  top: 50%;
14
24
  left: 50%;
15
25
  translate: -50% -50%;
16
- background-color: aquamarine;
17
- filter: drop-shadow(0px 0px 25px black);
18
26
  }
19
27
 
20
- .xelis-xswd-relayer-error {}
28
+ .xelis-xswd-relayer-error {
29
+ background-color: #02ffcf;
30
+ padding: 15px;
31
+ border-radius: 10px;
32
+ animation: xelis-xswd-relayer-error-appear .5s forwards;
33
+ opacity: 0;
34
+ }
35
+
36
+ @keyframes xelis-xswd-relayer-error-appear {
37
+ 25% {
38
+ translate: -4px 0;
39
+ rotate: -3deg;
40
+ }
41
+
42
+ 50% {
43
+ translate: 4px 0;
44
+ rotate: 3deg;
45
+ }
46
+
47
+ 75% {
48
+ translate: -4px 0;
49
+ rotate: -3deg;
50
+ }
51
+
52
+ 100% {
53
+ opacity: 1;
54
+ translate: 0 0;
55
+ rotate: 0;
56
+ }
57
+ }
58
+
59
+
60
+ .xelis-xswd-relayer-error-text {
61
+ background-color: rgba(31, 31, 31, 1);
62
+ border-radius: 5px;
63
+ padding: 5px 10px;
64
+ color: rgb(255, 63, 63);
65
+ }
21
66
 
22
67
  .xelis-xswd-relayer-loading {
23
- width: 50px;
24
- height: 50px;
25
- color: black;
68
+ width: 75px;
69
+ height: 75px;
70
+ color: #02ffcf;
26
71
  animation: xelis-xswd-relayer-loading-animation .75s infinite;
27
72
  }
28
73
 
@@ -32,6 +77,87 @@
32
77
  }
33
78
  }
34
79
 
35
- .xelis-xswd-relayer-qrcode {}
80
+ .xelis-xswd-relayer-qrcode {
81
+ background-color: rgba(2, 255, 207, 1);
82
+ padding: 30px 30px 50px 30px;
83
+ border-radius: 15px;
84
+ animation: xelis-xswd-relayer-qrcode-appear .25s forwards, xelis-xswd-relayer-qrcode-animation 2s infinite alternate;
85
+ translate: 0 -100%;
86
+ opacity: 0;
87
+ position: relative;
88
+ }
89
+
90
+ @keyframes xelis-xswd-relayer-qrcode-appear {
91
+ 100% {
92
+ translate: 0 0;
93
+ opacity: 1;
94
+ }
95
+ }
96
+
97
+ @keyframes xelis-xswd-relayer-qrcode-animation {
98
+ 0% {
99
+ background-color: rgba(2, 255, 207, 0.3);
100
+ filter: drop-shadow(0px 0px 100px rgba(2, 255, 209, 0.1));
101
+ }
102
+
103
+ 100% {
104
+ background-color: rgba(2, 255, 207, 1);
105
+ filter: drop-shadow(0px 0px 200px rgba(2, 255, 209, 0.1));
106
+ }
107
+ }
108
+
109
+ .xelis-xswd-relayer-scan-logo {
110
+ position: absolute;
111
+ bottom: -30px;
112
+ left: 50%;
113
+ translate: -50% 0;
114
+ width: 25px;
115
+ height: 25px;
116
+ color: white;
117
+ background-color: black;
118
+ padding: 20px;
119
+ border-radius: 100%;
120
+ }
121
+
122
+ .xelis-xswd-relayer-logo-wrap {
123
+ position: absolute;
124
+ width: 100%;
125
+ height: 100%;
126
+ overflow: hidden;
127
+ top: 0;
128
+ left: 0;
129
+ border-radius: 15px;
130
+ }
131
+
132
+ .xelis-xswd-relayer-logo {
133
+ position: absolute;
134
+ width: 100%;
135
+ height: 100%;
136
+ top: 25%;
137
+ left: 5%;
138
+ scale: 1.8;
139
+ z-index: -1;
140
+ animation: xelis-xswd-relayer-logo-animation 2s infinite alternate;
141
+ }
142
+
143
+ @keyframes xelis-xswd-relayer-logo-animation {
144
+ 0% {
145
+ color: rgba(0, 206, 168, 0);
146
+ }
147
+
148
+ 100% {
149
+ color: rgba(0, 206, 168, 0.8);
150
+ }
151
+ }
152
+
153
+
154
+ .xelis-xswd-relayer-title {
155
+ font-size: 25px;
156
+ font-weight: bold;
157
+ margin-bottom: 10px;
158
+ color: black;
159
+ }
36
160
 
37
- .xelis-xswd-relayer-qrcode canvas {}
161
+ .xelis-xswd-relayer-qrcode canvas {
162
+ border-radius: 10px;
163
+ }
@@ -18,9 +18,9 @@ import { DaemonMethods } from '../daemon/websocket.js';
18
18
  import { WalletMethods } from '../wallet/websocket.js';
19
19
  var WS = /** @class */ (function (_super) {
20
20
  __extends(WS, _super);
21
- function WS() {
22
- var _this = _super.call(this) || this;
23
- _this.timeout = 0;
21
+ function WS(endpoint) {
22
+ var _this = _super.call(this, endpoint) || this;
23
+ _this.callTimeout = 0; // xswd needs user input for confirmation - timeout should not be used
24
24
  _this.daemon = new DaemonMethods(_this, "node.");
25
25
  _this.wallet = new WalletMethods(_this, "wallet.");
26
26
  return _this;