diff --git a/apps/explorer-e2e/src/integration/blocks-page.feature b/apps/explorer-e2e/src/integration/blocks-page.feature index 13f528633..f9e6b387d 100644 --- a/apps/explorer-e2e/src/integration/blocks-page.feature +++ b/apps/explorer-e2e/src/integration/blocks-page.feature @@ -28,3 +28,9 @@ Feature: Blocks Page And jump to first block Then previous button is disabled And I am on the second block when I click next + + Scenario: Infinite scroll shows at least 300 new blocks + Given I am on the homepage + When I navigate to the blocks page + And I scroll down to the last block on the page + Then I can expect to see at least 100 blocks if i scroll 7 times \ No newline at end of file diff --git a/apps/explorer-e2e/src/support/pages/blocks-page.ts b/apps/explorer-e2e/src/support/pages/blocks-page.ts index a7290256a..301299de5 100644 --- a/apps/explorer-e2e/src/support/pages/blocks-page.ts +++ b/apps/explorer-e2e/src/support/pages/blocks-page.ts @@ -14,10 +14,10 @@ export default class BlocksPage extends BasePage { nextBlockBtn = 'next-block'; jumpToBlockInput = 'block-input'; jumpToBlockSubmit = 'go-submit'; + infiniteScrollWrapper = 'infinite-scroll-wrapper'; private waitForBlocksResponse() { - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000); + cy.contains('Loading...').should('not.exist', { timeout: 18000 }); } validateBlocksPageDisplayed() { @@ -37,8 +37,6 @@ export default class BlocksPage extends BasePage { validateBlockValidatorPage() { cy.getByTestId(this.minedByValidator).should('not.be.empty'); cy.getByTestId(this.blockTime).should('not.be.empty'); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000); // Wait for transactions to load if there are any cy.get('body').then(($body) => { if ($body.find(`[data-testid=${this.transactionsRow}] > td`).length) { cy.get(`[data-testid=${this.transactionsRow}] > td`).each(($cell) => { @@ -85,6 +83,50 @@ export default class BlocksPage extends BasePage { }); } + navigateToLastBlockOnPage() { + this.waitForBlocksResponse(); + cy.getByTestId(this.infiniteScrollWrapper).children().scrollTo('bottom'); + } + + navigateToOlderBlocksWithInfiniteScroll( + expectedBlocks: number, + scrollAttempts: number + ) { + cy.intercept('*blockchain?maxHeight*').as('blockchain_load'); + + cy.getByTestId(this.blockHeight) + .last() + .invoke('text') + .then(($initialLastBlockHeight) => { + for (let index = 0; index < scrollAttempts; index++) { + cy.getByTestId(this.infiniteScrollWrapper) + .children() + .children() + .invoke('css', 'height') + .then((scrollTarget) => { + cy.getByTestId(this.infiniteScrollWrapper) + .children() + .scrollTo(0, scrollTarget.toString(), { easing: 'linear' }) + .wait('@blockchain_load'); + + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(50); // Need this as although network response has arrived it takes a few millisecs for the css height to expand + }); + } + + cy.getByTestId(this.blockHeight) + .last() + .invoke('text') + .then(($lastBlockHeight) => { + const totalBlocksLoadedSinceScrollBegan = + parseInt($initialLastBlockHeight) - parseInt($lastBlockHeight); + expect(totalBlocksLoadedSinceScrollBegan).to.be.at.least( + expectedBlocks + ); + }); + }); + } + clickPreviousBlock() { cy.getByTestId(this.previousBlockBtn).click(); } diff --git a/apps/explorer-e2e/src/support/step_definitions/blocks-page.step.ts b/apps/explorer-e2e/src/support/step_definitions/blocks-page.step.ts index bd40e908b..99c4f25ce 100644 --- a/apps/explorer-e2e/src/support/step_definitions/blocks-page.step.ts +++ b/apps/explorer-e2e/src/support/step_definitions/blocks-page.step.ts @@ -34,3 +34,17 @@ Then('previous button is disabled', () => { Then('I am on the second block when I click next', () => { blocksPage.navigateToNextBlock(); }); + +Then('I scroll down to the last block on the page', () => { + blocksPage.navigateToLastBlockOnPage(); +}); + +Then( + 'I can expect to see at least {int} blocks if i scroll {int} times', + (expectedBlocks, scrollAttempts) => { + blocksPage.navigateToOlderBlocksWithInfiniteScroll( + expectedBlocks, + scrollAttempts + ); + } +); diff --git a/apps/explorer/.env b/apps/explorer/.env index ae45130a1..0c83efe3e 100644 --- a/apps/explorer/.env +++ b/apps/explorer/.env @@ -18,12 +18,13 @@ NX_URL=$URL NX_DEPLOY_URL=$DEPLOY_URL NX_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL -NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain-explorer-api" -NX_TENDERMINT_URL = "https://lb.testnet.vega.xyz/tm" -NX_TENDERMINT_WEBSOCKET_URL = "wss://lb.testnet.vega.xyz/tm/websocket" -NX_VEGA_URL = "https://lb.testnet.vega.xyz/query" +NX_CHAIN_EXPLORER_URL = 'https://explorer.vega.trading/.netlify/functions/chain-explorer-api' +NX_TENDERMINT_URL = 'https://lb.testnet.vega.xyz/tm' +NX_TENDERMINT_WEBSOCKET_URL = 'wss://lb.testnet.vega.xyz/tm/websocket' +NX_VEGA_URL = 'https://lb.testnet.vega.xyz/query' NX_VEGA_ENV = 'TESTNET' NX_VEGA_REST = 'https://lb.testnet.vega.xyz/datanode/rest' +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' CYPRESS_VEGA_TENDERMINT_URL='https://lb.testnet.vega.xyz/tm' # App flags diff --git a/apps/explorer/.env.capsule b/apps/explorer/.env.capsule index 482d5c699..4589e0022 100644 --- a/apps/explorer/.env.capsule +++ b/apps/explorer/.env.capsule @@ -3,6 +3,7 @@ NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain- NX_TENDERMINT_URL = "http://localhost:26617" NX_TENDERMINT_WEBSOCKET_URL = "wss://localhost:26617/websocket" NX_VEGA_URL = "http://localhost:3028/query" +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV = 'LOCAL' NX_VEGA_REST = 'http://localhost:3029' diff --git a/apps/explorer/.env.devnet b/apps/explorer/.env.devnet index 65b3ce2c0..047a94ad3 100644 --- a/apps/explorer/.env.devnet +++ b/apps/explorer/.env.devnet @@ -3,5 +3,6 @@ NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain- NX_TENDERMINT_URL = "https://n04.d.vega.xyz/tm" NX_TENDERMINT_WEBSOCKET_URL = "wss://n04.d.vega.xyz/tm/websocket" NX_VEGA_URL = "https://n04.d.vega.xyz/query" +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV = 'DEVNET' NX_VEGA_REST = 'https://n04.d.vega.xyz/datanode/rest' diff --git a/apps/explorer/.env.mainnet b/apps/explorer/.env.mainnet index fd1fce297..d982efa5c 100644 --- a/apps/explorer/.env.mainnet +++ b/apps/explorer/.env.mainnet @@ -3,5 +3,6 @@ NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain- NX_TENDERMINT_URL = "https://mainnet-observer-proxy01.ops.vega.xyz/" NX_TENDERMINT_WEBSOCKET_URL = "wss://mainnet-observer-proxy01.ops.vega.xyz/websocket" NX_VEGA_URL = "https://api.token.vega.xyz/query" +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV = 'MAINNET' NX_VEGA_REST = 'https://api.token.vega.xyz/' diff --git a/apps/explorer/.env.stagnet1 b/apps/explorer/.env.stagnet1 index 86e8a8a17..4e6859861 100644 --- a/apps/explorer/.env.stagnet1 +++ b/apps/explorer/.env.stagnet1 @@ -3,5 +3,6 @@ NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain- NX_TENDERMINT_URL = "https://n03.s.vega.xyz/tm" NX_TENDERMINT_WEBSOCKET_URL = "wss://n03.s.vega.xyz/tm/websocket" NX_VEGA_URL = "https://n03.s.vega.xyz/query" +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV = 'STAGNET' NX_VEGA_REST = 'https://n03.s.vega.xyz/datanode/rest' diff --git a/apps/explorer/.env.stagnet2 b/apps/explorer/.env.stagnet2 index 6aeef67b1..9b1e479c0 100644 --- a/apps/explorer/.env.stagnet2 +++ b/apps/explorer/.env.stagnet2 @@ -3,5 +3,6 @@ NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain- NX_TENDERMINT_URL = "https://n03.stagnet2.vega.xyz/tm" NX_TENDERMINT_WEBSOCKET_URL = "wss://n03.stagnet2.vega.xyz/tm/websocket" NX_VEGA_URL = "https://n03.stagnet2.vega.xyz/query" +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV = 'STAGNET2' NX_VEGA_REST = 'https://n01.stagnet2.vega.xyz/datanode/rest' diff --git a/apps/explorer/.env.testnet b/apps/explorer/.env.testnet index fc7a801d5..aabe2f8bc 100644 --- a/apps/explorer/.env.testnet +++ b/apps/explorer/.env.testnet @@ -3,5 +3,6 @@ NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain- NX_TENDERMINT_URL = "https://lb.testnet.vega.xyz/tm" NX_TENDERMINT_WEBSOCKET_URL = "wss://lb.testnet.vega.xyz/tm/websocket" NX_VEGA_URL = "https://lb.testnet.vega.xyz/query" +NX_VEGA_NETWORKS = '{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV = 'TESTNET' NX_VEGA_REST = 'https://lb.testnet.vega.xyz/datanode/rest' diff --git a/apps/explorer/src/app/app.tsx b/apps/explorer/src/app/app.tsx index 9cdd09834..5d025872f 100644 --- a/apps/explorer/src/app/app.tsx +++ b/apps/explorer/src/app/app.tsx @@ -1,11 +1,8 @@ import { useState, useEffect, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; import { ApolloProvider } from '@apollo/client'; -import { ThemeContext } from '@vegaprotocol/react-helpers'; -import { - useThemeSwitcher, - EnvironmentProvider, -} from '@vegaprotocol/react-helpers'; +import { ThemeContext, useThemeSwitcher } from '@vegaprotocol/react-helpers'; +import { EnvironmentProvider } from '@vegaprotocol/network-switcher'; import { createClient } from './lib/apollo-client'; import { Nav } from './components/nav'; import { Header } from './components/header'; diff --git a/apps/explorer/tailwind.config.js b/apps/explorer/tailwind.config.js index 3c7b5a348..51ca67ff2 100644 --- a/apps/explorer/tailwind.config.js +++ b/apps/explorer/tailwind.config.js @@ -6,6 +6,7 @@ const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom module.exports = { content: [ join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'), + 'libs/ui-toolkit/src/utils/shared.ts', ...createGlobPatternsForDependencies(__dirname), ], darkMode: 'class', diff --git a/apps/simple-trading-app/src/app/app.tsx b/apps/simple-trading-app/src/app/app.tsx index f106bddbb..bb8213af8 100644 --- a/apps/simple-trading-app/src/app/app.tsx +++ b/apps/simple-trading-app/src/app/app.tsx @@ -9,7 +9,7 @@ import { VegaManageDialog, VegaWalletProvider, } from '@vegaprotocol/wallet'; -import { EnvironmentProvider } from '@vegaprotocol/react-helpers'; +import { EnvironmentProvider } from '@vegaprotocol/network-switcher'; import { VegaWalletConnectButton } from './components/vega-wallet-connect-button'; import { ThemeSwitcher } from '@vegaprotocol/ui-toolkit'; import { Connectors } from './lib/vega-connectors'; diff --git a/apps/simple-trading-app/src/app/components/deal-ticket/__generated__/PartyBalanceQuery.ts b/apps/simple-trading-app/src/app/components/deal-ticket/__generated__/PartyBalanceQuery.ts new file mode 100644 index 000000000..b7f15b3c2 --- /dev/null +++ b/apps/simple-trading-app/src/app/components/deal-ticket/__generated__/PartyBalanceQuery.ts @@ -0,0 +1,59 @@ +/* tslint:disable */ +/* eslint-disable */ +// @generated +// This file was automatically generated and should not be edited. + +// ==================================================== +// GraphQL query operation: PartyBalanceQuery +// ==================================================== + +export interface PartyBalanceQuery_party_accounts_asset { + __typename: "Asset"; + /** + * The id of the asset + */ + id: string; + /** + * The symbol of the asset (e.g: GBP) + */ + symbol: string; + /** + * The full name of the asset (e.g: Great British Pound) + */ + name: string; + /** + * The precision of the asset + */ + decimals: number; +} + +export interface PartyBalanceQuery_party_accounts { + __typename: "Account"; + /** + * Balance as string - current account balance (approx. as balances can be updated several times per second) + */ + balance: string; + /** + * Asset, the 'currency' + */ + asset: PartyBalanceQuery_party_accounts_asset; +} + +export interface PartyBalanceQuery_party { + __typename: "Party"; + /** + * Collateral accounts relating to a party + */ + accounts: PartyBalanceQuery_party_accounts[] | null; +} + +export interface PartyBalanceQuery { + /** + * An entity that is trading on the VEGA network + */ + party: PartyBalanceQuery_party | null; +} + +export interface PartyBalanceQueryVariables { + partyId: string; +} diff --git a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-balance.tsx b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-balance.tsx new file mode 100644 index 000000000..e0bd91ef8 --- /dev/null +++ b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-balance.tsx @@ -0,0 +1,55 @@ +import * as React from 'react'; +import type { DealTicketQuery_market_tradableInstrument_instrument_product_settlementAsset } from '@vegaprotocol/deal-ticket'; +import type { PartyBalanceQuery_party_accounts } from './__generated__/PartyBalanceQuery'; +import { useSettlementAccount } from '../../hooks/use-settlement-account'; +import { addDecimalsFormatNumber, t } from '@vegaprotocol/react-helpers'; + +interface DealTicketBalanceProps { + settlementAsset: DealTicketQuery_market_tradableInstrument_instrument_product_settlementAsset; + accounts: PartyBalanceQuery_party_accounts[]; + isWalletConnected: boolean; +} + +export const DealTicketBalance = ({ + settlementAsset, + accounts, + isWalletConnected, +}: DealTicketBalanceProps) => { + const settlementAssetId = settlementAsset?.id; + const settlementAssetSymbol = settlementAsset?.symbol; + const settlementAccount = useSettlementAccount(settlementAssetId, accounts); + const formatedNumber = + settlementAccount?.balance && + settlementAccount.asset.decimals && + addDecimalsFormatNumber( + settlementAccount.balance, + settlementAccount.asset.decimals + ); + + const balance = settlementAccount ? ( +

+ {t( + `${formatedNumber} ${settlementAccount.asset.symbol} available to trade` + )} +

+ ) : ( +

{t(`You have no ${settlementAssetSymbol} available to trade`)}

+ ); + + const connectWallet = ( +

+ {t( + "Please connect your Vega wallet to see your balance for this market's settlement asset" + )} +

+ ); + + return ( +
+
+ {t('Balance')} + {isWalletConnected ? balance : connectWallet} +
+
+ ); +}; diff --git a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx index aa23ce6d0..0889af306 100644 --- a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx +++ b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx @@ -4,15 +4,58 @@ import { DealTicketContainer as Container, } from '@vegaprotocol/deal-ticket'; import { DealTicketSteps } from './deal-ticket-steps'; +import { useVegaWallet } from '@vegaprotocol/wallet'; +import { gql, useQuery } from '@apollo/client'; +import { DealTicketBalance } from './deal-ticket-balance'; +import * as React from 'react'; +import type { PartyBalanceQuery } from './__generated__/PartyBalanceQuery'; const tempEmptyText =

Please select a market from the markets page

; +const PARTY_BALANCE_QUERY = gql` + query PartyBalanceQuery($partyId: ID!) { + party(id: $partyId) { + accounts { + balance + asset { + id + symbol + name + decimals + } + } + } + } +`; + export const DealTicketContainer = () => { const { marketId } = useParams<{ marketId: string }>(); + const { keypair } = useVegaWallet(); + + const { data: partyData, loading } = useQuery( + PARTY_BALANCE_QUERY, + { + variables: { partyId: keypair?.pub }, + skip: !keypair?.pub, + } + ); + return marketId ? ( {(data) => ( + {loading ? ( + 'Loading...' + ) : ( + + )} )} diff --git a/apps/simple-trading-app/src/app/components/simple-market-list/constants.ts b/apps/simple-trading-app/src/app/components/simple-market-list/constants.ts index f0de9e3fc..dd24e47fb 100644 --- a/apps/simple-trading-app/src/app/components/simple-market-list/constants.ts +++ b/apps/simple-trading-app/src/app/components/simple-market-list/constants.ts @@ -1,15 +1,15 @@ -import { TailwindIntents } from '@vegaprotocol/ui-toolkit'; +import { Intent } from '@vegaprotocol/ui-toolkit'; import { MarketState } from '@vegaprotocol/types'; -export const MARKET_STATUS: Record = { - [MarketState.Active]: TailwindIntents.Success, - [MarketState.Cancelled]: TailwindIntents.Highlight, - [MarketState.Closed]: TailwindIntents.Help, - [MarketState.Pending]: TailwindIntents.Warning, - [MarketState.Proposed]: TailwindIntents.Prompt, - [MarketState.Rejected]: TailwindIntents.Danger, - [MarketState.Settled]: TailwindIntents.Highlight, - [MarketState.Suspended]: TailwindIntents.Warning, - [MarketState.TradingTerminated]: TailwindIntents.Danger, - '': TailwindIntents.Highlight, +export const MARKET_STATUS: Record = { + [MarketState.Active]: Intent.Success, + [MarketState.Cancelled]: Intent.Primary, + [MarketState.Closed]: Intent.None, + [MarketState.Pending]: Intent.Warning, + [MarketState.Proposed]: Intent.Warning, + [MarketState.Rejected]: Intent.Danger, + [MarketState.Settled]: Intent.Primary, + [MarketState.Suspended]: Intent.Warning, + [MarketState.TradingTerminated]: Intent.Danger, + '': Intent.Primary, }; diff --git a/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-percent-change.tsx b/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-percent-change.tsx index 9d1cd2086..ac8efb5f5 100644 --- a/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-percent-change.tsx +++ b/apps/simple-trading-app/src/app/components/simple-market-list/simple-market-percent-change.tsx @@ -43,7 +43,7 @@ const getColor = (change: number | string) => { if (parseFloat(change as string) < 0) { return theme.colors.vega.pink; } - return theme.colors.intent.highlight; + return theme.colors.black[10]; }; const SimpleMarketPercentChangeWrapper = (props: Props) => { diff --git a/apps/simple-trading-app/src/app/hooks/use-settlement-account.spec.tsx b/apps/simple-trading-app/src/app/hooks/use-settlement-account.spec.tsx new file mode 100644 index 000000000..fceb46475 --- /dev/null +++ b/apps/simple-trading-app/src/app/hooks/use-settlement-account.spec.tsx @@ -0,0 +1,61 @@ +import { renderHook } from '@testing-library/react-hooks'; +import { useSettlementAccount } from './use-settlement-account'; +import type { PartyBalanceQuery_party_accounts } from '../components/deal-ticket/__generated__/PartyBalanceQuery'; + +describe('useSettlementAccount Hook', () => { + it('should filter accounts by settlementAssetId', () => { + const accounts: PartyBalanceQuery_party_accounts[] = [ + { + __typename: 'Account', + balance: '2000000000000000000000', + asset: { + __typename: 'Asset', + id: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c', + symbol: 'tBTC', + name: 'tBTC TEST', + decimals: 5, + }, + }, + { + __typename: 'Account', + balance: '1000000000', + asset: { + __typename: 'Asset', + id: '6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61', + symbol: 'tDAI', + name: 'tDAI TEST', + decimals: 5, + }, + }, + { + __typename: 'Account', + balance: '5000000000000000000', + asset: { + __typename: 'Asset', + id: 'fc7fd956078fb1fc9db5c19b88f0874c4299b2a7639ad05a47a28c0aef291b55', + symbol: 'VEGA', + name: 'Vega (testnet)', + decimals: 18, + }, + }, + ]; + const settlementAssetId = + '6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61'; + + const { result } = renderHook(() => + useSettlementAccount(settlementAssetId, accounts) + ); + expect(result.current?.balance).toBe(accounts[1].balance); + expect(result.current?.asset).toEqual(accounts[1].asset); + }); + + it('should return null if no accounts', () => { + const accounts: PartyBalanceQuery_party_accounts[] = []; + const settlementAssetId = + '6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61'; + const { result } = renderHook(() => + useSettlementAccount(settlementAssetId, accounts) + ); + expect(result.current).toBe(undefined); + }); +}); diff --git a/apps/simple-trading-app/src/app/hooks/use-settlement-account.ts b/apps/simple-trading-app/src/app/hooks/use-settlement-account.ts new file mode 100644 index 000000000..4acb04cbb --- /dev/null +++ b/apps/simple-trading-app/src/app/hooks/use-settlement-account.ts @@ -0,0 +1,12 @@ +import type { PartyBalanceQuery_party_accounts } from '../components/deal-ticket/__generated__/PartyBalanceQuery'; +import { useMemo } from 'react'; + +export const useSettlementAccount = ( + settlementAssetId: string, + accounts: PartyBalanceQuery_party_accounts[] +): PartyBalanceQuery_party_accounts | null => { + const callback = () => + accounts.find((account) => account.asset.id === settlementAssetId); + const account = useMemo(callback, [accounts, settlementAssetId]); + return account as PartyBalanceQuery_party_accounts; +}; diff --git a/apps/simple-trading-app/tailwind.config.js b/apps/simple-trading-app/tailwind.config.js index 3c7b5a348..51ca67ff2 100644 --- a/apps/simple-trading-app/tailwind.config.js +++ b/apps/simple-trading-app/tailwind.config.js @@ -6,6 +6,7 @@ const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom module.exports = { content: [ join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'), + 'libs/ui-toolkit/src/utils/shared.ts', ...createGlobPatternsForDependencies(__dirname), ], darkMode: 'class', diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 8e883eb4c..9b0f8da82 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "129444.52681890269686566", + "locked_amount": "128021.232835487635464975", "deposits": [ { "amount": "129999.45", @@ -488,7 +488,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "97499.58", "total_removed": "0", - "locked_amount": "70195.22412914844148698", + "locked_amount": "68799.105317250070665786", "deposits": [ { "amount": "97499.58", @@ -521,7 +521,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "135173.4239508", "total_removed": "0", - "locked_amount": "95944.7526846639458443835832", + "locked_amount": "94036.49929865655770361639432", "deposits": [ { "amount": "135173.4239508", @@ -554,7 +554,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "32499.86", "total_removed": "0", - "locked_amount": "29529.91858445099991019", + "locked_amount": "28942.595509967648281348", "deposits": [ { "amount": "32499.86", @@ -587,7 +587,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "10833.29", "total_removed": "0", - "locked_amount": "9611.701947691653720404", + "locked_amount": "9420.533986195534071168", "deposits": [ { "amount": "10833.29", @@ -675,7 +675,7 @@ "tranche_end": "2022-11-01T00:00:00.000Z", "total_added": "22500", "total_removed": "0", - "locked_amount": "17934.06221693840475", + "locked_amount": "17200.396286231886", "deposits": [ { "amount": "15000", @@ -761,7 +761,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "0", - "locked_amount": "1911551.08354358756368137", + "locked_amount": "1879663.141708985403485286", "deposits": [ { "amount": "1852091.69", @@ -1777,7 +1777,7 @@ "tranche_end": "2022-09-30T00:00:00.000Z", "total_added": "60916.66666633337", "total_removed": "17896.108295511846757997", - "locked_amount": "17909.6211245656664631173828909605", + "locked_amount": "16972.4796018381286955927508687498", "deposits": [ { "amount": "2833.333333", @@ -3217,10 +3217,20 @@ "tranche_id": 10, "tranche_start": "2021-07-15T23:37:11.000Z", "tranche_end": "2021-07-15T23:37:11.000Z", - "total_added": "3475768.150000000000000001", - "total_removed": "3467578.640000000000000001", + "total_added": "3545768.150000000000000001", + "total_removed": "3537578.640000000000000001", "locked_amount": "0", "deposits": [ + { + "amount": "40000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tx": "0xf61821785ec3404b4c0120875ca2adac3577325f5ba3381be65af2087fa3d430" + }, + { + "amount": "30000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tx": "0x7f568014bcb0bd1991c2da53ce6d8b15da0c23bde42481b8f7eed31ab957a909" + }, { "amount": "50000", "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", @@ -3618,6 +3628,16 @@ } ], "withdrawals": [ + { + "amount": "40000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tx": "0x91ca1d5a05f389c43a5bd4d65a84d6400c094513841543080e6b8b489a16e7a4" + }, + { + "amount": "30000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tx": "0x50c9a9ac22a23c68b00de15fedf1d5f1ada9434c4494f4dbe291b57154d76609" + }, { "amount": "90000", "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", @@ -3958,6 +3978,18 @@ { "address": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", "deposits": [ + { + "amount": "40000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tranche_id": 10, + "tx": "0xf61821785ec3404b4c0120875ca2adac3577325f5ba3381be65af2087fa3d430" + }, + { + "amount": "30000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tranche_id": 10, + "tx": "0x7f568014bcb0bd1991c2da53ce6d8b15da0c23bde42481b8f7eed31ab957a909" + }, { "amount": "50000", "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", @@ -4008,6 +4040,18 @@ } ], "withdrawals": [ + { + "amount": "40000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tranche_id": 10, + "tx": "0x91ca1d5a05f389c43a5bd4d65a84d6400c094513841543080e6b8b489a16e7a4" + }, + { + "amount": "30000", + "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", + "tranche_id": 10, + "tx": "0x50c9a9ac22a23c68b00de15fedf1d5f1ada9434c4494f4dbe291b57154d76609" + }, { "amount": "90000", "user": "0xb2d6DEC77558Cf8EdB7c428d23E70Eab0688544f", @@ -4051,8 +4095,8 @@ "tx": "0xac16a4ce688d40a482a59914d68c3a676592f8804ee8f0781b66a4ba5ccfbdfc" } ], - "total_tokens": "329451", - "withdrawn_tokens": "329451", + "total_tokens": "399451", + "withdrawn_tokens": "399451", "remaining_tokens": "0" }, { @@ -5050,10 +5094,80 @@ "tranche_id": 11, "tranche_start": "2021-09-03T00:00:00.000Z", "tranche_end": "2022-09-03T00:00:00.000Z", - "total_added": "15073.000000000000000003", - "total_removed": "2905.98379934253", - "locked_amount": "3620.0297768581945964007204995243531204", + "total_added": "16708.000000000000000003", + "total_removed": "4111.28273531398", + "locked_amount": "3738.0605589802120624006711863584474884", "deposits": [ + { + "amount": "30", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tx": "0xf1be966b6f8b899485abd86d558bfe1a79b7af80077bb6157f12cf1d813ec443" + }, + { + "amount": "25", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tx": "0xab9fcd474774c5094af51f03443082fd560aa679da77ba78778c7c02dee1102d" + }, + { + "amount": "60", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tx": "0xebf6e95ac8b64942a6ab21fa3835f5bdc143e7c6b15c186b95b7836de779a950" + }, + { + "amount": "25", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tx": "0xe3e59d9ef72b2e91ff2f4cc7a4dac13cc70af83a23d79f7eac6a4e2194407e81" + }, + { + "amount": "30", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tx": "0x809d0f9608d06355658d287e305dafd4f96f2ce00c7063e3f53cc2fcb9b3c395" + }, + { + "amount": "250", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0xf63cbb6224be2b11aae80f9a5f372869e53061d1b2c4a454095aa6b6b9b723bd" + }, + { + "amount": "250", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0x9540e07a486f617e7cc6db4dadc520c8f59491062fe8a1af3fb7b5d8c6b85a58" + }, + { + "amount": "250", + "user": "0xbd332c522c423B710Aa68f4d1403F912029F8625", + "tx": "0x05734db18b3c1b8808a1ae96bb15c70b72c80118f644363609b2b24d7ba09e78" + }, + { + "amount": "200", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0xd7422454fd73831006588f945d807ec0d2312497d2f28738af27e7ff935c6e98" + }, + { + "amount": "170", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0x689c40036e449a1cac0958c0db669b1388b54bd8a0a0c6c71fe2a9b498066444" + }, + { + "amount": "80", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0xd3c728581506c71fc4f69aef018f512c8e87f278f36900b1b70661b9f2b5be40" + }, + { + "amount": "100", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0x28c0d7d0368216157d080db9ea958130b5d6f25bc111343ddb4a62ab7e1b051b" + }, + { + "amount": "90", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0xa99f5b902d47bdc4d106182ab72d21ce3f036d0830b07c6bb76f4facd17fc2b9" + }, + { + "amount": "75", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0xc4981c736caa5a186bb800cc61ce2d3372b66779a3f22a14e7b1871c959fccca" + }, { "amount": "10", "user": "0x10ea6ae9343A79c48eB5D7e58260a6523D7cb443", @@ -7701,6 +7815,26 @@ "user": "0xc5467213593778E528f0eB8117cc7AFBC5b7491b", "tx": "0xce562db43fe92ccd76b20c462f4f680336542c064020dfb646512994c4f229d9" }, + { + "amount": "34.691945712", + "user": "0xCffAAD68a1a538CADab2b82cC3740E66d4c111A5", + "tx": "0xf4fa4c712d7b1ee77c7abb0c9d6d6e213ffbf9cf8efdbe7edf248628e0ce4b14" + }, + { + "amount": "940.30940496195", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tx": "0x113a57018552a2003c49b030ef1cb9ffaee99747c81485647d195d08d676ed78" + }, + { + "amount": "193.5380596775", + "user": "0xbd332c522c423B710Aa68f4d1403F912029F8625", + "tx": "0x5ce90d1e49057d6ddb88660f6ee82fbb17aabd3e78e8a13eeeea9f2ffc84c667" + }, + { + "amount": "36.75952562", + "user": "0x3f626D48C2a6104976A03009cFDB4A48F32fd282", + "tx": "0xd7ad0cb1b12f2e91b49356296b0c7ccb710d9506838e2c78810b19f8bc1500f0" + }, { "amount": "7.42538686", "user": "0xc5467213593778E528f0eB8117cc7AFBC5b7491b", @@ -7948,6 +8082,281 @@ } ], "users": [ + { + "address": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "deposits": [ + { + "amount": "30", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xf1be966b6f8b899485abd86d558bfe1a79b7af80077bb6157f12cf1d813ec443" + }, + { + "amount": "25", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xab9fcd474774c5094af51f03443082fd560aa679da77ba78778c7c02dee1102d" + }, + { + "amount": "60", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xebf6e95ac8b64942a6ab21fa3835f5bdc143e7c6b15c186b95b7836de779a950" + }, + { + "amount": "25", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xe3e59d9ef72b2e91ff2f4cc7a4dac13cc70af83a23d79f7eac6a4e2194407e81" + }, + { + "amount": "30", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x809d0f9608d06355658d287e305dafd4f96f2ce00c7063e3f53cc2fcb9b3c395" + }, + { + "amount": "35", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xb2fb3960b88da57f1e7347fc19dd8fa59820bce7721341e6e9108d093a568975" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x7d429cebf256a98d748cdd9dc1d61b0057086e0c9b5775dcbe94626a4e6c721a" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x9bf0c211330b0a6039d5026ff1201ae605ef17cc97874162ba757f7256165f05" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xf5b6413a16a381772153499b430975cbb472111f4e91182d2d251b323a0ea455" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xe9292e81c451724fe5ed54b4a6c233343d479309f899c6618b305668e5a6e2b0" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x3c8303c57fb6c55d9529a8b6123897bc374f6196cf5cf7d82375e7f3ab5cb0c7" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xe61f863255b61bd130f4b376e6ae384268dfb4965b7450753d7d47da986f5a05" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x50c094b3accb1ecc7d6e237cfa2c94948845cd814d3b2abd65b88a879f73af5e" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x62d19a29c673db27c02c5f4266638278212e134f25a30d0b38f28b9254cfeeee" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x9c96a5eb7945b8e666fbab617c072cba6f23d843ac221003396141805878d8e8" + }, + { + "amount": "15", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x9d67e8fb6762dd435cc749ffdc1b2a5a8640b45aecbfd084fc18103ee08b9ba2" + }, + { + "amount": "100", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xbddda2e0eb2449fb616b03d69f6c237bc7276c66feaefd9de59ca6ffdd81507a" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xa3f6ec1b231c89dd1e34e0247266532aa7164ed1687e17d34c582c748b228d0d" + }, + { + "amount": "35", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xf55115db5cfc11464a8d994647a027d4e1013143f7d54fe34f9cc94b39ba293c" + }, + { + "amount": "35", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xcba0565d95ca237cca151d88bd19dc7cebd5c1820445fe1966be1f4b6f175e24" + }, + { + "amount": "15", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x32ac32e5d7f8ab38ecf4467c3c116ad676d9bfdc8b11ac8aa618b079837a7fa3" + }, + { + "amount": "15", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x481b1bac5120af196dfac4f480e85e26dd9e6c0b4bab3f8be506e5484a21292b" + }, + { + "amount": "15", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x50a1a2928181e56380fe21091786fcd82f3a8fafd9b13fee65a32cff117292ec" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x758533d671732b224d241e109691655d01ea58db862b8b366a6c8ede67109ce7" + }, + { + "amount": "20", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xaabdfe069e1e4d75132cbf18cca3991d58473fcb82f47c9adb516da4eba4b1cf" + }, + { + "amount": "5", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x982e8902d21680a0e57e97b33efcdd7ad7b08bea0873c82f933a4c73abdc972a" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0xd1641e0814331fdfd0553c3785de9c5697d575dac44ca78767569d68560017d4" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x4490efa6050f006d31faaebb4411335be52c29edf449bed4380664c8377529a3" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x2e64b89e05ee0a9646251b7acec1614b945417ec750b6808657c59d7ab2db2a0" + }, + { + "amount": "10", + "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", + "tranche_id": 11, + "tx": "0x248d34bdf3224997d3f0e2cd55f75e1b13937591a64cff99abf513bada6da087" + } + ], + "withdrawals": [], + "total_tokens": "670", + "withdrawn_tokens": "0", + "remaining_tokens": "670" + }, + { + "address": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "deposits": [ + { + "amount": "250", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0xf63cbb6224be2b11aae80f9a5f372869e53061d1b2c4a454095aa6b6b9b723bd" + }, + { + "amount": "250", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0x9540e07a486f617e7cc6db4dadc520c8f59491062fe8a1af3fb7b5d8c6b85a58" + }, + { + "amount": "200", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0xd7422454fd73831006588f945d807ec0d2312497d2f28738af27e7ff935c6e98" + }, + { + "amount": "170", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0x689c40036e449a1cac0958c0db669b1388b54bd8a0a0c6c71fe2a9b498066444" + }, + { + "amount": "80", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0xd3c728581506c71fc4f69aef018f512c8e87f278f36900b1b70661b9f2b5be40" + }, + { + "amount": "100", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0x28c0d7d0368216157d080db9ea958130b5d6f25bc111343ddb4a62ab7e1b051b" + }, + { + "amount": "90", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0xa99f5b902d47bdc4d106182ab72d21ce3f036d0830b07c6bb76f4facd17fc2b9" + }, + { + "amount": "75", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0xc4981c736caa5a186bb800cc61ce2d3372b66779a3f22a14e7b1871c959fccca" + } + ], + "withdrawals": [ + { + "amount": "940.30940496195", + "user": "0x3a380f7CFdEeb723228cA57d2795EA215094000d", + "tranche_id": 11, + "tx": "0x113a57018552a2003c49b030ef1cb9ffaee99747c81485647d195d08d676ed78" + } + ], + "total_tokens": "1215", + "withdrawn_tokens": "940.30940496195", + "remaining_tokens": "274.69059503805" + }, + { + "address": "0xbd332c522c423B710Aa68f4d1403F912029F8625", + "deposits": [ + { + "amount": "250", + "user": "0xbd332c522c423B710Aa68f4d1403F912029F8625", + "tranche_id": 11, + "tx": "0x05734db18b3c1b8808a1ae96bb15c70b72c80118f644363609b2b24d7ba09e78" + } + ], + "withdrawals": [ + { + "amount": "193.5380596775", + "user": "0xbd332c522c423B710Aa68f4d1403F912029F8625", + "tranche_id": 11, + "tx": "0x5ce90d1e49057d6ddb88660f6ee82fbb17aabd3e78e8a13eeeea9f2ffc84c667" + } + ], + "total_tokens": "250", + "withdrawn_tokens": "193.5380596775", + "remaining_tokens": "56.4619403225" + }, { "address": "0x10ea6ae9343A79c48eB5D7e58260a6523D7cb443", "deposits": [ @@ -8845,165 +9254,6 @@ "withdrawn_tokens": "0", "remaining_tokens": "3755" }, - { - "address": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "deposits": [ - { - "amount": "35", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xb2fb3960b88da57f1e7347fc19dd8fa59820bce7721341e6e9108d093a568975" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x7d429cebf256a98d748cdd9dc1d61b0057086e0c9b5775dcbe94626a4e6c721a" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x9bf0c211330b0a6039d5026ff1201ae605ef17cc97874162ba757f7256165f05" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xf5b6413a16a381772153499b430975cbb472111f4e91182d2d251b323a0ea455" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xe9292e81c451724fe5ed54b4a6c233343d479309f899c6618b305668e5a6e2b0" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x3c8303c57fb6c55d9529a8b6123897bc374f6196cf5cf7d82375e7f3ab5cb0c7" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xe61f863255b61bd130f4b376e6ae384268dfb4965b7450753d7d47da986f5a05" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x50c094b3accb1ecc7d6e237cfa2c94948845cd814d3b2abd65b88a879f73af5e" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x62d19a29c673db27c02c5f4266638278212e134f25a30d0b38f28b9254cfeeee" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x9c96a5eb7945b8e666fbab617c072cba6f23d843ac221003396141805878d8e8" - }, - { - "amount": "15", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x9d67e8fb6762dd435cc749ffdc1b2a5a8640b45aecbfd084fc18103ee08b9ba2" - }, - { - "amount": "100", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xbddda2e0eb2449fb616b03d69f6c237bc7276c66feaefd9de59ca6ffdd81507a" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xa3f6ec1b231c89dd1e34e0247266532aa7164ed1687e17d34c582c748b228d0d" - }, - { - "amount": "35", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xf55115db5cfc11464a8d994647a027d4e1013143f7d54fe34f9cc94b39ba293c" - }, - { - "amount": "35", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xcba0565d95ca237cca151d88bd19dc7cebd5c1820445fe1966be1f4b6f175e24" - }, - { - "amount": "15", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x32ac32e5d7f8ab38ecf4467c3c116ad676d9bfdc8b11ac8aa618b079837a7fa3" - }, - { - "amount": "15", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x481b1bac5120af196dfac4f480e85e26dd9e6c0b4bab3f8be506e5484a21292b" - }, - { - "amount": "15", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x50a1a2928181e56380fe21091786fcd82f3a8fafd9b13fee65a32cff117292ec" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x758533d671732b224d241e109691655d01ea58db862b8b366a6c8ede67109ce7" - }, - { - "amount": "20", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xaabdfe069e1e4d75132cbf18cca3991d58473fcb82f47c9adb516da4eba4b1cf" - }, - { - "amount": "5", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x982e8902d21680a0e57e97b33efcdd7ad7b08bea0873c82f933a4c73abdc972a" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0xd1641e0814331fdfd0553c3785de9c5697d575dac44ca78767569d68560017d4" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x4490efa6050f006d31faaebb4411335be52c29edf449bed4380664c8377529a3" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x2e64b89e05ee0a9646251b7acec1614b945417ec750b6808657c59d7ab2db2a0" - }, - { - "amount": "10", - "user": "0xb4eE687f019A8e48F7087f4b4f8653208B8cc48f", - "tranche_id": 11, - "tx": "0x248d34bdf3224997d3f0e2cd55f75e1b13937591a64cff99abf513bada6da087" - } - ], - "withdrawals": [], - "total_tokens": "500", - "withdrawn_tokens": "0", - "remaining_tokens": "500" - }, { "address": "0x4cf8879dC68ebe9F003E6231CB8B704FAbEA8d9c", "deposits": [ @@ -12687,6 +12937,12 @@ } ], "withdrawals": [ + { + "amount": "34.691945712", + "user": "0xCffAAD68a1a538CADab2b82cC3740E66d4c111A5", + "tranche_id": 11, + "tx": "0xf4fa4c712d7b1ee77c7abb0c9d6d6e213ffbf9cf8efdbe7edf248628e0ce4b14" + }, { "amount": "17.065404618", "user": "0xCffAAD68a1a538CADab2b82cC3740E66d4c111A5", @@ -12719,8 +12975,8 @@ } ], "total_tokens": "200", - "withdrawn_tokens": "118.81337519", - "remaining_tokens": "81.18662481" + "withdrawn_tokens": "153.505320902", + "remaining_tokens": "46.494679098" }, { "address": "0x65623CE02BEFCc862D069e463A88D784dA35332F", @@ -12761,6 +13017,12 @@ } ], "withdrawals": [ + { + "amount": "36.75952562", + "user": "0x3f626D48C2a6104976A03009cFDB4A48F32fd282", + "tranche_id": 11, + "tx": "0xd7ad0cb1b12f2e91b49356296b0c7ccb710d9506838e2c78810b19f8bc1500f0" + }, { "amount": "32.791241756", "user": "0x3f626D48C2a6104976A03009cFDB4A48F32fd282", @@ -12781,8 +13043,8 @@ } ], "total_tokens": "200", - "withdrawn_tokens": "118.324949264", - "remaining_tokens": "81.675050736" + "withdrawn_tokens": "155.084474884", + "remaining_tokens": "44.915525116" }, { "address": "0x6f5EBA1eCc26B8f1203a1D32116f286fAd383a2d", @@ -12929,7 +13191,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "74162.9780761646031", - "locked_amount": "2961889.80873522203511981118", + "locked_amount": "2912889.04981089405546711373", "deposits": [ { "amount": "1998.95815", @@ -13641,8 +13903,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15788853.065470999700000001", - "total_removed": "0", - "locked_amount": "15721455.8528753381544497845048217020856988", + "total_removed": "2446.31552516990115", + "locked_amount": "15548591.8682663462484073363217811693876723", "deposits": [ { "amount": "16249.93", @@ -14136,6 +14398,11 @@ } ], "withdrawals": [ + { + "amount": "2446.31552516990115", + "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", + "tx": "0x60d4969894932ea5611b8a9d98e9f4a857907be51879c6cfa469b42f4f289921" + }, { "amount": "0", "user": "0x4527F5A129f3Ab7c88c5863F8AB9a708928Fe702", @@ -14186,10 +14453,17 @@ "tx": "0x92f8d7f0a8b47133181ebe38781bfd3111e79d52f0022baae448bed8a674cad5" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "2446.31552516990115", + "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", + "tranche_id": 2, + "tx": "0x60d4969894932ea5611b8a9d98e9f4a857907be51879c6cfa469b42f4f289921" + } + ], "total_tokens": "194999.1675", - "withdrawn_tokens": "0", - "remaining_tokens": "194999.1675" + "withdrawn_tokens": "2446.31552516990115", + "remaining_tokens": "192552.85197483009885" }, { "address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c", @@ -15593,8 +15867,8 @@ "tranche_start": "2021-11-05T00:00:00.000Z", "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", - "total_removed": "2040741.482328946820515322", - "locked_amount": "8867191.40430055827121812084261657", + "total_removed": "2062546.433079096801723272", + "locked_amount": "8706783.24098689091258893352563194", "deposits": [ { "amount": "129284.449", @@ -15813,6 +16087,46 @@ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", "tx": "0x0014532478275404cdb672384ad9bf4dc4202b7ccd60682b7d8bfd5b997d3c00" }, + { + "amount": "499.42967288092014825", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0xf2fb89f9f7804f79d49dd03026a6f554befce5e9f368893cdd1b911467e61341" + }, + { + "amount": "17786.1881146007542887", + "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", + "tx": "0x3a572e6cf3a23c7fd307c4feb9b9c3d770a53d3ba083cd346c3650f8c647d574" + }, + { + "amount": "640.53064156365264175", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0x79f9bfbfd5b535b207b84d60e8a4d5b580fccb218177b5b42af358d529456380" + }, + { + "amount": "696.59039694433085325", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0x9f5bbd82ea1e9bf1851226eff6ac9f9f5812049a00495af3b5a9a52583ccdc12" + }, + { + "amount": "695.31907831462717875", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0xb03cf0af0c643353e144ed7c303e2e9a67daa280207517d8384bead582bc2b4f" + }, + { + "amount": "651.59947331819937675", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0x4fd35c3d04dc5e74ed1d4bc7e6d4c87f89cf8beccb7f14e5e1b1e5fa7acf27f9" + }, + { + "amount": "281.303640283608865", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0xb9c665547fbce8bad7435526ac7b4b6f7dc3370ab6647621f93b31a37558fddf" + }, + { + "amount": "553.9897322438878555", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0x4f9b8f6445ceef34a9ee572d5879fe38ba2c84548f843e9d8b511e0c3017479a" + }, { "amount": "1384.357697656285885", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -17301,6 +17615,48 @@ "tranche_id": 3, "tx": "0x0014532478275404cdb672384ad9bf4dc4202b7ccd60682b7d8bfd5b997d3c00" }, + { + "amount": "499.42967288092014825", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0xf2fb89f9f7804f79d49dd03026a6f554befce5e9f368893cdd1b911467e61341" + }, + { + "amount": "640.53064156365264175", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0x79f9bfbfd5b535b207b84d60e8a4d5b580fccb218177b5b42af358d529456380" + }, + { + "amount": "696.59039694433085325", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0x9f5bbd82ea1e9bf1851226eff6ac9f9f5812049a00495af3b5a9a52583ccdc12" + }, + { + "amount": "695.31907831462717875", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0xb03cf0af0c643353e144ed7c303e2e9a67daa280207517d8384bead582bc2b4f" + }, + { + "amount": "651.59947331819937675", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0x4fd35c3d04dc5e74ed1d4bc7e6d4c87f89cf8beccb7f14e5e1b1e5fa7acf27f9" + }, + { + "amount": "281.303640283608865", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0xb9c665547fbce8bad7435526ac7b4b6f7dc3370ab6647621f93b31a37558fddf" + }, + { + "amount": "553.9897322438878555", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0x4f9b8f6445ceef34a9ee572d5879fe38ba2c84548f843e9d8b511e0c3017479a" + }, { "amount": "1384.357697656285885", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -18425,8 +18781,8 @@ } ], "total_tokens": "359123.469575", - "withdrawn_tokens": "140494.75538433103984475", - "remaining_tokens": "218628.71419066896015525" + "withdrawn_tokens": "144513.518019880266764", + "remaining_tokens": "214609.951555119733236" }, { "address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB", @@ -18613,6 +18969,12 @@ } ], "withdrawals": [ + { + "amount": "17786.1881146007542887", + "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", + "tranche_id": 3, + "tx": "0x3a572e6cf3a23c7fd307c4feb9b9c3d770a53d3ba083cd346c3650f8c647d574" + }, { "amount": "14131.31542114178485692", "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", @@ -18813,8 +19175,8 @@ } ], "total_tokens": "1266324.603486", - "withdrawn_tokens": "479570.19259359168266556", - "remaining_tokens": "786754.41089240831733444" + "withdrawn_tokens": "497356.38070819243695426", + "remaining_tokens": "768968.22277780756304574" }, { "address": "0xC5d9221EB9c28A69859264c0A2Fe0d3272228296", @@ -19410,8 +19772,8 @@ "tranche_start": "2021-10-05T00:00:00.000Z", "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "5778205.3912159303", - "total_removed": "1341050.833974497576969742", - "locked_amount": "3186577.54862608898743900152867561", + "total_removed": "1354392.149662275357179742", + "locked_amount": "3123199.31316036463337626492844228", "deposits": [ { "amount": "552496.6455", @@ -19555,6 +19917,11 @@ } ], "withdrawals": [ + { + "amount": "13341.31568777778021", + "user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90", + "tx": "0xcaaf2eae83061031d9ffb54f095e12ea6bf1438a5d83c8ef48bd7b73aa67c0c1" + }, { "amount": "32683.576612762644585", "user": "0x91715128a71c9C734CDC20E5EdEEeA02E72e428E", @@ -20346,6 +20713,12 @@ } ], "withdrawals": [ + { + "amount": "13341.31568777778021", + "user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90", + "tranche_id": 4, + "tx": "0xcaaf2eae83061031d9ffb54f095e12ea6bf1438a5d83c8ef48bd7b73aa67c0c1" + }, { "amount": "19314.782639120135472", "user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90", @@ -20396,8 +20769,8 @@ } ], "total_tokens": "331498.5873", - "withdrawn_tokens": "135489.51216912215997", - "remaining_tokens": "196009.07513087784003" + "withdrawn_tokens": "148830.82785689994018", + "remaining_tokens": "182667.75944310005982" }, { "address": "0x16da609341ed67750A8BCC5AAa2005471006Cd77", @@ -20467,7 +20840,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", "total_removed": "0", - "locked_amount": "469328.37107805075503164173921864", + "locked_amount": "461563.92072621153998945052663624", "deposits": [ { "amount": "3000", @@ -46120,7 +46493,7 @@ "tranche_start": "2021-12-05T00:00:00.000Z", "tranche_end": "2022-06-05T00:00:00.000Z", "total_added": "171288.42", - "total_removed": "22821.6538075488377", + "total_removed": "25913.4485680598377", "locked_amount": "0", "deposits": [ { @@ -50490,6 +50863,86 @@ "user": "0x22771eDF88B1cec6E8849Af5c3C140FAc3EAcA5C", "tx": "0x4b565d215b1149dad23489678d7b51688e35e919039b6f8b221992c733888e19" }, + { + "amount": "500", + "user": "0x3Be204e2979113FA52fA6b0942AF8E4AD63bEe13", + "tx": "0xcc52eaea8fa6218e622c1bb487666b9eff1c12255c78d67c68a7377fbff1cf6f" + }, + { + "amount": "200", + "user": "0x7F1e7f6253DD2c64B6818FB2376F0e38e46F9cCD", + "tx": "0xe9bc87b901a15d3c5d75c07e65425e154b66aba4782f112a663e8a1690ab17f9" + }, + { + "amount": "250", + "user": "0x5DE853CB6813f9Aefd25635776139d8C0AAaF77A", + "tx": "0xdac530dc97a09dce8335182feaaab51f82b81ec29c04d3e4d38c226cdee629a3" + }, + { + "amount": "250", + "user": "0xd2Ebd8809FabeB6D5059fe0e3B97acdAA0e915e8", + "tx": "0x2cee02cfd48a02d4d2ab0534393d02282cd191004377a5f1305160679c278a38" + }, + { + "amount": "250", + "user": "0x9092c8C6d7a1ec4cA810b8497B0fF51D4Aa64Cc8", + "tx": "0xeb491d3171e65f69c6675fcb690f97fa5f136973fc379b876fd2cd2811e18b76" + }, + { + "amount": "250", + "user": "0x500EcB70D881FF656780aF6b753589B43d1c8bF6", + "tx": "0x51cbba92d94ed6f404cf6ef709e3c09d0fa83cbddd32e5cd0108b2fd8d806aa9" + }, + { + "amount": "80.9816977025", + "user": "0x962CBde0d0104a3fe7e2Fa40105037AAfabC1F46", + "tx": "0xd06b71e6e3382fa0e415faa2d466ea43af123853a58a1ae23ceaa4572408bb6d" + }, + { + "amount": "40", + "user": "0xC281e1B72Af15746A231F1e2d393Eee422cB91a7", + "tx": "0xce6120be88b9f20ee16458163b5dc64aef919bf5427817f296bc4518719791bc" + }, + { + "amount": "250", + "user": "0x45564345F125F78d3C3894A2C5226C673F8eB0Ae", + "tx": "0x3c5ae944abb30d0db6b7545f4ef183cfd6fe49424c318c300461277e4adce725" + }, + { + "amount": "100", + "user": "0x72e6631ADf75E813c09eCB4ec69B45F461e4fC2a", + "tx": "0x14a2b2e39c2bfef4cff4a40ed9cca82ad0b5808e50c7a17ab977c3ff62ce8bd2" + }, + { + "amount": "15.4615321025", + "user": "0x0E38F8B57C519511F27003e95f5352249a8c7690", + "tx": "0xf105475c5b826b52a23d6c016ec1f216752f609e2a148c67a9ceeef9159a9979" + }, + { + "amount": "239.367241555", + "user": "0xB8EE2A367C4e7Be085b5b00f9A01a0935fA5Ca6F", + "tx": "0x36767520442a11bfae07f31898dd5863be2b7f5b37a155c33cb9ae38661d2bf7" + }, + { + "amount": "42.422590431", + "user": "0xC33148FA880a374A432101f0da1eF619E270b070", + "tx": "0x698070ab64fbb1e6a1084b156ba59212897cfd3cd93ab33a8e006eee78d750a3" + }, + { + "amount": "250", + "user": "0x2074924ebfD97Ff2351659CB00e259eBd6451aA5", + "tx": "0xe937fa1d7d74544642b228362823791d91ba45b6a82bc0fd2bfc92259fdb8fe0" + }, + { + "amount": "173.56169872", + "user": "0xE245503f8a33eBDDD718915132869C9Ba9df37A8", + "tx": "0xde8cef251275f49e9cadf2b049146c0709d4d617602428b8ba9a580356dcefab" + }, + { + "amount": "200", + "user": "0x949ECa8174BBa367901e9a195B77B2eA7d862c43", + "tx": "0x25013a6975754e211e4d2b8406c6a12b95b6bb7538f7c94e31d889562b2c2d93" + }, { "amount": "65.56208982", "user": "0x36d345DCEB35816AD557355fA51E7C99FEE7d18E", @@ -53214,10 +53667,17 @@ "tx": "0x23a584d4881de8a7fdac91afaf0fd834e84ddcad95a0bc420020032bbeae8f50" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x9092c8C6d7a1ec4cA810b8497B0fF51D4Aa64Cc8", + "tranche_id": 6, + "tx": "0xeb491d3171e65f69c6675fcb690f97fa5f136973fc379b876fd2cd2811e18b76" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x68D771cd2074B69664214C21f20C60875b1978D8", @@ -54302,6 +54762,12 @@ } ], "withdrawals": [ + { + "amount": "239.367241555", + "user": "0xB8EE2A367C4e7Be085b5b00f9A01a0935fA5Ca6F", + "tranche_id": 6, + "tx": "0x36767520442a11bfae07f31898dd5863be2b7f5b37a155c33cb9ae38661d2bf7" + }, { "amount": "260.632758445", "user": "0xB8EE2A367C4e7Be085b5b00f9A01a0935fA5Ca6F", @@ -54310,8 +54776,8 @@ } ], "total_tokens": "500", - "withdrawn_tokens": "260.632758445", - "remaining_tokens": "239.367241555" + "withdrawn_tokens": "500", + "remaining_tokens": "0" }, { "address": "0xbbE8722E051120138751e0a5d477964c13F8fb65", @@ -56917,10 +57383,17 @@ "tx": "0x057f65938b1360b6d2c4ebf5e789c67897cf60cb6a13f947004def03891afbd8" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "500", + "user": "0x3Be204e2979113FA52fA6b0942AF8E4AD63bEe13", + "tranche_id": 6, + "tx": "0xcc52eaea8fa6218e622c1bb487666b9eff1c12255c78d67c68a7377fbff1cf6f" + } + ], "total_tokens": "500", - "withdrawn_tokens": "0", - "remaining_tokens": "500" + "withdrawn_tokens": "500", + "remaining_tokens": "0" }, { "address": "0xdc324433c9936c38c9334B373Db2468719CC17B9", @@ -57646,6 +58119,12 @@ } ], "withdrawals": [ + { + "amount": "42.422590431", + "user": "0xC33148FA880a374A432101f0da1eF619E270b070", + "tranche_id": 6, + "tx": "0x698070ab64fbb1e6a1084b156ba59212897cfd3cd93ab33a8e006eee78d750a3" + }, { "amount": "42.040674603", "user": "0xC33148FA880a374A432101f0da1eF619E270b070", @@ -57666,8 +58145,8 @@ } ], "total_tokens": "150", - "withdrawn_tokens": "107.577409569", - "remaining_tokens": "42.422590431" + "withdrawn_tokens": "150", + "remaining_tokens": "0" }, { "address": "0xC1Cf26609A19e1Fdd73360Fc6F3FdE269CB133Df", @@ -57715,10 +58194,17 @@ "tx": "0x96a22c369645e8945b4047374a05332f4054b50a492c43092e8bb8e974a006b9" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x500EcB70D881FF656780aF6b753589B43d1c8bF6", + "tranche_id": 6, + "tx": "0x51cbba92d94ed6f404cf6ef709e3c09d0fa83cbddd32e5cd0108b2fd8d806aa9" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0xeA863DB5E4fE3B9687e0Cf1606cCb8C602c5DDDd", @@ -59386,6 +59872,12 @@ } ], "withdrawals": [ + { + "amount": "173.56169872", + "user": "0xE245503f8a33eBDDD718915132869C9Ba9df37A8", + "tranche_id": 6, + "tx": "0xde8cef251275f49e9cadf2b049146c0709d4d617602428b8ba9a580356dcefab" + }, { "amount": "252.08931115", "user": "0xE245503f8a33eBDDD718915132869C9Ba9df37A8", @@ -59406,8 +59898,8 @@ } ], "total_tokens": "1000", - "withdrawn_tokens": "826.43830128", - "remaining_tokens": "173.56169872" + "withdrawn_tokens": "1000", + "remaining_tokens": "0" }, { "address": "0x915F09C81333830f156048CDd251eA0E11941F27", @@ -59866,6 +60358,12 @@ } ], "withdrawals": [ + { + "amount": "15.4615321025", + "user": "0x0E38F8B57C519511F27003e95f5352249a8c7690", + "tranche_id": 6, + "tx": "0xf105475c5b826b52a23d6c016ec1f216752f609e2a148c67a9ceeef9159a9979" + }, { "amount": "40.678720875", "user": "0x0E38F8B57C519511F27003e95f5352249a8c7690", @@ -59904,8 +60402,8 @@ } ], "total_tokens": "250", - "withdrawn_tokens": "234.5384678975", - "remaining_tokens": "15.4615321025" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0xA7f2dfEf34ed820aA790ce55E26925fd5A916D99", @@ -60107,10 +60605,17 @@ "tx": "0x716a7be06da5a7a3d8038907974887a31805ea8eeab5d130cba528e4d2094d9f" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x2074924ebfD97Ff2351659CB00e259eBd6451aA5", + "tranche_id": 6, + "tx": "0xe937fa1d7d74544642b228362823791d91ba45b6a82bc0fd2bfc92259fdb8fe0" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x697541181885FE7844C0b9373197BA54c3745D0E", @@ -60289,10 +60794,17 @@ "tx": "0x9f916cf09e8a3c4ade0ffce5190db464d0a2b1dadba78e1ee7ba5d6e751d6148" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "40", + "user": "0xC281e1B72Af15746A231F1e2d393Eee422cB91a7", + "tranche_id": 6, + "tx": "0xce6120be88b9f20ee16458163b5dc64aef919bf5427817f296bc4518719791bc" + } + ], "total_tokens": "40", - "withdrawn_tokens": "0", - "remaining_tokens": "40" + "withdrawn_tokens": "40", + "remaining_tokens": "0" }, { "address": "0x79819dFE0e47b97d6EaFF62fA76B588E5fb61198", @@ -60439,10 +60951,17 @@ "tx": "0x9f916cf09e8a3c4ade0ffce5190db464d0a2b1dadba78e1ee7ba5d6e751d6148" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x5DE853CB6813f9Aefd25635776139d8C0AAaF77A", + "tranche_id": 6, + "tx": "0xdac530dc97a09dce8335182feaaab51f82b81ec29c04d3e4d38c226cdee629a3" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x72e6631ADf75E813c09eCB4ec69B45F461e4fC2a", @@ -60454,10 +60973,17 @@ "tx": "0x9f916cf09e8a3c4ade0ffce5190db464d0a2b1dadba78e1ee7ba5d6e751d6148" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "100", + "user": "0x72e6631ADf75E813c09eCB4ec69B45F461e4fC2a", + "tranche_id": 6, + "tx": "0x14a2b2e39c2bfef4cff4a40ed9cca82ad0b5808e50c7a17ab977c3ff62ce8bd2" + } + ], "total_tokens": "100", - "withdrawn_tokens": "0", - "remaining_tokens": "100" + "withdrawn_tokens": "100", + "remaining_tokens": "0" }, { "address": "0x5e1623A9F268278B9Fd2115AA7b3ec34dc5d98A8", @@ -62174,10 +62700,17 @@ "tx": "0xd23813c30e93f3867eaa257b7aef7052a050b1ee1c1a90102a3f40c5d989fe82" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0xd2Ebd8809FabeB6D5059fe0e3B97acdAA0e915e8", + "tranche_id": 6, + "tx": "0x2cee02cfd48a02d4d2ab0534393d02282cd191004377a5f1305160679c278a38" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0xf0352681BcDBA8296b716d4EE085C27433Fff690", @@ -62396,10 +62929,17 @@ "tx": "0xd23813c30e93f3867eaa257b7aef7052a050b1ee1c1a90102a3f40c5d989fe82" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "250", + "user": "0x45564345F125F78d3C3894A2C5226C673F8eB0Ae", + "tranche_id": 6, + "tx": "0x3c5ae944abb30d0db6b7545f4ef183cfd6fe49424c318c300461277e4adce725" + } + ], "total_tokens": "250", - "withdrawn_tokens": "0", - "remaining_tokens": "250" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x57be0Bb139071b73F1bF20cAa13887D35cc38373", @@ -62853,6 +63393,12 @@ } ], "withdrawals": [ + { + "amount": "80.9816977025", + "user": "0x962CBde0d0104a3fe7e2Fa40105037AAfabC1F46", + "tranche_id": 6, + "tx": "0xd06b71e6e3382fa0e415faa2d466ea43af123853a58a1ae23ceaa4572408bb6d" + }, { "amount": "59.144679105", "user": "0x962CBde0d0104a3fe7e2Fa40105037AAfabC1F46", @@ -62867,8 +63413,8 @@ } ], "total_tokens": "250", - "withdrawn_tokens": "169.0183022975", - "remaining_tokens": "80.9816977025" + "withdrawn_tokens": "250", + "remaining_tokens": "0" }, { "address": "0x4E3D13B98FE0DFf4B7de38e09B6a4607EEd350B3", @@ -64423,10 +64969,17 @@ "tx": "0xe32a466fc780a0fb3fd84a804f622931ebfaf3f428bff0dc6d141270410e75f8" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "200", + "user": "0x7F1e7f6253DD2c64B6818FB2376F0e38e46F9cCD", + "tranche_id": 6, + "tx": "0xe9bc87b901a15d3c5d75c07e65425e154b66aba4782f112a663e8a1690ab17f9" + } + ], "total_tokens": "200", - "withdrawn_tokens": "0", - "remaining_tokens": "200" + "withdrawn_tokens": "200", + "remaining_tokens": "0" }, { "address": "0x9195bCD64d01C55a495f67364fF1d24C9df59540", @@ -64630,10 +65183,17 @@ "tx": "0xe32a466fc780a0fb3fd84a804f622931ebfaf3f428bff0dc6d141270410e75f8" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "200", + "user": "0x949ECa8174BBa367901e9a195B77B2eA7d862c43", + "tranche_id": 6, + "tx": "0x25013a6975754e211e4d2b8406c6a12b95b6bb7538f7c94e31d889562b2c2d93" + } + ], "total_tokens": "200", - "withdrawn_tokens": "0", - "remaining_tokens": "200" + "withdrawn_tokens": "200", + "remaining_tokens": "0" }, { "address": "0x07D1530B3560aFaba17496C011976db37b3fc2Fd", diff --git a/apps/static/src/assets/stagnet1-tranches.json b/apps/static/src/assets/stagnet1-tranches.json index ac492c4ca..f7ce975bf 100644 --- a/apps/static/src/assets/stagnet1-tranches.json +++ b/apps/static/src/assets/stagnet1-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2022-11-26T13:48:10.000Z", "total_added": "100", "total_removed": "0", - "locked_amount": "47.187921740233385", + "locked_amount": "45.544174911212587", "deposits": [ { "amount": "100", @@ -242,7 +242,7 @@ "tranche_end": "2022-10-12T00:53:20.000Z", "total_added": "100", "total_removed": "0", - "locked_amount": "34.71173579401319", + "locked_amount": "33.06798896499239", "deposits": [ { "amount": "100", diff --git a/apps/static/src/assets/testnet-tranches.json b/apps/static/src/assets/testnet-tranches.json index 4b358bf5d..d1f01905f 100644 --- a/apps/static/src/assets/testnet-tranches.json +++ b/apps/static/src/assets/testnet-tranches.json @@ -67,12 +67,112 @@ "tranche_id": 2, "tranche_start": "2021-10-12T00:53:20.000Z", "tranche_end": "2022-10-12T00:53:20.000Z", - "total_added": "0", - "total_removed": "0", - "locked_amount": "0", - "deposits": [], - "withdrawals": [], - "users": [] + "total_added": "1010.000000000000000001", + "total_removed": "668.3761174488", + "locked_amount": "333.9866885464231390003306798896499239", + "deposits": [ + { + "amount": "1000", + "user": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "tx": "0x6c22362848c237c4a5c7134e88c179d6ba90cb79498e0b7a33e4c76089448ddd" + }, + { + "amount": "10.000000000000000001", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tx": "0xcab88d53d9fe946b7089ce0b2e252ed6a589bc8a1900a733fdd6bd3a6fc6f514" + } + ], + "withdrawals": [ + { + "amount": "661.48985286", + "user": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "tx": "0xdabed7e1d1f354e9102f3a678db8fa80cad17596be9b73f9b517fb0417a56954" + }, + { + "amount": "6.6172349061", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tx": "0x5ff4b9826a54f8540e246519c5d3bd4a8ef1adc4fbfc324cf864beef8abd1a97" + }, + { + "amount": "0.26864536", + "user": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "tx": "0x7f8b379c5718352726b63438a4352e0d5657d7f0f08bf103c6fe942226e6d69d" + }, + { + "amount": "0.0003652968", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tx": "0xf65916a587ded089d316b8c9b7ca2d6300f5814beb190860c1bb76dc41e63148" + }, + { + "amount": "0.0000190259", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tx": "0xcbc22a50267244f1cbb61c1018270f7e9d0052815141c7c1158393036e93be5b" + } + ], + "users": [ + { + "address": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "deposits": [ + { + "amount": "1000", + "user": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "tranche_id": 2, + "tx": "0x6c22362848c237c4a5c7134e88c179d6ba90cb79498e0b7a33e4c76089448ddd" + } + ], + "withdrawals": [ + { + "amount": "661.48985286", + "user": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "tranche_id": 2, + "tx": "0xdabed7e1d1f354e9102f3a678db8fa80cad17596be9b73f9b517fb0417a56954" + }, + { + "amount": "0.26864536", + "user": "0x0d18ACaa868f87BB4666F918326141cAEAe893Fa", + "tranche_id": 2, + "tx": "0x7f8b379c5718352726b63438a4352e0d5657d7f0f08bf103c6fe942226e6d69d" + } + ], + "total_tokens": "1000", + "withdrawn_tokens": "661.75849822", + "remaining_tokens": "338.24150178" + }, + { + "address": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "deposits": [ + { + "amount": "10.000000000000000001", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tranche_id": 2, + "tx": "0xcab88d53d9fe946b7089ce0b2e252ed6a589bc8a1900a733fdd6bd3a6fc6f514" + } + ], + "withdrawals": [ + { + "amount": "6.6172349061", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tranche_id": 2, + "tx": "0x5ff4b9826a54f8540e246519c5d3bd4a8ef1adc4fbfc324cf864beef8abd1a97" + }, + { + "amount": "0.0003652968", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tranche_id": 2, + "tx": "0xf65916a587ded089d316b8c9b7ca2d6300f5814beb190860c1bb76dc41e63148" + }, + { + "amount": "0.0000190259", + "user": "0x970Bf6C66E55f90a7D455354954Af5CaBA11318C", + "tranche_id": 2, + "tx": "0xcbc22a50267244f1cbb61c1018270f7e9d0052815141c7c1158393036e93be5b" + } + ], + "total_tokens": "10.000000000000000001", + "withdrawn_tokens": "6.6176192288", + "remaining_tokens": "3.382380771200000001" + } + ] }, { "tranche_id": 3, diff --git a/apps/stats/src/app.tsx b/apps/stats/src/app.tsx index 66430467d..1b1ef0ab3 100644 --- a/apps/stats/src/app.tsx +++ b/apps/stats/src/app.tsx @@ -3,7 +3,7 @@ import { DATA_SOURCES } from './config'; import { Header } from './components/header'; import { StatsManager } from '@vegaprotocol/network-stats'; import { ThemeContext } from '@vegaprotocol/react-helpers'; -import { EnvironmentProvider } from '@vegaprotocol/react-helpers'; +import { EnvironmentProvider } from '@vegaprotocol/network-switcher'; import { useThemeSwitcher } from '@vegaprotocol/react-helpers'; const envName = DATA_SOURCES.envName; diff --git a/apps/stats/tailwind.config.js b/apps/stats/tailwind.config.js index 3c7b5a348..51ca67ff2 100644 --- a/apps/stats/tailwind.config.js +++ b/apps/stats/tailwind.config.js @@ -6,6 +6,7 @@ const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom module.exports = { content: [ join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'), + 'libs/ui-toolkit/src/utils/shared.ts', ...createGlobPatternsForDependencies(__dirname), ], darkMode: 'class', diff --git a/apps/token-e2e/src/integration/app.test.ts b/apps/token-e2e/src/integration/app.test.ts index 267fb2b73..d4ba0c282 100644 --- a/apps/token-e2e/src/integration/app.test.ts +++ b/apps/token-e2e/src/integration/app.test.ts @@ -6,7 +6,7 @@ describe('token', () => { it('should always have a header title based on environment', () => { cy.get('[data-testid="header-title"]', { timeout: 8000 }).should( 'have.text', - `${fairgroundSet ? 'Fairground token' : '$VEGA TOKEN'}` + `${fairgroundSet ? 'Fairground token' : 'VEGA TOKEN'}` ); }); }); diff --git a/apps/token/.env b/apps/token/.env index 998ab3e21..f93bd20e5 100644 --- a/apps/token/.env +++ b/apps/token/.env @@ -25,6 +25,8 @@ NX_ETHEREUM_CHAIN_ID = 3 NX_ETHEREUM_PROVIDER_URL = "https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8" NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" NX_FAIRGROUND = false +NX_IS_NEW_BRIDGE_CONTRACT = true +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET":"https://dev.token.vega.xyz","STAGNET2":"staging2.token.vega.xyz","TESTNET":"token.fairground.wtf","MAINNET":"token.vega.xyz"}' #Test configuration variables CYPRESS_FAIRGROUND = false diff --git a/apps/token/.env.devnet b/apps/token/.env.devnet index 43dfa5712..c236b7ccd 100644 --- a/apps/token/.env.devnet +++ b/apps/token/.env.devnet @@ -1,6 +1,7 @@ # App configuration variables NX_VEGA_ENV = "DEVNET" NX_VEGA_URL = "https://n04.d.vega.xyz/query" +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET":"https://dev.token.vega.xyz","STAGNET2":"staging2.token.vega.xyz","TESTNET":"token.fairground.wtf","MAINNET":"token.vega.xyz"}' NX_ETHEREUM_CHAIN_ID = 3 NX_ETHEREUM_PROVIDER_URL = "https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8" -NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" \ No newline at end of file +NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" diff --git a/apps/token/.env.mainnet b/apps/token/.env.mainnet index 037533823..bf5ba3311 100644 --- a/apps/token/.env.mainnet +++ b/apps/token/.env.mainnet @@ -1,6 +1,7 @@ # App configuration variables NX_VEGA_ENV = "MAINNET" NX_VEGA_URL = "https://api.token.vega.xyz/query" +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET":"https://dev.token.vega.xyz","STAGNET2":"staging2.token.vega.xyz","TESTNET":"token.fairground.wtf","MAINNET":"token.vega.xyz"}' NX_ETHEREUM_CHAIN_ID = 1 NX_ETHEREUM_PROVIDER_URL = "https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8" -NX_ETHERSCAN_URL = "https://etherscan.io" \ No newline at end of file +NX_ETHERSCAN_URL = "https://etherscan.io" diff --git a/apps/token/.env.stagnet1 b/apps/token/.env.stagnet1 index 17d96f986..e27160cc9 100644 --- a/apps/token/.env.stagnet1 +++ b/apps/token/.env.stagnet1 @@ -1,6 +1,7 @@ # App configuration variables NX_VEGA_ENV = "STAGNET" NX_VEGA_URL = "https://n03.s.vega.xyz/query" +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET":"https://dev.token.vega.xyz","STAGNET2":"staging2.token.vega.xyz","TESTNET":"token.fairground.wtf","MAINNET":"token.vega.xyz"}' NX_ETHEREUM_CHAIN_ID = 3 NX_ETHEREUM_PROVIDER_URL = "https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8" -NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" \ No newline at end of file +NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" diff --git a/apps/token/.env.stagnet2 b/apps/token/.env.stagnet2 index b7bcbb54a..64d0833f7 100644 --- a/apps/token/.env.stagnet2 +++ b/apps/token/.env.stagnet2 @@ -1,6 +1,7 @@ # App configuration variables NX_VEGA_ENV = "STAGNET2" NX_VEGA_URL = "https://n03.stagnet2.vega.xyz/query" +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET":"https://dev.token.vega.xyz","STAGNET2":"staging2.token.vega.xyz","TESTNET":"token.fairground.wtf","MAINNET":"token.vega.xyz"}' NX_ETHEREUM_CHAIN_ID = 3 NX_ETHEREUM_PROVIDER_URL = "https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8" -NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" \ No newline at end of file +NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" diff --git a/apps/token/.env.testnet b/apps/token/.env.testnet index 668cc42a7..47d22c4ca 100644 --- a/apps/token/.env.testnet +++ b/apps/token/.env.testnet @@ -1,6 +1,7 @@ # App configuration variables NX_VEGA_ENV = "TESTNET" NX_VEGA_URL = "https://lb.testnet.vega.xyz/query" +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET":"https://dev.token.vega.xyz","STAGNET2":"staging2.token.vega.xyz","TESTNET":"token.fairground.wtf","MAINNET":"token.vega.xyz"}' NX_ETHEREUM_CHAIN_ID = 3 NX_ETHEREUM_PROVIDER_URL = "https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8" -NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" \ No newline at end of file +NX_ETHERSCAN_URL = "https://ropsten.etherscan.io" diff --git a/apps/token/src/app-loader.tsx b/apps/token/src/app-loader.tsx index 2c06ea95f..3ea4ceea8 100644 --- a/apps/token/src/app-loader.tsx +++ b/apps/token/src/app-loader.tsx @@ -1,4 +1,5 @@ import * as Sentry from '@sentry/react'; +import { toBigNum } from '@vegaprotocol/react-helpers'; import { Splash } from '@vegaprotocol/ui-toolkit'; import { useVegaWallet, useEagerConnect } from '@vegaprotocol/wallet'; import { useWeb3React } from '@web3-react/core'; @@ -43,11 +44,16 @@ export const AppLoader = ({ children }: { children: React.ReactElement }) => { vesting.totalStaked(), token.decimals(), ]); + + const totalSupply = toBigNum(supply, decimals); + const totalWallet = toBigNum(totalAssociatedWallet, decimals); + const totalVesting = toBigNum(totalAssociatedVesting, decimals); + appDispatch({ type: AppStateActionType.SET_TOKEN, decimals, - totalSupply: supply, - totalAssociated: totalAssociatedWallet.plus(totalAssociatedVesting), + totalSupply, + totalAssociated: totalWallet.plus(totalVesting), }); setBalancesLoaded(true); } catch (err) { diff --git a/apps/token/src/app.tsx b/apps/token/src/app.tsx index aaa961d8e..3a546c9e7 100644 --- a/apps/token/src/app.tsx +++ b/apps/token/src/app.tsx @@ -1,14 +1,12 @@ import './i18n'; - import React from 'react'; +import { ApolloProvider } from '@apollo/client'; import { BrowserRouter as Router } from 'react-router-dom'; - import { AppLoader } from './app-loader'; import { AppBanner } from './components/app-banner'; import { AppFooter } from './components/app-footer'; import { BalanceManager } from './components/balance-manager'; import { EthWallet } from './components/eth-wallet'; -import { GraphQlProvider } from './components/graphql-provider'; import { TemplateSidebar } from './components/page-templates/template-sidebar'; import { TransactionModal } from './components/transactions-modal'; import { VegaWallet } from './components/vega-wallet'; @@ -20,12 +18,13 @@ import { Web3Provider } from '@vegaprotocol/web3'; import { Connectors } from './lib/web3-connectors'; import { VegaWalletDialogs } from './components/vega-wallet-dialogs'; import { VegaWalletProvider } from '@vegaprotocol/wallet'; -import { EnvironmentProvider } from '@vegaprotocol/react-helpers'; +import { EnvironmentProvider } from '@vegaprotocol/network-switcher'; +import { client } from './lib/apollo-client'; function App() { const sideBar = React.useMemo(() => [, ], []); return ( - + @@ -55,7 +54,7 @@ function App() { - + ); } diff --git a/apps/token/src/components/add-locked-token/add-locked-token.tsx b/apps/token/src/components/add-locked-token/add-locked-token.tsx index 275e0aa76..a715e6bfa 100644 --- a/apps/token/src/components/add-locked-token/add-locked-token.tsx +++ b/apps/token/src/components/add-locked-token/add-locked-token.tsx @@ -1,15 +1,15 @@ import { useTranslation } from 'react-i18next'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; +import { useEnvironment } from '@vegaprotocol/network-switcher'; import { useAddAssetSupported } from '../../hooks/use-add-asset-to-wallet'; import vegaVesting from '../../images/vega_vesting.png'; import { AddTokenButtonLink } from '../add-token-button/add-token-button'; import { Callout } from '@vegaprotocol/ui-toolkit'; export const AddLockedTokenAddress = () => { - const { ADDRESSES } = useEnvironment(); const { t } = useTranslation(); const addSupported = useAddAssetSupported(); + const { ADDRESSES } = useEnvironment(); return ( { return (

- + {bannerMessage} diff --git a/apps/token/src/components/app-footer/app-footer.tsx b/apps/token/src/components/app-footer/app-footer.tsx index 80d0e7469..3618b77c6 100644 --- a/apps/token/src/components/app-footer/app-footer.tsx +++ b/apps/token/src/components/app-footer/app-footer.tsx @@ -1,3 +1,4 @@ +import { Link } from '@vegaprotocol/ui-toolkit'; import { Trans } from 'react-i18next'; import { Links } from '../../config'; @@ -13,8 +14,12 @@ export const AppFooter = () => { i18nKey="footerLinksText" components={{ /* eslint-disable */ - feedbackLink: , - githubLink: , + feedbackLink: ( + + ), + githubLink: ( + + ), /* eslint-enable */ }} /> diff --git a/apps/token/src/components/balance-manager/balance-manager.tsx b/apps/token/src/components/balance-manager/balance-manager.tsx index 4f7e57dee..69ebe1964 100644 --- a/apps/token/src/components/balance-manager/balance-manager.tsx +++ b/apps/token/src/components/balance-manager/balance-manager.tsx @@ -1,8 +1,9 @@ import * as Sentry from '@sentry/react'; +import { toBigNum } from '@vegaprotocol/react-helpers'; +import { useEthereumConfig } from '@vegaprotocol/web3'; import { useWeb3React } from '@web3-react/core'; import React from 'react'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; import { AppStateActionType, useAppState, @@ -10,17 +11,19 @@ import { import { useContracts } from '../../contexts/contracts/contracts-context'; import { useGetAssociationBreakdown } from '../../hooks/use-get-association-breakdown'; import { useGetUserTrancheBalances } from '../../hooks/use-get-user-tranche-balances'; -import { BigNumber } from '../../lib/bignumber'; interface BalanceManagerProps { children: React.ReactElement; } export const BalanceManager = ({ children }: BalanceManagerProps) => { - const { ADDRESSES } = useEnvironment(); const contracts = useContracts(); const { account } = useWeb3React(); - const { appDispatch } = useAppState(); + const { + appState: { decimals }, + appDispatch, + } = useAppState(); + const { config } = useEthereumConfig(); const getUserTrancheBalances = useGetUserTrancheBalances( account || '', @@ -35,17 +38,26 @@ export const BalanceManager = ({ children }: BalanceManagerProps) => { // update balances on connect to Ethereum React.useEffect(() => { const updateBalances = async () => { - if (!account) return; + if (!account || !config) return; try { - const [balance, walletBalance, lien, allowance] = await Promise.all([ - contracts.vesting.getUserBalanceAllTranches(account), + const [b, w, stats, a] = await Promise.all([ + contracts.vesting.userTotalAllTranches(account), contracts.token.balanceOf(account), - contracts.vesting.getLien(account), - contracts.token.allowance(account, ADDRESSES.stakingBridge), + contracts.vesting.userStats(account), + contracts.token.allowance( + account, + config.staking_bridge_contract.address + ), ]); + + const balance = toBigNum(b, decimals); + const walletBalance = toBigNum(w, decimals); + const lien = toBigNum(stats.lien, decimals); + const allowance = toBigNum(a, decimals); + appDispatch({ type: AppStateActionType.UPDATE_ACCOUNT_BALANCES, - balance: new BigNumber(balance), + balance, walletBalance, lien, allowance, @@ -57,11 +69,12 @@ export const BalanceManager = ({ children }: BalanceManagerProps) => { updateBalances(); }, [ + decimals, appDispatch, contracts?.token, contracts?.vesting, account, - ADDRESSES.stakingBridge, + config, ]); // This use effect hook is very expensive and is kept separate to prevent expensive reloading of data. diff --git a/apps/token/src/components/bullet-header/bullet-header.tsx b/apps/token/src/components/bullet-header/bullet-header.tsx index eed46c796..9f76c2bb4 100644 --- a/apps/token/src/components/bullet-header/bullet-header.tsx +++ b/apps/token/src/components/bullet-header/bullet-header.tsx @@ -9,7 +9,7 @@ interface BulletHeaderProps { export const BulletHeader = ({ tag, children, style }: BulletHeaderProps) => { return React.createElement( tag, - { className: 'mt-24 pt-8 pb-20 uppercase', style }, + { className: 'mt-24 pt-8 pb-20 uppercase text-white', style }, <> {children} diff --git a/apps/token/src/components/eth-wallet-container/eth-wallet-container.tsx b/apps/token/src/components/eth-wallet-container/eth-wallet-container.tsx deleted file mode 100644 index 943c40bdf..000000000 --- a/apps/token/src/components/eth-wallet-container/eth-wallet-container.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { useWeb3React } from '@web3-react/core'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; - -import { - AppStateActionType, - useAppState, -} from '../../contexts/app-state/app-state-context'; -import { Ethereum } from '../icons'; -import { Button } from '@vegaprotocol/ui-toolkit'; - -interface EthWalletContainerProps { - children: (address: string) => React.ReactElement; -} - -export const EthWalletContainer = ({ children }: EthWalletContainerProps) => { - const { t } = useTranslation(); - const { appDispatch } = useAppState(); - const { account } = useWeb3React(); - - if (!account) { - return ( - - ); - } - - return children(account); -}; diff --git a/apps/token/src/components/eth-wallet-container/index.ts b/apps/token/src/components/eth-wallet-container/index.ts deleted file mode 100644 index 669004a23..000000000 --- a/apps/token/src/components/eth-wallet-container/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './eth-wallet-container'; diff --git a/apps/token/src/components/eth-wallet/eth-wallet.tsx b/apps/token/src/components/eth-wallet/eth-wallet.tsx index 2605b374c..014ec8f91 100644 --- a/apps/token/src/components/eth-wallet/eth-wallet.tsx +++ b/apps/token/src/components/eth-wallet/eth-wallet.tsx @@ -22,7 +22,7 @@ import { WalletCardHeader, WalletCardRow, } from '../wallet-card'; -import { Button, Loader } from '@vegaprotocol/ui-toolkit'; +import { Loader } from '@vegaprotocol/ui-toolkit'; import { theme } from '@vegaprotocol/tailwindcss-config'; const Colors = theme.colors; @@ -163,15 +163,15 @@ const ConnectedKey = () => { /> )} - - + - - + @@ -187,14 +187,14 @@ export const EthWallet = () => { return ( -

{t('ethereumKey')}

+

{t('ethereumKey')}

{account && ( -
-
{truncateMiddle(account)}
+
+
{truncateMiddle(account)}
{pendingTxs && (
- +
)}
@@ -215,8 +215,8 @@ export const EthWallet = () => { {account ? ( ) : ( - + )} {account && ( diff --git a/apps/token/src/components/graphql-provider/graphql-provider.tsx b/apps/token/src/components/graphql-provider/graphql-provider.tsx deleted file mode 100644 index 7a4a34995..000000000 --- a/apps/token/src/components/graphql-provider/graphql-provider.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { ApolloProvider } from '@apollo/client'; -import React from 'react'; - -import { client } from '../../lib/apollo-client'; - -export const GraphQlProvider = ({ - children, -}: { - children: React.ReactNode; -}) => { - return {children}; -}; diff --git a/apps/token/src/components/graphql-provider/index.ts b/apps/token/src/components/graphql-provider/index.ts deleted file mode 100644 index eb5712fd1..000000000 --- a/apps/token/src/components/graphql-provider/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './graphql-provider'; diff --git a/apps/token/src/components/heading/heading.tsx b/apps/token/src/components/heading/heading.tsx index 31c843164..4c5b91950 100644 --- a/apps/token/src/components/heading/heading.tsx +++ b/apps/token/src/components/heading/heading.tsx @@ -7,7 +7,7 @@ export const Heading = ({ title }: HeadingProps) => { return (
-

+

{title}

diff --git a/apps/token/src/components/loader/index.ts b/apps/token/src/components/loader/index.ts deleted file mode 100644 index 3f3b9e663..000000000 --- a/apps/token/src/components/loader/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './loader'; diff --git a/apps/token/src/components/loader/loader.tsx b/apps/token/src/components/loader/loader.tsx deleted file mode 100644 index b5d53d40c..000000000 --- a/apps/token/src/components/loader/loader.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; - -interface LoaderProps { - invert?: boolean; -} - -export const Loader = ({ invert = false }: LoaderProps) => { - const [, forceRender] = React.useState(false); - - React.useEffect(() => { - const interval = setInterval(() => { - forceRender((x) => !x); - }, 100); - - return () => clearInterval(interval); - }, []); - - return ( - - {new Array(9).fill(null).map((_, i) => { - return ( - 0.5 ? 1 : 0, - }} - className={`block w-5 h-5 opacity-0 ${ - invert ? 'bg-black' : 'bg-white' - }`} - /> - ); - })} - - ); -}; diff --git a/apps/token/src/components/locked-progress/locked-progress.tsx b/apps/token/src/components/locked-progress/locked-progress.tsx index caa264ab5..3c12cb031 100644 --- a/apps/token/src/components/locked-progress/locked-progress.tsx +++ b/apps/token/src/components/locked-progress/locked-progress.tsx @@ -15,7 +15,7 @@ const ProgressContents = ({ }) => (
{children} @@ -72,7 +72,7 @@ export const LockedProgress = ({ unlocked, leftLabel, rightLabel, - leftColor = Colors.pink, + leftColor = Colors.vega.pink, rightColor = Colors.green.DEFAULT, light = false, }: LockedProgressProps) => { diff --git a/apps/token/src/components/nav/nav.tsx b/apps/token/src/components/nav/nav.tsx index 99e82c981..dda04475e 100644 --- a/apps/token/src/components/nav/nav.tsx +++ b/apps/token/src/components/nav/nav.tsx @@ -5,14 +5,13 @@ import debounce from 'lodash/debounce'; import React from 'react'; import * as Dialog from '@radix-ui/react-dialog'; import { useTranslation } from 'react-i18next'; -import { Link, NavLink } from 'react-router-dom'; +import { NavLink } from 'react-router-dom'; import { Flags } from '../../config'; import { AppStateActionType, useAppState, } from '../../contexts/app-state/app-state-context'; -import vegaWhite from '../../images/vega_white.png'; import { Routes } from '../../routes/router-config'; import { EthWallet } from '../eth-wallet'; import { VegaWallet } from '../vega-wallet'; @@ -36,14 +35,14 @@ export const Nav = () => { return (
{isDesktop && } -
+
{!isDesktop && }
{isDesktop ? ( @@ -61,76 +60,10 @@ const NavHeader = ({ fairground }: { fairground: boolean }) => { const { t } = useTranslation(); return ( -
- - {fairground ? ( - - - - - - - - - - - - - - - - - - - - - ) : ( - Vega - )} - +

diff --git a/apps/token/src/components/page-templates/template-sidebar.tsx b/apps/token/src/components/page-templates/template-sidebar.tsx index c8a959f65..971ce54cc 100644 --- a/apps/token/src/components/page-templates/template-sidebar.tsx +++ b/apps/token/src/components/page-templates/template-sidebar.tsx @@ -12,7 +12,7 @@ export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) {
) : ( -

+

-

- - - + + + +

); } diff --git a/apps/token/src/routes/staking/validator-table.tsx b/apps/token/src/routes/staking/validator-table.tsx index 557551422..041d0ab66 100644 --- a/apps/token/src/routes/staking/validator-table.tsx +++ b/apps/token/src/routes/staking/validator-table.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from '@vegaprotocol/ui-toolkit'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; +import { useEnvironment } from '@vegaprotocol/network-switcher'; import { KeyValueTable, KeyValueTableRow } from '@vegaprotocol/ui-toolkit'; import { BigNumber } from '../../lib/bignumber'; import { formatNumber } from '../../lib/format-number'; @@ -59,8 +59,9 @@ export const ValidatorTable = ({ {t('ETHEREUM ADDRESS')} {node.ethereumAdddress} diff --git a/apps/token/src/routes/tranches/tranche-label.spex.tsx b/apps/token/src/routes/tranches/tranche-label.spec.tsx similarity index 65% rename from apps/token/src/routes/tranches/tranche-label.spex.tsx rename to apps/token/src/routes/tranches/tranche-label.spec.tsx index e391cca1c..cc429f8af 100644 --- a/apps/token/src/routes/tranches/tranche-label.spex.tsx +++ b/apps/token/src/routes/tranches/tranche-label.spec.tsx @@ -1,10 +1,5 @@ import { render } from '@testing-library/react'; -import { - EthereumChainIds, - EnvironmentConfig, - Networks, -} from '@vegaprotocol/smart-contracts'; import type { TrancheLabelProps } from './tranche-label'; import { TrancheLabel } from './tranche-label'; @@ -12,14 +7,13 @@ let props: TrancheLabelProps; beforeEach(() => { props = { - chainId: EthereumChainIds.Mainnet, - contract: EnvironmentConfig[Networks.MAINNET].vestingAddress, + chainId: 1, id: 5, }; }); it('Renders null for right contract address, wrong network', () => { - const WRONG_CHAIN = EthereumChainIds.Goerli; + const WRONG_CHAIN = 3; const { container } = render( ); @@ -27,16 +21,6 @@ it('Renders null for right contract address, wrong network', () => { expect(container).toBeEmptyDOMElement(); }); -it('Renders null for right network, wrong contract address', () => { - const WRONG_ADDRESS = '0x0'; - - const { container } = render( - - ); - - expect(container).toBeEmptyDOMElement(); -}); - it('Renders null for right network, right contract address, tranche without a name', () => { const UNNAMED_TRANCHE = 0; diff --git a/apps/token/src/routes/tranches/tranche-label.tsx b/apps/token/src/routes/tranches/tranche-label.tsx index 54154e7f5..7a12ed1e2 100644 --- a/apps/token/src/routes/tranches/tranche-label.tsx +++ b/apps/token/src/routes/tranches/tranche-label.tsx @@ -1,7 +1,3 @@ -import type { EthereumChainId } from '@vegaprotocol/smart-contracts'; -import { EthereumChainIds } from '@vegaprotocol/smart-contracts'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; - const TRANCHE_LABELS: Record = { '5': ['Coinlist Option 1', 'Community Whitelist'], '6': ['Coinlist Option 2'], @@ -11,8 +7,7 @@ const TRANCHE_LABELS: Record = { }; export interface TrancheLabelProps { - chainId: EthereumChainId | null; - contract: string; + chainId: number | undefined; id: number; } @@ -26,14 +21,9 @@ export interface TrancheLabelProps { * @param chainId The ID of the chain this contract is on * @param id The tranche ID on this contract */ -export const TrancheLabel = ({ contract, chainId, id }: TrancheLabelProps) => { - const { ADDRESSES } = useEnvironment(); +export const TrancheLabel = ({ chainId, id }: TrancheLabelProps) => { // Only mainnet tranches on the known vesting contract have useful name - if ( - chainId && - chainId === EthereumChainIds.Mainnet && - contract === ADDRESSES.vestingAddress - ) { + if (chainId === 1) { // Only some tranches have titles worth showing if (TRANCHE_LABELS[id]) { return ( diff --git a/apps/token/src/routes/tranches/tranche-progress.tsx b/apps/token/src/routes/tranches/tranche-progress.tsx index 095e1279e..213f5b66c 100644 --- a/apps/token/src/routes/tranches/tranche-progress.tsx +++ b/apps/token/src/routes/tranches/tranche-progress.tsx @@ -29,7 +29,7 @@ export const TrancheProgress = ({ {t('Locked')} diff --git a/apps/token/src/routes/tranches/tranche.tsx b/apps/token/src/routes/tranches/tranche.tsx index 3a429be92..bff32105a 100644 --- a/apps/token/src/routes/tranches/tranche.tsx +++ b/apps/token/src/routes/tranches/tranche.tsx @@ -1,7 +1,5 @@ -import type { - Tranche as ITranche, - EthereumChainId, -} from '@vegaprotocol/smart-contracts'; +import type { Tranche as ITranche } from '@vegaprotocol/smart-contracts'; +import { Link } from '@vegaprotocol/ui-toolkit'; import { useWeb3React } from '@web3-react/core'; import React from 'react'; import { useTranslation } from 'react-i18next'; @@ -9,8 +7,7 @@ import { useParams } from 'react-router'; import { Navigate } from 'react-router-dom'; import { useOutletContext } from 'react-router-dom'; -import { Link } from '@vegaprotocol/ui-toolkit'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; +import { useEnvironment } from '@vegaprotocol/network-switcher'; import { BigNumber } from '../../lib/bignumber'; import { formatNumber } from '../../lib/format-number'; import { TrancheItem } from '../redemption/tranche-item'; @@ -29,7 +26,7 @@ const TrancheProgressContents = ({ export const Tranche = () => { const tranches = useOutletContext(); - const { ADDRESSES, ETHERSCAN_URL } = useEnvironment(); + const { ETHERSCAN_URL } = useEnvironment(); const { t } = useTranslation(); const { trancheId } = useParams<{ trancheId: string }>(); const { chainId } = useWeb3React(); @@ -58,11 +55,7 @@ export const Tranche = () => { unlocked={tranche.total_added.minus(tranche.locked_amount)} total={tranche.total_added} secondaryHeader={ - + } />
{ return (
  • {user.address} diff --git a/apps/token/src/routes/tranches/tranches.tsx b/apps/token/src/routes/tranches/tranches.tsx index fed3d559a..fd2e494e4 100644 --- a/apps/token/src/routes/tranches/tranches.tsx +++ b/apps/token/src/routes/tranches/tranches.tsx @@ -1,5 +1,5 @@ import { useOutletContext } from 'react-router-dom'; -import type { Tranche, EthereumChainId } from '@vegaprotocol/smart-contracts'; +import type { Tranche } from '@vegaprotocol/smart-contracts'; import { useWeb3React } from '@web3-react/core'; import React from 'react'; import { useTranslation } from 'react-i18next'; @@ -8,7 +8,7 @@ import { TrancheItem } from '../redemption/tranche-item'; import { TrancheLabel } from './tranche-label'; import { VestingChart } from './vesting-chart'; import { Button } from '@vegaprotocol/ui-toolkit'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; +import { useEthereumConfig } from '@vegaprotocol/web3'; const trancheMinimum = 10; @@ -16,13 +16,17 @@ const shouldShowTranche = (t: Tranche) => !t.total_added.isLessThanOrEqualTo(trancheMinimum); export const Tranches = () => { - const { ADDRESSES } = useEnvironment(); const tranches = useOutletContext(); const [showAll, setShowAll] = React.useState(false); const { t } = useTranslation(); const { chainId } = useWeb3React(); + const { config } = useEthereumConfig(); const filteredTranches = tranches?.filter(shouldShowTranche) || []; + if (!config) { + return null; + } + return (

    {t('chartTitle')}

    @@ -41,11 +45,7 @@ export const Tranches = () => { unlocked={tranche.total_added.minus(tranche.locked_amount)} total={tranche.total_added} secondaryHeader={ - + } /> diff --git a/apps/token/src/routes/tranches/vesting-chart.tsx b/apps/token/src/routes/tranches/vesting-chart.tsx index 666919fba..767d38ce5 100644 --- a/apps/token/src/routes/tranches/vesting-chart.tsx +++ b/apps/token/src/routes/tranches/vesting-chart.tsx @@ -33,8 +33,8 @@ export const VestingChart = () => { {[ - ['pink', Colors.pink], - ['green', Colors.green.vega], + ['pink', Colors.vega.pink], + ['green', Colors.vega.green], ['orange', Colors.orange], ['yellow', Colors.yellow.DEFAULT], ].map(([key, color]) => ( @@ -95,7 +95,7 @@ export const VestingChart = () => { dot={false} type="linear" dataKey="team" - stroke={Colors.pink} + stroke={Colors.vega.pink} fill="url(#pink)" yAxisId={0} strokeWidth={2} @@ -107,7 +107,7 @@ export const VestingChart = () => { dot={false} type="monotone" dataKey="earlyInvestors" - stroke={Colors.green.vega} + stroke={Colors.vega.green} fill="url(#green)" yAxisId={0} strokeWidth={2} diff --git a/apps/token/src/routes/withdraw/index.tsx b/apps/token/src/routes/withdraw/index.tsx index 89dc9b1ac..00be00cd4 100644 --- a/apps/token/src/routes/withdraw/index.tsx +++ b/apps/token/src/routes/withdraw/index.tsx @@ -15,6 +15,7 @@ import type { WithdrawPageVariables, } from './__generated__/WithdrawPage'; import { WithdrawManager } from '@vegaprotocol/withdraws'; +import { Flags } from '../../config'; const Withdraw = () => { const { t } = useTranslation(); @@ -22,7 +23,7 @@ const Withdraw = () => { return ( <> -

    {t('withdrawPageText')}

    +

    {t('withdrawPageText')}

    {(currVegaKey) => } @@ -138,18 +139,22 @@ export const WithdrawContainer = ({ currVegaKey }: WithdrawContainerProps) => {
    -

    {t('pendingWithdrawalsCalloutText')}

    -

    - +

    {t('pendingWithdrawalsCalloutText')}

    +

    + {t('pendingWithdrawalsCalloutButton')}

    )} - + ); }; diff --git a/apps/token/src/routes/withdrawals/index.tsx b/apps/token/src/routes/withdrawals/index.tsx index 5894bafd6..b00aae9ba 100644 --- a/apps/token/src/routes/withdrawals/index.tsx +++ b/apps/token/src/routes/withdrawals/index.tsx @@ -1,16 +1,15 @@ -import { Splash } from '@vegaprotocol/ui-toolkit'; +import { Button, Splash } from '@vegaprotocol/ui-toolkit'; import { format } from 'date-fns'; import orderBy from 'lodash/orderBy'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from '@vegaprotocol/ui-toolkit'; -import { useEnvironment } from '@vegaprotocol/react-helpers'; +import { useEnvironment } from '@vegaprotocol/network-switcher'; import { Heading } from '../../components/heading'; import { KeyValueTable, KeyValueTableRow } from '@vegaprotocol/ui-toolkit'; import { SplashLoader } from '../../components/splash-loader'; import { VegaWalletContainer } from '../../components/vega-wallet-container'; -import type { VegaKeyExtended } from '@vegaprotocol/wallet'; import { BigNumber } from '../../lib/bignumber'; import { DATE_FORMAT_DETAILED } from '../../lib/date-formats'; import { addDecimal } from '../../lib/decimals'; @@ -19,6 +18,7 @@ import type { Withdrawals_party_withdrawals } from '@vegaprotocol/withdraws'; import { useCompleteWithdraw, useWithdrawals } from '@vegaprotocol/withdraws'; import { TransactionDialog } from '@vegaprotocol/web3'; import { WithdrawalStatus } from '../../__generated__/globalTypes'; +import { Flags } from '../../config'; const Withdrawals = () => { const { t } = useTranslation(); @@ -27,23 +27,17 @@ const Withdrawals = () => { <> - {(currVegaKey) => ( - - )} + {(currVegaKey) => } ); }; -interface WithdrawPendingContainerProps { - currVegaKey: VegaKeyExtended; -} - -const WithdrawPendingContainer = ({ - currVegaKey, -}: WithdrawPendingContainerProps) => { +const WithdrawPendingContainer = () => { const { t } = useTranslation(); - const { transaction, submit } = useCompleteWithdraw(); + const { transaction, submit } = useCompleteWithdraw( + Flags.USE_NEW_BRIDGE_CONTRACT + ); const { data, loading, error } = useWithdrawals(); const withdrawals = React.useMemo(() => { @@ -80,11 +74,11 @@ const WithdrawPendingContainer = ({ return ( <>

    {t('withdrawalsPreparedWarningHeading')}

    -

    {t('withdrawalsText')}

    -

    {t('withdrawalsPreparedWarningText')}

    +

    {t('withdrawalsText')}

    +

    {t('withdrawalsPreparedWarningText')}