Skip to content

Commit

Permalink
Merge pull request #34 from multiversx/development
Browse files Browse the repository at this point in the history
v2.1.0 (#31)
  • Loading branch information
arhtudormorar authored Oct 21, 2024
2 parents f8b98b1 + 1d43fab commit 3c9d8fe
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 378 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[2.1.0](https://github.com/multiversx/mx-sdk-dapp-swap/pull/34)] - 2024-10-21
- [Upgrade sdk-dapp](https://github.com/multiversx/mx-sdk-dapp-swap/pull/31)

## [[2.0.0](https://github.com/multiversx/mx-sdk-dapp-swap/pull/33)] - 2024-10-18

- [Fixes balances not updating on authenticated change. Many other fixes.](https://github.com/multiversx/mx-sdk-dapp-swap/pull/32)
Expand Down
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp-swap",
"version": "2.0.0",
"version": "2.1.0",
"description": "A library to hold the main logic for swapping between tokens on the MultiversX blockchain",
"author": "MultiversX",
"license": "GPL-3.0-or-later",
Expand All @@ -25,8 +25,11 @@
"test:watch": "jest --watch"
},
"devDependencies": {
"@multiversx/sdk-core": "13.1.0",
"@multiversx/sdk-dapp": "2.32.5",
"@apollo/client": ">=3.8.6",
"graphql": ">=16.9.0",
"@multiversx/sdk-network-providers": ">=2.8.0",
"@multiversx/sdk-core": ">=13.5.0",
"@multiversx/sdk-dapp": ">=3.0.0",
"@size-limit/preset-small-lib": "7.0.8",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "13.3.0",
Expand Down Expand Up @@ -86,10 +89,13 @@
"transaction"
],
"peerDependencies": {
"@multiversx/sdk-core": ">=12.18.0",
"@multiversx/sdk-dapp": ">=2.28.0",
"@multiversx/sdk-core": ">=13.5.0",
"@multiversx/sdk-dapp": ">=3.0.0",
"@apollo/client": ">=3.8.6",
"@multiversx/sdk-network-providers": ">=2.8.0",
"react": ">=18",
"react-dom": ">=18"
"react-dom": ">=18",
"graphql": ">=16.9.0"
},
"optionalDependencies": {
"classnames": "2.3.1",
Expand All @@ -98,13 +104,10 @@
"react-tooltip": "4.2.21"
},
"dependencies": {
"@apollo/client": "3.11.8",
"@multiversx/sdk-network-providers": "2.2.1",
"anchorme": "2.1.2",
"bech32": "2.0.0",
"bignumber.js": "9.x",
"formik": "2.2.9",
"graphql": "15.5.0",
"sass": "1.54.0",
"yup": "0.32.11"
}
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useLazyQueryWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState } from 'react';
import {
DocumentNode,
useApolloClient,
QueryHookOptions,
LazyQueryHookOptions
} from '@apollo/client';
import { useAuthorizationContext } from 'components/SwapAuthorizationProvider';

export const useLazyQueryWrapper = <TData>({
query,
Expand All @@ -13,7 +13,7 @@ export const useLazyQueryWrapper = <TData>({
query: DocumentNode;
queryOptions?: QueryHookOptions<TData>;
}) => {
const apolloClient = useApolloClient();
const { client } = useAuthorizationContext();
const [isLoading, setIsLoading] = useState<boolean>();
const [isError, setIsError] = useState<boolean>();
const [error, setError] = useState<string>();
Expand All @@ -25,7 +25,7 @@ export const useLazyQueryWrapper = <TData>({
try {
setIsLoading(true);

const response = await apolloClient.query<TData>({
const response = await client?.query<TData>({
query,
variables
});
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useQueryWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useCallback, useEffect } from 'react';
import { useQuery, DocumentNode, QueryHookOptions } from '@apollo/client';
import { useAuthorizationContext } from 'components/SwapAuthorizationProvider';
import { POLLING_INTERVAL } from 'constants/index';
import { useIsPageVisible } from 'hooks';

Expand All @@ -17,6 +18,7 @@ export const useQueryWrapper = <TData>({
queryOptions?: QueryHookOptions<TData>;
}) => {
const isPageVisible = useIsPageVisible();
const { client } = useAuthorizationContext();

const {
error,
Expand All @@ -28,6 +30,7 @@ export const useQueryWrapper = <TData>({
startPolling,
...rest
} = useQuery<TData>(query, {
client,
notifyOnNetworkStatusChange: true,
fetchPolicy: 'no-cache', // used for first run
nextFetchPolicy: 'no-cache', // used for subsequent runs
Expand Down
Loading

0 comments on commit 3c9d8fe

Please sign in to comment.