Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.22.5 #956

Merged
merged 6 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ All notable changes will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [[v2.22.5]](https://github.com/multiversx/mx-sdk-dapp/pull/956)] - 2023-10-13

- [Prevent "document/window is undefined" issue on Next.js](https://github.com/multiversx/mx-sdk-dapp/pull/955)
- [Update the WalletConnect provider to 4.0.4 (@walletconnect 2.10.2)](https://github.com/multiversx/mx-sdk-dapp/pull/957)

## [[v2.22.4]](https://github.com/multiversx/mx-sdk-dapp/pull/954)] - 2023-10-13

- [Integration tests](https://github.com/multiversx/mx-sdk-dapp/pull/953)

## [[v2.22.3]](https://github.com/multiversx/mx-sdk-dapp/pull/949)] - 2023-10-12

- [Add used indexes to addressTable component](https://github.com/multiversx/mx-sdk-dapp/pull/948)

## [[v2.22.2]](https://github.com/multiversx/mx-sdk-dapp/pull/947)] - 2023-10-12

- [Added `ESDTNFTBurn` to `getTokenFromData` helper](https://github.com/multiversx/mx-sdk-dapp/pull/946)
- [Added page reload on login redirect](https://github.com/multiversx/mx-sdk-dapp/pull/944)
- [Fixed `ModalContainer` not working in `StrictMode`](https://github.com/multiversx/mx-sdk-dapp/pull/943)

## [[v2.22.1]](https://github.com/multiversx/mx-sdk-dapp/pull/942)] - 2023-10-02

- [Fixed `WebWalletLoginButtonPropsType` interface](https://github.com/multiversx/mx-sdk-dapp/pull/942)

## [[v2.22.0]](https://github.com/multiversx/mx-sdk-dapp/pull/941)] - 2023-10-02

- [Added support for custom Web Wallet address](https://github.com/multiversx/mx-sdk-dapp/pull/940)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp",
"version": "2.22.4",
"version": "2.22.5",
"description": "A library to hold the main logic for a dapp on the MultiversX blockchain",
"author": "MultiversX",
"license": "GPL-3.0-or-later",
Expand Down Expand Up @@ -150,7 +150,7 @@
"@multiversx/sdk-network-providers": "1.5.0",
"@multiversx/sdk-opera-provider": "1.0.0-alpha.1",
"@multiversx/sdk-wallet": "4.2.0",
"@multiversx/sdk-wallet-connect-provider": "4.0.3",
"@multiversx/sdk-wallet-connect-provider": "4.0.4",
"@multiversx/sdk-web-wallet-provider": "3.1.0",
"@reduxjs/toolkit": "1.8.2",
"axios": "0.24.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('ExtensionLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
expect(window?.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
});
});

Expand All @@ -83,7 +83,7 @@ describe('ExtensionLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledWith(
expect(window?.location.assign).toHaveBeenCalledWith(
'https://multivers.com'
);
});
Expand All @@ -108,7 +108,7 @@ describe('ExtensionLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledTimes(0);
expect(window?.location.assign).toHaveBeenCalledTimes(0);
expect(onLoginRedirect).toHaveBeenCalledTimes(1);
expect(onLoginRedirect).toHaveBeenCalledWith(CALLBACK_ROUTE, {
address: testAddress,
Expand Down Expand Up @@ -141,7 +141,7 @@ describe('ExtensionLoginButton tests', () => {
tokenLoginWithSignature
);

expect(window.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
expect(window?.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
});
});

Expand All @@ -164,7 +164,7 @@ describe('ExtensionLoginButton tests', () => {
fireEvent.click(loginButton);

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledTimes(0);
expect(window?.location.assign).toHaveBeenCalledTimes(0);
});
});
});
10 changes: 5 additions & 5 deletions src/UI/ledger/LedgerLoginButton/tests/LedgerLoginButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('LedgerLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
expect(window?.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
});
});

Expand All @@ -78,7 +78,7 @@ describe('LedgerLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledWith(
expect(window?.location.assign).toHaveBeenCalledWith(
'https://multivers.com'
);
});
Expand All @@ -101,7 +101,7 @@ describe('LedgerLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledTimes(0);
expect(window?.location.assign).toHaveBeenCalledTimes(0);
expect(onLoginRedirect).toHaveBeenCalledTimes(1);
expect(onLoginRedirect).toHaveBeenCalledWith(CALLBACK_ROUTE, {
address: testAddress,
Expand Down Expand Up @@ -137,7 +137,7 @@ describe('LedgerLoginButton tests', () => {
tokenLoginWithSignature
);

expect(window.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
expect(window?.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
});
});

Expand All @@ -162,7 +162,7 @@ describe('LedgerLoginButton tests', () => {
await ledgerLogin(methods);

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledTimes(0);
expect(window?.location.assign).toHaveBeenCalledTimes(0);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe.skip('OperaLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
expect(window?.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
});
});
it('should perform simple login and call onLoginRedirect', async () => {
Expand All @@ -73,7 +73,7 @@ describe.skip('OperaLoginButton tests', () => {
await checkIsLoggedInStore();

await waitFor(() => {
expect(window.location.assign).toHaveBeenCalledTimes(0);
expect(window?.location.assign).toHaveBeenCalledTimes(0);
expect(onLoginRedirect).toHaveBeenCalledTimes(1);
});
});
Expand All @@ -92,7 +92,7 @@ describe.skip('OperaLoginButton tests', () => {

await waitFor(() => {
expect(consoleWarnSpy).toHaveBeenCalledWith(tokenLogin);
expect(window.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
expect(window?.location.assign).toHaveBeenCalledWith(CALLBACK_ROUTE);
});
});
it('should not perform nativeAuth login when block call fails', async () => {
Expand Down
4 changes: 4 additions & 0 deletions src/__mocks__/utils/mockWindowHistory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const mockWindowHistory = () => {
if (!window) {
return;
}

const history = window.history;

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
4 changes: 4 additions & 0 deletions src/__mocks__/utils/mockWindowLocation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const mockWindowLocation = () => {
if (!window) {
return;
}

const location = window.location;

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/login/useWebWalletLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const useWebWalletLogin = ({
const targetUrl = window?.location
? `${origin}${callbackRoute}`
: `${callbackRoute}`;
const params = new URLSearchParams(document.location.search);
const params = new URLSearchParams(document?.location.search);

// skip login when an address param is prefilled in URL
const skipLogin = params.get('address');
Expand Down
80 changes: 40 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1971,13 +1971,13 @@
dependencies:
bech32 "^2.0.0"

"@multiversx/[email protected].3":
version "4.0.3"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-wallet-connect-provider/-/sdk-wallet-connect-provider-4.0.3.tgz#98f5dfb6665f58e3affa7c09f281c6ba492d3b3f"
integrity sha512-j48gz0ZBuYAUbEKx3qN2AvwZssNHYASwfng/ek097wgmDEIH8cfeA1ujkN6FF0WMvh8T6bIHtOHKWH3diZ/Fdg==
"@multiversx/[email protected].4":
version "4.0.4"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-wallet-connect-provider/-/sdk-wallet-connect-provider-4.0.4.tgz#4111bc2c1978e4beffd18f146648fec8c73f6d07"
integrity sha512-k+t/M0U1SnHsdLmcbXkoYgA5+R3KJA+h8N4uC026l1fRz8Vo7g3joQoqLi5qSanuc0S+uiInpDyIoq0fbFLUjA==
dependencies:
"@walletconnect/sign-client" "2.9.1"
"@walletconnect/utils" "2.9.1"
"@walletconnect/sign-client" "2.10.2"
"@walletconnect/utils" "2.10.2"
bech32 "1.1.4"

"@multiversx/[email protected]":
Expand Down Expand Up @@ -3972,9 +3972,9 @@
form-data "^4.0.0"

"@types/node@*", "@types/node@>=13.7.0":
version "20.8.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.4.tgz#0e9ebb2ff29d5c3302fc84477d066fa7c6b441aa"
integrity sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==
version "20.8.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.5.tgz#13352ae1f80032171616910e8aba2e3e52e57d96"
integrity sha512-SPlobFgbidfIeOYlzXiEjSYeIJiOCthv+9tSQVpvk4PAdIIc+2SmjNVzWXk9t0Y7dl73Zdf+OgXKHX9XtkqUpw==
dependencies:
undici-types "~5.25.1"

Expand Down Expand Up @@ -4285,10 +4285,10 @@
"@typescript-eslint/types" "5.14.0"
eslint-visitor-keys "^3.0.0"

"@walletconnect/core@2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.9.1.tgz#1a333933750f5f933d9b7788a8dae44ce1173063"
integrity sha512-xyWeP0eLhEEDQAVJSmqs4n/AClKUM+8os2ZFe7BTuw1tFYjeLNVDtKCHziVOSTh8wEChMsKSGKA4zerQoH8mAQ==
"@walletconnect/core@2.10.2":
version "2.10.2"
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.2.tgz#a1bf6e3e87b33f9df795ce0970d8ddd400fdc8a3"
integrity sha512-JQz/xp3SLEpTeRQctdck2ugSBVEpMxoSE+lFi2voJkZop1hv6P+uqr6E4PzjFluAjeAnKlT1xvra0aFWjPWVcw==
dependencies:
"@walletconnect/heartbeat" "1.2.1"
"@walletconnect/jsonrpc-provider" "1.0.13"
Expand All @@ -4301,8 +4301,8 @@
"@walletconnect/relay-auth" "^1.0.4"
"@walletconnect/safe-json" "^1.0.2"
"@walletconnect/time" "^1.0.2"
"@walletconnect/types" "2.9.1"
"@walletconnect/utils" "2.9.1"
"@walletconnect/types" "2.10.2"
"@walletconnect/utils" "2.10.2"
events "^3.3.0"
lodash.isequal "4.5.0"
uint8arrays "^3.1.0"
Expand Down Expand Up @@ -4411,19 +4411,19 @@
dependencies:
tslib "1.14.1"

"@walletconnect/sign-client@2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.9.1.tgz#e4aa9c7b15849f450fdd1b03754a7517cb5c8811"
integrity sha512-Z7tFRrJ9btA1vU427vsjUS6cPlHQVcTWdKH90khEc2lv3dB6mU8FNO0VJsw+I2D7CW7WaMWF3nnj6Z1FfotbDg==
"@walletconnect/sign-client@2.10.2":
version "2.10.2"
resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.10.2.tgz#33300a9cfe42487473f66b73c99535f6b26f8c54"
integrity sha512-vviSLV3f92I0bReX+OLr1HmbH0uIzYEQQFd1MzIfDk9PkfFT/LLAHhUnDaIAMkIdippqDcJia+5QEtT4JihL3Q==
dependencies:
"@walletconnect/core" "2.9.1"
"@walletconnect/core" "2.10.2"
"@walletconnect/events" "^1.0.1"
"@walletconnect/heartbeat" "1.2.1"
"@walletconnect/jsonrpc-utils" "1.0.8"
"@walletconnect/logger" "^2.0.1"
"@walletconnect/time" "^1.0.2"
"@walletconnect/types" "2.9.1"
"@walletconnect/utils" "2.9.1"
"@walletconnect/types" "2.10.2"
"@walletconnect/utils" "2.10.2"
events "^3.3.0"

"@walletconnect/time@^1.0.2":
Expand All @@ -4433,10 +4433,10 @@
dependencies:
tslib "1.14.1"

"@walletconnect/types@2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.9.1.tgz#cb32ff396cc8880a7395f28716d1e82f407e1372"
integrity sha512-xbGgTPuD6xsb7YMvCESBIH55cjB86QAnnVL50a/ED42YkQzDsOdJ0VGTbrm0tG5cxUOF933rpxZQjxGdP+ovww==
"@walletconnect/types@2.10.2":
version "2.10.2"
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.2.tgz#68e433a29ec2cf42d79d8b50c77bd5c1d91db721"
integrity sha512-luNV+07Wdla4STi9AejseCQY31tzWKQ5a7C3zZZaRK/di+rFaAAb7YW04OP4klE7tw/mJRGPTlekZElmHxO8kQ==
dependencies:
"@walletconnect/events" "^1.0.1"
"@walletconnect/heartbeat" "1.2.1"
Expand All @@ -4445,10 +4445,10 @@
"@walletconnect/logger" "^2.0.1"
events "^3.3.0"

"@walletconnect/utils@2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.9.1.tgz#92abc24b3af3ead42a3864e019dbf2f651ab2e47"
integrity sha512-tXeQVebF5oPBvhdmuUyVSkSIBYx/egIi4czav1QrnUpwrUS1LsrFhyWBxSbhN7TXY287ULWkEf6aFpWOHdp5EA==
"@walletconnect/utils@2.10.2":
version "2.10.2"
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.2.tgz#1f2c6a2f1bb95bcc4517b1e94aa7164c9286eb46"
integrity sha512-syxXRpc2yhSknMu3IfiBGobxOY7fLfLTJuw+ppKaeO6WUdZpIit3wfuGOcc0Ms3ZPFCrGfyGOoZsCvgdXtptRg==
dependencies:
"@stablelib/chacha20poly1305" "1.0.1"
"@stablelib/hkdf" "1.0.1"
Expand All @@ -4458,7 +4458,7 @@
"@walletconnect/relay-api" "^1.0.9"
"@walletconnect/safe-json" "^1.0.2"
"@walletconnect/time" "^1.0.2"
"@walletconnect/types" "2.9.1"
"@walletconnect/types" "2.10.2"
"@walletconnect/window-getters" "^1.0.1"
"@walletconnect/window-metadata" "^1.0.1"
detect-browser "5.3.0"
Expand Down Expand Up @@ -6795,9 +6795,9 @@ defaults@^1.0.3:
clone "^1.0.2"

define-data-property@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451"
integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==
version "1.1.1"
resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3"
integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==
dependencies:
get-intrinsic "^1.2.1"
gopd "^1.0.1"
Expand Down Expand Up @@ -7139,9 +7139,9 @@ [email protected]:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@^1.4.535:
version "1.4.551"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.551.tgz#14db6660a88f66ce095ea2657abe5653bc7f42ed"
integrity sha512-/Ng/W/kFv7wdEHYzxdK7Cv0BHEGSkSB3M0Ssl8Ndr1eMiYeas/+Mv4cNaDqamqWx6nd2uQZfPz6g25z25M/sdw==
version "1.4.553"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.553.tgz#56fd65afddbd713c52f0e95d0223b3368f520865"
integrity sha512-HiRdtyKS2+VhiXvjhMvvxiMC33FJJqTA5EB2YHgFZW6v7HkK4Q9Ahv2V7O2ZPgAjw+MyCJVMQvigj13H8t+wvA==

element-resize-detector@^1.2.2:
version "1.2.4"
Expand Down Expand Up @@ -8590,9 +8590,9 @@ fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2:
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
version "1.1.2"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==

function.prototype.name@^1.1.0, function.prototype.name@^1.1.6:
version "1.1.6"
Expand Down