From 02b1f58d44a04e53f0c195862b06832c658cfc67 Mon Sep 17 00:00:00 2001 From: cipriandraghici Date: Tue, 3 Sep 2024 17:34:05 +0300 Subject: [PATCH] updates according to new sdk-dapp-utils changes --- package-lock.json | 10 +++++----- package.json | 4 ++-- src/CrossWindowProvider/CrossWindowProvider.ts | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index f5e8d76..ab54775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@multiversx/sdk-core": ">= 13.5.0", - "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.5", + "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.6", "@types/node": "18.19.0", "@typescript-eslint/eslint-plugin": "5.0.0", "@typescript-eslint/parser": "5.14.0", @@ -38,7 +38,7 @@ }, "peerDependencies": { "@multiversx/sdk-core": ">= 13.5.0", - "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.5" + "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.6" } }, "node_modules/@ampproject/remapping": { @@ -1095,9 +1095,9 @@ } }, "node_modules/@multiversx/sdk-dapp-utils": { - "version": "0.2.0-alpha.5", - "resolved": "http://localhost:4873/@multiversx/sdk-dapp-utils/-/sdk-dapp-utils-0.2.0-alpha.5.tgz", - "integrity": "sha512-CGiq8QT9NqBJGxSSvAgEDJHvw0iMNdgyqWogTfKBzyMfa5tzRFwd/N1qwM5RbNf7lJLuZwwKdWKcA0Nrc3qgpg==", + "version": "0.2.0-alpha.6", + "resolved": "http://localhost:4873/@multiversx/sdk-dapp-utils/-/sdk-dapp-utils-0.2.0-alpha.6.tgz", + "integrity": "sha512-x5Zah7edSNZ7j7gvfagfo/lnrhkKiOzt0zOA0/f9c2fzm8cRdXmx07GP8As5mqr3gOeQ/dhLdd58dS1gYqY1Qg==", "dev": true, "peerDependencies": { "@multiversx/sdk-core": ">= 13.5.0" diff --git a/package.json b/package.json index ecd0c66..50b972f 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "license": "GPL-3.0-or-later", "devDependencies": { "@multiversx/sdk-core": ">= 13.5.0", - "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.5", + "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.6", "@types/node": "18.19.0", "@typescript-eslint/eslint-plugin": "5.0.0", "@typescript-eslint/parser": "5.14.0", @@ -41,7 +41,7 @@ }, "peerDependencies": { "@multiversx/sdk-core": ">= 13.5.0", - "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.5" + "@multiversx/sdk-dapp-utils": ">= 0.2.0-alpha.6" }, "dependencies": { "@types/jest": "^29.5.11", diff --git a/src/CrossWindowProvider/CrossWindowProvider.ts b/src/CrossWindowProvider/CrossWindowProvider.ts index dc7c2b8..48aaa67 100644 --- a/src/CrossWindowProvider/CrossWindowProvider.ts +++ b/src/CrossWindowProvider/CrossWindowProvider.ts @@ -91,7 +91,7 @@ export class CrossWindowProvider implements IDAppProviderBase { throw new ErrProviderNotInitialized(); } - const isRelogin = await this.isConnected(); + const isRelogin = this.isConnected(); if (isRelogin) { const { address, signature, multisig, impersonate } = this.account; @@ -164,11 +164,11 @@ export class CrossWindowProvider implements IDAppProviderBase { return this.account?.address ?? ''; } - isInitialized(): boolean { + isInitialized = (): boolean => { return this.initialized; - } + }; - async isConnected(): Promise { + isConnected(): boolean { return Boolean(this.account.address); }