diff --git a/apps/explorer/tsconfig.json b/apps/explorer/tsconfig.json index 213c874c4..d5aff9e2e 100644 --- a/apps/explorer/tsconfig.json +++ b/apps/explorer/tsconfig.json @@ -8,10 +8,11 @@ "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, + "noPropertyAccessFromIndexSignature": false, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "lib": ["es5", "es6", "dom", "dom.iterable"] + "lib": ["es5", "es6", "dom", "dom.iterable"], + "resolveJsonModule": true }, "files": [], "include": [], diff --git a/apps/token/src/components/transactions-modal/transactions-modal.tsx b/apps/token/src/components/transactions-modal/transactions-modal.tsx index 23b5232c7..57acc30e6 100644 --- a/apps/token/src/components/transactions-modal/transactions-modal.tsx +++ b/apps/token/src/components/transactions-modal/transactions-modal.tsx @@ -1,4 +1,4 @@ -import type { TxData } from '@vegaprotocol/smart-contracts-sdk'; +import type { TxData } from '@vegaprotocol/smart-contracts'; import { Dialog, EtherscanLink } from '@vegaprotocol/ui-toolkit'; import React from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/apps/token/src/config/ethereum.ts b/apps/token/src/config/ethereum.ts index 62d603843..f9f7e8e0f 100644 --- a/apps/token/src/config/ethereum.ts +++ b/apps/token/src/config/ethereum.ts @@ -1,8 +1,8 @@ -import type { EthereumChainId } from '@vegaprotocol/smart-contracts-sdk'; +import type { EthereumChainId } from '@vegaprotocol/smart-contracts'; import { EnvironmentConfig, EthereumChainIds, -} from '@vegaprotocol/smart-contracts-sdk'; +} from '@vegaprotocol/smart-contracts'; import type { Networks } from './vega'; diff --git a/apps/token/src/contexts/app-state/app-state-context.ts b/apps/token/src/contexts/app-state/app-state-context.ts index f0fa92853..1f4af80a3 100644 --- a/apps/token/src/contexts/app-state/app-state-context.ts +++ b/apps/token/src/contexts/app-state/app-state-context.ts @@ -1,4 +1,4 @@ -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; import React from 'react'; import type { BigNumber } from '../../lib/bignumber'; diff --git a/apps/token/src/contexts/contracts/contracts-context.ts b/apps/token/src/contexts/contracts/contracts-context.ts index 81751498c..d5ec9bc67 100644 --- a/apps/token/src/contexts/contracts/contracts-context.ts +++ b/apps/token/src/contexts/contracts/contracts-context.ts @@ -5,7 +5,7 @@ import type { VegaStaking, ERC20Token, VegaVesting, -} from '@vegaprotocol/smart-contracts-sdk'; +} from '@vegaprotocol/smart-contracts'; import React from 'react'; export interface ContractsContextShape { diff --git a/apps/token/src/contexts/contracts/contracts-provider.tsx b/apps/token/src/contexts/contracts/contracts-provider.tsx index 2904056fd..3fc6bd745 100644 --- a/apps/token/src/contexts/contracts/contracts-provider.tsx +++ b/apps/token/src/contexts/contracts/contracts-provider.tsx @@ -1,11 +1,11 @@ -import type { TxData } from '@vegaprotocol/smart-contracts-sdk'; +import type { TxData } from '@vegaprotocol/smart-contracts'; import { VegaClaim, VegaErc20Bridge, VegaStaking, ERC20Token, VegaVesting, -} from '@vegaprotocol/smart-contracts-sdk'; +} from '@vegaprotocol/smart-contracts'; import { Splash } from '@vegaprotocol/ui-toolkit'; import { useWeb3React } from '@web3-react/core'; import uniqBy from 'lodash/uniqBy'; diff --git a/apps/token/src/hooks/__mocks__/tranches-mock.ts b/apps/token/src/hooks/__mocks__/tranches-mock.ts index 8627e2221..c943db27b 100644 --- a/apps/token/src/hooks/__mocks__/tranches-mock.ts +++ b/apps/token/src/hooks/__mocks__/tranches-mock.ts @@ -1,6 +1,6 @@ import parseJSON from 'date-fns/parseJSON'; import { BigNumber } from '../../lib/bignumber'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; const json: Tranche[] = [ { @@ -71,7 +71,7 @@ const json: Tranche[] = [ ], withdrawals: [], total_tokens: new BigNumber('112323.67'), - withdrawn_tokens: '0', + withdrawn_tokens: new BigNumber('0'), remaining_tokens: new BigNumber('112323.67'), }, ], @@ -254,7 +254,7 @@ const json: Tranche[] = [ ], withdrawals: [], total_tokens: new BigNumber('44499.2'), - withdrawn_tokens: '0', + withdrawn_tokens: new BigNumber('0'), remaining_tokens: new BigNumber('44499.2'), }, { @@ -373,7 +373,7 @@ const json: Tranche[] = [ ], withdrawals: [], total_tokens: new BigNumber('1104995.291'), - withdrawn_tokens: '0', + withdrawn_tokens: new BigNumber('0'), remaining_tokens: new BigNumber('1104995.291'), }, { diff --git a/apps/token/src/hooks/__mocks__/use-tranches.ts b/apps/token/src/hooks/__mocks__/use-tranches.ts index 92ff1fbc4..42afaf090 100644 --- a/apps/token/src/hooks/__mocks__/use-tranches.ts +++ b/apps/token/src/hooks/__mocks__/use-tranches.ts @@ -1,7 +1,7 @@ import React from 'react'; import { useContracts } from '../../contexts/contracts/contracts-context'; import mock from './tranches-mock'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; export function useTranches() { const { vesting } = useContracts(); diff --git a/apps/token/src/hooks/use-get-association-breakdown.ts b/apps/token/src/hooks/use-get-association-breakdown.ts index ca836ab3f..ae12a6419 100644 --- a/apps/token/src/hooks/use-get-association-breakdown.ts +++ b/apps/token/src/hooks/use-get-association-breakdown.ts @@ -1,9 +1,6 @@ import React from 'react'; import * as Sentry from '@sentry/react'; -import type { - VegaStaking, - VegaVesting, -} from '@vegaprotocol/smart-contracts-sdk'; +import type { VegaStaking, VegaVesting } from '@vegaprotocol/smart-contracts'; import { AppStateActionType, diff --git a/apps/token/src/hooks/use-get-user-tranche-balances.ts b/apps/token/src/hooks/use-get-user-tranche-balances.ts index 56787d39c..65d996d28 100644 --- a/apps/token/src/hooks/use-get-user-tranche-balances.ts +++ b/apps/token/src/hooks/use-get-user-tranche-balances.ts @@ -1,6 +1,6 @@ import React from 'react'; import * as Sentry from '@sentry/react'; -import type { VegaVesting } from '@vegaprotocol/smart-contracts-sdk'; +import type { VegaVesting } from '@vegaprotocol/smart-contracts'; import { AppStateActionType, diff --git a/apps/token/src/hooks/use-tranches.ts b/apps/token/src/hooks/use-tranches.ts index e91f57754..b1bca1045 100644 --- a/apps/token/src/hooks/use-tranches.ts +++ b/apps/token/src/hooks/use-tranches.ts @@ -1,5 +1,5 @@ import { useFetch } from '@vegaprotocol/react-helpers'; -import type { Networks, Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Networks, Tranche } from '@vegaprotocol/smart-contracts'; import React, { useEffect } from 'react'; import { APP_ENV } from '../config'; diff --git a/apps/token/src/index.html b/apps/token/src/index.html index 992a6a47a..bc6c9003f 100644 --- a/apps/token/src/index.html +++ b/apps/token/src/index.html @@ -17,8 +17,14 @@ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ --> + Vega Token dApp - diff --git a/apps/token/src/lib/__mocks__/generate-tranche.ts b/apps/token/src/lib/__mocks__/generate-tranche.ts index de4919d2a..76faefdf0 100644 --- a/apps/token/src/lib/__mocks__/generate-tranche.ts +++ b/apps/token/src/lib/__mocks__/generate-tranche.ts @@ -1,4 +1,4 @@ -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; import { BigNumber } from '../bignumber'; diff --git a/apps/token/src/routes/claim/claim-flow.tsx b/apps/token/src/routes/claim/claim-flow.tsx index 91fc101c3..a59330f3d 100644 --- a/apps/token/src/routes/claim/claim-flow.tsx +++ b/apps/token/src/routes/claim/claim-flow.tsx @@ -1,10 +1,10 @@ import * as Sentry from '@sentry/react'; -import { UNSPENT_CODE } from '@vegaprotocol/smart-contracts-sdk'; +import { UNSPENT_CODE } from '@vegaprotocol/smart-contracts'; import { format } from 'date-fns'; import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; import { KeyValueTable, KeyValueTableRow } from '@vegaprotocol/ui-toolkit'; import { useContracts } from '../../contexts/contracts/contracts-context'; diff --git a/apps/token/src/routes/claim/claim-info.tsx b/apps/token/src/routes/claim/claim-info.tsx index df693e5c7..19b225824 100644 --- a/apps/token/src/routes/claim/claim-info.tsx +++ b/apps/token/src/routes/claim/claim-info.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next'; import { format } from 'date-fns'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; import { DATE_FORMAT_LONG } from '../../lib/date-formats'; diff --git a/apps/token/src/routes/claim/claim-reducer.ts b/apps/token/src/routes/claim/claim-reducer.ts index 9d80f876d..b4aa544a8 100644 --- a/apps/token/src/routes/claim/claim-reducer.ts +++ b/apps/token/src/routes/claim/claim-reducer.ts @@ -1,6 +1,6 @@ import { BigNumber } from '../../lib/bignumber'; import { addDecimal } from '../../lib/decimals'; -import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts-sdk'; +import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts'; export enum ClaimStatus { Ready, diff --git a/apps/token/src/routes/claim/claim.tsx b/apps/token/src/routes/claim/claim.tsx index bae890aa4..a36bc7067 100644 --- a/apps/token/src/routes/claim/claim.tsx +++ b/apps/token/src/routes/claim/claim.tsx @@ -13,7 +13,7 @@ import { initialClaimState, } from './claim-reducer'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; const Claim = ({ address, diff --git a/apps/token/src/routes/claim/hooks.ts b/apps/token/src/routes/claim/hooks.ts index ed97ce6cf..6ea6eee60 100644 --- a/apps/token/src/routes/claim/hooks.ts +++ b/apps/token/src/routes/claim/hooks.ts @@ -1,6 +1,6 @@ import { useContracts } from '../../contexts/contracts/contracts-context'; import { useTransaction } from '../../hooks/use-transaction'; -import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts-sdk'; +import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts'; export const useClaim = (claimData: IClaimTokenParams, address: string) => { const claimArgs = { diff --git a/apps/token/src/routes/claim/targeted-claim/targeted-claim.tsx b/apps/token/src/routes/claim/targeted-claim/targeted-claim.tsx index 8fe2bffb6..59b038517 100644 --- a/apps/token/src/routes/claim/targeted-claim/targeted-claim.tsx +++ b/apps/token/src/routes/claim/targeted-claim/targeted-claim.tsx @@ -1,4 +1,4 @@ -import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts-sdk'; +import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts'; import { FormGroup } from '@vegaprotocol/ui-toolkit'; import React from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/apps/token/src/routes/claim/untargeted-claim/untargeted-claim.tsx b/apps/token/src/routes/claim/untargeted-claim/untargeted-claim.tsx index 27be4d38f..39106fa41 100644 --- a/apps/token/src/routes/claim/untargeted-claim/untargeted-claim.tsx +++ b/apps/token/src/routes/claim/untargeted-claim/untargeted-claim.tsx @@ -1,4 +1,4 @@ -import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts-sdk'; +import type { IClaimTokenParams } from '@vegaprotocol/smart-contracts'; import { FormGroup } from '@vegaprotocol/ui-toolkit'; import { BigNumber } from '../../../lib/bignumber'; import React from 'react'; diff --git a/apps/token/src/routes/home/token-details/token-details-circulating.test.ts b/apps/token/src/routes/home/token-details/token-details-circulating.test.ts index 1ac742460..7184c4dae 100644 --- a/apps/token/src/routes/home/token-details/token-details-circulating.test.ts +++ b/apps/token/src/routes/home/token-details/token-details-circulating.test.ts @@ -1,6 +1,6 @@ import { BigNumber } from '../../../lib/bignumber'; import { sumCirculatingTokens } from './token-details-circulating'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; test('It sums some easy tranches correctly', () => { const tranches: Partial[] = [ diff --git a/apps/token/src/routes/home/token-details/token-details-circulating.tsx b/apps/token/src/routes/home/token-details/token-details-circulating.tsx index 6d856273c..2416b01be 100644 --- a/apps/token/src/routes/home/token-details/token-details-circulating.tsx +++ b/apps/token/src/routes/home/token-details/token-details-circulating.tsx @@ -1,6 +1,6 @@ import { BigNumber } from '../../../lib/bignumber'; import { formatNumber } from '../../../lib/format-number'; -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; /** * Add together the circulating tokens from all tranches diff --git a/apps/token/src/routes/redemption/redemption-reducer.ts b/apps/token/src/routes/redemption/redemption-reducer.ts index 5fd374285..690c9b9be 100644 --- a/apps/token/src/routes/redemption/redemption-reducer.ts +++ b/apps/token/src/routes/redemption/redemption-reducer.ts @@ -1,4 +1,4 @@ -import type { Tranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; import type { BigNumber } from '../../lib/bignumber'; export interface TrancheBalance { diff --git a/apps/token/src/routes/tranches/tranche.tsx b/apps/token/src/routes/tranches/tranche.tsx index bd5216201..72daa2d2f 100644 --- a/apps/token/src/routes/tranches/tranche.tsx +++ b/apps/token/src/routes/tranches/tranche.tsx @@ -1,4 +1,4 @@ -import type { Tranche as ITranche } from '@vegaprotocol/smart-contracts-sdk'; +import type { Tranche as ITranche } from '@vegaprotocol/smart-contracts'; import { useWeb3React } from '@web3-react/core'; import React from 'react'; import { useTranslation } from 'react-i18next'; @@ -75,8 +75,10 @@ export const Tranche = () => { {tranche.users.length ? (