chore(utils,react-helpers,data-provider): remove apollo deps from ui-toolkit (#3626)
This commit is contained in:
parent
40d2e033e0
commit
72821dd183
@ -12,7 +12,10 @@ import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|||||||
import type { RowClickedEvent } from 'ag-grid-community';
|
import type { RowClickedEvent } from 'ag-grid-community';
|
||||||
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { ProposalStateMapping } from '@vegaprotocol/types';
|
import { ProposalStateMapping } from '@vegaprotocol/types';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { ProposalsTable } from '../../components/proposals/proposals-table';
|
import { ProposalsTable } from '../../components/proposals/proposals-table';
|
||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
@ -4,7 +4,7 @@ import { marketsProvider } from '@vegaprotocol/market-list';
|
|||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { MarketsTable } from '../../components/markets/markets-table';
|
import { MarketsTable } from '../../components/markets/markets-table';
|
||||||
|
|
||||||
export const MarketsPage = () => {
|
export const MarketsPage = () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParametersTable } from './network-parameters';
|
import { NetworkParametersTable } from './network-parameters';
|
||||||
|
|
||||||
describe('NetworkParametersTable', () => {
|
describe('NetworkParametersTable', () => {
|
||||||
|
@ -13,8 +13,8 @@ import {
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
import orderBy from 'lodash/orderBy';
|
import orderBy from 'lodash/orderBy';
|
||||||
import { useNetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import { useNetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { useScrollToLocation } from '../../hooks/scroll-to-location';
|
import { useScrollToLocation } from '../../hooks/scroll-to-location';
|
||||||
import { useDocumentTitle } from '../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../hooks/use-document-title';
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ import type { MockedResponse } from '@apollo/client/testing';
|
|||||||
import { MockedProvider } from '@apollo/client/testing';
|
import { MockedProvider } from '@apollo/client/testing';
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { ProposalRejectionReason, ProposalState } from '@vegaprotocol/types';
|
import { ProposalRejectionReason, ProposalState } from '@vegaprotocol/types';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
||||||
import { generateProposal } from '../../test-helpers/generate-proposals';
|
import { generateProposal } from '../../test-helpers/generate-proposals';
|
||||||
import { CurrentProposalStatus } from './current-proposal-status';
|
import { CurrentProposalStatus } from './current-proposal-status';
|
||||||
|
@ -3,8 +3,8 @@ import { generateProposal } from '../../test-helpers/generate-proposals';
|
|||||||
import { Proposal } from './proposal';
|
import { Proposal } from './proposal';
|
||||||
import type { ProposalQuery } from '../../proposal/__generated__/Proposal';
|
import type { ProposalQuery } from '../../proposal/__generated__/Proposal';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/react-helpers', () => ({
|
jest.mock('@vegaprotocol/network-parameters', () => ({
|
||||||
...jest.requireActual('@vegaprotocol/react-helpers'),
|
...jest.requireActual('@vegaprotocol/network-parameters'),
|
||||||
useNetworkParams: jest.fn(() => ({
|
useNetworkParams: jest.fn(() => ({
|
||||||
params: {
|
params: {
|
||||||
governance_proposal_asset_minVoterBalance: '1',
|
governance_proposal_asset_minVoterBalance: '1',
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { ProposalHeader } from '../proposal-detail-header/proposal-header';
|
import { ProposalHeader } from '../proposal-detail-header/proposal-header';
|
||||||
import type { ProposalFieldsFragment } from '../../proposals/__generated__/Proposals';
|
import type { ProposalFieldsFragment } from '../../proposals/__generated__/Proposals';
|
||||||
|
@ -3,8 +3,8 @@ import { BigNumber } from '../../../lib/bignumber';
|
|||||||
import { useProposalNetworkParams } from './use-proposal-network-params';
|
import { useProposalNetworkParams } from './use-proposal-network-params';
|
||||||
import { generateProposal } from '../test-helpers/generate-proposals';
|
import { generateProposal } from '../test-helpers/generate-proposals';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/react-helpers', () => ({
|
jest.mock('@vegaprotocol/network-parameters', () => ({
|
||||||
...jest.requireActual('@vegaprotocol/react-helpers'),
|
...jest.requireActual('@vegaprotocol/network-parameters'),
|
||||||
useNetworkParams: jest.fn(() => ({
|
useNetworkParams: jest.fn(() => ({
|
||||||
params: {
|
params: {
|
||||||
governance_proposal_updateMarket_requiredMajority: '0.1',
|
governance_proposal_updateMarket_requiredMajority: '0.1',
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { BigNumber } from '../../../lib/bignumber';
|
import { BigNumber } from '../../../lib/bignumber';
|
||||||
import type { ProposalFieldsFragment } from '../proposals/__generated__/Proposals';
|
import type { ProposalFieldsFragment } from '../proposals/__generated__/Proposals';
|
||||||
import type { ProposalQuery } from '../proposal/__generated__/Proposal';
|
import type { ProposalQuery } from '../proposal/__generated__/Proposal';
|
||||||
|
@ -28,8 +28,8 @@ jest.mock('../../../contexts/app-state/app-state-context', () => ({
|
|||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/react-helpers', () => ({
|
jest.mock('@vegaprotocol/network-parameters', () => ({
|
||||||
...jest.requireActual('@vegaprotocol/react-helpers'),
|
...jest.requireActual('@vegaprotocol/network-parameters'),
|
||||||
useNetworkParams: jest.fn(() => ({
|
useNetworkParams: jest.fn(() => ({
|
||||||
params: {
|
params: {
|
||||||
governance_proposal_updateMarket_requiredMajority: '0.5',
|
governance_proposal_updateMarket_requiredMajority: '0.5',
|
||||||
|
@ -5,9 +5,9 @@ import { mockWalletContext } from '../../test-helpers/mocks';
|
|||||||
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
||||||
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
||||||
import { MemoryRouter as Router } from 'react-router-dom';
|
import { MemoryRouter as Router } from 'react-router-dom';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import type { MockedResponse } from '@apollo/client/testing';
|
import type { MockedResponse } from '@apollo/client/testing';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/environment', () => ({
|
jest.mock('@vegaprotocol/environment', () => ({
|
||||||
useEnvironment: () => ({
|
useEnvironment: () => ({
|
||||||
|
@ -19,7 +19,10 @@ import { ProposalMinRequirements } from '../../components/shared';
|
|||||||
import { AsyncRenderer, ExternalLink } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Heading } from '../../../../components/heading';
|
import { Heading } from '../../../../components/heading';
|
||||||
import { createDocsLinks } from '@vegaprotocol/utils';
|
import { createDocsLinks } from '@vegaprotocol/utils';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { ProposalUserAction } from '../../components/shared';
|
import { ProposalUserAction } from '../../components/shared';
|
||||||
import { downloadJson } from '../../../../lib/download-json';
|
import { downloadJson } from '../../../../lib/download-json';
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import { mockWalletContext } from '../../test-helpers/mocks';
|
|||||||
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
||||||
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
||||||
import { MemoryRouter as Router } from 'react-router-dom';
|
import { MemoryRouter as Router } from 'react-router-dom';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
import type { MockedResponse } from '@apollo/client/testing';
|
import type { MockedResponse } from '@apollo/client/testing';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/environment', () => ({
|
jest.mock('@vegaprotocol/environment', () => ({
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
createDocsLinks,
|
createDocsLinks,
|
||||||
suitableForSyntaxHighlighter,
|
suitableForSyntaxHighlighter,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { useNetworkParams } from '@vegaprotocol/react-helpers';
|
import { useNetworkParams } from '@vegaprotocol/network-parameters';
|
||||||
import {
|
import {
|
||||||
getClosingTimestamp,
|
getClosingTimestamp,
|
||||||
getEnactmentTimestamp,
|
getEnactmentTimestamp,
|
||||||
|
@ -5,9 +5,9 @@ import { VegaWalletContext } from '@vegaprotocol/wallet';
|
|||||||
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
||||||
import { mockWalletContext } from '../../test-helpers/mocks';
|
import { mockWalletContext } from '../../test-helpers/mocks';
|
||||||
import { ProposeNewAsset } from './propose-new-asset';
|
import { ProposeNewAsset } from './propose-new-asset';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import type { MockedResponse } from '@apollo/client/testing';
|
import type { MockedResponse } from '@apollo/client/testing';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/environment', () => ({
|
jest.mock('@vegaprotocol/environment', () => ({
|
||||||
useEnvironment: () => ({
|
useEnvironment: () => ({
|
||||||
|
@ -9,7 +9,10 @@ import {
|
|||||||
} from '@vegaprotocol/proposals';
|
} from '@vegaprotocol/proposals';
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import {
|
import {
|
||||||
ProposalFormDescription,
|
ProposalFormDescription,
|
||||||
ProposalFormSubheader,
|
ProposalFormSubheader,
|
||||||
|
@ -6,8 +6,8 @@ import { AppStateProvider } from '../../../../contexts/app-state/app-state-provi
|
|||||||
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import type { MockedResponse } from '@apollo/client/testing';
|
import type { MockedResponse } from '@apollo/client/testing';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/environment', () => ({
|
jest.mock('@vegaprotocol/environment', () => ({
|
||||||
useEnvironment: () => ({
|
useEnvironment: () => ({
|
||||||
|
@ -8,7 +8,10 @@ import {
|
|||||||
} from '@vegaprotocol/proposals';
|
} from '@vegaprotocol/proposals';
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import {
|
import {
|
||||||
ProposalFormDescription,
|
ProposalFormDescription,
|
||||||
ProposalFormSubheader,
|
ProposalFormSubheader,
|
||||||
|
@ -10,8 +10,8 @@ import { ProposeRaw } from './propose-raw';
|
|||||||
import { ProposalEventDocument } from '@vegaprotocol/proposals';
|
import { ProposalEventDocument } from '@vegaprotocol/proposals';
|
||||||
import type { ProposalEventSubscription } from '@vegaprotocol/proposals';
|
import type { ProposalEventSubscription } from '@vegaprotocol/proposals';
|
||||||
|
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
const paramsDelay = 20;
|
const paramsDelay = 20;
|
||||||
|
|
||||||
|
@ -10,7 +10,10 @@ import {
|
|||||||
TextArea,
|
TextArea,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { useProposalSubmit } from '@vegaprotocol/proposals';
|
import { useProposalSubmit } from '@vegaprotocol/proposals';
|
||||||
import {
|
import {
|
||||||
ProposalFormSubmit,
|
ProposalFormSubmit,
|
||||||
|
@ -5,9 +5,9 @@ import { VegaWalletContext } from '@vegaprotocol/wallet';
|
|||||||
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
||||||
import { mockWalletContext } from '../../test-helpers/mocks';
|
import { mockWalletContext } from '../../test-helpers/mocks';
|
||||||
import { ProposeUpdateAsset } from './propose-update-asset';
|
import { ProposeUpdateAsset } from './propose-update-asset';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import type { MockedResponse } from '@apollo/client/testing';
|
import type { MockedResponse } from '@apollo/client/testing';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/environment', () => ({
|
jest.mock('@vegaprotocol/environment', () => ({
|
||||||
useEnvironment: () => ({
|
useEnvironment: () => ({
|
||||||
|
@ -8,7 +8,10 @@ import {
|
|||||||
} from '@vegaprotocol/proposals';
|
} from '@vegaprotocol/proposals';
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import {
|
import {
|
||||||
ProposalFormDescription,
|
ProposalFormDescription,
|
||||||
ProposalFormSubheader,
|
ProposalFormSubheader,
|
||||||
|
@ -6,8 +6,8 @@ import { VegaWalletContext } from '@vegaprotocol/wallet';
|
|||||||
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
|
||||||
import { mockWalletContext } from '../../test-helpers/mocks';
|
import { mockWalletContext } from '../../test-helpers/mocks';
|
||||||
import { ProposeUpdateMarket } from './propose-update-market';
|
import { ProposeUpdateMarket } from './propose-update-market';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
import type { ProposalMarketsQueryQuery } from './__generated__/UpdateMarket';
|
import type { ProposalMarketsQueryQuery } from './__generated__/UpdateMarket';
|
||||||
import { ProposalMarketsQueryDocument } from './__generated__/UpdateMarket';
|
import { ProposalMarketsQueryDocument } from './__generated__/UpdateMarket';
|
||||||
import { ProposalState } from '@vegaprotocol/types';
|
import { ProposalState } from '@vegaprotocol/types';
|
||||||
|
@ -9,7 +9,10 @@ import {
|
|||||||
} from '@vegaprotocol/proposals';
|
} from '@vegaprotocol/proposals';
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
import { createDocsLinks, validateJson } from '@vegaprotocol/utils';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import {
|
import {
|
||||||
ProposalFormDescription,
|
ProposalFormDescription,
|
||||||
ProposalFormDownloadJson,
|
ProposalFormDownloadJson,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { NetworkParamsDocument } from '@vegaprotocol/react-helpers';
|
import { NetworkParamsDocument } from '@vegaprotocol/network-parameters';
|
||||||
import type { MockedResponse } from '@apollo/client/testing';
|
import type { MockedResponse } from '@apollo/client/testing';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import type { PubKey } from '@vegaprotocol/wallet';
|
import type { PubKey } from '@vegaprotocol/wallet';
|
||||||
|
|
||||||
export const mockPubkey: PubKey = {
|
export const mockPubkey: PubKey = {
|
||||||
|
@ -12,7 +12,10 @@ import {
|
|||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { createDocsLinks } from '@vegaprotocol/utils';
|
import { createDocsLinks } from '@vegaprotocol/utils';
|
||||||
import { useNetworkParams, NetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
useNetworkParams,
|
||||||
|
NetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { useEpochQuery } from './__generated__/Rewards';
|
import { useEpochQuery } from './__generated__/Rewards';
|
||||||
import { EpochCountdown } from '../../../components/epoch-countdown';
|
import { EpochCountdown } from '../../../components/epoch-countdown';
|
||||||
import { Heading, SubHeading } from '../../../components/heading';
|
import { Heading, SubHeading } from '../../../components/heading';
|
||||||
|
@ -23,7 +23,10 @@ import {
|
|||||||
addDecimal,
|
addDecimal,
|
||||||
removePaginationWrapper,
|
removePaginationWrapper,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { useNetworkParam, NetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
useNetworkParam,
|
||||||
|
NetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { useBalances } from '../../../lib/balances/balances-store';
|
import { useBalances } from '../../../lib/balances/balances-store';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { SubHeading } from '../../../components/heading';
|
import { SubHeading } from '../../../components/heading';
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
WithdrawalsTable,
|
WithdrawalsTable,
|
||||||
} from '@vegaprotocol/withdraws';
|
} from '@vegaprotocol/withdraws';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useDocumentTitle } from '../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../hooks/use-document-title';
|
||||||
import type { RouteChildProps } from '../index';
|
import type { RouteChildProps } from '../index';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { makeDerivedDataProvider } from '@vegaprotocol/utils';
|
import { makeDerivedDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { useState, useMemo, useRef, useCallback } from 'react';
|
import { useState, useMemo, useRef, useCallback } from 'react';
|
||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||||
import { useYesterday, useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useYesterday } from '@vegaprotocol/react-helpers';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import {
|
import {
|
||||||
calcDayVolume,
|
calcDayVolume,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { marketsWithDataProvider } from '@vegaprotocol/market-list';
|
import { marketsWithDataProvider } from '@vegaprotocol/market-list';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Links, Routes } from '../../pages/client-router';
|
import { Links, Routes } from '../../pages/client-router';
|
||||||
import { useGlobalStore } from '../../stores';
|
import { useGlobalStore } from '../../stores';
|
||||||
|
@ -12,12 +12,12 @@ import {
|
|||||||
formatNumberPercentage,
|
formatNumberPercentage,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import { updateGridData } from '@vegaprotocol/react-helpers';
|
||||||
import {
|
import {
|
||||||
NetworkParams,
|
NetworkParams,
|
||||||
useDataProvider,
|
|
||||||
useNetworkParams,
|
useNetworkParams,
|
||||||
updateGridData,
|
} from '@vegaprotocol/network-parameters';
|
||||||
} from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import {
|
import {
|
||||||
AsyncRenderer,
|
AsyncRenderer,
|
||||||
Tab,
|
Tab,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
import { addDecimalsFormatNumber, titlefy } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber, titlefy } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import { useScreenDimensions } from '@vegaprotocol/react-helpers';
|
||||||
import {
|
import {
|
||||||
useDataProvider,
|
useDataProvider,
|
||||||
useScreenDimensions,
|
|
||||||
useThrottledDataProvider,
|
useThrottledDataProvider,
|
||||||
} from '@vegaprotocol/react-helpers';
|
} from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer, ExternalLink, Splash } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, ExternalLink, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { marketProvider, marketDataProvider } from '@vegaprotocol/market-list';
|
import { marketProvider, marketDataProvider } from '@vegaprotocol/market-list';
|
||||||
import { useGlobalStore, usePageTitleStore } from '../../stores';
|
import { useGlobalStore, usePageTitleStore } from '../../stores';
|
||||||
|
@ -20,7 +20,7 @@ import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
|||||||
import type { ColDef } from 'ag-grid-community';
|
import type { ColDef } from 'ag-grid-community';
|
||||||
import { SettlementDateCell } from './settlement-date-cell';
|
import { SettlementDateCell } from './settlement-date-cell';
|
||||||
import { SettlementPriceCell } from './settlement-price-cell';
|
import { SettlementPriceCell } from './settlement-price-cell';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
type SettlementAsset =
|
type SettlementAsset =
|
||||||
|
@ -24,7 +24,8 @@ import { PriceChart } from 'pennant';
|
|||||||
import 'pennant/dist/style.css';
|
import 'pennant/dist/style.css';
|
||||||
import type { Account } from '@vegaprotocol/accounts';
|
import type { Account } from '@vegaprotocol/accounts';
|
||||||
import { accountsDataProvider } from '@vegaprotocol/accounts';
|
import { accountsDataProvider } from '@vegaprotocol/accounts';
|
||||||
import { useDataProvider, useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { Market } from '@vegaprotocol/market-list';
|
import type { Market } from '@vegaprotocol/market-list';
|
||||||
|
|
||||||
const DateRange = {
|
const DateRange = {
|
||||||
|
@ -2,10 +2,8 @@ import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
|||||||
import { useDepositDialog, DepositsTable } from '@vegaprotocol/deposits';
|
import { useDepositDialog, DepositsTable } from '@vegaprotocol/deposits';
|
||||||
import { depositsProvider } from '@vegaprotocol/deposits';
|
import { depositsProvider } from '@vegaprotocol/deposits';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import {
|
import { useBottomPlaceholder } from '@vegaprotocol/react-helpers';
|
||||||
useDataProvider,
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
useBottomPlaceholder,
|
|
||||||
} from '@vegaprotocol/react-helpers';
|
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useRef } from 'react';
|
import { useRef } from 'react';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
} from '@vegaprotocol/withdraws';
|
} from '@vegaprotocol/withdraws';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { VegaWalletContainer } from '../../components/vega-wallet-container';
|
import { VegaWalletContainer } from '../../components/vega-wallet-container';
|
||||||
|
|
||||||
export const WithdrawalsContainer = () => {
|
export const WithdrawalsContainer = () => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
NetworkParams,
|
NetworkParams,
|
||||||
useDataProvider,
|
|
||||||
useNetworkParams,
|
useNetworkParams,
|
||||||
} from '@vegaprotocol/react-helpers';
|
} from '@vegaprotocol/network-parameters';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { MarketData } from '@vegaprotocol/market-list';
|
import type { MarketData } from '@vegaprotocol/market-list';
|
||||||
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import type { RefObject } from 'react';
|
import type { RefObject } from 'react';
|
||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
import { addDecimalsFormatNumber, isNumeric } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber, isNumeric } from '@vegaprotocol/utils';
|
||||||
import { useThrottledDataProvider } from '@vegaprotocol/react-helpers';
|
import { useThrottledDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { PriceCell } from '@vegaprotocol/datagrid';
|
import { PriceCell } from '@vegaprotocol/datagrid';
|
||||||
import { marketDataProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider } from '@vegaprotocol/market-list';
|
||||||
import { THROTTLE_UPDATE_TIME } from '../constants';
|
import { THROTTLE_UPDATE_TIME } from '../constants';
|
||||||
|
@ -2,7 +2,7 @@ import throttle from 'lodash/throttle';
|
|||||||
import type { MarketData, Market } from '@vegaprotocol/market-list';
|
import type { MarketData, Market } from '@vegaprotocol/market-list';
|
||||||
import { marketDataProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider } from '@vegaprotocol/market-list';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
|
@ -2,7 +2,7 @@ import { useCallback, useRef, useState } from 'react';
|
|||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { MarketData } from '@vegaprotocol/market-list';
|
import type { MarketData } from '@vegaprotocol/market-list';
|
||||||
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
|
@ -3,7 +3,7 @@ import type { RefObject } from 'react';
|
|||||||
import { useMarketList } from '@vegaprotocol/market-list';
|
import { useMarketList } from '@vegaprotocol/market-list';
|
||||||
import { positionsDataProvider } from '@vegaprotocol/positions';
|
import { positionsDataProvider } from '@vegaprotocol/positions';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { ExternalLink, Icon, Loader, Popover } from '@vegaprotocol/ui-toolkit';
|
import { ExternalLink, Icon, Loader, Popover } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import {
|
import {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
||||||
import take from 'lodash/take';
|
import take from 'lodash/take';
|
||||||
import * as Types from '@vegaprotocol/types';
|
import * as Types from '@vegaprotocol/types';
|
||||||
|
@ -2,7 +2,8 @@ import React, { useCallback } from 'react';
|
|||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
import { Dialog } from '@vegaprotocol/ui-toolkit';
|
import { Dialog } from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider, useLocalStorage } from '@vegaprotocol/react-helpers';
|
import { useLocalStorage } from '@vegaprotocol/react-helpers';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { activeMarketsProvider } from '@vegaprotocol/market-list';
|
import { activeMarketsProvider } from '@vegaprotocol/market-list';
|
||||||
import * as constants from '../constants';
|
import * as constants from '../constants';
|
||||||
import { RiskNoticeDialog } from './risk-notice-dialog';
|
import { RiskNoticeDialog } from './risk-notice-dialog';
|
||||||
|
@ -34,7 +34,7 @@ import { AnnouncementBanner } from '../components/banner';
|
|||||||
import { AppLoader, DynamicLoader } from '../components/app-loader';
|
import { AppLoader, DynamicLoader } from '../components/app-loader';
|
||||||
import { Navbar } from '../components/navbar';
|
import { Navbar } from '../components/navbar';
|
||||||
import { ENV } from '../lib/config';
|
import { ENV } from '../lib/config';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { activeOrdersProvider, allOrdersProvider } from '@vegaprotocol/orders';
|
import { activeOrdersProvider, allOrdersProvider } from '@vegaprotocol/orders';
|
||||||
import { useTelemetryApproval } from '../lib/hooks/use-telemetry-approval';
|
import { useTelemetryApproval } from '../lib/hooks/use-telemetry-approval';
|
||||||
import {
|
import {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { assetsProvider } from '@vegaprotocol/assets';
|
import { assetsProvider } from '@vegaprotocol/assets';
|
||||||
import { marketsProvider } from '@vegaprotocol/market-list';
|
import { marketsProvider } from '@vegaprotocol/market-list';
|
||||||
|
import { removePaginationWrapper } from '@vegaprotocol/utils';
|
||||||
import {
|
import {
|
||||||
makeDataProvider,
|
makeDataProvider,
|
||||||
makeDerivedDataProvider,
|
makeDerivedDataProvider,
|
||||||
removePaginationWrapper,
|
} from '@vegaprotocol/data-provider';
|
||||||
} from '@vegaprotocol/utils';
|
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import produce from 'immer';
|
import produce from 'immer';
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import {
|
|||||||
screen,
|
screen,
|
||||||
waitFor,
|
waitFor,
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
import * as helpers from '@vegaprotocol/react-helpers';
|
import * as helpers from '@vegaprotocol/data-provider';
|
||||||
import { AccountManager } from './accounts-manager';
|
import { AccountManager } from './accounts-manager';
|
||||||
|
|
||||||
const mockedUseDataProvider = jest.fn();
|
const mockedUseDataProvider = jest.fn();
|
||||||
jest.mock('@vegaprotocol/react-helpers', () => ({
|
jest.mock('@vegaprotocol/data-provider', () => ({
|
||||||
...jest.requireActual('@vegaprotocol/react-helpers'),
|
...jest.requireActual('@vegaprotocol/data-provider'),
|
||||||
useDataProvider: jest.fn(() => mockedUseDataProvider()),
|
useDataProvider: jest.fn(() => mockedUseDataProvider()),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { useRef, useMemo, memo, useCallback } from 'react';
|
import { useRef, useMemo, memo, useCallback } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import {
|
import { useBottomPlaceholder } from '@vegaprotocol/react-helpers';
|
||||||
useDataProvider,
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
useBottomPlaceholder,
|
|
||||||
} from '@vegaprotocol/react-helpers';
|
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import type { AccountFields } from './accounts-data-provider';
|
import type { AccountFields } from './accounts-data-provider';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||||
import { accountsDataProvider } from './accounts-data-provider';
|
import { accountsDataProvider } from './accounts-data-provider';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
|
||||||
interface AssetBalanceProps {
|
interface AssetBalanceProps {
|
||||||
partyId: string;
|
partyId: string;
|
||||||
|
@ -3,9 +3,9 @@ import { addDecimal, truncateByChars } from '@vegaprotocol/utils';
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import {
|
import {
|
||||||
NetworkParams,
|
NetworkParams,
|
||||||
useDataProvider,
|
|
||||||
useNetworkParam,
|
useNetworkParam,
|
||||||
} from '@vegaprotocol/react-helpers';
|
} from '@vegaprotocol/network-parameters';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { Transfer } from '@vegaprotocol/wallet';
|
import type { Transfer } from '@vegaprotocol/wallet';
|
||||||
import { useVegaTransactionStore, useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaTransactionStore, useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { accountsDataProvider } from './accounts-data-provider';
|
import { accountsDataProvider } from './accounts-data-provider';
|
||||||
import type { Account } from './accounts-data-provider';
|
import type { Account } from './accounts-data-provider';
|
||||||
import { getSettlementAccount } from './get-settlement-account';
|
import { getSettlementAccount } from './get-settlement-account';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { accountsDataProvider } from './accounts-data-provider';
|
import { accountsDataProvider } from './accounts-data-provider';
|
||||||
import type { Account } from './accounts-data-provider';
|
import type { Account } from './accounts-data-provider';
|
||||||
import { getMarketAccount } from './get-market-account';
|
import { getMarketAccount } from './get-market-account';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { makeDataProvider } from '@vegaprotocol/utils';
|
import { makeDataProvider, useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
AssetQuery,
|
AssetQuery,
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import { makeDataProvider, makeDerivedDataProvider } from '@vegaprotocol/utils';
|
import {
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
makeDataProvider,
|
||||||
|
makeDerivedDataProvider,
|
||||||
|
} from '@vegaprotocol/data-provider';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AssetsDocument } from './__generated__/Assets';
|
import { AssetsDocument } from './__generated__/Assets';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import type { AssetsQuery } from './__generated__/Assets';
|
import type { AssetsQuery } from './__generated__/Assets';
|
||||||
|
@ -20,7 +20,7 @@ export * from '../market-list/src/lib/markets.mock';
|
|||||||
export * from '../oracles/src/lib/oracle-spec-data-connection.mock';
|
export * from '../oracles/src/lib/oracle-spec-data-connection.mock';
|
||||||
export * from '../orders/src/lib/components/order-data-provider/orders.mock';
|
export * from '../orders/src/lib/components/order-data-provider/orders.mock';
|
||||||
export * from '../positions/src/lib/positions.mock';
|
export * from '../positions/src/lib/positions.mock';
|
||||||
export * from '../react-helpers/src/hooks/network-params.mock';
|
export * from '../network-parameters/src/network-params.mock';
|
||||||
export * from '../react-helpers/src/lib/chain-id.mock';
|
export * from '../wallet/src/connect-dialog/chain-id.mock';
|
||||||
export * from '../trades/src/lib/trades.mock';
|
export * from '../trades/src/lib/trades.mock';
|
||||||
export * from '../withdraws/src/lib/withdrawal.mock';
|
export * from '../withdraws/src/lib/withdrawal.mock';
|
||||||
|
12
libs/data-provider/.babelrc
Normal file
12
libs/data-provider/.babelrc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"@nrwl/react/babel",
|
||||||
|
{
|
||||||
|
"runtime": "automatic",
|
||||||
|
"useBuiltIns": "usage"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"plugins": []
|
||||||
|
}
|
18
libs/data-provider/.eslintrc.json
Normal file
18
libs/data-provider/.eslintrc.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
|
"ignorePatterns": ["!**/*"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.js", "*.jsx"],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
7
libs/data-provider/README.md
Normal file
7
libs/data-provider/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# data-provider
|
||||||
|
|
||||||
|
This library was generated with [Nx](https://nx.dev).
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `nx test data-provider` to execute the unit tests via [Jest](https://jestjs.io).
|
10
libs/data-provider/jest.config.ts
Normal file
10
libs/data-provider/jest.config.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
export default {
|
||||||
|
displayName: 'data-provider',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
transform: {
|
||||||
|
'^.+\\.[tj]sx?$': 'babel-jest',
|
||||||
|
},
|
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
|
coverageDirectory: '../../coverage/libs/data-provider',
|
||||||
|
};
|
4
libs/data-provider/package.json
Normal file
4
libs/data-provider/package.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "@vegaprotocol/data-provider",
|
||||||
|
"version": "0.0.1"
|
||||||
|
}
|
43
libs/data-provider/project.json
Normal file
43
libs/data-provider/project.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"sourceRoot": "libs/data-provider/src",
|
||||||
|
"projectType": "library",
|
||||||
|
"tags": [],
|
||||||
|
"targets": {
|
||||||
|
"build": {
|
||||||
|
"executor": "@nrwl/web:rollup",
|
||||||
|
"outputs": ["{options.outputPath}"],
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/libs/data-provider",
|
||||||
|
"tsConfig": "libs/data-provider/tsconfig.lib.json",
|
||||||
|
"project": "libs/data-provider/package.json",
|
||||||
|
"entryFile": "libs/data-provider/src/index.ts",
|
||||||
|
"external": ["react/jsx-runtime"],
|
||||||
|
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
|
||||||
|
"compiler": "babel",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "libs/data-provider/README.md",
|
||||||
|
"input": ".",
|
||||||
|
"output": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nrwl/linter:eslint",
|
||||||
|
"outputs": ["{options.outputFile}"],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": ["libs/data-provider/**/*.{ts,tsx,js,jsx}"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"executor": "@nrwl/jest:jest",
|
||||||
|
"outputs": ["coverage/libs/data-provider"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "libs/data-provider/jest.config.ts",
|
||||||
|
"passWithNoTests": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@ import type {
|
|||||||
import type { GraphQLErrors } from '@apollo/client/errors';
|
import type { GraphQLErrors } from '@apollo/client/errors';
|
||||||
import type { Subscription } from 'zen-observable-ts';
|
import type { Subscription } from 'zen-observable-ts';
|
||||||
import isEqualWith from 'lodash/isEqualWith';
|
import isEqualWith from 'lodash/isEqualWith';
|
||||||
import { isNotFoundGraphQLError } from './apollo-client';
|
import { isNotFoundGraphQLError } from './helpers';
|
||||||
import type * as Schema from '@vegaprotocol/types';
|
import type * as Schema from '@vegaprotocol/types';
|
||||||
interface UpdateData<Data, Delta> {
|
interface UpdateData<Data, Delta> {
|
||||||
delta?: Delta;
|
delta?: Delta;
|
@ -9,15 +9,6 @@ const isApolloGraphQLError = (
|
|||||||
return !!error && !!(error as ApolloError).graphQLErrors;
|
return !!error && !!(error as ApolloError).graphQLErrors;
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasNotFoundGraphQLErrors = (errors: GraphQLErrors, path?: string[]) => {
|
|
||||||
return errors.some(
|
|
||||||
(e) =>
|
|
||||||
e.extensions &&
|
|
||||||
e.extensions['type'] === NOT_FOUND &&
|
|
||||||
(!path || path.every((item, i) => item === e?.path?.[i]))
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isNotFoundGraphQLError = (
|
export const isNotFoundGraphQLError = (
|
||||||
error: Error | ApolloError | undefined,
|
error: Error | ApolloError | undefined,
|
||||||
path?: string[]
|
path?: string[]
|
||||||
@ -28,5 +19,14 @@ export const isNotFoundGraphQLError = (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hasNotFoundGraphQLErrors = (errors: GraphQLErrors, path?: string[]) => {
|
||||||
|
return errors.some(
|
||||||
|
(e) =>
|
||||||
|
e.extensions &&
|
||||||
|
e.extensions['type'] === NOT_FOUND &&
|
||||||
|
(!path || path.every((item, i) => item === e?.path?.[i]))
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const marketDataErrorPolicyGuard = (errors: GraphQLErrors) =>
|
export const marketDataErrorPolicyGuard = (errors: GraphQLErrors) =>
|
||||||
errors.every((e) => e.message.match(/no market data for market:/i));
|
errors.every((e) => e.message.match(/no market data for market:/i));
|
4
libs/data-provider/src/index.ts
Normal file
4
libs/data-provider/src/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from './use-data-provider';
|
||||||
|
export * from './generic-data-provider';
|
||||||
|
export * from './pagination';
|
||||||
|
export * from './helpers';
|
@ -1,6 +1,5 @@
|
|||||||
import type { IGetRowsParams } from 'ag-grid-community';
|
import type { IGetRowsParams } from 'ag-grid-community';
|
||||||
import type { Load, DerivedPart } from './generic-data-provider';
|
import type { Load, DerivedPart, Node, Edge } from './generic-data-provider';
|
||||||
import type { Node, Edge } from './generic-data-provider';
|
|
||||||
import type { MutableRefObject } from 'react';
|
import type { MutableRefObject } from 'react';
|
||||||
|
|
||||||
const getLastRow = (
|
const getLastRow = (
|
@ -1,7 +1,7 @@
|
|||||||
import { renderHook, act } from '@testing-library/react';
|
import { renderHook, act } from '@testing-library/react';
|
||||||
import { useDataProvider, useThrottledDataProvider } from './use-data-provider';
|
import { useDataProvider, useThrottledDataProvider } from './use-data-provider';
|
||||||
import type { useDataProviderParams } from './use-data-provider';
|
import type { useDataProviderParams } from './use-data-provider';
|
||||||
import type { Subscribe, UpdateCallback } from '@vegaprotocol/utils';
|
import type { Subscribe, UpdateCallback } from './generic-data-provider';
|
||||||
import { MockedProvider } from '@apollo/client/testing';
|
import { MockedProvider } from '@apollo/client/testing';
|
||||||
|
|
||||||
type Data = number;
|
type Data = number;
|
@ -3,8 +3,8 @@ import throttle from 'lodash/throttle';
|
|||||||
import isEqualWith from 'lodash/isEqualWith';
|
import isEqualWith from 'lodash/isEqualWith';
|
||||||
import { useApolloClient } from '@apollo/client';
|
import { useApolloClient } from '@apollo/client';
|
||||||
import type { OperationVariables } from '@apollo/client';
|
import type { OperationVariables } from '@apollo/client';
|
||||||
import type { Subscribe, Load, UpdateCallback } from '@vegaprotocol/utils';
|
import type { Subscribe, Load, UpdateCallback } from './generic-data-provider';
|
||||||
import { variablesIsEqualCustomizer } from '@vegaprotocol/utils';
|
import { variablesIsEqualCustomizer } from './generic-data-provider';
|
||||||
|
|
||||||
export interface useDataProviderParams<
|
export interface useDataProviderParams<
|
||||||
Data,
|
Data,
|
25
libs/data-provider/tsconfig.json
Normal file
25
libs/data-provider/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"allowJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.lib.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
23
libs/data-provider/tsconfig.lib.json
Normal file
23
libs/data-provider/tsconfig.lib.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||||
|
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"jest.config.ts",
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.test.ts",
|
||||||
|
"**/*.spec.tsx",
|
||||||
|
"**/*.test.tsx",
|
||||||
|
"**/*.spec.js",
|
||||||
|
"**/*.test.js",
|
||||||
|
"**/*.spec.jsx",
|
||||||
|
"**/*.test.jsx"
|
||||||
|
],
|
||||||
|
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
|
||||||
|
}
|
20
libs/data-provider/tsconfig.spec.json
Normal file
20
libs/data-provider/tsconfig.spec.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"module": "commonjs",
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"jest.config.ts",
|
||||||
|
"**/*.test.ts",
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.test.tsx",
|
||||||
|
"**/*.spec.tsx",
|
||||||
|
"**/*.test.js",
|
||||||
|
"**/*.spec.js",
|
||||||
|
"**/*.test.jsx",
|
||||||
|
"**/*.spec.jsx",
|
||||||
|
"**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useThrottledDataProvider } from '@vegaprotocol/react-helpers';
|
import { useThrottledDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useVegaTransactionStore } from '@vegaprotocol/wallet';
|
import { useVegaTransactionStore } from '@vegaprotocol/wallet';
|
||||||
import { useMarket, marketDataProvider } from '@vegaprotocol/market-list';
|
import { useMarket, marketDataProvider } from '@vegaprotocol/market-list';
|
||||||
import { DealTicket } from './deal-ticket';
|
import { DealTicket } from './deal-ticket';
|
||||||
|
@ -44,7 +44,7 @@ import {
|
|||||||
|
|
||||||
import { OrderTimeInForce, OrderType } from '@vegaprotocol/types';
|
import { OrderTimeInForce, OrderType } from '@vegaprotocol/types';
|
||||||
import { useOrderForm } from '../../hooks/use-order-form';
|
import { useOrderForm } from '../../hooks/use-order-form';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
|
||||||
import { marketMarginDataProvider } from '@vegaprotocol/positions';
|
import { marketMarginDataProvider } from '@vegaprotocol/positions';
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
useScreenDimensions,
|
useScreenDimensions,
|
||||||
useOutsideClick,
|
useOutsideClick,
|
||||||
useDataProvider,
|
|
||||||
} from '@vegaprotocol/react-helpers';
|
} from '@vegaprotocol/react-helpers';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { IconNames } from '@blueprintjs/icons';
|
import { IconNames } from '@blueprintjs/icons';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { marketDataProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider } from '@vegaprotocol/market-list';
|
||||||
import {
|
import {
|
||||||
|
@ -2,7 +2,7 @@ import { Networks, useEnvironment } from '@vegaprotocol/environment';
|
|||||||
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { DepositManager } from './deposit-manager';
|
import { DepositManager } from './deposit-manager';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { enabledAssetsProvider } from '@vegaprotocol/assets';
|
import { enabledAssetsProvider } from '@vegaprotocol/assets';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import uniqBy from 'lodash/uniqBy';
|
import uniqBy from 'lodash/uniqBy';
|
||||||
import orderBy from 'lodash/orderBy';
|
import orderBy from 'lodash/orderBy';
|
||||||
import {
|
import { getEvents, removePaginationWrapper } from '@vegaprotocol/utils';
|
||||||
getEvents,
|
import { makeDataProvider } from '@vegaprotocol/data-provider';
|
||||||
makeDataProvider,
|
|
||||||
removePaginationWrapper,
|
|
||||||
} from '@vegaprotocol/utils';
|
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import {
|
import {
|
||||||
DepositsDocument,
|
DepositsDocument,
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import produce from 'immer';
|
import produce from 'immer';
|
||||||
import orderBy from 'lodash/orderBy';
|
import orderBy from 'lodash/orderBy';
|
||||||
|
import {} from '@vegaprotocol/utils';
|
||||||
|
import type { PageInfo, Edge } from '@vegaprotocol/data-provider';
|
||||||
import {
|
import {
|
||||||
makeDataProvider,
|
makeDataProvider,
|
||||||
makeDerivedDataProvider,
|
makeDerivedDataProvider,
|
||||||
defaultAppend as append,
|
defaultAppend as append,
|
||||||
paginatedCombineDelta as combineDelta,
|
paginatedCombineDelta as combineDelta,
|
||||||
paginatedCombineInsertionData as combineInsertionData,
|
paginatedCombineInsertionData as combineInsertionData,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/data-provider';
|
||||||
import type { Market } from '@vegaprotocol/market-list';
|
import type { Market } from '@vegaprotocol/market-list';
|
||||||
import { marketsProvider } from '@vegaprotocol/market-list';
|
import { marketsProvider } from '@vegaprotocol/market-list';
|
||||||
import type { PageInfo, Edge } from '@vegaprotocol/utils';
|
|
||||||
import { FillsDocument, FillsEventDocument } from './__generated__/Fills';
|
import { FillsDocument, FillsEventDocument } from './__generated__/Fills';
|
||||||
import type {
|
import type {
|
||||||
FillsQuery,
|
FillsQuery,
|
||||||
|
@ -16,8 +16,8 @@ const mockDataProvider = jest.fn((args) => {
|
|||||||
updateMock = args.update;
|
updateMock = args.update;
|
||||||
return mockDataProviderData;
|
return mockDataProviderData;
|
||||||
});
|
});
|
||||||
jest.mock('@vegaprotocol/react-helpers', () => ({
|
jest.mock('@vegaprotocol/data-provider', () => ({
|
||||||
...jest.requireActual('@vegaprotocol/react-helpers'),
|
...jest.requireActual('@vegaprotocol/data-provider'),
|
||||||
useDataProvider: jest.fn((args) => mockDataProvider(args)),
|
useDataProvider: jest.fn((args) => mockDataProvider(args)),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import type { RefObject } from 'react';
|
import type { RefObject } from 'react';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import { useCallback, useRef } from 'react';
|
import { useCallback, useRef } from 'react';
|
||||||
import { makeInfiniteScrollGetRows } from '@vegaprotocol/utils';
|
import { makeInfiniteScrollGetRows } from '@vegaprotocol/data-provider';
|
||||||
import { useDataProvider, updateGridData } from '@vegaprotocol/react-helpers';
|
import { updateGridData } from '@vegaprotocol/react-helpers';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { Trade, TradeEdge } from './fills-data-provider';
|
import type { Trade, TradeEdge } from './fills-data-provider';
|
||||||
import { fillsWithMarketProvider } from './fills-data-provider';
|
import { fillsWithMarketProvider } from './fills-data-provider';
|
||||||
|
|
||||||
|
@ -2,12 +2,13 @@ import type { Asset } from '@vegaprotocol/assets';
|
|||||||
import { assetsProvider } from '@vegaprotocol/assets';
|
import { assetsProvider } from '@vegaprotocol/assets';
|
||||||
import type { Market } from '@vegaprotocol/market-list';
|
import type { Market } from '@vegaprotocol/market-list';
|
||||||
import { marketsProvider } from '@vegaprotocol/market-list';
|
import { marketsProvider } from '@vegaprotocol/market-list';
|
||||||
|
import { makeInfiniteScrollGetRows } from '@vegaprotocol/data-provider';
|
||||||
|
import { updateGridData } from '@vegaprotocol/react-helpers';
|
||||||
import {
|
import {
|
||||||
makeDataProvider,
|
makeDataProvider,
|
||||||
makeDerivedDataProvider,
|
makeDerivedDataProvider,
|
||||||
makeInfiniteScrollGetRows,
|
useDataProvider,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/data-provider';
|
||||||
import { useDataProvider, updateGridData } from '@vegaprotocol/react-helpers';
|
|
||||||
import type * as Schema from '@vegaprotocol/types';
|
import type * as Schema from '@vegaprotocol/types';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import produce from 'immer';
|
import produce from 'immer';
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import compact from 'lodash/compact';
|
import compact from 'lodash/compact';
|
||||||
import { makeDataProvider, makeDerivedDataProvider } from '@vegaprotocol/utils';
|
import {
|
||||||
|
makeDataProvider,
|
||||||
|
makeDerivedDataProvider,
|
||||||
|
} from '@vegaprotocol/data-provider';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import produce from 'immer';
|
import produce from 'immer';
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import { makeDataProvider, makeDerivedDataProvider } from '@vegaprotocol/utils';
|
import {
|
||||||
import { useDataProvider, useYesterday } from '@vegaprotocol/react-helpers';
|
makeDataProvider,
|
||||||
|
makeDerivedDataProvider,
|
||||||
|
useDataProvider,
|
||||||
|
} from '@vegaprotocol/data-provider';
|
||||||
|
import { useYesterday } from '@vegaprotocol/react-helpers';
|
||||||
import type {
|
import type {
|
||||||
MarketCandles,
|
MarketCandles,
|
||||||
MarketMaybeWithDataAndCandles,
|
MarketMaybeWithDataAndCandles,
|
||||||
|
@ -3,7 +3,8 @@ import throttle from 'lodash/throttle';
|
|||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { addDecimal, getNumberFormat } from '@vegaprotocol/utils';
|
import { addDecimal, getNumberFormat } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider, useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { marketDepthProvider } from './market-depth-provider';
|
import { marketDepthProvider } from './market-depth-provider';
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { makeDataProvider } from '@vegaprotocol/utils';
|
import type { Update } from '@vegaprotocol/data-provider';
|
||||||
|
import { makeDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { updateLevels } from './orderbook-data';
|
import { updateLevels } from './orderbook-data';
|
||||||
import type { Update } from '@vegaprotocol/utils';
|
|
||||||
import { captureException } from '@sentry/react';
|
import { captureException } from '@sentry/react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Orderbook } from './orderbook';
|
import { Orderbook } from './orderbook';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { marketDepthProvider } from './market-depth-provider';
|
import { marketDepthProvider } from './market-depth-provider';
|
||||||
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
import { marketDataProvider, marketProvider } from '@vegaprotocol/market-list';
|
||||||
import type { MarketData } from '@vegaprotocol/market-list';
|
import type { MarketData } from '@vegaprotocol/market-list';
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import type { RefObject } from 'react';
|
import type { RefObject } from 'react';
|
||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
import { isNumeric } from '@vegaprotocol/utils';
|
import { isNumeric } from '@vegaprotocol/utils';
|
||||||
import {
|
import { useYesterday } from '@vegaprotocol/react-helpers';
|
||||||
useThrottledDataProvider,
|
import { useThrottledDataProvider } from '@vegaprotocol/data-provider';
|
||||||
useYesterday,
|
|
||||||
} from '@vegaprotocol/react-helpers';
|
|
||||||
import { PriceChangeCell } from '@vegaprotocol/datagrid';
|
import { PriceChangeCell } from '@vegaprotocol/datagrid';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import type { CandleClose } from '@vegaprotocol/types';
|
import type { CandleClose } from '@vegaprotocol/types';
|
||||||
|
@ -5,10 +5,8 @@ import {
|
|||||||
marketCandlesProvider,
|
marketCandlesProvider,
|
||||||
} from '@vegaprotocol/market-list';
|
} from '@vegaprotocol/market-list';
|
||||||
import { addDecimalsFormatNumber, isNumeric } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber, isNumeric } from '@vegaprotocol/utils';
|
||||||
import {
|
import { useYesterday } from '@vegaprotocol/react-helpers';
|
||||||
useThrottledDataProvider,
|
import { useThrottledDataProvider } from '@vegaprotocol/data-provider';
|
||||||
useYesterday,
|
|
||||||
} from '@vegaprotocol/react-helpers';
|
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { removePaginationWrapper, TokenLinks } from '@vegaprotocol/utils';
|
import { removePaginationWrapper, TokenLinks } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import {
|
import {
|
||||||
Accordion,
|
Accordion,
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
import { makeDataProvider, makeDerivedDataProvider } from '@vegaprotocol/utils';
|
import {
|
||||||
|
makeDataProvider,
|
||||||
|
makeDerivedDataProvider,
|
||||||
|
} from '@vegaprotocol/data-provider';
|
||||||
import type {
|
import type {
|
||||||
MarketInfoQuery,
|
MarketInfoQuery,
|
||||||
MarketInfoQueryVariables,
|
MarketInfoQueryVariables,
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
useOracleProofs,
|
useOracleProofs,
|
||||||
useOracleMarkets,
|
useOracleMarkets,
|
||||||
} from '@vegaprotocol/oracles';
|
} from '@vegaprotocol/oracles';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
|
||||||
type PanelProps = Pick<
|
type PanelProps = Pick<
|
||||||
ComponentProps<typeof MarketInfoTable>,
|
ComponentProps<typeof MarketInfoTable>,
|
||||||
|
@ -52,7 +52,8 @@ jest.mock('@vegaprotocol/environment', () => ({
|
|||||||
useEnvironment: jest.fn((args) => mockEnvironment()),
|
useEnvironment: jest.fn((args) => mockEnvironment()),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('@vegaprotocol/react-helpers', () => ({
|
jest.mock('@vegaprotocol/data-provider', () => ({
|
||||||
|
...jest.requireActual('@vegaprotocol/data-provider'),
|
||||||
useDataProvider: jest.fn((args) => mockDataProvider()),
|
useDataProvider: jest.fn((args) => mockDataProvider()),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { useOracleProofs } from '@vegaprotocol/oracles';
|
import { useOracleProofs } from '@vegaprotocol/oracles';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { marketInfoProvider } from '../components/market-info/market-info-data-provider';
|
import { marketInfoProvider } from '../components/market-info/market-info-data-provider';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import type { AgGridReact } from 'ag-grid-react';
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { MarketListTable } from './market-list-table';
|
import { MarketListTable } from './market-list-table';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { CellClickedEvent } from 'ag-grid-community';
|
import type { CellClickedEvent } from 'ag-grid-community';
|
||||||
import { marketsWithDataProvider as dataProvider } from '../../markets-provider';
|
import { marketsWithDataProvider as dataProvider } from '../../markets-provider';
|
||||||
import type { MarketMaybeWithData } from '../../markets-provider';
|
import type { MarketMaybeWithData } from '../../markets-provider';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { makeDataProvider } from '@vegaprotocol/utils';
|
import { makeDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type {
|
import type {
|
||||||
MarketCandlesQuery,
|
MarketCandlesQuery,
|
||||||
MarketCandlesQueryVariables,
|
MarketCandlesQueryVariables,
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import produce from 'immer';
|
import produce from 'immer';
|
||||||
import { makeDataProvider, makeDerivedDataProvider } from '@vegaprotocol/utils';
|
import {
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
makeDataProvider,
|
||||||
|
makeDerivedDataProvider,
|
||||||
|
} from '@vegaprotocol/data-provider';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import {
|
import {
|
||||||
MarketDataDocument,
|
MarketDataDocument,
|
||||||
MarketDataUpdateDocument,
|
MarketDataUpdateDocument,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { makeDataProvider } from '@vegaprotocol/utils';
|
import { makeDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { MarketsCandlesDocument } from './__generated__/markets-candles';
|
import { MarketsCandlesDocument } from './__generated__/markets-candles';
|
||||||
import type {
|
import type {
|
||||||
MarketsCandlesQuery,
|
MarketsCandlesQuery,
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import {
|
import { marketDataErrorPolicyGuard } from '@vegaprotocol/data-provider';
|
||||||
makeDataProvider,
|
import { makeDataProvider } from '@vegaprotocol/data-provider';
|
||||||
marketDataErrorPolicyGuard,
|
|
||||||
} from '@vegaprotocol/utils';
|
|
||||||
import type { MarketsDataQuery } from './__generated__/markets-data';
|
import type { MarketsDataQuery } from './__generated__/markets-data';
|
||||||
import { MarketsDataDocument } from './__generated__/markets-data';
|
import { MarketsDataDocument } from './__generated__/markets-data';
|
||||||
import type { MarketData } from './market-data-provider';
|
import type { MarketData } from './market-data-provider';
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user