Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed Sep 4, 2024
2 parents 59dffc8 + 69bb844 commit d95fe19
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0


- [Added restore provider after page reload](https://github.com/multiversx/mx-sdk-dapp-core/pull/19)
- [Added signMessage](https://github.com/multiversx/mx-sdk-dapp-core/pull/18)

## [[0.0.0-alpha.9]](https://github.com/multiversx/mx-sdk-dapp-core)] - 2024-08-29
- [CrossWindow login](https://github.com/multiversx/mx-sdk-dapp-core/pull/13)

## [[v0.0.0-alpha.8]](https://github.com/multiversx/mx-sdk-dapp-core/pull/16) - 2024-08-27
- [Added sdk-web-wallet-cross-window-provider as peer dependency](https://github.com/multiversx/mx-sdk-dapp-core/pull/14)
- [Generic login + ExtensionProvider login](https://github.com/multiversx/mx-sdk-dapp-core/pull/12)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@multiversx/sdk-metamask-provider": "0.0.5",
"@multiversx/sdk-native-auth-client": "^1.0.8",
"@multiversx/sdk-opera-provider": "1.0.0-alpha.1",
"@multiversx/sdk-wallet": "^4.5.1",
"@multiversx/sdk-wallet": "4.5.1",
"@multiversx/sdk-wallet-connect-provider": "4.1.2",
"@multiversx/sdk-web-wallet-provider": "3.2.1",
"@types/lodash": "^4.17.4",
Expand Down
48 changes: 48 additions & 0 deletions src/core/methods/initApp/initApp.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { StorageCallback } from 'store/storage';
import { CustomNetworkType } from 'types/network.types';
import { EnvironmentsEnum } from 'types/enums.types';
import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types';

type BaseDappConfigType = {
/**
* The native auth configuration for the dApp.
* If set to `true`, will fallback on default configuration.
* If set to `false`, will disable native auth.
* If set to `NativeAuthConfigType`, will set the native auth configuration.
*/
nativeAuth?: boolean | NativeAuthConfigType;
};

export type EnvironmentDappConfigType = BaseDappConfigType & {
/**
* If passed in, will automatically initialize the network with the given environment.
*/
environment: EnvironmentsEnum;
network?: CustomNetworkType;
};

export type CustomNetworkDappConfigType = BaseDappConfigType & {
/**
* Can override the network configuration, e.g. for sovereign shards.
* Must include `apiAddress` if provided.
*/
network: CustomNetworkType & { apiAddress: string };
environment?: never;
};

export type DappConfigType =
| EnvironmentDappConfigType
| CustomNetworkDappConfigType;

export type InitAppType = {
/**
* The storage configuration for the dApp.
*/
storage?: {
/**
* The callback to get the storage (custom storage).
*/
getStorageCallback: StorageCallback;
};
dAppConfig: DappConfigType;
};
1 change: 1 addition & 0 deletions src/core/methods/login/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async function loginWithNativeToken(
signature,
nativeAuthToken
});

loginAction({
address,
providerType: provider.getType()
Expand Down
7 changes: 0 additions & 7 deletions src/core/methods/signMessage/signMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Nullable } from 'types';
import { getAddress } from '../account/getAddress';
import { addOriginToLocationPath } from 'utils/window/addOriginToLocationPath';
import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types';
import { log } from 'console';

export interface SignMessageType {
message: string;
Expand All @@ -25,12 +24,6 @@ export const signMessage = async ({
const provider = getAccountProvider();
const providerType = getProviderType(provider);

console.log('signMessage', providerType, provider);

const providerAddress = await provider?.getAddress?.();

console.log('providerAddress', providerAddress);

const callbackUrl = addOriginToLocationPath(callbackRoute);
const signableMessage = new SignableMessage({
address: new Address(address),
Expand Down
4 changes: 1 addition & 3 deletions src/store/actions/network/initializeNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type InitializeNetworkPropsType = {
export const initializeNetwork = async ({
customNetworkConfig = {},
environment
}: InitializeNetworkPropsType): Promise<NetworkType> => {
}: InitializeNetworkPropsType) => {
const fetchConfigFromServer = !customNetworkConfig?.skipFetchFromServer;
const customNetworkApiAddress = customNetworkConfig?.apiAddress;

Expand Down Expand Up @@ -55,10 +55,8 @@ export const initializeNetwork = async ({
};

initializeNetworkConfig(apiConfig);
return apiConfig;
}
}

initializeNetworkConfig(localConfig);
return localConfig;
};

0 comments on commit d95fe19

Please sign in to comment.