Skip to content

Commit 17ad646

Browse files
committedMar 13, 2020
clean up
1 parent 60b37ba commit 17ad646

20 files changed

+75
-1640
lines changed
 

‎README.md

+14
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ In order to have your token included in the list of tokens identified by the app
9393

9494
Instructions one how to add a token there may be found [here](https://kb.myetherwallet.com/en/tokens/adding-token-as-a-default/)
9595

96+
## Debugging
97+
98+
The MEWconnect client uses the debug library to provide verbose debug logging. In local storage add the key 'debug' with the value:
99+
- \*
100+
- to see everything
101+
- MEWconnect: *
102+
- to see everything related to the MEWconnect client
103+
- MEWconnect:connection-state
104+
- to see the connection state when it changes
105+
- MEWconnect:webRTC-communication
106+
- to see the events and signals related to webRTC
107+
- MEWconnect:websocketWrapper
108+
- to see the events related to setting up the webRTC connection
109+
96110

97111
<br>
98112
<br>
-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
import combined from './initiator/MewConnectInitiator.js';
22
export default combined;
3-
// import oldCombined from './initiator/MewConnectInitiatorV1_V2'
4-
// export default oldCombined;

‎src/connectClient/WebRtcCommunication.js

+12-33
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import MewConnectCommon from './MewConnectCommon';
1010
const debug = debugLogger('MEWconnect:webRTC-communication');
1111
const debugPeer = debugLogger('MEWconnectVerbose:peer-instances');
1212
const debugStages = debugLogger('MEWconnect:peer-stages');
13-
const debugTemp = console.error; //debugLogger('temp');
1413
const logger = createLogger('WebRtcCommunication');
1514

1615
export default class WebRtcCommunication extends MewConnectCommon {
@@ -19,14 +18,12 @@ export default class WebRtcCommunication extends MewConnectCommon {
1918
this.Peer = SimplePeer;
2019
this.mewCrypto = mewCrypto;
2120
this.peersCreated = {};
22-
this.peersActive = {};
2321
this.allPeerIds = [];
2422
this.iceState = '';
2523
this.answerReceived = {};
2624
this.answersReceived = [];
2725
this.offersSent = -1;
2826
this.turnTimer = null;
29-
this.turnResponseTimer = null;
3027
this.turnWaitTime = 5000;
3128
this.enableTimer = true;
3229
this.tryingTurn = false;
@@ -47,7 +44,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
4744

4845
clearExtraOnConnection() {
4946
this.peersCreated = {};
50-
this.peersActive = {};
5147
this.allPeerIds = [];
5248
this.answerReceived = {};
5349
this.answersReceived = [];
@@ -66,7 +62,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
6662

6763
// can be used to listen to specific events, especially those that pass data
6864
uiCommunicator(event, data) {
69-
debug(event, data); // todo remove dev item
65+
debug(event, data);
7066
this.emit(event, data);
7167
this.emitStatus(event);
7268
}
@@ -119,7 +115,6 @@ export default class WebRtcCommunication extends MewConnectCommon {
119115
}
120116

121117
start(simpleOptions) {
122-
debugTemp('start');
123118
this.canSignal = !this.canSignal;
124119
this.fallbackTimer();
125120
this.setActivePeerId();
@@ -142,8 +137,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
142137
}
143138

144139
onConnect(peerID) {
145-
console.log('onConnect'); // todo remove dev item
146-
debug('onConnect', peerID); // todo remove dev item
140+
debug('onConnect', peerID);
147141
this.connected = true;
148142
this.emit('connect', peerID);
149143
this.clearExtraOnConnection();
@@ -153,19 +147,18 @@ export default class WebRtcCommunication extends MewConnectCommon {
153147
if(this.canSignal) {
154148
this.canSignal = !this.canSignal;
155149
++this.offersSent;
156-
debug('signalListener'); // todo remove dev item
150+
debug('webRTC setup signal received');
157151
this.emit('signal', data);
158152
}
159153
}
160154

161155
receiveAnswer(plainTextOffer, peerID) {
162156

163-
debugTemp('receiveAnswer', this.usingVersion);
157+
debug('receiveAnswer for version: ', this.usingVersion);
164158
this.fallbackTimer();
165159
if (this.tryingTurn && this.usingVersion === 'V1') {
166160
this.answersReceived.push(plainTextOffer);
167161
if (this.turnTimer === null) {
168-
debug(this.turnTimer); // todo remove dev item
169162
const _self = this;
170163
this.turnTimer = setTimeout(this.receiveTurnAnswer.bind(_self), 1000);
171164
}
@@ -174,12 +167,11 @@ export default class WebRtcCommunication extends MewConnectCommon {
174167
if (this.turnTimer !== null) {
175168
clearTimeout(this.turnTimer);
176169
}
177-
debug('webRtc receiveAnswer', this.answerReceived);
170+
debug('webRtc receiveAnswer');
178171
debug(`active PEER_ID: ${this.p.peerInstanceId}`);
179172
try {
180-
debug('recieveAnswer: plaintext', plainTextOffer); // todo remove dev item
181173
this.p.signal(plainTextOffer);
182-
debug('============ INITIATOR ================='); // todo remove dev item
174+
debug('webRTC answer received and processed');
183175
} catch (e) {
184176
// eslint-disable-next-line
185177
console.error(e);
@@ -189,9 +181,8 @@ export default class WebRtcCommunication extends MewConnectCommon {
189181
debug(`active PEER_ID: ${this.p.peerInstanceId}`);
190182
try {
191183
this.answerReceived[this.p.peerInstanceId] = true;
192-
debug('recieveAnswer: plaintext', plainTextOffer); // todo remove dev item
193184
this.p.signal(plainTextOffer);
194-
debug('============ INITIATOR ================='); // todo remove dev item
185+
debug('webRTC answer received and processed');
195186
} catch (e) {
196187
// eslint-disable-next-line
197188
console.error(e);
@@ -200,16 +191,13 @@ export default class WebRtcCommunication extends MewConnectCommon {
200191
}
201192

202193
receiveTurnAnswer() {
203-
if (!this.connected) {
204-
205-
}
206194
const plainTextOffer = this.answersReceived[this.answersReceived.length - 1];
207195
debug('webRtc receiveTurnAnswer', this.answerReceived);
208196
debug(`active PEER_ID: ${this.p.peerInstanceId}`);
209197
try {
210198
this.answerReceived[this.p.peerInstanceId] = true;
211-
debug('recieveAnswer: plaintext', plainTextOffer); // todo remove dev item
212199
this.p.signal(plainTextOffer);
200+
debug('webRTC answer received and processed');
213201
} catch (e) {
214202
// eslint-disable-next-line
215203
console.error(e);
@@ -229,11 +217,9 @@ export default class WebRtcCommunication extends MewConnectCommon {
229217
// Provide Notice that initial WebRTC connection failed and the fallback method will be used
230218
willAttemptTurn() {
231219
debugStages('TRY TURN CONNECTION');
232-
console.log(this.tryingTurn); // todo remove dev item
233220
this.uiCommunicator(this.lifeCycle.UsingFallback);
234221
if (!this.tryingTurn && this.usingVersion === 'V2') {
235-
console.log('emit try tuen =========================================================='); // todo remove dev item
236-
console.log(this.usingVersion); // todo remove dev item
222+
debugStages(' TRY TURN V2');
237223
this.tryingTurn = true;
238224
try {
239225
this.useFallback();
@@ -254,9 +240,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
254240

255241
useFallback() {
256242
if (!this.connected) {
257-
console.log(this.turnTimer); // todo remove dev item
258243
this.emit('useFallback');
259-
// this.rtcDestroy();
260244
}
261245
}
262246

@@ -303,7 +287,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
303287
// =========================================================
304288
// =========================================================
305289
async onData(peerID, data) {
306-
debug('DATA RECEIVED', data.toString());
290+
debug('DATA RECEIVED');
307291
debugPeer('peerID', peerID);
308292
this.fallbackTimer();
309293

@@ -321,11 +305,8 @@ export default class WebRtcCommunication extends MewConnectCommon {
321305
}
322306
if (this.isJSON(decryptedData)) {
323307
const parsed = JSON.parse(decryptedData);
324-
debug('DECRYPTED DATA RECEIVED 1', parsed);
325-
debug(parsed.type, parsed.data); // todo remove dev item
326308
this.emit('data', { type: parsed.type, data: parsed.data });
327309
} else {
328-
debug('DECRYPTED DATA RECEIVED 2', decryptedData);
329310
this.emit('data', {
330311
type: decryptedData.type,
331312
data: decryptedData.data
@@ -339,8 +320,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
339320
}
340321

341322
onClose(peerID, data) {
342-
console.log('onClose'); // todo remove dev item
343-
debugStages('WRTC MAYBE CLOSE');
323+
debugStages('WRTC onClose event');
344324
debug('peerID', peerID);
345325
if (!this.isAlive()) {
346326
debugStages('WRTC CLOSE', data);
@@ -354,8 +334,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
354334
}
355335

356336
onError(peerID, err) {
357-
console.log('onError'); // todo remove dev item
358-
debugStages('WRTC ERROR');
337+
debugStages('WRTC onError event');
359338
debug('peerID', peerID);
360339
debug(err.code);
361340
debug('error', err);

‎src/connectClient/initiator/MewConnectInitiator.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const debug = debugLogger('MEWconnect:initiator-base');
1414
const debugPeer = debugLogger('MEWconnectVerbose:peer-instances');
1515
const debugStages = debugLogger('MEWconnect:initiator-stages');
1616
const logger = createLogger('MewConnectInitiator');
17+
const debugConnectionState = debugLogger('MEWconnect:connection-state');
1718

1819
export default class MewConnectInitiator extends MewConnectCommon {
1920
constructor(options = {}) {
@@ -45,16 +46,12 @@ export default class MewConnectInitiator extends MewConnectCommon {
4546
this.iceState = '';
4647
this.turnServers = [];
4748

48-
// this.Peer = options.wrtc || SimplePeer; //WebRTCConnection
49-
// this.Peer = SimplePeer;
5049
this.mewCrypto = options.cryptoImpl || MewConnectCrypto.create();
5150
this.webRtcCommunication = new WebRtcCommunication(this.mewCrypto);
5251
this.popupCreator = new PopUpCreator();
53-
this.popUpWindow = {};
54-
this.connPath = '';
55-
console.log(MewConnectInitiator.getConnectionState()); // todo remove dev item
52+
53+
debugConnectionState('Initial Connection State:', MewConnectInitiator.getConnectionState());
5654
this.version = this.jsonDetails.version;
57-
// this.versions = this.jsonDetails.versions;
5855
this.lifeCycle = this.jsonDetails.lifeCycle;
5956
this.iceStates = this.jsonDetails.iceConnectionState;
6057
this.stunServers = options.stunServers || this.jsonDetails.stunSrvers;
@@ -131,7 +128,7 @@ export default class MewConnectInitiator extends MewConnectCommon {
131128

132129
// can be used to listen to specific events, especially those that pass data
133130
uiCommunicator(event, data) {
134-
debug('MewConnectInitiator', event, data); // todo remove dev item
131+
debug('MewConnectInitiator event emitted', event);
135132
this.emit(event, data);
136133
this.emitStatus(event);
137134
}
@@ -154,7 +151,6 @@ export default class MewConnectInitiator extends MewConnectCommon {
154151
this.version + separator + privateKey + separator + this.connId;
155152

156153
debug(qrCodeString);
157-
debug(qrCodeString); // todo remove dev item
158154
if (this.showPopup) {
159155
if(this.popupCreator.popupWindowOpen){
160156
this.popupCreator.updateQrCode(qrCodeString)
@@ -210,7 +206,7 @@ Keys
210206
debug('this.signed', this.signed);
211207
}
212208

213-
// TODO change this to handle supplying urls at time point
209+
// TODO change this to use supplied urls at time point
214210
async initiatorStart(url, testPrivate) {
215211
if(this.socketV1Connected){
216212
this.V1.socketDisconnect();
@@ -267,12 +263,11 @@ Keys
267263
this.connected = false;
268264
this.uiCommunicator(this.lifeCycle.RtcDisconnectEvent);
269265
this.webRtcCommunication.disconnectRTC();
270-
// this.V2.disconnectRTC();
271266
this.instance = null;
272267
}
273268

274269
async rtcSend(arg) {
275-
this.webRtcCommunication.rtcSend(arg);
270+
await this.webRtcCommunication.rtcSend(arg);
276271
}
277272

278273
sendRtcMessage(type, data) {

‎src/connectClient/initiator/MewConnectInitiatorV1_V2.js

-908
This file was deleted.

‎src/connectClient/initiator/MewConnectInitiatorV1_prior.js

-348
This file was deleted.

‎src/connectClient/initiator/MewConnectInitiatorV2.js

+2-30
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
4242

4343
this.webRtcCommunication = options.webRtcCommunication;
4444

45-
// this.Peer = options.wrtc || SimplePeer; //WebRTCConnection
46-
// this.webRtcCommunication = new WebRtcCommunication();
47-
// this.mewCrypto = options.crypto || MewConnectCrypto.create();
4845
this.socket = new WebSocket();
49-
// this.io = io;
50-
this.connPath = '';
5146

5247
this.signals = this.jsonDetails.signals;
53-
this.signalsV1 = this.jsonDetails.signalsV1;
5448
this.signals = this.jsonDetails.signalsV2;
5549
this.rtcEvents = this.jsonDetails.rtc;
5650
this.version = this.jsonDetails.version;
@@ -71,7 +65,7 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
7165

7266

7367
this.webRtcCommunication.on('useFallback', () =>{
74-
console.log("TURN ======================================================================"); // todo remove dev item
68+
debug('USING TURN FALLBACK')
7569
this.useFallback();
7670
})
7771

@@ -164,18 +158,11 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
164158
}
165159
}
166160

167-
// async initiatorStart(url, testPrivate) {
168-
// this.generateKeys(testPrivate);
169-
// this.displayCode(this.privateKey);
170-
// this.initiatorStartV1(this.v1Url);
171-
// await this.initiatorStart(this.Url);
172-
// }
173-
174161
async initiatorStart(url = this.Url, cryptoInstance, details = {}) {
175162
this.connId = details.connId;
176163
this.signed = details.signed;
177164
try {
178-
debug('initiatorStart V2'); // todo remove dev item
165+
debug('initiatorStart V2');
179166
this.mewCrypto = cryptoInstance;
180167
this.uiCommunicator(this.lifeCycle.signatureCheck);
181168
await this.connect(url);
@@ -185,23 +172,8 @@ export default class MewConnectInitiatorV2 extends MewConnectCommon {
185172
debug('initiatorStart error:', e);
186173
}
187174
}
188-
189-
// beginRtcSequence(source, data) {
190-
// if (source === '') {
191-
// this.connPath = '';
192-
// this.socketV1Disconnect();
193-
// this.beginRtcSequence(data);
194-
// } else if (source === 'V1') {
195-
// this.connPath = 'V1';
196-
// this.socketDisconnect();
197-
// this.beginRtcSequence(data);
198-
// }
199-
// }
200-
201175
async connect(websocketURL, options = null) {
202176
try {
203-
// if (!websocketURL)
204-
// websocketURL =
205177
if (typeof jest !== 'undefined' && this.connId === null) {
206178
// for tests only
207179
// this.generateKeys();

‎src/connectProvider/change.svg

-15
This file was deleted.

‎src/connectProvider/images/index.js

-7
This file was deleted.

‎src/connectProvider/images/logoImage.js

-3
This file was deleted.

‎src/connectProvider/images/refreshIcon.js

-3
This file was deleted.

‎src/connectProvider/index.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import url from 'url';
88
import EventEmitter from 'events';
99
import EventNames from './web3Provider/web3-provider/events';
1010
import { Transaction } from 'ethereumjs-tx';
11-
import BigNumber from 'bignumber.js';
12-
import * as unit from 'ethjs-unit';
11+
1312
import parseTokensData from './web3Provider/helpers/parseTokensData';
13+
import debugLogger from 'debug';
14+
15+
const debugConnectionState = debugLogger('MEWconnect:connection-state');
1416

1517
const state = {
1618
wallet: null
@@ -34,11 +36,6 @@ export default class Integration {
3436
}
3537

3638

37-
38-
showNotice() {
39-
this.popUpHandler.showPopupWindow('lksdfsdfsdfsdfsdfsdfsdfsfsfdsf');
40-
}
41-
4239
showNotifier() {
4340
this.popUpHandler.showNotice('connected', { border: 'rgba(5, 158, 135, 0.88) solid 2px' });
4441

@@ -48,8 +45,6 @@ export default class Integration {
4845
if(MEWconnectWallet.getConnectionState() === 'disconnected' && this.returnPromise === null){
4946
this.returnPromise = this.enabler();
5047
}
51-
console.log(MEWconnectWallet.getConnectionState()); // todo remove dev item
52-
console.log(this.returnPromise); // todo remove dev item
5348
return this.returnPromise;
5449
}
5550

@@ -58,10 +53,12 @@ export default class Integration {
5853
if (!state.wallet && MEWconnectWallet.getConnectionState() === 'disconnected' ) {
5954
MEWconnectWallet.setConnectionState('connecting');
6055
this.connectionState = 'connecting';
56+
debugConnectionState(MEWconnectWallet.getConnectionState());
6157
state.wallet = await new MEWconnectWallet(state);
6258
this.popUpHandler.showNotice('connected', { border: 'rgba(5, 158, 135, 0.88) solid 2px' });
6359
this.popUpHandler.hideNotifier();
64-
this.disconnectNotifier();
60+
this.createDisconnectNotifier();
61+
debugConnectionState(MEWconnectWallet.getConnectionState());
6562
}
6663

6764
if (state.web3 && state.wallet) {
@@ -122,9 +119,9 @@ export default class Integration {
122119
return web3Provider;
123120
}
124121

125-
disconnectNotifier() {
122+
createDisconnectNotifier() {
126123
const connection = state.wallet.getConnection();
127-
console.log(connection); // todo remove dev item
124+
debugConnectionState(MEWconnectWallet.getConnectionState());
128125
connection.webRtcCommunication.on(connection.lifeCycle.RtcDisconnectEvent, () => {
129126
this.popUpHandler.showNotice('disconnected');
130127
MEWconnectWallet.setConnectionState('disconnected');

‎src/connectProvider/logo.png

-8.16 KB
Binary file not shown.

‎src/connectProvider/style.css

-70
This file was deleted.

‎src/connectProvider/web3Provider/MEWconnect/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import { hashPersonalMessage } from 'ethereumjs-util';
1313
import errorHandler from './errorHandler';
1414
import commonGenerator from '../helpers/commonGenerator';
1515
import Misc from '../helpers/misc';
16+
import debugLogger from 'debug';
17+
18+
// TODO add debug logging
19+
const debug = debugLogger('MEWconnect:popup-window');
20+
const debugConnectionState = debugLogger('MEWconnect:connection-state');
1621

1722
const V1_SIGNAL_URL = 'https://connect.mewapi.io';
1823
const V2_SIGNAL_URL = 'wss://connect2.mewapi.io/staging';

‎src/connectProvider/windowStyles.js

-105
This file was deleted.

‎src/connectWindow/popUpCreator.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import QrCode from 'qrcode';
22
import {logo, refresh} from './images';
33
import { cssStyles, htmlDesign, noticetext, windowInformer } from './popupWindowDesign';
4+
import debugLogger from 'debug';
45

6+
// TODO add debug logging
7+
const debug = debugLogger('MEWconnect:popup-window');
8+
const debugConnectionState = debugLogger('MEWconnect:connection-state');
9+
10+
debug
511
export default class PopUpCreator {
6-
constructor(linkUrl) {
12+
constructor() {
713
this.sessionId = '';
814
this.sessionId = false;
915
this.logo = logo;
@@ -114,7 +120,6 @@ export default class PopUpCreator {
114120

115121
const channel = new BroadcastChannel('refresh-channel');
116122
channel.addEventListener('message', (event) => {
117-
console.log(event.data); // todo remove dev item
118123
this.refreshQrcode();
119124
});
120125
this.popupWindowOpen = true;
@@ -123,7 +128,6 @@ export default class PopUpCreator {
123128

124129
updateQrCode(qrcode){
125130
const element = this.popupWindow.document.getElementById('canvas');
126-
console.log(element); // todo remove dev item
127131
QrCode.toCanvas(element, qrcode, { errorCorrectionLevel: 'H', width: 200 });
128132
}
129133

‎src/connectWindow/popUpHandler.js

+9-26
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import {logo, refresh} from '../connectProvider/images';
2-
import { notifierCSS, WindowInformerCSS } from './popupStyles';
3-
import { windowPopup, windowInformer, noticeHtml } from './popupHtml';
4-
import cssStyles from '../connectProvider/windowStyles';
5-
import debugLogger from 'debug';
1+
import {logo} from './images';
2+
import { notifierCSS } from './popupStyles';
3+
import { noticeHtml } from './popupHtml';
4+
// import debugLogger from 'debug';
65

7-
8-
const debug = debugLogger('MEWconnect:popup-handler');
6+
// TODO add debug logging
7+
// const debug = debugLogger('MEWconnect:popup-handler');
98

109
export default class PopUpHandler {
1110
constructor() {
@@ -14,7 +13,6 @@ export default class PopUpHandler {
1413
this.elementId = 'mew-connect-notice';
1514
this.initialcheckIfIdExists();
1615
this.createNotice();
17-
this.createWindowInformer();
1816
this.styleDefaults = {};
1917
this.timeoutTracker = null;
2018
}
@@ -131,27 +129,12 @@ export default class PopUpHandler {
131129
});
132130
}
133131

134-
createWindowInformer() {
135-
this.index++;
136-
137-
const css = document.createElement('style');
138-
css.type = 'text/css';
139-
if ('textContent' in css)
140-
css.textContent = WindowInformerCSS;
141-
else
142-
css.innerText = WindowInformerCSS;
143-
document.body.appendChild(css);
144-
const div = window.document.createElement('div');
145-
div.id = 'Notifications';
146-
div.className = 'hidden';
147-
148-
div.innerHTML = windowInformer;
149-
window.document.body.appendChild(div);
150-
}
151132

152133
hideNotifier() {
153134
const notify = document.getElementById('Notifications');
154-
notify.className = 'hidden';
135+
if(notify){
136+
notify.className = 'hidden';
137+
}
155138
}
156139

157140
}

‎src/connectWindow/popupStyles.js

+1-52
Original file line numberDiff line numberDiff line change
@@ -497,58 +497,7 @@ const WindowInformerCSS = `
497497
opacity: 0.6;
498498
}
499499
`;
500-
501-
const innerHTML = `
502-
<div class="_WalletLinkNotification _WalletLinkNotificationShow _WalletLinkNotificationExpand">
503-
<div class="_WalletLinkNotificationBox">
504-
<div class="_WalletLinkNotificationContent">
505-
<div class="_WalletLinkNotificationMessage">Requesting to connect to your wallet...</div>
506-
<img
507-
src="data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.5539 10.4174C16.8027 10.16 16.8027 9.75167 16.5539 9.49423C16.2928 9.22408 15.8598 9.22405 15.5987 9.49415L13.2753 11.8974C12.874 12.3125 12.6734 12.5201 12.4404 12.5975C12.2357 12.6655 12.0144 12.6655 11.8096 12.5975C11.5766 12.52 11.376 12.3125 10.9747 11.8974L8.6513 9.49406C8.39018 9.22396 7.9572 9.22399 7.69612 9.49413C7.44731 9.75158 7.44731 10.1599 7.69612 10.4173L10.9745 13.8096C11.3759 14.2249 11.5766 14.4325 11.8095 14.51C12.0144 14.5781 12.2357 14.5781 12.4405 14.51C12.6735 14.4325 12.8742 14.2249 13.2756 13.8096L16.5539 10.4174Z' fill='%23050F19'/%3E%3C/svg%3E%0A"
508-
alt="Expand" class="_WalletLinkNotificationChevron"></div>
509-
<div class="_WalletLinkNotificationProgressBar"></div>
510-
<div class="_WalletLinkNotificationActions">
511-
<div class="_WalletLinkNotificationAction"><span
512-
class="_WalletLinkNotificationButtonInfo _WalletLinkNotificationButtonInfo1">Don’t see the popup?</span>
513-
<button class="_WalletLinkNotificationButton _WalletLinkNotificationButton1">Show
514-
window
515-
</button>
516-
</div>
517-
<div class="_WalletLinkNotificationAction"><span
518-
class="_WalletLinkNotificationButtonInfo _WalletLinkNotificationButtonInfo2">Made a mistake?</span>
519-
<button class="_WalletLinkNotificationButton _WalletLinkNotificationButton2">Cancel
520-
</button>
521-
</div>
522-
</div>
523-
</div>
524-
</div>
525-
<div class="_WalletLinkNotification _WalletLinkNotificationShow _WalletLinkNotificationExpand">
526-
<div class="_WalletLinkNotificationBox">
527-
<div class="_WalletLinkNotificationContent">
528-
<div class="_WalletLinkNotificationMessage">Requesting to connect to your wallet...</div>
529-
<img
530-
src="data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.5539 10.4174C16.8027 10.16 16.8027 9.75167 16.5539 9.49423C16.2928 9.22408 15.8598 9.22405 15.5987 9.49415L13.2753 11.8974C12.874 12.3125 12.6734 12.5201 12.4404 12.5975C12.2357 12.6655 12.0144 12.6655 11.8096 12.5975C11.5766 12.52 11.376 12.3125 10.9747 11.8974L8.6513 9.49406C8.39018 9.22396 7.9572 9.22399 7.69612 9.49413C7.44731 9.75158 7.44731 10.1599 7.69612 10.4173L10.9745 13.8096C11.3759 14.2249 11.5766 14.4325 11.8095 14.51C12.0144 14.5781 12.2357 14.5781 12.4405 14.51C12.6735 14.4325 12.8742 14.2249 13.2756 13.8096L16.5539 10.4174Z' fill='%23050F19'/%3E%3C/svg%3E%0A"
531-
alt="Expand" class="_WalletLinkNotificationChevron"></div>
532-
<div class="_WalletLinkNotificationProgressBar"></div>
533-
<div class="_WalletLinkNotificationActions">
534-
<div class="_WalletLinkNotificationAction"><span
535-
class="_WalletLinkNotificationButtonInfo _WalletLinkNotificationButtonInfo1">Don’t see the popup?</span>
536-
<button class="_WalletLinkNotificationButton _WalletLinkNotificationButton1">Show
537-
window
538-
</button>
539-
</div>
540-
<div class="_WalletLinkNotificationAction"><span
541-
class="_WalletLinkNotificationButtonInfo _WalletLinkNotificationButtonInfo2">Made a mistake?</span>
542-
<button class="_WalletLinkNotificationButton _WalletLinkNotificationButton2">Cancel
543-
</button>
544-
</div>
545-
</div>
546-
</div>
547-
</div>
548-
</div>
549-
`;
550500
export {
551501
notifierCSS,
552-
WindowInformerCSS,
553-
innerHTML
502+
WindowInformerCSS
554503
};

‎web/example/app/src/App.vue

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<template>
22
<div id="app">
33

4-
<ul>
5-
<li>
6-
<h2>connector</h2>
7-
<button @click="onClick">OPEN</button>
8-
<h3>{{userAddress}}</h3>
9-
</li>
10-
</ul>
4+
<h2>MEW connect client library example</h2>
5+
<button @click="onClick">CONNECT</button>
6+
<h3>{{userAddress}}</h3>
7+
118
<ul v-show="userAddress !== ''">
129
<li>
1310
<button @click="disconnect">Disconnect</button>
@@ -64,13 +61,15 @@
6461
<button @click="createSubscription">createSubscription</button>
6562
</li>
6663
</ul>
67-
68-
<button @click="animate">animate</button>
64+
<br>
65+
<hr style="width: 50%">
66+
<h6> The two buttons below show the various windows and notification types that occur. They are
67+
for display only and use dummy data.</h6>
6968
<p>
70-
<button @click="animateDirect">animate direct</button>
69+
<button @click="animateDirect">Display popup window</button>
7170
</p>
7271
<p>
73-
<button @click="animateNotifier">animate notifier</button>
72+
<button @click="animateNotifier">Display action notifier</button>
7473
</p>
7574
</div>
7675
</template>
@@ -272,7 +271,6 @@ export default {
272271
text-align: center;
273272
color: #2c3e50;
274273
margin-top: 60px;
275-
/*background-color: #2c3e50;*/
276274
}
277275
278276

0 commit comments

Comments
 (0)
Please sign in to comment.