Skip to content

Commit

Permalink
Merge pull request #307 from torusresearch/feat/dynamic-import-broadcast
Browse files Browse the repository at this point in the history
dynamic import of broadcast channel
  • Loading branch information
chaitanyapotti authored Nov 23, 2023
2 parents 6d6d085 + d86586b commit ad8ba9a
Show file tree
Hide file tree
Showing 18 changed files with 2,574 additions and 3,649 deletions.
5,341 changes: 2,074 additions & 3,267 deletions examples/vue-app/package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions examples/vue-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@
"dependencies": {
"@toruslabs/customauth": "file:../..",
"@toruslabs/openlogin-starkkey": "^3.2.0",
"@web3auth/ethereum-provider": "^6.1.7",
"core-js": "^3.32.0",
"daisyui": "^3.5.1",
"@web3auth/ethereum-provider": "^7.1.2",
"core-js": "^3.33.3",
"daisyui": "^4.4.4",
"enc-utils": "^3.0.0",
"vue": "^3.3.4",
"vue-router": "^4.2.4",
"web3": "^1.8.1"
"vue": "^3.3.8",
"vue-router": "^4.2.5",
"web3": "^4.2.2"
},
"devDependencies": {
"@types/elliptic": "^6.4.14",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@types/elliptic": "^6.4.18",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"autoprefixer": "^10.4.14",
"@vue/eslint-config-typescript": "^12.0.0",
"autoprefixer": "^10.4.16",
"color": "^4.2.3",
"eslint": "^8.46.0",
"eslint-plugin-vue": "^9.17.0",
"postcss": "^8.4.27",
"prettier": "^3.0.1",
"eslint": "^8.54.0",
"eslint-plugin-vue": "^9.18.1",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"source-map-loader": "^4.0.1",
"tailwindcss": "^3.3.3",
"typescript": "~5.1.6",
"vue-template-compiler": "^2.7.14"
"tailwindcss": "^3.3.5",
"typescript": "~5.3.2",
"vue-template-compiler": "^2.7.15"
},
"browserslist": [
"supports bigint",
Expand Down
8 changes: 4 additions & 4 deletions examples/vue-app/public/serviceworker/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
<h1 class="title content" id="closeText" style="display: none">You can close this window now</h1>
</div>
<script
src="https://scripts.toruswallet.io/broadcastChannel_9_0_0.js"
integrity="sha384-nbxq0ciPTNmGeCrATAjgJtLS/hHp33KxBqDFvi9lsOK7eqDNDLiWdUrocSTxW7xp"
src="https://scripts.toruswallet.io/broadcastChannel_9_0_1.js"
integrity="sha384-taBzlN8/+K08+avbr6royzsuqJU0Qoi9tUUnvdiKwHTQ5SV6uef5erTEdV4ojYS9"
crossorigin="anonymous"
></script>
<script>
Expand Down Expand Up @@ -197,10 +197,10 @@ <h1 class="title content" id="closeText" style="display: none">You can close thi
var error = "";
try {
if (Object.keys(hashParams).length > 0 && hashParams.state) {
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
if (hashParams.error) error = hashParams.error;
} else if (Object.keys(queryParams).length > 0 && queryParams.state) {
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
if (queryParams.error) error = queryParams.error;
}
} catch (e) {
Expand Down
8 changes: 4 additions & 4 deletions examples/vue-app/public/serviceworker/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ self.addEventListener("fetch", function (event) {
<h1 class="title content" id="closeText" style="display: none;">You can close this window now</h1>
</div>
<script
src="https://scripts.toruswallet.io/broadcastChannel_9_0_0.js"
integrity="sha384-nbxq0ciPTNmGeCrATAjgJtLS/hHp33KxBqDFvi9lsOK7eqDNDLiWdUrocSTxW7xp"
src="https://scripts.toruswallet.io/broadcastChannel_9_0_1.js"
integrity="sha384-taBzlN8/+K08+avbr6royzsuqJU0Qoi9tUUnvdiKwHTQ5SV6uef5erTEdV4ojYS9"
crossorigin="anonymous"
></script>
<script>
Expand Down Expand Up @@ -217,10 +217,10 @@ self.addEventListener("fetch", function (event) {
var error = "";
try {
if (Object.keys(hashParams).length > 0 && hashParams.state) {
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(hashParams.state)))) || {};
if (hashParams.error) error = hashParams.error;
} else if (Object.keys(queryParams).length > 0 && queryParams.state) {
instanceParams = JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
instanceParams = JSON.parse(base64urlLib.decode(decodeURIComponent(decodeURIComponent(queryParams.state)))) || {};
if (queryParams.error) error = queryParams.error;
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-app/src/services/chainHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const signEthMessage = async (provider: SafeEventEmitterProvider): Promis
// hex message
const message = "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad";
const sign = await web3.eth.sign(message, accounts[0]);
return sign;
return sign as string;
};

export const signTypedData_v1 = async (provider: SafeEventEmitterProvider): Promise<any> => {
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-app/src/views/PopupMode/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default defineComponent({
privKey: privateKey,
});
this.provider = providerInstance.provider;
this.provider = providerInstance;
this.loginResponse = loginDetails;
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-app/src/views/RedirectMode/Auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default defineComponent({
});
this.loginDetails = loginDetails;
setTimeout(() => {
this.provider = providerInstance.provider;
this.provider = providerInstance;
this.console("Login Details", loginDetails);
}, 1000);
},
Expand Down
Loading

0 comments on commit ad8ba9a

Please sign in to comment.