Skip to content

Commit

Permalink
Update getAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed Nov 25, 2024
1 parent 7a60e9f commit 68a270e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/core/methods/account/getIsLoggedIn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { isLoggedInSelector } from 'store/selectors/accountSelectors';
import { getAddress } from './getAddress';
import { getState } from 'store/store';

export function getIsLoggedIn() {
Expand Down
11 changes: 5 additions & 6 deletions src/core/providers/DappProvider/helpers/logout/logout.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { storage } from 'storage';
import { localStorageKeys } from 'storage/local';
import { getAddress } from '../../../../methods/account/getAddress';
import { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider';
import { logoutAction } from 'store/actions/sharedActions/sharedActions';
import { getAccountProvider } from 'core/providers/accountProvider';
import { getAddress } from 'core/methods/account/getAddress';
import { getProviderType } from 'core/providers/helpers/utils';
import {
IProvider,
ProviderTypeEnum
} from 'core/providers/types/providerFactory.types';
import { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider';
import { storage } from 'storage';
import { localStorageKeys } from 'storage/local';
import { logoutAction } from 'store/actions/sharedActions/sharedActions';

const broadcastLogoutAcrossTabs = (address: string) => {
const storedData = storage.local?.getItem(localStorageKeys.logoutEvent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Message, Address } from '@multiversx/sdk-core';
import { getAddress } from 'core/methods/account/getAddress';
import { getProviderType } from 'core/providers/helpers/utils';
import { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider';
import { Nullable } from 'types';
import {
IProvider,
ProviderTypeEnum
} from 'core/providers/types/providerFactory.types';
import { getAddress } from 'core/methods/account/getAddress';
import { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider';
import { Nullable } from 'types';

export type SignMessageType = {
provider: IProvider;
Expand Down
22 changes: 11 additions & 11 deletions src/core/providers/ProviderFactory.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { IframeLoginTypes } from '@multiversx/sdk-web-wallet-iframe-provider/out/constants';
import { SECOND_LOGIN_ATTEMPT_ERROR } from 'constants/errorMessages.constants';
import { getAddress } from 'core/methods/account/getAddress';
import { getIsLoggedIn } from 'core/methods/account/getIsLoggedIn';
import { setProviderType } from 'store/actions/loginInfo/loginInfoActions';
import { setAccountProvider } from './accountProvider';
import { DappProvider } from './DappProvider/DappProvider';
import { createCrossWindowProvider } from './helpers/crossWindow/createCrossWindowProvider';
import { createExtensionProvider } from './helpers/extension/createExtensionProvider';
import { createIframeProvider } from './helpers/iframe/createIframeProvider';
import { createLedgerProvider } from './helpers/ledger/createLedgerProvider';
import {
IProvider,
IProviderFactory,
ProviderTypeEnum
} from './types/providerFactory.types';
import { createLedgerProvider } from './helpers/ledger/createLedgerProvider';
import { createCrossWindowProvider } from './helpers/crossWindow/createCrossWindowProvider';
import { createExtensionProvider } from './helpers/extension/createExtensionProvider';
import { createIframeProvider } from './helpers/iframe/createIframeProvider';
import { IframeLoginTypes } from '@multiversx/sdk-web-wallet-iframe-provider/out/constants';
import { getIsLoggedIn } from 'core/methods/account/getIsLoggedIn';
import { getAddress } from 'core/methods/account/getAddress';
import { SECOND_LOGIN_ATTEMPT_ERROR } from 'constants/errorMessages.constants';
import { setAccountProvider } from './accountProvider';
import { setProviderType } from 'store/actions/loginInfo/loginInfoActions';
import { DappProvider } from './DappProvider/DappProvider';

export class ProviderFactory {
public async create({
Expand Down
6 changes: 3 additions & 3 deletions src/core/providers/helpers/restoreProvider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getAddress } from 'core/methods/account/getAddress';
import { providerTypeSelector } from 'store/selectors';
import { ProviderFactory } from '../ProviderFactory';
import { IProviderConfig } from '../types/providerFactory.types';
import { getState } from 'store/store';
import { setAccountProvider } from '../accountProvider';
import { getAddress } from 'core/methods/account/getAddress';
import { ProviderFactory } from '../ProviderFactory';
import { IProviderConfig } from '../types/providerFactory.types';

export async function restoreProvider() {
const type = providerTypeSelector(getState());
Expand Down
2 changes: 1 addition & 1 deletion src/utils/account/refreshAccount.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getAddress } from 'core/methods/account/getAddress';
import { fetchAccount } from './fetchAccount';
import { getLatestNonce } from 'core/methods/account/getLatestNonce';
import { getAccountProvider } from 'core/providers/accountProvider';
import { setAccount } from 'store/actions';
import { fetchAccount } from './fetchAccount';

const setNewAccount = async () => {
try {
Expand Down

0 comments on commit 68a270e

Please sign in to comment.