Skip to content

Commit ad8ba9a

Browse files
Merge pull request #307 from torusresearch/feat/dynamic-import-broadcast
dynamic import of broadcast channel
2 parents 6d6d085 + d86586b commit ad8ba9a

File tree

18 files changed

+2574
-3649
lines changed

18 files changed

+2574
-3649
lines changed

examples/vue-app/package-lock.json

Lines changed: 2074 additions & 3267 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/vue-app/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@
1111
"dependencies": {
1212
"@toruslabs/customauth": "file:../..",
1313
"@toruslabs/openlogin-starkkey": "^3.2.0",
14-
"@web3auth/ethereum-provider": "^6.1.7",
15-
"core-js": "^3.32.0",
16-
"daisyui": "^3.5.1",
14+
"@web3auth/ethereum-provider": "^7.1.2",
15+
"core-js": "^3.33.3",
16+
"daisyui": "^4.4.4",
1717
"enc-utils": "^3.0.0",
18-
"vue": "^3.3.4",
19-
"vue-router": "^4.2.4",
20-
"web3": "^1.8.1"
18+
"vue": "^3.3.8",
19+
"vue-router": "^4.2.5",
20+
"web3": "^4.2.2"
2121
},
2222
"devDependencies": {
23-
"@types/elliptic": "^6.4.14",
24-
"@typescript-eslint/eslint-plugin": "^6.3.0",
25-
"@typescript-eslint/parser": "^6.3.0",
23+
"@types/elliptic": "^6.4.18",
24+
"@typescript-eslint/eslint-plugin": "^6.12.0",
25+
"@typescript-eslint/parser": "^6.12.0",
2626
"@vue/cli-plugin-babel": "~5.0.8",
2727
"@vue/cli-plugin-eslint": "~5.0.8",
2828
"@vue/cli-plugin-typescript": "~5.0.8",
2929
"@vue/cli-service": "~5.0.8",
3030
"@vue/eslint-config-prettier": "^8.0.0",
31-
"@vue/eslint-config-typescript": "^11.0.3",
32-
"autoprefixer": "^10.4.14",
31+
"@vue/eslint-config-typescript": "^12.0.0",
32+
"autoprefixer": "^10.4.16",
3333
"color": "^4.2.3",
34-
"eslint": "^8.46.0",
35-
"eslint-plugin-vue": "^9.17.0",
36-
"postcss": "^8.4.27",
37-
"prettier": "^3.0.1",
34+
"eslint": "^8.54.0",
35+
"eslint-plugin-vue": "^9.18.1",
36+
"postcss": "^8.4.31",
37+
"prettier": "^3.1.0",
3838
"source-map-loader": "^4.0.1",
39-
"tailwindcss": "^3.3.3",
40-
"typescript": "~5.1.6",
41-
"vue-template-compiler": "^2.7.14"
39+
"tailwindcss": "^3.3.5",
40+
"typescript": "~5.3.2",
41+
"vue-template-compiler": "^2.7.15"
4242
},
4343
"browserslist": [
4444
"supports bigint",

examples/vue-app/public/serviceworker/redirect.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
<h1 class="title content" id="closeText" style="display: none">You can close this window now</h1>
116116
</div>
117117
<script
118-
src="https://scripts.toruswallet.io/broadcastChannel_9_0_0.js"
119-
integrity="sha384-nbxq0ciPTNmGeCrATAjgJtLS/hHp33KxBqDFvi9lsOK7eqDNDLiWdUrocSTxW7xp"
118+
src="https://scripts.toruswallet.io/broadcastChannel_9_0_1.js"
119+
integrity="sha384-taBzlN8/+K08+avbr6royzsuqJU0Qoi9tUUnvdiKwHTQ5SV6uef5erTEdV4ojYS9"
120120
crossorigin="anonymous"
121121
></script>
122122
<script>
@@ -197,10 +197,10 @@ <h1 class="title content" id="closeText" style="display: none">You can close thi
197197
var error = "";
198198
try {
199199
if (Object.keys(hashParams).length > 0 && hashParams.state) {
200-
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
200+
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
201201
if (hashParams.error) error = hashParams.error;
202202
} else if (Object.keys(queryParams).length > 0 && queryParams.state) {
203-
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
203+
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
204204
if (queryParams.error) error = queryParams.error;
205205
}
206206
} catch (e) {

examples/vue-app/public/serviceworker/sw.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ self.addEventListener("fetch", function (event) {
135135
<h1 class="title content" id="closeText" style="display: none;">You can close this window now</h1>
136136
</div>
137137
<script
138-
src="https://scripts.toruswallet.io/broadcastChannel_9_0_0.js"
139-
integrity="sha384-nbxq0ciPTNmGeCrATAjgJtLS/hHp33KxBqDFvi9lsOK7eqDNDLiWdUrocSTxW7xp"
138+
src="https://scripts.toruswallet.io/broadcastChannel_9_0_1.js"
139+
integrity="sha384-taBzlN8/+K08+avbr6royzsuqJU0Qoi9tUUnvdiKwHTQ5SV6uef5erTEdV4ojYS9"
140140
crossorigin="anonymous"
141141
></script>
142142
<script>
@@ -217,10 +217,10 @@ self.addEventListener("fetch", function (event) {
217217
var error = "";
218218
try {
219219
if (Object.keys(hashParams).length > 0 && hashParams.state) {
220-
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
220+
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
221221
if (hashParams.error) error = hashParams.error;
222222
} else if (Object.keys(queryParams).length > 0 && queryParams.state) {
223-
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
223+
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
224224
if (queryParams.error) error = queryParams.error;
225225
}
226226
} catch (e) {

examples/vue-app/src/services/chainHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const signEthMessage = async (provider: SafeEventEmitterProvider): Promis
77
// hex message
88
const message = "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad";
99
const sign = await web3.eth.sign(message, accounts[0]);
10-
return sign;
10+
return sign as string;
1111
};
1212

1313
export const signTypedData_v1 = async (provider: SafeEventEmitterProvider): Promise<any> => {

examples/vue-app/src/views/PopupMode/Login.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export default defineComponent({
254254
privKey: privateKey,
255255
});
256256
257-
this.provider = providerInstance.provider;
257+
this.provider = providerInstance;
258258
259259
this.loginResponse = loginDetails;
260260

examples/vue-app/src/views/RedirectMode/Auth.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export default defineComponent({
263263
});
264264
this.loginDetails = loginDetails;
265265
setTimeout(() => {
266-
this.provider = providerInstance.provider;
266+
this.provider = providerInstance;
267267
this.console("Login Details", loginDetails);
268268
}, 1000);
269269
},

0 commit comments

Comments
 (0)