Compare commits
39
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfea7eba61 | ||
|
|
ace45053c2 | ||
|
|
7cfaf02d09 | ||
|
|
c803cafd53 | ||
|
|
aa2b755b93 | ||
|
|
4a7296312a | ||
|
|
1418a2259f | ||
|
|
7e5ef0157a | ||
|
|
0cf764f11e | ||
|
|
1c626aeeb2 | ||
|
|
c4cec47b0b | ||
|
|
1a67c41bb4 | ||
|
|
fc66240390 | ||
|
|
fc0da98683 | ||
|
|
4d0dafb113 | ||
|
|
eda431be9e | ||
|
|
4ff1749e54 | ||
|
|
e7a108fd7a | ||
|
|
5d3f2ea7d8 | ||
|
|
1ab27574ca | ||
|
|
0ea3c43e78 | ||
|
|
9e183568b0 | ||
|
|
69fd5b26b6 | ||
|
|
2d5b926609 | ||
|
|
98a2ba79a8 | ||
|
|
0e6e986937 | ||
|
|
15d6ea0c05 | ||
|
|
0358ce6293 | ||
|
|
0791be4636 | ||
|
|
07442848ee | ||
|
|
d5f0bd419e | ||
|
|
2c7934a8c7 | ||
|
|
fae61c28ca | ||
|
|
fcd4541625 | ||
|
|
8e0a92fdec | ||
|
|
6e7109ed87 | ||
|
|
f2c698ce06 | ||
|
|
ad9a3a3400 | ||
|
|
efeac49d58 |
@@ -33,5 +33,4 @@ jobs:
|
||||
config: baseUrl=${{ github.event.inputs.url }}
|
||||
env: grepTags=@live
|
||||
env:
|
||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
######
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: yarn nx run ${{ matrix.project }}:e2e ${{ env.SKIP_CACHE }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome --env.grepTags="${{ inputs.tags }}"
|
||||
run: yarn nx run ${{ matrix.project }}:e2e ${{ env.SKIP_CACHE }} --browser chrome --env.grepTags="${{ inputs.tags }}"
|
||||
working-directory: frontend-monorepo
|
||||
env:
|
||||
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
||||
|
||||
@@ -190,3 +190,38 @@ jobs:
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \
|
||||
https://api.fleek.co/graphql
|
||||
|
||||
- name: Checkout vega.xyz
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: vegaprotocol/vega.xyz
|
||||
path: './vega-xyz'
|
||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Update hash on interstitial page
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||
run: |
|
||||
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
||||
tar -xzf kubo.tgz
|
||||
export PATH="$PATH:$PWD/kubo"
|
||||
which ipfs
|
||||
new_hash=$(cat ${{ matrix.app }}-ipfs-hash)
|
||||
cd vega-xyz
|
||||
./interstital-allow-update.sh ${new_hash}
|
||||
git config --global user.email "vega-ci-bot@vega.xyz"
|
||||
git config --global user.name "vega-ci-bot"
|
||||
git add interstitial-allow.json netlify.toml
|
||||
commit_msg="feat(ci): Update CID for console release @ ${{ github.ref }}"
|
||||
git commit -m "${commit_msg}"
|
||||
git push origin main
|
||||
|
||||
# branch_name=${{ github.ref_name }}-hash-update
|
||||
# git checkout -b "${branch_name}"
|
||||
# git add interstitial-allow.json netlify.toml
|
||||
# git push -u origin "${branch_name}"
|
||||
# pr_url="$(gh pr create --title "${commit_msg}" --body 'update ipfs hash for console @ ${{ github.ref }}')"
|
||||
# echo $pr_url
|
||||
# gh pr merge --admin --auto $pr_url
|
||||
|
||||
@@ -57,7 +57,6 @@ context(
|
||||
// 2001-STKE-002, 2001-STKE-032
|
||||
before('visit staking tab and connect vega wallet', function () {
|
||||
cy.visit('/');
|
||||
cy.validatorsSelfDelegate();
|
||||
ethereumWalletConnect();
|
||||
// this is a workaround for #2422 which can be removed once issue is resolved
|
||||
cy.associateTokensToVegaWallet('4');
|
||||
|
||||
@@ -109,7 +109,7 @@ context(
|
||||
);
|
||||
cy.getByTestId('protocol-upgrade-proposal-status').should(
|
||||
'have.text',
|
||||
'Approved '
|
||||
'Approved by validators '
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -136,7 +136,7 @@ context(
|
||||
);
|
||||
cy.getByTestId('protocol-upgrade-state').should(
|
||||
'have.text',
|
||||
'Approved'
|
||||
'Approved by validators'
|
||||
);
|
||||
cy.getByTestId('protocol-upgrade-release-tag').should(
|
||||
'have.text',
|
||||
|
||||
@@ -31,9 +31,6 @@ const totalPenaltyToolTip = '[data-testid="total-penalty-tooltip"]';
|
||||
const epochCountDown = '[data-testid="epoch-countdown"]';
|
||||
const stakeNumberRegex = /^\d{1,3}(,\d{3})*(\.\d+)?$/;
|
||||
|
||||
// If running locally, validators need to have self-stake to be displayed
|
||||
// Run cy.validatorsSelfDelegate() in before hook
|
||||
|
||||
context('Validators Page - verify elements on page', function () {
|
||||
before('navigate to validators page', function () {
|
||||
cy.visit('/validators');
|
||||
|
||||
@@ -33,4 +33,6 @@ before(() => {
|
||||
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||
});
|
||||
// Self stake validators so they are displayed
|
||||
cy.validatorsSelfDelegate();
|
||||
});
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
StakingBridge,
|
||||
Token,
|
||||
TokenVesting,
|
||||
TokenFaucetable,
|
||||
CollateralBridge,
|
||||
} from '@vegaprotocol/smart-contracts';
|
||||
import { ethers, Wallet } from 'ethers';
|
||||
@@ -41,7 +40,7 @@ export async function depositAsset(
|
||||
decimalPlaces: number
|
||||
) {
|
||||
// Approve asset
|
||||
const faucet = new TokenFaucetable(assetEthAddress, signer);
|
||||
const faucet = new Token(assetEthAddress, signer);
|
||||
cy.wrap(
|
||||
faucet.approve(Erc20BridgeAddress, amount + '0'.repeat(decimalPlaces + 1)),
|
||||
{
|
||||
@@ -62,7 +61,7 @@ export async function depositAsset(
|
||||
}
|
||||
|
||||
export async function faucetAsset(assetEthAddress: string) {
|
||||
const faucet = new TokenFaucetable(assetEthAddress, signer);
|
||||
const faucet = new Token(assetEthAddress, signer);
|
||||
await promiseWithTimeout(faucet.faucet(), 10 * 60 * 1000, 'faucet asset');
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ const AppContainer = () => {
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (ENV.dsn && telemetryOn) {
|
||||
if (ENV.dsn && telemetryOn === 'true') {
|
||||
Sentry.init({
|
||||
dsn: ENV.dsn,
|
||||
tracesSampleRate: 0.1,
|
||||
|
||||
@@ -1,23 +1,14 @@
|
||||
import { Button } from '@vegaprotocol/ui-toolkit';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import {
|
||||
AppStateActionType,
|
||||
useAppState,
|
||||
} from '../../contexts/app-state/app-state-context';
|
||||
import { useWeb3ConnectStore } from '@vegaprotocol/web3';
|
||||
|
||||
export const EthConnectPrompt = () => {
|
||||
const { t } = useTranslation();
|
||||
const { appDispatch } = useAppState();
|
||||
const { open } = useWeb3ConnectStore();
|
||||
return (
|
||||
<Button
|
||||
variant="default"
|
||||
onClick={() =>
|
||||
appDispatch({
|
||||
type: AppStateActionType.SET_ETH_WALLET_OVERLAY,
|
||||
isOpen: true,
|
||||
})
|
||||
}
|
||||
onClick={open}
|
||||
fill={true}
|
||||
data-testid="connect-to-eth-btn"
|
||||
>
|
||||
|
||||
@@ -2,10 +2,7 @@ import { Button } from '@vegaprotocol/ui-toolkit';
|
||||
import { useWeb3React } from '@web3-react/core';
|
||||
import type { ReactElement } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
AppStateActionType,
|
||||
useAppState,
|
||||
} from '../../contexts/app-state/app-state-context';
|
||||
import { useWeb3ConnectStore } from '@vegaprotocol/web3';
|
||||
|
||||
export const EthWalletContainer = ({
|
||||
children,
|
||||
@@ -14,21 +11,12 @@ export const EthWalletContainer = ({
|
||||
}) => {
|
||||
const { account } = useWeb3React();
|
||||
const { t } = useTranslation();
|
||||
const { appDispatch } = useAppState();
|
||||
const { open } = useWeb3ConnectStore();
|
||||
|
||||
if (!account) {
|
||||
return (
|
||||
<div className="w-full text-center">
|
||||
<Button
|
||||
onClick={() =>
|
||||
appDispatch({
|
||||
type: AppStateActionType.SET_ETH_WALLET_OVERLAY,
|
||||
isOpen: true,
|
||||
})
|
||||
}
|
||||
>
|
||||
{t('connectEthWallet')}
|
||||
</Button>
|
||||
<Button onClick={open}>{t('connectEthWallet')}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,11 @@ import {
|
||||
import { Loader } from '@vegaprotocol/ui-toolkit';
|
||||
import colors from 'tailwindcss/colors';
|
||||
import { useBalances } from '../../lib/balances/balances-store';
|
||||
import { useEthereumConfig, useWeb3Disconnect } from '@vegaprotocol/web3';
|
||||
import {
|
||||
useEthereumConfig,
|
||||
useWeb3ConnectStore,
|
||||
useWeb3Disconnect,
|
||||
} from '@vegaprotocol/web3';
|
||||
import { getChainName } from '@vegaprotocol/web3';
|
||||
|
||||
const removeLeadingAddressSymbol = (key: string) => {
|
||||
@@ -189,6 +193,7 @@ export const EthWallet = () => {
|
||||
const pendingTxs = usePendingTransactions();
|
||||
const disconnect = useWeb3Disconnect(connector);
|
||||
const { config } = useEthereumConfig();
|
||||
const { open } = useWeb3ConnectStore();
|
||||
|
||||
return (
|
||||
<WalletCard>
|
||||
@@ -233,12 +238,7 @@ export const EthWallet = () => {
|
||||
) : (
|
||||
<Button
|
||||
fill={true}
|
||||
onClick={() =>
|
||||
appDispatch({
|
||||
type: AppStateActionType.SET_ETH_WALLET_OVERLAY,
|
||||
isOpen: true,
|
||||
})
|
||||
}
|
||||
onClick={open}
|
||||
data-testid="connect-to-eth-wallet-button"
|
||||
>
|
||||
{t('connectEthWalletToAssociate')}
|
||||
|
||||
@@ -25,20 +25,26 @@ export function Web3Connector({
|
||||
connectors,
|
||||
chainId,
|
||||
}: Web3ConnectorProps) {
|
||||
const { appState, appDispatch } = useAppState();
|
||||
const { open, close, isOpen } = useWeb3ConnectStore();
|
||||
|
||||
const setDialogOpen = useCallback(
|
||||
(isOpen: boolean) => {
|
||||
appDispatch({ type: AppStateActionType.SET_ETH_WALLET_OVERLAY, isOpen });
|
||||
if (isOpen) {
|
||||
open();
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
},
|
||||
[appDispatch]
|
||||
[open, close]
|
||||
);
|
||||
|
||||
const appChainId = Number(chainId);
|
||||
return (
|
||||
<>
|
||||
<Web3Content appChainId={appChainId}>{children}</Web3Content>
|
||||
<Web3ConnectDialog
|
||||
connectors={connectors}
|
||||
dialogOpen={appState.ethConnectOverlay}
|
||||
dialogOpen={isOpen}
|
||||
setDialogOpen={setDialogOpen}
|
||||
desiredChainId={appChainId}
|
||||
/>
|
||||
|
||||
@@ -34,9 +34,6 @@ export interface AppState {
|
||||
/** Whether or not the manage VEGA wallet overlay is open */
|
||||
vegaWalletManageOverlay: boolean;
|
||||
|
||||
/** Whether or not the connect to Ethereum wallet overlay is open */
|
||||
ethConnectOverlay: boolean;
|
||||
|
||||
/** Whether or not the transaction modal is open */
|
||||
transactionOverlay: boolean;
|
||||
/**
|
||||
@@ -57,7 +54,6 @@ export enum AppStateActionType {
|
||||
REFRESH_BALANCES,
|
||||
SET_VEGA_WALLET_OVERLAY,
|
||||
SET_VEGA_WALLET_MANAGE_OVERLAY,
|
||||
SET_ETH_WALLET_OVERLAY,
|
||||
SET_DRAWER,
|
||||
REFRESH_ASSOCIATED_BALANCES,
|
||||
SET_ASSOCIATION_BREAKDOWN,
|
||||
@@ -81,10 +77,6 @@ export type AppStateAction =
|
||||
type: AppStateActionType.SET_VEGA_WALLET_MANAGE_OVERLAY;
|
||||
isOpen: boolean;
|
||||
}
|
||||
| {
|
||||
type: AppStateActionType.SET_ETH_WALLET_OVERLAY;
|
||||
isOpen: boolean;
|
||||
}
|
||||
| {
|
||||
type: AppStateActionType.SET_DRAWER;
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -16,7 +16,6 @@ const initialAppState: AppState = {
|
||||
totalSupply: new BigNumber(0),
|
||||
vegaWalletOverlay: false,
|
||||
vegaWalletManageOverlay: false,
|
||||
ethConnectOverlay: false,
|
||||
transactionOverlay: false,
|
||||
bannerMessage: '',
|
||||
disconnectNotice: false,
|
||||
@@ -45,12 +44,6 @@ function appStateReducer(state: AppState, action: AppStateAction): AppState {
|
||||
vegaWalletOverlay: action.isOpen ? false : state.vegaWalletOverlay,
|
||||
};
|
||||
}
|
||||
case AppStateActionType.SET_ETH_WALLET_OVERLAY: {
|
||||
return {
|
||||
...state,
|
||||
ethConnectOverlay: action.isOpen,
|
||||
};
|
||||
}
|
||||
case AppStateActionType.SET_DRAWER: {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -788,9 +788,9 @@
|
||||
"homeVegaTokenButtonText": "Manage tokens",
|
||||
"downloadProposalJson": "Download proposal as JSON",
|
||||
"networkUpgrade": "Network Upgrade",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED": "Approved",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_PENDING": "Pending",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_REJECTED": "Rejected",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED": "Approved by validators",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_PENDING": "Waiting for validator votes",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_REJECTED": "Declined by validators",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_UNSPECIFIED": "Unspecified",
|
||||
"vegaRelease{release}": "Vega Release {{release}}",
|
||||
"upgradeBlockHeight": "Upgrade block height",
|
||||
|
||||
@@ -53,7 +53,6 @@ const mockAppState: AppState = {
|
||||
totalSupply: new BigNumber(65000000),
|
||||
vegaWalletOverlay: false,
|
||||
vegaWalletManageOverlay: false,
|
||||
ethConnectOverlay: false,
|
||||
transactionOverlay: false,
|
||||
bannerMessage: '',
|
||||
disconnectNotice: false,
|
||||
|
||||
+3
-1
@@ -32,7 +32,9 @@ describe('ProtocolUpgradeProposalDetailInfo', () => {
|
||||
|
||||
it('should render the state', () => {
|
||||
const { getByTestId } = renderComponent();
|
||||
expect(getByTestId('protocol-upgrade-state')).toHaveTextContent('Pending');
|
||||
expect(getByTestId('protocol-upgrade-state')).toHaveTextContent(
|
||||
'Waiting for validator votes'
|
||||
);
|
||||
});
|
||||
|
||||
it('should render the vega release tag', () => {
|
||||
|
||||
+7
-1
@@ -26,28 +26,34 @@ describe('ProtocolUpgradeProposalsListItem', () => {
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_REJECTED,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-rejected',
|
||||
text: 'Declined by validators',
|
||||
},
|
||||
{
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_PENDING,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-pending',
|
||||
text: 'Waiting for validator votes',
|
||||
},
|
||||
{
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-approved',
|
||||
text: 'Approved by validators',
|
||||
},
|
||||
{
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_UNSPECIFIED,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-unspecified',
|
||||
text: 'Unspecified',
|
||||
},
|
||||
];
|
||||
|
||||
statuses.forEach(({ status, icon }) => {
|
||||
statuses.forEach(({ status, icon, text }) => {
|
||||
renderComponent({ ...proposal, status });
|
||||
const statusIcon = screen.getByTestId(icon);
|
||||
const textContent = screen.getByText(text);
|
||||
expect(statusIcon).toBeInTheDocument();
|
||||
expect(textContent).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ const mockAppState: AppState = {
|
||||
totalSupply: mockTotalSupply,
|
||||
vegaWalletOverlay: false,
|
||||
vegaWalletManageOverlay: false,
|
||||
ethConnectOverlay: false,
|
||||
transactionOverlay: false,
|
||||
bannerMessage: '',
|
||||
disconnectNotice: false,
|
||||
|
||||
+18
-1
@@ -79,7 +79,24 @@ export const generateEpochIndividualRewardsList = ({
|
||||
epoch?.rewards.push(asset);
|
||||
}
|
||||
|
||||
asset.rewardTypes[rewardType] = { amount, percentageOfTotal };
|
||||
if (!asset.rewardTypes[rewardType]) {
|
||||
asset.rewardTypes[rewardType] = { amount, percentageOfTotal };
|
||||
} else {
|
||||
const previousAmount = asset.rewardTypes[rewardType]?.amount;
|
||||
const previousPercentageOfTotal =
|
||||
asset.rewardTypes[rewardType]?.percentageOfTotal;
|
||||
|
||||
asset.rewardTypes[rewardType] = {
|
||||
amount: previousAmount
|
||||
? new BigNumber(previousAmount).plus(amount).toString()
|
||||
: amount,
|
||||
percentageOfTotal: previousPercentageOfTotal
|
||||
? new BigNumber(previousPercentageOfTotal)
|
||||
.plus(percentageOfTotal)
|
||||
.toString()
|
||||
: percentageOfTotal,
|
||||
};
|
||||
}
|
||||
|
||||
// totalAmount is the sum of all rewardTypes amounts
|
||||
asset.totalAmount = Object.values(asset.rewardTypes).reduce(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { ENV } from '../../../config';
|
||||
import { Callout, Intent, Splash } from '@vegaprotocol/ui-toolkit';
|
||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||
@@ -28,6 +29,7 @@ export const NodeContainer = ({
|
||||
const { t } = useTranslation();
|
||||
const { pubKey } = useVegaWallet();
|
||||
const { delegationsPagination } = ENV;
|
||||
|
||||
const { data, loading, error, refetch } = useStakingQuery({
|
||||
variables: {
|
||||
partyId: pubKey || '',
|
||||
@@ -38,6 +40,20 @@ export const NodeContainer = ({
|
||||
: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
const [isRefetching, setIsRefetching] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (error && error.message.includes('failed to get party for ID')) {
|
||||
setIsRefetching(true);
|
||||
// The API errors if there is a pubkey, but it hasn't interacted with the
|
||||
// chain before. In that case, retry the query with empty pubKey
|
||||
refetch({
|
||||
partyId: '',
|
||||
}).finally(() => setIsRefetching(false));
|
||||
}
|
||||
}, [error, refetch, delegationsPagination]);
|
||||
|
||||
const { data: previousEpochData } = usePreviousEpochQuery({
|
||||
variables: {
|
||||
epochId: (Number(data?.epoch.id) - 1).toString(),
|
||||
@@ -47,7 +63,7 @@ export const NodeContainer = ({
|
||||
|
||||
useRefreshAfterEpoch(data?.epoch.timestamps.expiry, refetch);
|
||||
|
||||
if (error) {
|
||||
if (error && !isRefetching) {
|
||||
return (
|
||||
<Callout intent={Intent.Danger} title={t('Something went wrong')}>
|
||||
<pre>
|
||||
@@ -59,7 +75,7 @@ export const NodeContainer = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
if (loading || isRefetching) {
|
||||
return (
|
||||
<Splash>
|
||||
<SplashLoader />
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
[
|
||||
{
|
||||
"tranche_id": 59,
|
||||
"tranche_start": "2024-05-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-11-01T00:00:00.000Z",
|
||||
"total_added": "15000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "15000",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"tx": "0x90af73d7321833fc32445850655a1210f0298845b9222e695e1229801f7a95b0"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": [
|
||||
{
|
||||
"address": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"tranche_id": 59,
|
||||
"tx": "0x90af73d7321833fc32445850655a1210f0298845b9222e695e1229801f7a95b0"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "15000",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "15000"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tranche_id": 58,
|
||||
"tranche_start": "2023-05-11T00:00:00.000Z",
|
||||
@@ -48,8 +81,8 @@
|
||||
"tranche_start": "2023-04-20T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-20T00:00:00.000Z",
|
||||
"total_added": "19242.125",
|
||||
"total_removed": "1979.64045368475",
|
||||
"locked_amount": "5448.4017548225310304875",
|
||||
"total_removed": "2249.511113406525",
|
||||
"locked_amount": "2401.96952025462936594125",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "188",
|
||||
@@ -238,6 +271,11 @@
|
||||
"user": "0xDd7a98557586ce21f770662319C2047C5a3bD605",
|
||||
"tx": "0x47f5bf2c758c5270dd1b6519ac649ddabef8199f8a0bae319e36f8ac5c9c142e"
|
||||
},
|
||||
{
|
||||
"amount": "269.870659721775",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
"tx": "0x156ef84c345adecdf7b1c55756b1f4326716d1b0191ce1a208f614fc807ce033"
|
||||
},
|
||||
{
|
||||
"amount": "202.093666077975",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
@@ -311,6 +349,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "269.870659721775",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
"tranche_id": 56,
|
||||
"tx": "0x156ef84c345adecdf7b1c55756b1f4326716d1b0191ce1a208f614fc807ce033"
|
||||
},
|
||||
{
|
||||
"amount": "202.093666077975",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
@@ -337,8 +381,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "1207.5",
|
||||
"withdrawn_tokens": "597.002068860225",
|
||||
"remaining_tokens": "610.497931139775"
|
||||
"withdrawn_tokens": "866.872728582",
|
||||
"remaining_tokens": "340.627271418"
|
||||
},
|
||||
{
|
||||
"address": "0x33Ce1D9E53AFb7367E34749517C086405a651a95",
|
||||
@@ -899,7 +943,7 @@
|
||||
"tranche_start": "2023-04-06T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-06T00:00:00.000Z",
|
||||
"total_added": "14610",
|
||||
"total_removed": "6675.45090157707",
|
||||
"total_removed": "6918.45090157707",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -1104,6 +1148,21 @@
|
||||
"user": "0x2586bA83696a92b5467Aaa0CF9EEC052F28F2c02",
|
||||
"tx": "0x5aa922056cad64f97a7dfa750da57d63abfdaea4499192d4d57958bfb4fba2ea"
|
||||
},
|
||||
{
|
||||
"amount": "33",
|
||||
"user": "0xBf1AaB792D729fA125e6D7122D4b916a1E1C44B1",
|
||||
"tx": "0xd2c2f11c150797924c49f6022957d701052268c7335ef3927597fca4f1b544a2"
|
||||
},
|
||||
{
|
||||
"amount": "114",
|
||||
"user": "0x8D416A61bCccf4E6aF5598302BC4e41f97401652",
|
||||
"tx": "0x619088e473d63826e10d3516619b505cb0a82884a5b8158146ff8ab79307967d"
|
||||
},
|
||||
{
|
||||
"amount": "96",
|
||||
"user": "0x6324334064d1d807940191C658d925DA7d323b12",
|
||||
"tx": "0xd4d9926de15e6dc4992c47e9fbb9d25bf873d7e331524994bb6139a2953ea96a"
|
||||
},
|
||||
{
|
||||
"amount": "106.53500000286",
|
||||
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
|
||||
@@ -1249,10 +1308,17 @@
|
||||
"tx": "0xc7736d362d5ffdd16dc26f25047f52fa6238f60837e831b149b6ebb25a0d9281"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "33",
|
||||
"user": "0xBf1AaB792D729fA125e6D7122D4b916a1E1C44B1",
|
||||
"tranche_id": 54,
|
||||
"tx": "0xd2c2f11c150797924c49f6022957d701052268c7335ef3927597fca4f1b544a2"
|
||||
}
|
||||
],
|
||||
"total_tokens": "33",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "33"
|
||||
"withdrawn_tokens": "33",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xB0Dbf35C0918536B62a2FbcCC852bCffDB41d6aF",
|
||||
@@ -1399,10 +1465,17 @@
|
||||
"tx": "0x96b16197328b59556848409bcc4ebf1f71648485fabedde2848461247aa4be32"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "96",
|
||||
"user": "0x6324334064d1d807940191C658d925DA7d323b12",
|
||||
"tranche_id": 54,
|
||||
"tx": "0xd4d9926de15e6dc4992c47e9fbb9d25bf873d7e331524994bb6139a2953ea96a"
|
||||
}
|
||||
],
|
||||
"total_tokens": "96",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "96"
|
||||
"withdrawn_tokens": "96",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x268070d5EEd5b24E34a5F4C17B5482178b18089D",
|
||||
@@ -1573,10 +1646,17 @@
|
||||
"tx": "0x09d7342bca4e0fdc9f5a40e18e402b0328991d0df5da17b834c67b149e270808"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "114",
|
||||
"user": "0x8D416A61bCccf4E6aF5598302BC4e41f97401652",
|
||||
"tranche_id": 54,
|
||||
"tx": "0x619088e473d63826e10d3516619b505cb0a82884a5b8158146ff8ab79307967d"
|
||||
}
|
||||
],
|
||||
"total_tokens": "114",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "114"
|
||||
"withdrawn_tokens": "114",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x9E53F72210479BF46aE7ABF77c48B0d611b3c3dB",
|
||||
@@ -1860,7 +1940,7 @@
|
||||
"tranche_start": "2023-03-06T00:00:00.000Z",
|
||||
"tranche_end": "2023-04-06T00:00:00.000Z",
|
||||
"total_added": "14099",
|
||||
"total_removed": "3785.49002352036",
|
||||
"total_removed": "4373.49002352036",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -2630,6 +2710,16 @@
|
||||
"user": "0x2a65Ae527C6Ff4665e048B0E0883c486A7BA4DBc",
|
||||
"tx": "0xb0edcc25e422bc3db3ad8027dfdfc0928abd7a8af8957a1699e4cf2dc8cee8f7"
|
||||
},
|
||||
{
|
||||
"amount": "558",
|
||||
"user": "0xA7f89FF809549F4577993de3d1B3017241a53F40",
|
||||
"tx": "0x84e5ff587c312b578fa946e2dce386cdf19c7638602b12eceaaab7de563f8394"
|
||||
},
|
||||
{
|
||||
"amount": "30",
|
||||
"user": "0x8D416A61bCccf4E6aF5598302BC4e41f97401652",
|
||||
"tx": "0x6a6dc596ec40beefbe40b32666cbef8ea31d1ce73c0c11f57a1e60f9ea242b8d"
|
||||
},
|
||||
{
|
||||
"amount": "30",
|
||||
"user": "0xBe9F912Ad481C61B653463E8F1D2b2b310D49861",
|
||||
@@ -3861,10 +3951,17 @@
|
||||
"tx": "0xecbb3424e425019a8ebdb9326f662c3520f220fbecdfdaa4770c282001a0f5eb"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "30",
|
||||
"user": "0x8D416A61bCccf4E6aF5598302BC4e41f97401652",
|
||||
"tranche_id": 53,
|
||||
"tx": "0x6a6dc596ec40beefbe40b32666cbef8ea31d1ce73c0c11f57a1e60f9ea242b8d"
|
||||
}
|
||||
],
|
||||
"total_tokens": "30",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "30"
|
||||
"withdrawn_tokens": "30",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x83D7eD53E7CB97b542F1F71f40561d51F8019C8B",
|
||||
@@ -4446,10 +4543,17 @@
|
||||
"tx": "0x46d80a145d2f49ef3152cbfaa6d2bb054deabe21396ab43553a3f076e2db62e1"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "558",
|
||||
"user": "0xA7f89FF809549F4577993de3d1B3017241a53F40",
|
||||
"tranche_id": 53,
|
||||
"tx": "0x84e5ff587c312b578fa946e2dce386cdf19c7638602b12eceaaab7de563f8394"
|
||||
}
|
||||
],
|
||||
"total_tokens": "558",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "558"
|
||||
"withdrawn_tokens": "558",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x363D3d06d70761c34D6EfEB25E409A9549E6970D",
|
||||
@@ -4907,7 +5011,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "86666.297",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "49267.8881106870934141481",
|
||||
"locked_amount": "48140.1269815871359888489",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "86666.297",
|
||||
@@ -4973,7 +5077,7 @@
|
||||
"tranche_end": "2023-06-01T00:00:00.000Z",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "281.5177299552299",
|
||||
"locked_amount": "216.275564713064575",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
@@ -5006,7 +5110,7 @@
|
||||
"tranche_end": "2023-11-01T00:00:00.000Z",
|
||||
"total_added": "15000.000000000000015",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "14143.5726147343005141435726147343005",
|
||||
"locked_amount": "13756.37454710145001375637454710145",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1.5e-14",
|
||||
@@ -5048,10 +5152,15 @@
|
||||
"tranche_id": 46,
|
||||
"tranche_start": "2023-11-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-05-01T00:00:00.000Z",
|
||||
"total_added": "7500",
|
||||
"total_added": "22500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "7500",
|
||||
"locked_amount": "22500",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
"tx": "0x959f5eed214f5376e834c2c20ed2a23a75c4465240c2776452ade80afa11ae2e"
|
||||
},
|
||||
{
|
||||
"amount": "7500",
|
||||
"user": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
@@ -5060,6 +5169,21 @@
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": [
|
||||
{
|
||||
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
"tranche_id": 46,
|
||||
"tx": "0x959f5eed214f5376e834c2c20ed2a23a75c4465240c2776452ade80afa11ae2e"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "15000",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "15000"
|
||||
},
|
||||
{
|
||||
"address": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"deposits": [
|
||||
@@ -5094,7 +5218,7 @@
|
||||
"tranche_end": "2023-09-01T00:00:00.000Z",
|
||||
"total_added": "17500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "10699.20428240740825",
|
||||
"locked_amount": "10247.473203502416",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "12500",
|
||||
@@ -5360,8 +5484,8 @@
|
||||
"tranche_start": "2023-02-01T00:00:00.000Z",
|
||||
"tranche_end": "2023-08-01T00:00:00.000Z",
|
||||
"total_added": "37500",
|
||||
"total_removed": "18302.01762945",
|
||||
"locked_amount": "16884.2176949048475",
|
||||
"total_removed": "18500.56159815",
|
||||
"locked_amount": "15900.17840699815875",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -5380,6 +5504,11 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x0a46fa3cc0154727ae4c7abca97bd7e26e6835018f96cf3a3860a9fcc791b9a4"
|
||||
},
|
||||
{
|
||||
"amount": "198.5439687",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xc25a025176872981def8433ef0982ba306737aaf2cf0867f2259fd19492af2b5"
|
||||
},
|
||||
{
|
||||
"amount": "164.727209925",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -5564,6 +5693,12 @@
|
||||
"tranche_id": 34,
|
||||
"tx": "0x0a46fa3cc0154727ae4c7abca97bd7e26e6835018f96cf3a3860a9fcc791b9a4"
|
||||
},
|
||||
{
|
||||
"amount": "198.5439687",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 34,
|
||||
"tx": "0xc25a025176872981def8433ef0982ba306737aaf2cf0867f2259fd19492af2b5"
|
||||
},
|
||||
{
|
||||
"amount": "164.727209925",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -5746,8 +5881,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "7500",
|
||||
"withdrawn_tokens": "4092.25895865",
|
||||
"remaining_tokens": "3407.74104135"
|
||||
"withdrawn_tokens": "4290.80292735",
|
||||
"remaining_tokens": "3209.19707265"
|
||||
},
|
||||
{
|
||||
"address": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
|
||||
@@ -5791,7 +5926,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "129999.45",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "49222.937361909470971875",
|
||||
"locked_amount": "48096.20517293948430816",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129999.45",
|
||||
@@ -5824,7 +5959,7 @@
|
||||
"tranche_end": "2024-04-01T00:00:00.000Z",
|
||||
"total_added": "54144.7663",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "48152.52222157082703945313",
|
||||
"locked_amount": "47449.8785431340723146965",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "54144.7663",
|
||||
@@ -5857,7 +5992,7 @@
|
||||
"tranche_end": "2023-09-03T00:00:00.000Z",
|
||||
"total_added": "62600",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "19636.5893708777252",
|
||||
"locked_amount": "18821.995357686454604",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10000",
|
||||
@@ -6050,7 +6185,7 @@
|
||||
"tranche_end": "2023-09-17T00:00:00.000Z",
|
||||
"total_added": "5000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "1760.1985032978185",
|
||||
"locked_amount": "1695.1350837138507",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "5000",
|
||||
@@ -7119,7 +7254,7 @@
|
||||
"tranche_end": "2023-06-02T00:00:00.000Z",
|
||||
"total_added": "1939928.38",
|
||||
"total_removed": "1709370.7872515768348",
|
||||
"locked_amount": "114240.47288112379901012188",
|
||||
"locked_amount": "88996.7980509664211246026",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1852091.69",
|
||||
@@ -40991,7 +41126,7 @@
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "3732368.4671",
|
||||
"total_removed": "715655.108029600523393",
|
||||
"locked_amount": "200049.157239417195653993231",
|
||||
"locked_amount": "161258.417939562670358424702",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1998.95815",
|
||||
@@ -42383,8 +42518,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "15870102.715470999700000001",
|
||||
"total_removed": "873375.18460711694221852",
|
||||
"locked_amount": "6009049.0528282882857238651980333316436875",
|
||||
"total_removed": "885240.49984321970795352",
|
||||
"locked_amount": "5871499.5818745175664760343676677342903488",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "16249.93",
|
||||
@@ -42903,6 +43038,26 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x989d22d5ba66353cb132b5643100a99e78133e5d40aef1ac91ed6ab0a2290299"
|
||||
},
|
||||
{
|
||||
"amount": "2195.39447101000955",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tx": "0xa515dafd399b366ba7f510ea6314587eb19e83fa92dbd5c2a212f3541a0cc4ef"
|
||||
},
|
||||
{
|
||||
"amount": "6626.72344",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
"tx": "0xdedcbf90e8f19c2a732ba2da663f59b5a19ad94800ddca6a3575019f19e9ca20"
|
||||
},
|
||||
{
|
||||
"amount": "856.50757224183006",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tx": "0xc8835acd2e148eeaacde2a0df0ecad19c22717c7c51b207fdeac9a1af3f98c88"
|
||||
},
|
||||
{
|
||||
"amount": "2186.689752850926125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xb048cb2dcdfc30508770a3a112ddbacd63210f740cc887559660522bd506612c"
|
||||
},
|
||||
{
|
||||
"amount": "10150.87581603206683",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
@@ -45089,6 +45244,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0x989d22d5ba66353cb132b5643100a99e78133e5d40aef1ac91ed6ab0a2290299"
|
||||
},
|
||||
{
|
||||
"amount": "2186.689752850926125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xb048cb2dcdfc30508770a3a112ddbacd63210f740cc887559660522bd506612c"
|
||||
},
|
||||
{
|
||||
"amount": "913.910324501590625",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -46645,8 +46806,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "259998.8875",
|
||||
"withdrawn_tokens": "161285.6283934563635",
|
||||
"remaining_tokens": "98713.2591065436365"
|
||||
"withdrawn_tokens": "163472.318146307289625",
|
||||
"remaining_tokens": "96526.569353692710375"
|
||||
},
|
||||
{
|
||||
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
|
||||
@@ -46873,6 +47034,18 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "2195.39447101000955",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xa515dafd399b366ba7f510ea6314587eb19e83fa92dbd5c2a212f3541a0cc4ef"
|
||||
},
|
||||
{
|
||||
"amount": "856.50757224183006",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xc8835acd2e148eeaacde2a0df0ecad19c22717c7c51b207fdeac9a1af3f98c88"
|
||||
},
|
||||
{
|
||||
"amount": "10150.87581603206683",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
@@ -47163,8 +47336,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "150551.801",
|
||||
"withdrawn_tokens": "91577.204932811647",
|
||||
"remaining_tokens": "58974.596067188353"
|
||||
"withdrawn_tokens": "94629.10697606348661",
|
||||
"remaining_tokens": "55922.69402393651339"
|
||||
},
|
||||
{
|
||||
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
|
||||
@@ -47384,6 +47557,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "6626.72344",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xdedcbf90e8f19c2a732ba2da663f59b5a19ad94800ddca6a3575019f19e9ca20"
|
||||
},
|
||||
{
|
||||
"amount": "1784.722222",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
@@ -47644,8 +47823,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "200000",
|
||||
"withdrawn_tokens": "118742.2403",
|
||||
"remaining_tokens": "81257.7597"
|
||||
"withdrawn_tokens": "125368.96374",
|
||||
"remaining_tokens": "74631.03626"
|
||||
},
|
||||
{
|
||||
"address": "0x1b956E6c00E238194B331eddEFF72Cb5f28A8d01",
|
||||
@@ -59170,8 +59349,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "472355.6199999996",
|
||||
"total_removed": "44544.1737890903416",
|
||||
"locked_amount": "31698.932494320098793185875900572",
|
||||
"total_removed": "44796.7287294743416",
|
||||
"locked_amount": "25552.318114939110235126642617948",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "3000",
|
||||
@@ -65800,6 +65979,16 @@
|
||||
"user": "0x3F9E884B459a6AaC3f66b72555611AdE68a7F472",
|
||||
"tx": "0x4697229c7f272bd3fc06ecdc1b15143d28e20083e15f1b3cadb3fc80e80af180"
|
||||
},
|
||||
{
|
||||
"amount": "186.817193048",
|
||||
"user": "0x0003423D0A1858B6Eaf9a67914aBc67cDF989c2F",
|
||||
"tx": "0x7f120bd664d54bdabddad1ddb7ffdd84fbaa2630f1657289e3a7b11503ec4018"
|
||||
},
|
||||
{
|
||||
"amount": "65.737747336",
|
||||
"user": "0xAc5bd5a3890B12B0da7cF1Ad846F6b8b260B60CC",
|
||||
"tx": "0x8a4862b1fdacb7e24492397fac234152aae4146d9cca2f0a476e918cbe130af7"
|
||||
},
|
||||
{
|
||||
"amount": "182.662252664",
|
||||
"user": "0xb1169C6daAc76bAcaf0D8f87641Fc38fbabe569F",
|
||||
@@ -71055,10 +71244,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "186.817193048",
|
||||
"user": "0x0003423D0A1858B6Eaf9a67914aBc67cDF989c2F",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x7f120bd664d54bdabddad1ddb7ffdd84fbaa2630f1657289e3a7b11503ec4018"
|
||||
}
|
||||
],
|
||||
"total_tokens": "200",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "200"
|
||||
"withdrawn_tokens": "186.817193048",
|
||||
"remaining_tokens": "13.182806952"
|
||||
},
|
||||
{
|
||||
"address": "0x659ce8E49DA0c872AAC44c70496122044CbcA911",
|
||||
@@ -71379,6 +71575,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "65.737747336",
|
||||
"user": "0xAc5bd5a3890B12B0da7cF1Ad846F6b8b260B60CC",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x8a4862b1fdacb7e24492397fac234152aae4146d9cca2f0a476e918cbe130af7"
|
||||
},
|
||||
{
|
||||
"amount": "309.708054284",
|
||||
"user": "0xAc5bd5a3890B12B0da7cF1Ad846F6b8b260B60CC",
|
||||
@@ -71387,8 +71589,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "400",
|
||||
"withdrawn_tokens": "309.708054284",
|
||||
"remaining_tokens": "90.291945716"
|
||||
"withdrawn_tokens": "375.44580162",
|
||||
"remaining_tokens": "24.55419838"
|
||||
},
|
||||
{
|
||||
"address": "0x71bA18Cb18d7Cd338CF6E911882E717A8dEf8041",
|
||||
@@ -88971,7 +89173,7 @@
|
||||
"tranche_start": "2021-12-05T00:00:00.000Z",
|
||||
"tranche_end": "2022-06-05T00:00:00.000Z",
|
||||
"total_added": "171288.42",
|
||||
"total_removed": "70140.5995794947989",
|
||||
"total_removed": "71890.5995794947989",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -93196,6 +93398,41 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xcAEbd70D80D5aB92Ae5A2E1c92F479298826548C",
|
||||
"tx": "0x7ffbc82e96bb7c796feb548a7ca48a7430a47dae3f2e9de859e6d45ac31a4e6c"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xac494D6eC2CcA7C9BD1caD0c1D0516F3706c6b7c",
|
||||
"tx": "0x85a5d2a4faa6490fc25e080f09dc4d9b5fb3857d762042ba2dcbc0f04de41e0c"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x4eE1C5ED78143f298ae4E5E17e538a99E8512db7",
|
||||
"tx": "0xcb7b99dc5240cdcaaed2fae06e9fd8172db0387179fe09b5f1e1cefff16c6025"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x01E41ffFBcBC9DDA6E2e9e7291cA8AcCE1AF2091",
|
||||
"tx": "0x0af2b3703c268eed4532409b52b6fae066207adf80f9dd2fc17b7aacc40f2879"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xa9C1CA1E66CB3063352433843521861844A2Fd33",
|
||||
"tx": "0x8fad99b8976fff57a099e59351ae96379ec3041e32ccce144727eea29cfffe59"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x13A01db15250975cE4f7AddF5C20CC1f5056Fc47",
|
||||
"tx": "0xc4bcffd71245b9f2af79e04fd58740f7b4cce50da80a405403c959563d132f2c"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x2A6Ea2aBEf3D7d7A76CBeF3c297eE0eF9a86BBA8",
|
||||
"tx": "0x163b699e8a25073ad1ad45c8a8f9b1348eb0b648d3f4bc6f3f64648e0ad726bf"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x0E3407C9A94effa675471afe7A9D37e687C32141",
|
||||
@@ -95538,10 +95775,17 @@
|
||||
"tx": "0x87b7e454992157e175f824cbd5cbfd068ce890b8603edcb70174bae9b5c4afc8"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x13A01db15250975cE4f7AddF5C20CC1f5056Fc47",
|
||||
"tranche_id": 6,
|
||||
"tx": "0xc4bcffd71245b9f2af79e04fd58740f7b4cce50da80a405403c959563d132f2c"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x7b4127D262acC0Ff3dB2D0521d1F1f3b602243C2",
|
||||
@@ -98054,10 +98298,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x4eE1C5ED78143f298ae4E5E17e538a99E8512db7",
|
||||
"tranche_id": 6,
|
||||
"tx": "0xcb7b99dc5240cdcaaed2fae06e9fd8172db0387179fe09b5f1e1cefff16c6025"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x1dC24e9601e40013a12CB9976a519860c4eDF359",
|
||||
@@ -98099,10 +98350,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x01E41ffFBcBC9DDA6E2e9e7291cA8AcCE1AF2091",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x0af2b3703c268eed4532409b52b6fae066207adf80f9dd2fc17b7aacc40f2879"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x6EE016F4512C910b401B18087BBAC15412dD97cA",
|
||||
@@ -98436,10 +98694,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xac494D6eC2CcA7C9BD1caD0c1D0516F3706c6b7c",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x85a5d2a4faa6490fc25e080f09dc4d9b5fb3857d762042ba2dcbc0f04de41e0c"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xa7137DA63B53138A6DCdC9D9a010F42F951F1113",
|
||||
@@ -98481,10 +98746,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xa9C1CA1E66CB3063352433843521861844A2Fd33",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x8fad99b8976fff57a099e59351ae96379ec3041e32ccce144727eea29cfffe59"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0xbCd93996629B0fFA1DfaE74Bb6e107ddB1CE7934",
|
||||
@@ -98511,10 +98783,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xcAEbd70D80D5aB92Ae5A2E1c92F479298826548C",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x7ffbc82e96bb7c796feb548a7ca48a7430a47dae3f2e9de859e6d45ac31a4e6c"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x64Aac7Cb63317DE77C331686E0b2dAA41303Adf0",
|
||||
@@ -98593,10 +98872,17 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x2A6Ea2aBEf3D7d7A76CBeF3c297eE0eF9a86BBA8",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x163b699e8a25073ad1ad45c8a8f9b1348eb0b648d3f4bc6f3f64648e0ad726bf"
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x5D84C52FEf44a84298422f0F87147F80145e2043",
|
||||
|
||||
@@ -7,6 +7,9 @@ const marketTitle = 'accordion-title';
|
||||
const externalLink = 'external-link';
|
||||
const accordionContent = 'accordion-content';
|
||||
const providerName = 'provider-name';
|
||||
const oracleBannerStatus = 'oracle-banner-status';
|
||||
const oracleBannerDialogTrigger = 'oracle-banner-dialog-trigger';
|
||||
const oracleFullProfile = 'oracle-full-profile';
|
||||
|
||||
describe('market info is displayed', { tags: '@smoke' }, () => {
|
||||
beforeEach(() => {
|
||||
@@ -29,7 +32,11 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
|
||||
|
||||
it('show oracle banner', () => {
|
||||
cy.getByTestId(marketTitle).contains('Oracle').click();
|
||||
cy.getByTestId('oracle-status').should('contain.text', 'COMPROMISED');
|
||||
cy.getByTestId(oracleBannerStatus).should('contain.text', 'COMPROMISED');
|
||||
cy.getByTestId(oracleBannerDialogTrigger)
|
||||
.should('contain.text', 'Show more')
|
||||
.click();
|
||||
cy.getByTestId(oracleFullProfile).should('exist');
|
||||
});
|
||||
|
||||
it('current fees displayed', () => {
|
||||
|
||||
@@ -291,12 +291,58 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
.should('have.text', '200.00');
|
||||
});
|
||||
|
||||
it('must see a pegged order - ask', () => {
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
side: Schema.Side.SIDE_BUY,
|
||||
peggedOrder: {
|
||||
__typename: 'PeggedOrder',
|
||||
reference: Schema.PeggedReference.PEGGED_REFERENCE_BEST_ASK,
|
||||
offset: '250000',
|
||||
},
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="type"]')
|
||||
.should('have.text', 'Ask - 2.50 Peg limit');
|
||||
});
|
||||
|
||||
it('must see a pegged order - bid', () => {
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
side: Schema.Side.SIDE_SELL,
|
||||
peggedOrder: {
|
||||
__typename: 'PeggedOrder',
|
||||
reference: Schema.PeggedReference.PEGGED_REFERENCE_BEST_BID,
|
||||
offset: '100',
|
||||
},
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="type"]')
|
||||
.should('have.text', 'Bid + 0.001 Peg limit');
|
||||
});
|
||||
|
||||
it('must see a pegged order - mid', () => {
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
side: Schema.Side.SIDE_SELL,
|
||||
peggedOrder: {
|
||||
__typename: 'PeggedOrder',
|
||||
reference: Schema.PeggedReference.PEGGED_REFERENCE_MID,
|
||||
offset: '0.5',
|
||||
},
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="type"]')
|
||||
.should('have.text', 'Mid + 0.00001 Peg limit');
|
||||
});
|
||||
|
||||
it('for market typy must not see a price for active or parked orders', () => {
|
||||
// 7003-MORD-005
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
type: Schema.OrderType.TYPE_MARKET,
|
||||
status: Schema.OrderStatus.STATUS_PARKED,
|
||||
peggedOrder: null,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="price"]')
|
||||
@@ -337,6 +383,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
peggedOrder: {},
|
||||
liquidityProvisionId: '6536',
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { aliasGQLQuery } from '@vegaprotocol/cypress';
|
||||
import * as Schema from '@vegaprotocol/types';
|
||||
import type { CyHttpMessages } from 'cypress/types/net-stubbing';
|
||||
import type { Provider, Status } from '@vegaprotocol/oracles';
|
||||
import type { Provider, Status } from '@vegaprotocol/market-info';
|
||||
import {
|
||||
accountsQuery,
|
||||
assetQuery,
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
function ReactMarkdown({ children }) {
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export default ReactMarkdown;
|
||||
@@ -13,7 +13,7 @@ import { memo, useState } from 'react';
|
||||
import type { ReactNode, ComponentProps } from 'react';
|
||||
import { DepthChartContainer } from '@vegaprotocol/market-depth';
|
||||
import { CandlesChartContainer } from '@vegaprotocol/candles-chart';
|
||||
import { OracleBanner } from '../../components/banner';
|
||||
import { OracleBanner } from '@vegaprotocol/market-info';
|
||||
import {
|
||||
Tab,
|
||||
LocalStoragePersistTabs as Tabs,
|
||||
|
||||
@@ -6,8 +6,8 @@ import { MarketState } from '@vegaprotocol/types';
|
||||
import { subDays } from 'date-fns';
|
||||
import type { MockedResponse } from '@apollo/client/testing';
|
||||
import { MockedProvider } from '@apollo/client/testing';
|
||||
import type { OracleSpecDataConnectionQuery } from '@vegaprotocol/oracles';
|
||||
import { OracleSpecDataConnectionDocument } from '@vegaprotocol/oracles';
|
||||
import type { OracleSpecDataConnectionQuery } from '@vegaprotocol/market-info';
|
||||
import { OracleSpecDataConnectionDocument } from '@vegaprotocol/market-info';
|
||||
import type { VegaWalletContextShape } from '@vegaprotocol/wallet';
|
||||
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
||||
import type {
|
||||
|
||||
@@ -2,8 +2,8 @@ import { render, screen } from '@testing-library/react';
|
||||
import type { Property } from '@vegaprotocol/types';
|
||||
import type { MockedResponse } from '@apollo/client/testing';
|
||||
import { MockedProvider } from '@apollo/client/testing';
|
||||
import type { OracleSpecDataConnectionQuery } from '@vegaprotocol/oracles';
|
||||
import { OracleSpecDataConnectionDocument } from '@vegaprotocol/oracles';
|
||||
import type { OracleSpecDataConnectionQuery } from '@vegaprotocol/market-info';
|
||||
import { OracleSpecDataConnectionDocument } from '@vegaprotocol/market-info';
|
||||
import type { SettlementPriceCellProps } from './settlement-price-cell';
|
||||
import { SettlementPriceCell } from './settlement-price-cell';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DApp, EXPLORER_ORACLE, useLinks } from '@vegaprotocol/environment';
|
||||
import { t } from '@vegaprotocol/i18n';
|
||||
import { useOracleSpecBindingData } from '@vegaprotocol/oracles';
|
||||
import { useOracleSpecBindingData } from '@vegaprotocol/market-info';
|
||||
import { Link } from '@vegaprotocol/ui-toolkit';
|
||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Icon, NavigationLink } from '@vegaprotocol/ui-toolkit';
|
||||
import { t } from '@vegaprotocol/i18n';
|
||||
import { Links, Routes } from '../../pages/client-router';
|
||||
import { COG } from '@blueprintjs/icons/src/generated/iconNames';
|
||||
import { IconNames } from '@blueprintjs/icons';
|
||||
|
||||
export const SettingsButton = ({ withMobile }: { withMobile?: boolean }) => {
|
||||
return (
|
||||
@@ -9,7 +9,7 @@ export const SettingsButton = ({ withMobile }: { withMobile?: boolean }) => {
|
||||
{withMobile ? (
|
||||
t('Settings')
|
||||
) : (
|
||||
<Icon name={COG} className="!align-middle" />
|
||||
<Icon name={IconNames.COG} className="!align-middle" />
|
||||
)}
|
||||
</NavigationLink>
|
||||
);
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
export * from './announcement-banner';
|
||||
export * from './oracle-banner';
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import { t } from '@vegaprotocol/i18n';
|
||||
import { useMarketOracle } from '@vegaprotocol/market-info';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { Intent, NotificationBanner } from '@vegaprotocol/ui-toolkit';
|
||||
|
||||
const oracleStatuses = {
|
||||
UNKNOWN: t(
|
||||
"This public key's proofs have not been verified yet, or no proofs have been provided yet."
|
||||
),
|
||||
GOOD: t("This public key's proofs have been verified."),
|
||||
SUSPICIOUS: t(
|
||||
'This public key is suspected to be acting in bad faith, pending investigation.'
|
||||
),
|
||||
MALICIOUS: t('This public key has been observed acting in bad faith.'),
|
||||
RETIRED: t('This public key is no longer in use.'),
|
||||
COMPROMISED: t(
|
||||
'This public key is no longer in the control of its original owners.'
|
||||
),
|
||||
};
|
||||
|
||||
export const OracleBanner = ({ marketId }: { marketId: string }) => {
|
||||
const oracle = useMarketOracle(marketId);
|
||||
if (!oracle || oracle.status === 'GOOD') {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<NotificationBanner intent={Intent.Danger}>
|
||||
<div>
|
||||
Oracle status for this market is{' '}
|
||||
<span data-testId="oracle-status">{oracle.status}</span>.{' '}
|
||||
{oracleStatuses[oracle.status]}
|
||||
</div>
|
||||
{oracle.status_reason ? (
|
||||
<ReactMarkdown
|
||||
className="react-markdown-container"
|
||||
skipHtml={true}
|
||||
disallowedElements={['img']}
|
||||
linkTarget="_blank"
|
||||
>
|
||||
{oracle.status_reason}
|
||||
</ReactMarkdown>
|
||||
) : null}
|
||||
</NotificationBanner>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { MockedProvider } from '@apollo/client/testing';
|
||||
import type { VegaWalletContextShape } from '@vegaprotocol/wallet';
|
||||
import { VegaWalletContext } from '@vegaprotocol/wallet';
|
||||
import { Navbar } from './navbar';
|
||||
|
||||
describe('Navbar', () => {
|
||||
const pubKey = 'pubKey';
|
||||
it('should be properly rendered', () => {
|
||||
render(
|
||||
<MockedProvider>
|
||||
<MemoryRouter>
|
||||
<VegaWalletContext.Provider
|
||||
value={{ pubKey } as VegaWalletContextShape}
|
||||
>
|
||||
<Navbar theme="dark" />
|
||||
</VegaWalletContext.Provider>
|
||||
</MemoryRouter>
|
||||
</MockedProvider>
|
||||
);
|
||||
expect(screen.getByTestId('Markets')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('Trading')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('Portfolio')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('Markets page route should not match empty market page', () => {
|
||||
render(
|
||||
<MockedProvider>
|
||||
<MemoryRouter initialEntries={['/markets/all']}>
|
||||
<VegaWalletContext.Provider
|
||||
value={{ pubKey } as VegaWalletContextShape}
|
||||
>
|
||||
<Navbar theme="dark" />
|
||||
</VegaWalletContext.Provider>
|
||||
</MemoryRouter>
|
||||
</MockedProvider>
|
||||
);
|
||||
expect(screen.getByTestId('Markets')).toHaveClass('active');
|
||||
expect(screen.getByTestId('Trading')).not.toHaveClass('active');
|
||||
});
|
||||
});
|
||||
@@ -75,7 +75,7 @@ export const Navbar = ({
|
||||
</NavigationLink>
|
||||
</NavigationItem>
|
||||
<NavigationItem>
|
||||
<NavigationLink data-testid="Trading" to={tradingPath}>
|
||||
<NavigationLink data-testid="Trading" to={tradingPath} end>
|
||||
{t('Trading')}
|
||||
</NavigationLink>
|
||||
</NavigationItem>
|
||||
|
||||
@@ -12,13 +12,13 @@ export * from '../fills/src/lib/fills.mock';
|
||||
export * from '../proposals/src/lib/proposals-data-provider/proposals.mock';
|
||||
export * from '../ledger/src/lib/ledger-entries.mock';
|
||||
export * from '../market-depth/src/lib/market-depth.mock';
|
||||
export * from '../market-info/src/components/market-info/market-info.mock';
|
||||
export * from '../market-info/src/lib/components/market-info/market-info.mock';
|
||||
export * from '../market-list/src/lib/market-candles.mock';
|
||||
export * from '../market-list/src/lib/market-data.mock';
|
||||
export * from '../market-list/src/lib/markets-candles.mock';
|
||||
export * from '../market-list/src/lib/markets-data.mock';
|
||||
export * from '../market-list/src/lib/markets.mock';
|
||||
export * from '../oracles/src/lib/oracle-spec-data-connection.mock';
|
||||
export * from '../market-info/src/lib/oracle-spec-data-connection.mock';
|
||||
export * from '../orders/src/lib/components/order-data-provider/orders.mock';
|
||||
export * from '../positions/src/lib/positions.mock';
|
||||
export * from '../network-parameters/src/network-params.mock';
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { gql } from 'graphql-request';
|
||||
import { selfDelegate } from '../capsule/self-delegate';
|
||||
import { requestGQL, setGraphQLEndpoint } from '../capsule/request';
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
@@ -19,112 +21,143 @@ export const addValidatorsSelfDelegate = () => {
|
||||
vegaUrl: Cypress.env('VEGA_URL'),
|
||||
faucetUrl: Cypress.env('FAUCET_URL'),
|
||||
};
|
||||
setGraphQLEndpoint(config.vegaUrl);
|
||||
cy.wrap(getStakedByOperator()).as('selfStakeAmount');
|
||||
cy.get('@selfStakeAmount').then((selfStakeAmount) => {
|
||||
if (String(selfStakeAmount) == '0') {
|
||||
// Get node wallet recovery phrases
|
||||
cy.exec('vegacapsule nodes ls --home-path ~/.vegacapsule/testnet/')
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const obj = JSON.parse(result);
|
||||
console.log(obj);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node0RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node1RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
);
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node0PubKey');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node1PubKey');
|
||||
|
||||
// Get node wallet recovery phrases
|
||||
cy.exec('vegacapsule nodes ls --home-path ~/.vegacapsule/testnet/')
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const obj = JSON.parse(result);
|
||||
console.log(obj);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node0RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node0Id');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node1Id');
|
||||
});
|
||||
|
||||
// Import node wallets
|
||||
cy.exec(
|
||||
'vega wallet import -w node0_wallet --recovery-phrase-file ./src/fixtures/wallet/node0RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node1RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
cy.exec(
|
||||
'vega wallet import -w node1_wallet --recovery-phrase-file ./src/fixtures/wallet/node1RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
);
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node0PubKey');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node1PubKey');
|
||||
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node0Id');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node1Id');
|
||||
});
|
||||
// Initialise api token
|
||||
cy.exec(
|
||||
'vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file ./src/fixtures/wallet/passphrase'
|
||||
);
|
||||
|
||||
// Import node wallets
|
||||
cy.exec(
|
||||
'vega wallet import -w node0_wallet --recovery-phrase-file ./src/fixtures/wallet/node0RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
);
|
||||
cy.exec(
|
||||
'vega wallet import -w node1_wallet --recovery-phrase-file ./src/fixtures/wallet/node1RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
);
|
||||
// Generate api tokens for wallets
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node0_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node0ApiToken');
|
||||
}
|
||||
});
|
||||
|
||||
// Initialise api token
|
||||
cy.exec(
|
||||
'vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file ./src/fixtures/wallet/passphrase'
|
||||
);
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node1_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node1ApiToken');
|
||||
}
|
||||
});
|
||||
|
||||
// Generate api tokens for wallets
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node0_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node0ApiToken');
|
||||
}
|
||||
});
|
||||
cy.updateCapsuleMultiSig();
|
||||
cy.highlight('Validators self-delegating');
|
||||
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node1_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node1ApiToken');
|
||||
}
|
||||
});
|
||||
|
||||
cy.updateCapsuleMultiSig();
|
||||
cy.highlight('Validators self-delegating');
|
||||
|
||||
// Self delegating Node 0 wallet
|
||||
cy.get('@node0PubKey').then((node0PubKey) => {
|
||||
cy.get('@node0ApiToken').then((node0ApiToken) => {
|
||||
cy.get('@node0Id').then((node0Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node0PubKey),
|
||||
String(node0ApiToken),
|
||||
String(node0Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
// Self delegating Node 1 wallet
|
||||
cy.get('@node1PubKey').then((node1PubKey) => {
|
||||
cy.get('@node1ApiToken').then((node1ApiToken) => {
|
||||
cy.get('@node1Id').then((node1Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node1PubKey),
|
||||
String(node1ApiToken),
|
||||
String(node1Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
// Self delegating Node 0 wallet
|
||||
cy.get('@node0PubKey').then((node0PubKey) => {
|
||||
cy.get('@node0ApiToken').then((node0ApiToken) => {
|
||||
cy.get('@node0Id').then((node0Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node0PubKey),
|
||||
String(node0ApiToken),
|
||||
String(node0Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
// Self delegating Node 1 wallet
|
||||
cy.get('@node1PubKey').then((node1PubKey) => {
|
||||
cy.get('@node1ApiToken').then((node1ApiToken) => {
|
||||
cy.get('@node1Id').then((node1Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node1PubKey),
|
||||
String(node1ApiToken),
|
||||
String(node1Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
async function getStakedByOperator() {
|
||||
const query = gql`
|
||||
query ExplorerNodes {
|
||||
nodesConnection {
|
||||
edges {
|
||||
node {
|
||||
stakedByOperator
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const res = await requestGQL<{
|
||||
nodesConnection: {
|
||||
edges: Array<{
|
||||
node: {
|
||||
stakedByOperator: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
}>(query);
|
||||
|
||||
return res.nodesConnection.edges[0].node.stakedByOperator;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
function ReactMarkdown({ children }) {
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export default ReactMarkdown;
|
||||
@@ -36,10 +36,7 @@ export const DepositManager = ({
|
||||
const bridgeContract = useBridgeContract();
|
||||
const closeDepositDialog = useDepositDialog((state) => state.close);
|
||||
|
||||
const { getBalances, reset, balances } = useDepositBalances(
|
||||
asset,
|
||||
isFaucetable
|
||||
);
|
||||
const { getBalances, reset, balances } = useDepositBalances(asset);
|
||||
|
||||
// Set up approve transaction
|
||||
const approve = useSubmitApproval(asset, getBalances);
|
||||
|
||||
@@ -28,13 +28,9 @@ const initialState: DepositBalances = {
|
||||
* Hook which fetches all the balances required for depositing
|
||||
* whenever the asset changes in the form
|
||||
*/
|
||||
export const useDepositBalances = (
|
||||
asset: Asset | undefined,
|
||||
isFaucetable: boolean
|
||||
) => {
|
||||
export const useDepositBalances = (asset: Asset | undefined) => {
|
||||
const tokenContract = useTokenContract(
|
||||
isAssetTypeERC20(asset) ? asset.source.contractAddress : undefined,
|
||||
isFaucetable
|
||||
isAssetTypeERC20(asset) ? asset.source.contractAddress : undefined
|
||||
);
|
||||
const bridgeContract = useBridgeContract();
|
||||
const getAllowance = useGetAllowance(tokenContract, asset);
|
||||
|
||||
@@ -20,8 +20,7 @@ export const useSubmitApproval = (
|
||||
});
|
||||
const { config } = useEthereumConfig();
|
||||
const contract = useTokenContract(
|
||||
isAssetTypeERC20(asset) ? asset.source.contractAddress : undefined,
|
||||
true
|
||||
isAssetTypeERC20(asset) ? asset.source.contractAddress : undefined
|
||||
);
|
||||
|
||||
// When tx is confirmed refresh balances
|
||||
|
||||
@@ -18,8 +18,7 @@ export const useSubmitFaucet = (
|
||||
return state.transactions.find((t) => t?.id === id);
|
||||
});
|
||||
const contract = useTokenContract(
|
||||
isAssetTypeERC20(asset) ? asset.source.contractAddress : undefined,
|
||||
true
|
||||
isAssetTypeERC20(asset) ? asset.source.contractAddress : undefined
|
||||
);
|
||||
|
||||
// When tx is confirmed refresh balances
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
function ReactMarkdown({ children }) {
|
||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export default ReactMarkdown;
|
||||
@@ -39,6 +39,37 @@
|
||||
"passWithNoTests": true
|
||||
}
|
||||
},
|
||||
"storybook": {
|
||||
"executor": "@nrwl/storybook:storybook",
|
||||
"options": {
|
||||
"uiFramework": "@storybook/react",
|
||||
"port": 4400,
|
||||
"config": {
|
||||
"configFolder": "libs/market-info/.storybook"
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"quiet": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"build-storybook": {
|
||||
"executor": "@nrwl/storybook:build",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"uiFramework": "@storybook/react",
|
||||
"outputPath": "dist/storybook/market-info",
|
||||
"config": {
|
||||
"configFolder": "libs/market-info/.storybook"
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"quiet": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"build-spec": {
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export * from './use-market-oracle';
|
||||
@@ -1,2 +1 @@
|
||||
export * from './components';
|
||||
export * from './hooks';
|
||||
export * from './lib';
|
||||
|
||||
Generated
+3
@@ -2,3 +2,6 @@ export * from './market-info';
|
||||
export * from './last-24h-price-change';
|
||||
export * from './last-24h-volume';
|
||||
export * from './fees-breakdown';
|
||||
export * from './oracle-basic-profile';
|
||||
export * from './oracle-full-profile';
|
||||
export * from './oracle-banner';
|
||||
+4
-4
@@ -5,7 +5,7 @@ import {
|
||||
} from '@vegaprotocol/types';
|
||||
import { DataSourceProof } from './market-info-panels';
|
||||
|
||||
jest.mock('@vegaprotocol/oracles', () => ({
|
||||
jest.mock('../../hooks/use-oracle-markets', () => ({
|
||||
useOracleMarkets: () => [],
|
||||
}));
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('DataSourceProof', () => {
|
||||
providers: [],
|
||||
type: 'termination' as const,
|
||||
};
|
||||
render(<DataSourceProof id={''} {...props} />);
|
||||
render(<DataSourceProof dataSourceSpecId={''} {...props} />);
|
||||
expect(
|
||||
screen.getByText('No oracle proof for termination')
|
||||
).toBeInTheDocument();
|
||||
@@ -88,7 +88,7 @@ describe('DataSourceProof', () => {
|
||||
],
|
||||
type: 'settlementData' as const,
|
||||
};
|
||||
render(<DataSourceProof id={''} {...props} />);
|
||||
render(<DataSourceProof dataSourceSpecId={''} {...props} />);
|
||||
expect(
|
||||
screen.getByText('No oracle proof for settlement data')
|
||||
).toBeInTheDocument();
|
||||
@@ -128,7 +128,7 @@ describe('DataSourceProof', () => {
|
||||
providers: [],
|
||||
type: 'termination' as const,
|
||||
};
|
||||
render(<DataSourceProof id={''} {...props} />);
|
||||
render(<DataSourceProof dataSourceSpecId={''} {...props} />);
|
||||
expect(screen.getByText('Internal conditions')).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(
|
||||
+47
-32
@@ -26,13 +26,13 @@ import type { DataSourceDefinition, SignerKind } from '@vegaprotocol/types';
|
||||
import { ConditionOperatorMapping } from '@vegaprotocol/types';
|
||||
import { MarketTradingModeMapping } from '@vegaprotocol/types';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import type { Provider } from '@vegaprotocol/oracles';
|
||||
import { OracleProfileTitle, OracleFullProfile } from '@vegaprotocol/oracles';
|
||||
import type { Provider } from '../../oracle-schema';
|
||||
import {
|
||||
OracleBasicProfile,
|
||||
useOracleProofs,
|
||||
useOracleMarkets,
|
||||
} from '@vegaprotocol/oracles';
|
||||
OracleProfileTitle,
|
||||
OracleFullProfile,
|
||||
} from '../../components';
|
||||
import { useOracleProofs, useOracleMarkets } from '../../hooks';
|
||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||
|
||||
type PanelProps = Pick<
|
||||
@@ -478,7 +478,7 @@ export const OracleInfoPanel = ({
|
||||
}
|
||||
providers={data}
|
||||
type={type}
|
||||
id={dataSourceSpecId}
|
||||
dataSourceSpecId={dataSourceSpecId}
|
||||
/>
|
||||
<ExternalLink
|
||||
data-testid="oracle-spec-links"
|
||||
@@ -500,12 +500,12 @@ export const DataSourceProof = ({
|
||||
data,
|
||||
providers,
|
||||
type,
|
||||
id,
|
||||
dataSourceSpecId,
|
||||
}: {
|
||||
data: DataSourceDefinition;
|
||||
providers: Provider[] | undefined;
|
||||
type: 'settlementData' | 'termination';
|
||||
id: string;
|
||||
dataSourceSpecId: string;
|
||||
}) => {
|
||||
if (data.sourceType.__typename === 'DataSourceDefinitionExternal') {
|
||||
const signers = data.sourceType.sourceType.signers || [];
|
||||
@@ -523,7 +523,7 @@ export const DataSourceProof = ({
|
||||
providers={providers}
|
||||
signer={signer}
|
||||
type={type}
|
||||
id={id}
|
||||
dataSourceSpecId={dataSourceSpecId}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -554,12 +554,12 @@ const OracleLink = ({
|
||||
providers,
|
||||
signer,
|
||||
type,
|
||||
id,
|
||||
dataSourceSpecId,
|
||||
}: {
|
||||
providers: Provider[];
|
||||
signer: SignerKind;
|
||||
type: 'settlementData' | 'termination';
|
||||
id: string;
|
||||
dataSourceSpecId: string;
|
||||
}) => {
|
||||
const signerProviders = providers.filter((p) => {
|
||||
if (signer.__typename === 'PubKey') {
|
||||
@@ -590,7 +590,11 @@ const OracleLink = ({
|
||||
return (
|
||||
<div>
|
||||
{signerProviders.map((provider) => (
|
||||
<OracleProfile key={id} provider={provider} id={id} />
|
||||
<OracleProfile
|
||||
key={dataSourceSpecId}
|
||||
provider={provider}
|
||||
dataSourceSpecId={dataSourceSpecId}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
@@ -611,35 +615,46 @@ const NoOracleProof = ({
|
||||
);
|
||||
};
|
||||
|
||||
const OracleProfile = ({
|
||||
export const OracleDialog = ({
|
||||
provider,
|
||||
id,
|
||||
dataSourceSpecId,
|
||||
open,
|
||||
onChange,
|
||||
}: {
|
||||
dataSourceSpecId: string;
|
||||
provider: Provider;
|
||||
id: string;
|
||||
open: boolean;
|
||||
onChange?: (isOpen: boolean) => void;
|
||||
}) => {
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
const oracleMarkets = useOracleMarkets(provider);
|
||||
return (
|
||||
<div key={provider.name}>
|
||||
<OracleBasicProfile
|
||||
<Dialog
|
||||
title={<OracleProfileTitle provider={provider} />}
|
||||
aria-labelledby="oracle-proof-dialog"
|
||||
open={open}
|
||||
onChange={onChange}
|
||||
>
|
||||
<OracleFullProfile
|
||||
provider={provider}
|
||||
onClick={() => setDialogOpen(!dialogOpen)}
|
||||
dataSourceSpecId={dataSourceSpecId}
|
||||
markets={oracleMarkets}
|
||||
/>
|
||||
<Dialog
|
||||
title={<OracleProfileTitle provider={provider} />}
|
||||
open={dialogOpen}
|
||||
onChange={() => setDialogOpen(!dialogOpen)}
|
||||
aria-labelledby="oracle-proof-dialog"
|
||||
>
|
||||
<OracleFullProfile
|
||||
provider={provider}
|
||||
id={id}
|
||||
key={id}
|
||||
markets={oracleMarkets}
|
||||
/>
|
||||
</Dialog>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
const OracleProfile = (props: {
|
||||
provider: Provider;
|
||||
dataSourceSpecId: string;
|
||||
}) => {
|
||||
const [open, onChange] = useState(false);
|
||||
return (
|
||||
<div key={props.provider.name}>
|
||||
<OracleBasicProfile
|
||||
provider={props.provider}
|
||||
onClick={() => onChange(!open)}
|
||||
/>
|
||||
<OracleDialog {...props} open={open} onChange={onChange} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from './oracle-banner';
|
||||
@@ -0,0 +1,53 @@
|
||||
import { useState } from 'react';
|
||||
import { t } from '@vegaprotocol/i18n';
|
||||
import { useMarketOracle } from '../../hooks';
|
||||
import {
|
||||
Intent,
|
||||
NotificationBanner,
|
||||
ButtonLink,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import { OracleDialog } from '../market-info';
|
||||
|
||||
export const oracleStatuses = {
|
||||
UNKNOWN: t(
|
||||
"This public key's proofs have not been verified yet, or no proofs have been provided yet."
|
||||
),
|
||||
GOOD: t("This public key's proofs have been verified."),
|
||||
SUSPICIOUS: t(
|
||||
'This public key is suspected to be acting in bad faith, pending investigation.'
|
||||
),
|
||||
MALICIOUS: t('This public key has been observed acting in bad faith.'),
|
||||
RETIRED: t('This public key is no longer in use.'),
|
||||
COMPROMISED: t(
|
||||
'This public key is no longer in the control of its original owners.'
|
||||
),
|
||||
};
|
||||
|
||||
export const OracleBanner = ({ marketId }: { marketId: string }) => {
|
||||
const [open, onChange] = useState(false);
|
||||
const oracle = useMarketOracle(marketId);
|
||||
if (!oracle || oracle.provider.oracle.status === 'GOOD') {
|
||||
return null;
|
||||
}
|
||||
const { provider } = oracle;
|
||||
return (
|
||||
<>
|
||||
<OracleDialog open={open} onChange={onChange} {...oracle} />
|
||||
<NotificationBanner intent={Intent.Danger}>
|
||||
<div>
|
||||
Oracle status for this market is{' '}
|
||||
<span data-testid="oracle-banner-status">
|
||||
{provider.oracle.status}
|
||||
</span>
|
||||
. {oracleStatuses[provider.oracle.status]}{' '}
|
||||
<ButtonLink
|
||||
onClick={() => onChange(!open)}
|
||||
data-testid="oracle-banner-dialog-trigger"
|
||||
>
|
||||
{t('Show more')}
|
||||
</ButtonLink>
|
||||
</div>
|
||||
</NotificationBanner>
|
||||
</>
|
||||
);
|
||||
};
|
||||
+6
-2
@@ -31,7 +31,11 @@ describe('OracleFullProfile', () => {
|
||||
|
||||
it('should render successfully', () => {
|
||||
const component = (
|
||||
<OracleFullProfile provider={testProvider} id={''} markets={[]} />
|
||||
<OracleFullProfile
|
||||
provider={testProvider}
|
||||
dataSourceSpecId={''}
|
||||
markets={[]}
|
||||
/>
|
||||
);
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
@@ -40,7 +44,7 @@ describe('OracleFullProfile', () => {
|
||||
render(
|
||||
<OracleFullProfile
|
||||
provider={testProvider}
|
||||
id={'oracle-id'}
|
||||
dataSourceSpecId={'oracle-id'}
|
||||
markets={[]}
|
||||
/>
|
||||
);
|
||||
+1
-1
@@ -7,7 +7,7 @@ export default {
|
||||
} as Meta;
|
||||
|
||||
const Template: Story = (args) => (
|
||||
<OracleFullProfile provider={args['provider']} id="4578" />
|
||||
<OracleFullProfile provider={args['provider']} dataSourceSpecId="4578" />
|
||||
);
|
||||
|
||||
export const OraclePrimary = Template.bind({});
|
||||
+40
-29
@@ -2,19 +2,19 @@ import { t } from '@vegaprotocol/i18n';
|
||||
import type { Provider } from '../../oracle-schema';
|
||||
import { MarketState, MarketStateMapping } from '@vegaprotocol/types';
|
||||
import {
|
||||
ButtonLink,
|
||||
ExternalLink,
|
||||
Icon,
|
||||
Intent,
|
||||
VegaIcon,
|
||||
VegaIconNames,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import { oracleStatuses } from '../oracle-banner';
|
||||
import type { IconName } from '@blueprintjs/icons';
|
||||
import classNames from 'classnames';
|
||||
import { getLinkIcon, getVerifiedStatusIcon } from '../oracle-basic-profile';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import type { OracleMarketSpecFieldsFragment } from '../../__generated__/OracleMarketsSpec';
|
||||
import { useState } from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
|
||||
export const OracleProfileTitle = ({ provider }: { provider: Provider }) => {
|
||||
const { icon, intent } = getVerifiedStatusIcon(provider);
|
||||
@@ -49,18 +49,35 @@ export const OracleProfileTitle = ({ provider }: { provider: Provider }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const OracleStatus = ({ oracle }: { oracle: Provider['oracle'] }) => (
|
||||
<div>
|
||||
{t(`Oracle status`)}: {oracle.status}. {oracleStatuses[oracle.status]}
|
||||
{oracle.status_reason ? (
|
||||
<div>
|
||||
<ReactMarkdown
|
||||
className="react-markdown-container"
|
||||
skipHtml={true}
|
||||
disallowedElements={['img']}
|
||||
linkTarget="_blank"
|
||||
>
|
||||
{oracle.status_reason}
|
||||
</ReactMarkdown>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
export const OracleFullProfile = ({
|
||||
provider,
|
||||
id,
|
||||
dataSourceSpecId,
|
||||
markets: oracleMarkets,
|
||||
}: {
|
||||
provider: Provider;
|
||||
id: string;
|
||||
dataSourceSpecId: string;
|
||||
markets?: OracleMarketSpecFieldsFragment[] | undefined;
|
||||
}) => {
|
||||
const { message } = getVerifiedStatusIcon(provider);
|
||||
const { VEGA_EXPLORER_URL } = useEnvironment();
|
||||
const [showMore, setShowMore] = useState(false);
|
||||
|
||||
const links = provider.proofs
|
||||
.filter((proof) => proof.format === 'url' && proof.available === true)
|
||||
@@ -71,30 +88,24 @@ export const OracleFullProfile = ({
|
||||
}));
|
||||
|
||||
return (
|
||||
<div className="flex flex-col text-sm">
|
||||
<div className="flex flex-col text-sm" data-testid="oracle-full-profile">
|
||||
<div className="dark:text-vega-light-300 text-vega-dark-300">
|
||||
<p className=" pb-2">{message}</p>
|
||||
{!showMore && (
|
||||
<p className="pb-2">
|
||||
{provider.description_markdown.slice(0, 100)}
|
||||
{'... '}
|
||||
<span className="ml-2">
|
||||
<ButtonLink onClick={() => setShowMore(!showMore)}>
|
||||
Read more
|
||||
</ButtonLink>
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
{showMore && (
|
||||
<p className="pb-2">
|
||||
{provider.oracle.status !== 'GOOD' ? (
|
||||
<div className="mb-2">
|
||||
<OracleStatus oracle={provider.oracle} />
|
||||
</div>
|
||||
) : null}
|
||||
<div className="mb-2">{message}</div>
|
||||
<div className="mb-2">
|
||||
<ReactMarkdown
|
||||
className="react-markdown-container"
|
||||
skipHtml={true}
|
||||
disallowedElements={['img']}
|
||||
linkTarget="_blank"
|
||||
>
|
||||
{provider.description_markdown}
|
||||
<span className="ml-2">
|
||||
<ButtonLink onClick={() => setShowMore(!showMore)}>
|
||||
Show less
|
||||
</ButtonLink>
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
</ReactMarkdown>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div className="col-span-1">
|
||||
@@ -132,9 +143,9 @@ export const OracleFullProfile = ({
|
||||
<p className="dark:text-vega-light-300 text-vega-dark-300 uppercase">
|
||||
{t('Details')}
|
||||
</p>
|
||||
{id && (
|
||||
{dataSourceSpecId && (
|
||||
<ExternalLink
|
||||
href={`${VEGA_EXPLORER_URL}/oracles/${id}`}
|
||||
href={`${VEGA_EXPLORER_URL}/oracles/${dataSourceSpecId}`}
|
||||
data-testid="block-explorer-link"
|
||||
>
|
||||
{t('Block explorer')}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './use-market-oracle';
|
||||
export * from './use-oracle-markets';
|
||||
export * from './use-oracle-proofs';
|
||||
export * from './use-oracle-spec-binding-data';
|
||||
+8
-4
@@ -1,12 +1,13 @@
|
||||
import { renderHook } from '@testing-library/react';
|
||||
import { useMarketOracle } from './use-market-oracle';
|
||||
import type { MarketInfoQuery } from '../components/market-info/__generated__/MarketInfo';
|
||||
import type { Provider } from '@vegaprotocol/oracles';
|
||||
import type { Provider } from '../oracle-schema';
|
||||
|
||||
const ORACLE_PROOFS_URL = 'ORACLE_PROOFS_URL';
|
||||
|
||||
const address = 'address';
|
||||
const key = 'key';
|
||||
const dataSourceSpecId = 'dataSourceSpecId';
|
||||
|
||||
const mockEnvironment = jest.fn(() => ({ ORACLE_PROOFS_URL }));
|
||||
const mockDataProvider = jest.fn<
|
||||
@@ -18,6 +19,7 @@ const mockDataProvider = jest.fn<
|
||||
instrument: {
|
||||
product: {
|
||||
dataSourceSpecForSettlementData: {
|
||||
id: dataSourceSpecId,
|
||||
data: {
|
||||
sourceType: {
|
||||
__typename: 'DataSourceDefinitionExternal',
|
||||
@@ -57,7 +59,7 @@ jest.mock('@vegaprotocol/data-provider', () => ({
|
||||
useDataProvider: jest.fn((args) => mockDataProvider()),
|
||||
}));
|
||||
|
||||
jest.mock('@vegaprotocol/oracles', () => ({
|
||||
jest.mock('./use-oracle-proofs', () => ({
|
||||
useOracleProofs: jest.fn((args) => mockOracleProofs()),
|
||||
}));
|
||||
|
||||
@@ -100,7 +102,8 @@ describe('useMarketOracle', () => {
|
||||
data,
|
||||
});
|
||||
const { result } = renderHook(() => useMarketOracle(marketId));
|
||||
expect(result.current).toBe(data[1].oracle);
|
||||
expect(result.current?.dataSourceSpecId).toBe(dataSourceSpecId);
|
||||
expect(result.current?.provider).toBe(data[1]);
|
||||
});
|
||||
|
||||
it('returns oracle matching by public_key', () => {
|
||||
@@ -128,6 +131,7 @@ describe('useMarketOracle', () => {
|
||||
data,
|
||||
});
|
||||
const { result } = renderHook(() => useMarketOracle(marketId));
|
||||
expect(result.current).toBe(data[1].oracle);
|
||||
expect(result.current?.dataSourceSpecId).toBe(dataSourceSpecId);
|
||||
expect(result.current?.provider).toBe(data[1]);
|
||||
});
|
||||
});
|
||||
+10
-5
@@ -1,5 +1,5 @@
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import { useOracleProofs } from '@vegaprotocol/oracles';
|
||||
import { useOracleProofs } from './use-oracle-proofs';
|
||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||
import { marketInfoProvider } from '../components/market-info/market-info-data-provider';
|
||||
import { useMemo } from 'react';
|
||||
@@ -15,10 +15,11 @@ export const useMarketOracle = (marketId: string) => {
|
||||
if (!data || !marketInfo) {
|
||||
return undefined;
|
||||
}
|
||||
const dataSource =
|
||||
const dataSourceSpec =
|
||||
marketInfo.tradableInstrument.instrument.product
|
||||
.dataSourceSpecForSettlementData.data;
|
||||
return data.find((provider) =>
|
||||
.dataSourceSpecForSettlementData;
|
||||
const { data: dataSource, id: dataSourceSpecId } = dataSourceSpec;
|
||||
const provider = data.find((provider) =>
|
||||
provider.proofs.some((proof) => {
|
||||
if (
|
||||
proof.type === 'eth_address' &&
|
||||
@@ -42,6 +43,10 @@ export const useMarketOracle = (marketId: string) => {
|
||||
}
|
||||
return false;
|
||||
})
|
||||
)?.oracle;
|
||||
);
|
||||
if (provider) {
|
||||
return { provider, dataSourceSpecId };
|
||||
}
|
||||
return undefined;
|
||||
}, [data, marketInfo]);
|
||||
};
|
||||
@@ -1,7 +1,4 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import 'jest-canvas-mock';
|
||||
import ResizeObserver from 'resize-observer-polyfill';
|
||||
import { defaultFallbackInView } from 'react-intersection-observer';
|
||||
|
||||
defaultFallbackInView(true);
|
||||
global.ResizeObserver = ResizeObserver;
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
},
|
||||
{
|
||||
"path": "./.storybook/tsconfig.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user