d8bf887245
* delete token version of vega wallet serivce * update use-user-vote to use new wallet service * remove typo * add further types for transaction submissions, add assets to withdraw page query * update api client package to get generated types, adjust render logic of withdrawals page * fix withdrawals list rendering * update determine id function to not use nodejs buffer * update service api client so it accepts new tx types * remove stray logs and formatting * make filtering erc20 assets the responsibility of the withdraw/deposit lib and not the app * remove sha3 dep and use js-sha3 and ethers to determine ids * use hook for fetching withdrawals form lib, add type policy to ensure withdrawal state is updated correctly * fix: markets page feature
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import type { EthereumConfig } from '../../../components/web3-container/web3-container';
|
|
import { gql } from '@apollo/client';
|
|
import { PageQueryContainer } from '../../../components/page-query-container';
|
|
import type { DepositPage } from './__generated__/DepositPage';
|
|
import { DepositManager } from '@vegaprotocol/deposits';
|
|
import { t } from '@vegaprotocol/react-helpers';
|
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
|
import { ASSET_FRAGMENT } from '../../../lib/query-fragments';
|
|
|
|
const DEPOSIT_PAGE_QUERY = gql`
|
|
${ASSET_FRAGMENT}
|
|
query DepositPage {
|
|
assets {
|
|
...AssetFields
|
|
}
|
|
}
|
|
`;
|
|
|
|
interface DepositContainerProps {
|
|
ethereumConfig: EthereumConfig;
|
|
assetId?: string;
|
|
}
|
|
|
|
/**
|
|
* Fetches data required for the Deposit page
|
|
*/
|
|
export const DepositContainer = ({
|
|
ethereumConfig,
|
|
assetId,
|
|
}: DepositContainerProps) => {
|
|
return (
|
|
<PageQueryContainer<DepositPage>
|
|
query={DEPOSIT_PAGE_QUERY}
|
|
render={(data) => {
|
|
if (!data.assets?.length) {
|
|
return (
|
|
<Splash>
|
|
<p>{t('No assets on this network')}</p>
|
|
</Splash>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<DepositManager
|
|
bridgeAddress={ethereumConfig.collateral_bridge_contract.address}
|
|
requiredConfirmations={ethereumConfig.confirmations}
|
|
assets={data.assets}
|
|
initialAssetId={assetId}
|
|
/>
|
|
);
|
|
}}
|
|
/>
|
|
);
|
|
};
|