Fix/1326: Do not allow proposal voting unless sufficient associated t… (#1701)

* Fix/1326: Do not allow proposal voting unless sufficient associated tokens

* Fix/1326: Renaming string

* Fix/1326: Changes from PR comments and vote-buttons tests

* Fix/1326: Switched to enum

* Fix/1326: Used enum in unit tests
This commit is contained in:
Sam Keen 2022-10-14 14:13:51 +01:00 committed by GitHub
parent 16d35df133
commit 6d71109798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 742 additions and 335 deletions

View File

@ -640,6 +640,7 @@
"NewFreeformProposal": "New freeform proposal", "NewFreeformProposal": "New freeform proposal",
"NewRawProposal": "New raw proposal", "NewRawProposal": "New raw proposal",
"MinProposalRequirements": "You must have at least {{value}} VEGA associated to make a proposal", "MinProposalRequirements": "You must have at least {{value}} VEGA associated to make a proposal",
"MinProposalVoteRequirements": "You must have at least {{value}} VEGA associated to vote on this proposal",
"totalSupply": "Total Supply", "totalSupply": "Total Supply",
"viaWallet": "via wallet", "viaWallet": "via wallet",
"viaContract": "via vesting", "viaContract": "via vesting",

View File

@ -1,5 +1,4 @@
export * from './proposal-form-subheader'; export * from './proposal-form-subheader';
export * from './proposal-form-min-requirements';
export * from './proposal-form-title'; export * from './proposal-form-title';
export * from './proposal-form-description'; export * from './proposal-form-description';
export * from './proposal-form-terms'; export * from './proposal-form-terms';

View File

@ -1,30 +0,0 @@
import { useTranslation } from 'react-i18next';
import BigNumber from 'bignumber.js';
import { addDecimal } from '@vegaprotocol/react-helpers';
interface ProposalFormMinRequirementsProps {
minProposerBalance: string | undefined;
spamProtectionMin: string | undefined;
}
export const ProposalFormMinRequirements = ({
minProposerBalance,
spamProtectionMin,
}: ProposalFormMinRequirementsProps) => {
const { t } = useTranslation();
const minProposerBalanceFormatted =
minProposerBalance && new BigNumber(addDecimal(minProposerBalance, 18));
const spamProtectionMinFormatted =
spamProtectionMin && new BigNumber(addDecimal(spamProtectionMin, 18));
const larger =
Number(minProposerBalanceFormatted) > (spamProtectionMinFormatted || 0)
? minProposerBalanceFormatted
: spamProtectionMinFormatted;
return (
<p className="mb-4" data-testid="min-proposal-requirements">
{t('MinProposalRequirements', { value: larger })}
</p>
);
};

View File

@ -0,0 +1 @@
export * from './proposal-min-requirements';

View File

@ -1,12 +1,14 @@
import { render } from '@testing-library/react'; import { render } from '@testing-library/react';
import { ProposalFormMinRequirements } from './proposal-form-min-requirements'; import { ProposalMinRequirements } from './proposal-min-requirements';
import { ProposalUserAction } from '@vegaprotocol/types';
describe('ProposalFormMinRequirements', () => { describe('ProposalFormMinRequirements', () => {
it('should render successfully with spam protection value, if larger', () => { it('should render successfully with spam protection value, if larger', () => {
const { baseElement } = render( const { baseElement } = render(
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance="1000000000000000000" minProposalBalance="1000000000000000000"
spamProtectionMin="2000000000000000000" spamProtectionMin="2000000000000000000"
userAction={ProposalUserAction.CREATE}
/> />
); );
expect(baseElement).toBeTruthy(); expect(baseElement).toBeTruthy();
@ -18,9 +20,10 @@ describe('ProposalFormMinRequirements', () => {
it('should render successfully with min proposer value, if larger', () => { it('should render successfully with min proposer value, if larger', () => {
const { baseElement } = render( const { baseElement } = render(
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance="3000000000000000000" minProposalBalance="3000000000000000000"
spamProtectionMin="1000000000000000000" spamProtectionMin="1000000000000000000"
userAction={ProposalUserAction.CREATE}
/> />
); );
expect(baseElement).toBeTruthy(); expect(baseElement).toBeTruthy();

View File

@ -0,0 +1,39 @@
import { useTranslation } from 'react-i18next';
import BigNumber from 'bignumber.js';
import { addDecimal } from '@vegaprotocol/react-helpers';
import { ProposalUserAction } from '@vegaprotocol/types';
interface ProposalFormMinRequirementsProps {
minProposalBalance: string;
spamProtectionMin: string;
userAction: ProposalUserAction.CREATE | ProposalUserAction.VOTE;
}
// Returns the larger, formatted value of the two token amounts
export const ProposalMinRequirements = ({
minProposalBalance,
spamProtectionMin,
userAction,
}: ProposalFormMinRequirementsProps) => {
const { t } = useTranslation();
const minProposalBalanceFormatted = new BigNumber(
addDecimal(minProposalBalance, 18)
);
const spamProtectionMinFormatted = new BigNumber(
addDecimal(spamProtectionMin, 18)
);
const larger =
minProposalBalanceFormatted > spamProtectionMinFormatted
? minProposalBalanceFormatted
: spamProtectionMinFormatted;
return (
<div className="mb-4" data-testid="min-proposal-requirements">
{userAction === ProposalUserAction.CREATE &&
t('MinProposalRequirements', { value: Number(larger) })}
{userAction === ProposalUserAction.VOTE &&
t('MinProposalVoteRequirements', { value: Number(larger) })}
</div>
);
};

View File

@ -4,10 +4,10 @@
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
// ==================================================== // ====================================================
// GraphQL query operation: VoteButtons // GraphQL query operation: VoteButtonsQuery
// ==================================================== // ====================================================
export interface VoteButtons_party_stake { export interface VoteButtonsQuery_party_stake {
__typename: "PartyStake"; __typename: "PartyStake";
/** /**
* The stake currently available for the party * The stake currently available for the party
@ -19,7 +19,7 @@ export interface VoteButtons_party_stake {
currentStakeAvailableFormatted: string; currentStakeAvailableFormatted: string;
} }
export interface VoteButtons_party { export interface VoteButtonsQuery_party {
__typename: "Party"; __typename: "Party";
/** /**
* Party identifier * Party identifier
@ -28,16 +28,16 @@ export interface VoteButtons_party {
/** /**
* The staking information for this Party * The staking information for this Party
*/ */
stake: VoteButtons_party_stake; stake: VoteButtonsQuery_party_stake;
} }
export interface VoteButtons { export interface VoteButtonsQuery {
/** /**
* An entity that is trading on the Vega network * An entity that is trading on the Vega network
*/ */
party: VoteButtons_party | null; party: VoteButtonsQuery_party | null;
} }
export interface VoteButtonsVariables { export interface VoteButtonsQueryVariables {
partyId: string; partyId: string;
} }

View File

@ -0,0 +1,267 @@
import { render, screen, fireEvent } from '@testing-library/react';
import BigNumber from 'bignumber.js';
import { VoteButtons } from './vote-buttons';
import { VoteState } from './use-user-vote';
import { ProposalState, VoteValue } from '@vegaprotocol/types';
import { VegaWalletContext } from '@vegaprotocol/wallet';
import { mockWalletContext } from '../../test-helpers/mocks';
import { AppStateProvider } from '../../../../contexts/app-state/app-state-provider';
describe('Vote buttons', () => {
it('should render successfully', () => {
const { baseElement } = render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance={null}
spamProtectionMinTokens={null}
currentStakeAvailable={new BigNumber(1)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(baseElement).toBeTruthy();
});
it('should explain that voting is closed if the proposal is not open', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_PASSED}
minVoterBalance={null}
spamProtectionMinTokens={null}
currentStakeAvailable={new BigNumber(1)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByText('Voting has ended. You did not vote')).toBeTruthy();
});
it('should provide a connect wallet prompt if no pubkey', () => {
const mockWalletNoPubKeyContext = {
pubKey: null,
pubKeys: [],
sendTx: jest.fn().mockReturnValue(Promise.resolve(null)),
connect: jest.fn(),
disconnect: jest.fn(),
selectPubKey: jest.fn(),
connector: null,
};
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletNoPubKeyContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance={null}
spamProtectionMinTokens={null}
currentStakeAvailable={new BigNumber(1)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('connect-wallet')).toBeTruthy();
});
it('should tell the user they need tokens if their current stake is 0', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance={null}
spamProtectionMinTokens={null}
currentStakeAvailable={new BigNumber(0)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(
screen.getByText('You need some VEGA tokens to participate in governance')
).toBeTruthy();
});
it('should tell the user of the minimum requirements if they have some, but not enough tokens', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(1)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(
screen.getByText(
'You must have at least 2 VEGA associated to vote on this proposal'
)
).toBeTruthy();
});
it('should display vote requested', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.Requested}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('vote-requested')).toBeInTheDocument();
});
it('should display vote pending', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.Pending}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('vote-pending')).toBeInTheDocument();
});
it('should show you voted if vote state is correct, and if the proposal is still open, it will display a change vote button', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.Yes}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('you-voted')).toBeInTheDocument();
expect(screen.getByTestId('change-vote-button')).toBeInTheDocument();
});
it('should display vote failure', () => {
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.Failed}
castVote={jest.fn()}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('vote-failure')).toBeInTheDocument();
});
it('should cast yes vote when vote-for button is clicked', () => {
const castVote = jest.fn();
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={castVote}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('vote-buttons')).toBeInTheDocument();
const button = screen.getByTestId('vote-for');
fireEvent.click(button);
expect(castVote).toHaveBeenCalledWith(VoteValue.VALUE_YES);
});
it('should cast no vote when vote-against button is clicked', () => {
const castVote = jest.fn();
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.NotCast}
castVote={castVote}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
expect(screen.getByTestId('vote-buttons')).toBeInTheDocument();
const button = screen.getByTestId('vote-against');
fireEvent.click(button);
expect(castVote).toHaveBeenCalledWith(VoteValue.VALUE_NO);
});
it('should allow you to change your vote', () => {
const castVote = jest.fn();
render(
<AppStateProvider>
<VegaWalletContext.Provider value={mockWalletContext}>
<VoteButtons
voteState={VoteState.No}
castVote={castVote}
voteDatetime={null}
proposalState={ProposalState.STATE_OPEN}
minVoterBalance="2000000000000000000"
spamProtectionMinTokens="1000000000000000000"
currentStakeAvailable={new BigNumber(10)}
/>
</VegaWalletContext.Provider>
</AppStateProvider>
);
fireEvent.click(screen.getByTestId('change-vote-button'));
fireEvent.click(screen.getByTestId('vote-for'));
expect(castVote).toHaveBeenCalledWith(VoteValue.VALUE_YES);
});
});

View File

@ -10,24 +10,32 @@ import {
import { BigNumber } from '../../../../lib/bignumber'; import { BigNumber } from '../../../../lib/bignumber';
import { DATE_FORMAT_LONG } from '../../../../lib/date-formats'; import { DATE_FORMAT_LONG } from '../../../../lib/date-formats';
import type { import type {
VoteButtons as VoteButtonsQueryResult, VoteButtonsQuery as VoteButtonsQueryResult,
VoteButtonsVariables, VoteButtonsQueryVariables,
} from './__generated__/VoteButtons'; } from './__generated__/VoteButtonsQuery';
import { VoteState } from './use-user-vote'; import { VoteState } from './use-user-vote';
import { useVegaWallet } from '@vegaprotocol/wallet'; import { useVegaWallet } from '@vegaprotocol/wallet';
import { ProposalState, VoteValue } from '@vegaprotocol/types'; import {
import { Button, ButtonLink } from '@vegaprotocol/ui-toolkit'; ProposalState,
ProposalUserAction,
VoteValue,
} from '@vegaprotocol/types';
import { AsyncRenderer, Button, ButtonLink } from '@vegaprotocol/ui-toolkit';
import { ProposalMinRequirements } from '../shared';
import { addDecimal } from '@vegaprotocol/react-helpers';
interface VoteButtonsContainerProps { interface VoteButtonsContainerProps {
voteState: VoteState | null; voteState: VoteState | null;
castVote: (vote: VoteValue) => void; castVote: (vote: VoteValue) => void;
voteDatetime: Date | null; voteDatetime: Date | null;
proposalState: ProposalState; proposalState: ProposalState;
minVoterBalance: string | null;
spamProtectionMinTokens: string | null;
className?: string; className?: string;
} }
const VOTE_BUTTONS_QUERY = gql` export const VOTE_BUTTONS_QUERY = gql`
query VoteButtons($partyId: ID!) { query VoteButtonsQuery($partyId: ID!) {
party(id: $partyId) { party(id: $partyId) {
id id
stake { stake {
@ -40,23 +48,23 @@ const VOTE_BUTTONS_QUERY = gql`
export const VoteButtonsContainer = (props: VoteButtonsContainerProps) => { export const VoteButtonsContainer = (props: VoteButtonsContainerProps) => {
const { pubKey } = useVegaWallet(); const { pubKey } = useVegaWallet();
const { data, loading } = useQuery< const { data, loading, error } = useQuery<
VoteButtonsQueryResult, VoteButtonsQueryResult,
VoteButtonsVariables VoteButtonsQueryVariables
>(VOTE_BUTTONS_QUERY, { >(VOTE_BUTTONS_QUERY, {
variables: { partyId: pubKey || '' }, variables: { partyId: pubKey || '' },
skip: !pubKey, skip: !pubKey,
}); });
if (loading) return null;
return ( return (
<AsyncRenderer loading={loading} error={error} data={data}>
<VoteButtons <VoteButtons
{...props} {...props}
currentStakeAvailable={ currentStakeAvailable={
new BigNumber(data?.party?.stake.currentStakeAvailableFormatted || 0) new BigNumber(data?.party?.stake.currentStakeAvailableFormatted || 0)
} }
/> />
</AsyncRenderer>
); );
}; };
@ -70,6 +78,8 @@ export const VoteButtons = ({
voteDatetime, voteDatetime,
proposalState, proposalState,
currentStakeAvailable, currentStakeAvailable,
minVoterBalance,
spamProtectionMinTokens,
}: VoteButtonsProps) => { }: VoteButtonsProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const { appDispatch } = useAppState(); const { appDispatch } = useAppState();
@ -83,7 +93,7 @@ export const VoteButtons = ({
if (!pubKey) { if (!pubKey) {
return ( return (
<> <div data-testid="connect-wallet">
<ButtonLink <ButtonLink
onClick={() => onClick={() =>
appDispatch({ appDispatch({
@ -95,7 +105,7 @@ export const VoteButtons = ({
{t('connectVegaWallet')} {t('connectVegaWallet')}
</ButtonLink>{' '} </ButtonLink>{' '}
{t('toVote')} {t('toVote')}
</> </div>
); );
} }
@ -103,8 +113,38 @@ export const VoteButtons = ({
return t('noGovernanceTokens'); return t('noGovernanceTokens');
} }
if (minVoterBalance && spamProtectionMinTokens) {
const formattedMinVoterBalance = new BigNumber(
addDecimal(minVoterBalance, 18)
);
const formattedSpamProtectionMinTokens = new BigNumber(
addDecimal(spamProtectionMinTokens, 18)
);
if (
currentStakeAvailable.isLessThan(formattedMinVoterBalance) ||
currentStakeAvailable.isLessThan(formattedSpamProtectionMinTokens)
) {
return (
<ProposalMinRequirements
minProposalBalance={minVoterBalance}
spamProtectionMin={spamProtectionMinTokens}
userAction={ProposalUserAction.VOTE}
/>
);
}
}
return false; return false;
}, [t, pubKey, currentStakeAvailable, proposalState, appDispatch]); }, [
t,
pubKey,
currentStakeAvailable,
proposalState,
appDispatch,
minVoterBalance,
spamProtectionMinTokens,
]);
function submitVote(vote: VoteValue) { function submitVote(vote: VoteValue) {
setChangeVote(false); setChangeVote(false);
@ -118,15 +158,15 @@ export const VoteButtons = ({
} }
if (cantVoteUI) { if (cantVoteUI) {
return <p>{cantVoteUI}</p>; return <div>{cantVoteUI}</div>;
} }
if (voteState === VoteState.Requested) { if (voteState === VoteState.Requested) {
return <p>{t('voteRequested')}...</p>; return <p data-testid="vote-requested">{t('voteRequested')}...</p>;
} }
if (voteState === VoteState.Pending) { if (voteState === VoteState.Pending) {
return <p>{t('votePending')}...</p>; return <p data-testid="vote-pending">{t('votePending')}...</p>;
} }
// If voted show current vote info` // If voted show current vote info`
@ -137,7 +177,7 @@ export const VoteButtons = ({
const className = const className =
voteState === VoteState.Yes ? 'text-success' : 'text-danger'; voteState === VoteState.Yes ? 'text-success' : 'text-danger';
return ( return (
<p> <p data-testid="you-voted">
<span>{t('youVoted')}:</span>{' '} <span>{t('youVoted')}:</span>{' '}
<span className={className}>{t(`voteState_${voteState}`)}</span>{' '} <span className={className}>{t(`voteState_${voteState}`)}</span>{' '}
{voteDatetime ? ( {voteDatetime ? (
@ -158,18 +198,24 @@ export const VoteButtons = ({
} }
if (!changeVote && voteState === VoteState.Failed) { if (!changeVote && voteState === VoteState.Failed) {
return <p>{t('voteError')}</p>; return <p data-testid="vote-failure">{t('voteError')}</p>;
} }
return ( return (
<div className="flex gap-4" data-testid="vote-buttons"> <div className="flex gap-4" data-testid="vote-buttons">
<div className="flex-1"> <div className="flex-1">
<Button onClick={() => submitVote(VoteValue.VALUE_YES)}> <Button
data-testid="vote-for"
onClick={() => submitVote(VoteValue.VALUE_YES)}
>
{t('voteFor')} {t('voteFor')}
</Button> </Button>
</div> </div>
<div className="flex-1"> <div className="flex-1">
<Button onClick={() => submitVote(VoteValue.VALUE_NO)}> <Button
data-testid="vote-against"
onClick={() => submitVote(VoteValue.VALUE_NO)}
>
{t('voteAgainst')} {t('voteAgainst')}
</Button> </Button>
</div> </div>

View File

@ -1,6 +1,5 @@
import { formatDistanceToNow } from 'date-fns'; import { formatDistanceToNow } from 'date-fns';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { formatNumber } from '../../../../lib/format-number'; import { formatNumber } from '../../../../lib/format-number';
import { ConnectToVega } from '../../../staking/connect-to-vega'; import { ConnectToVega } from '../../../staking/connect-to-vega';
import { useVoteInformation } from '../../hooks'; import { useVoteInformation } from '../../hooks';
@ -11,6 +10,7 @@ import { VoteProgress } from './vote-progress';
import { useVegaWallet } from '@vegaprotocol/wallet'; import { useVegaWallet } from '@vegaprotocol/wallet';
import { ProposalState } from '@vegaprotocol/types'; import { ProposalState } from '@vegaprotocol/types';
import type { Proposal_proposal } from '../../proposal/__generated__/Proposal'; import type { Proposal_proposal } from '../../proposal/__generated__/Proposal';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
interface VoteDetailsProps { interface VoteDetailsProps {
proposal: Proposal_proposal; proposal: Proposal_proposal;
@ -30,6 +30,43 @@ export const VoteDetails = ({ proposal }: VoteDetailsProps) => {
requiredParticipation, requiredParticipation,
} = useVoteInformation({ proposal }); } = useVoteInformation({ proposal });
let minVoterBalance = null;
const { params } = useNetworkParams([
NetworkParams.governance_proposal_market_minVoterBalance,
NetworkParams.governance_proposal_updateMarket_minVoterBalance,
NetworkParams.governance_proposal_asset_minVoterBalance,
NetworkParams.governance_proposal_updateAsset_minVoterBalance,
NetworkParams.governance_proposal_updateNetParam_minVoterBalance,
NetworkParams.governance_proposal_freeform_minVoterBalance,
NetworkParams.spam_protection_voting_min_tokens,
]);
if (params) {
switch (proposal.terms.change.__typename) {
case 'NewMarket':
minVoterBalance = params.governance_proposal_market_minVoterBalance;
break;
case 'UpdateMarket':
minVoterBalance =
params.governance_proposal_updateMarket_minVoterBalance;
break;
case 'NewAsset':
minVoterBalance = params.governance_proposal_asset_minVoterBalance;
break;
case 'UpdateAsset':
minVoterBalance =
params.governance_proposal_updateAsset_minVoterBalance;
break;
case 'UpdateNetworkParameter':
minVoterBalance =
params.governance_proposal_updateNetParam_minVoterBalance;
break;
case 'NewFreeform':
minVoterBalance = params.governance_proposal_freeform_minVoterBalance;
break;
}
}
const { t } = useTranslation(); const { t } = useTranslation();
const { voteState, voteDatetime, castVote } = useUserVote( const { voteState, voteDatetime, castVote } = useUserVote(
proposal.id, proposal.id,
@ -122,6 +159,8 @@ export const VoteDetails = ({ proposal }: VoteDetailsProps) => {
castVote={castVote} castVote={castVote}
voteDatetime={voteDatetime} voteDatetime={voteDatetime}
proposalState={proposal.state} proposalState={proposal.state}
minVoterBalance={minVoterBalance}
spamProtectionMinTokens={params.spam_protection_voting_min_tokens}
className="flex" className="flex"
/> />
</> </>

View File

@ -6,18 +6,19 @@ import {
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { import {
ProposalFormSubheader,
ProposalFormMinRequirements,
ProposalFormTitle,
ProposalFormDescription, ProposalFormDescription,
ProposalFormSubheader,
ProposalFormSubmit, ProposalFormSubmit,
ProposalFormTitle,
ProposalFormTransactionDialog, ProposalFormTransactionDialog,
ProposalFormVoteAndEnactmentDeadline, ProposalFormVoteAndEnactmentDeadline,
} from '../../components/propose'; } from '../../components/propose';
import { ProposalMinRequirements } from '../../components/shared';
import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit'; import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit';
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import { useNetworkParams, NetworkParams } from '@vegaprotocol/react-helpers'; import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
import { ProposalUserAction } from '@vegaprotocol/types';
export interface FreeformProposalFormFields { export interface FreeformProposalFormFields {
proposalVoteDeadline: string; proposalVoteDeadline: string;
@ -65,11 +66,12 @@ export const ProposeFreeform = () => {
<VegaWalletContainer> <VegaWalletContainer>
{() => ( {() => (
<> <>
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance={ minProposalBalance={
params.governance_proposal_freeform_minProposerBalance params.governance_proposal_freeform_minProposerBalance
} }
spamProtectionMin={params.spam_protection_proposal_min_tokens} spamProtectionMin={params.spam_protection_proposal_min_tokens}
userAction={ProposalUserAction.CREATE}
/> />
{VEGA_DOCS_URL && ( {VEGA_DOCS_URL && (

View File

@ -6,20 +6,20 @@ import {
useNetworkParams, useNetworkParams,
} from '@vegaprotocol/react-helpers'; } from '@vegaprotocol/react-helpers';
import { import {
useProposalSubmit,
getClosingTimestamp, getClosingTimestamp,
getEnactmentTimestamp, getEnactmentTimestamp,
useProposalSubmit,
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { import {
ProposalFormSubheader,
ProposalFormMinRequirements,
ProposalFormTitle,
ProposalFormDescription, ProposalFormDescription,
ProposalFormSubheader,
ProposalFormSubmit, ProposalFormSubmit,
ProposalFormTitle,
ProposalFormTransactionDialog, ProposalFormTransactionDialog,
ProposalFormVoteAndEnactmentDeadline, ProposalFormVoteAndEnactmentDeadline,
} from '../../components/propose'; } from '../../components/propose';
import { ProposalMinRequirements } from '../../components/shared';
import { import {
AsyncRenderer, AsyncRenderer,
FormGroup, FormGroup,
@ -32,6 +32,7 @@ import {
} from '@vegaprotocol/ui-toolkit'; } from '@vegaprotocol/ui-toolkit';
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import { ProposalUserAction } from '@vegaprotocol/types';
interface SelectedNetworkParamCurrentValueProps { interface SelectedNetworkParamCurrentValueProps {
value: string; value: string;
@ -130,11 +131,12 @@ export const ProposeNetworkParameter = () => {
<VegaWalletContainer> <VegaWalletContainer>
{() => ( {() => (
<> <>
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance={ minProposalBalance={
params.governance_proposal_updateNetParam_minProposerBalance params.governance_proposal_updateNetParam_minProposerBalance
} }
spamProtectionMin={params.spam_protection_proposal_min_tokens} spamProtectionMin={params.spam_protection_proposal_min_tokens}
userAction={ProposalUserAction.CREATE}
/> />
{VEGA_DOCS_URL && ( {VEGA_DOCS_URL && (

View File

@ -1,27 +1,31 @@
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
useProposalSubmit,
getClosingTimestamp, getClosingTimestamp,
getEnactmentTimestamp, getEnactmentTimestamp,
getValidationTimestamp, getValidationTimestamp,
useProposalSubmit,
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { validateJson } from '@vegaprotocol/react-helpers';
import { import {
ProposalFormMinRequirements, NetworkParams,
ProposalFormTitle, useNetworkParams,
validateJson,
} from '@vegaprotocol/react-helpers';
import {
ProposalFormDescription, ProposalFormDescription,
ProposalFormTerms,
ProposalFormSubmit,
ProposalFormTransactionDialog,
ProposalFormSubheader, ProposalFormSubheader,
ProposalFormSubmit,
ProposalFormTerms,
ProposalFormTitle,
ProposalFormTransactionDialog,
ProposalFormVoteAndEnactmentDeadline, ProposalFormVoteAndEnactmentDeadline,
} from '../../components/propose'; } from '../../components/propose';
import { ProposalMinRequirements } from '../../components/shared';
import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit'; import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit';
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers'; import { ProposalUserAction } from '@vegaprotocol/types';
export interface NewAssetProposalFormFields { export interface NewAssetProposalFormFields {
proposalVoteDeadline: string; proposalVoteDeadline: string;
@ -90,11 +94,12 @@ export const ProposeNewAsset = () => {
<VegaWalletContainer> <VegaWalletContainer>
{() => ( {() => (
<> <>
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance={ minProposalBalance={
params.governance_proposal_asset_minProposerBalance params.governance_proposal_asset_minProposerBalance
} }
spamProtectionMin={params.spam_protection_proposal_min_tokens} spamProtectionMin={params.spam_protection_proposal_min_tokens}
userAction={ProposalUserAction.CREATE}
/> />
{VEGA_DOCS_URL && ( {VEGA_DOCS_URL && (

View File

@ -1,26 +1,30 @@
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
useProposalSubmit,
getClosingTimestamp, getClosingTimestamp,
getEnactmentTimestamp, getEnactmentTimestamp,
useProposalSubmit,
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { validateJson } from '@vegaprotocol/react-helpers';
import { import {
ProposalFormMinRequirements, NetworkParams,
ProposalFormTitle, useNetworkParams,
validateJson,
} from '@vegaprotocol/react-helpers';
import {
ProposalFormDescription, ProposalFormDescription,
ProposalFormTerms,
ProposalFormSubmit,
ProposalFormTransactionDialog,
ProposalFormSubheader, ProposalFormSubheader,
ProposalFormSubmit,
ProposalFormTerms,
ProposalFormTitle,
ProposalFormTransactionDialog,
ProposalFormVoteAndEnactmentDeadline, ProposalFormVoteAndEnactmentDeadline,
} from '../../components/propose'; } from '../../components/propose';
import { ProposalMinRequirements } from '../../components/shared';
import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit'; import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit';
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers'; import { ProposalUserAction } from '@vegaprotocol/types';
export interface NewMarketProposalFormFields { export interface NewMarketProposalFormFields {
proposalVoteDeadline: string; proposalVoteDeadline: string;
@ -85,11 +89,12 @@ export const ProposeNewMarket = () => {
<VegaWalletContainer> <VegaWalletContainer>
{() => ( {() => (
<> <>
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance={ minProposalBalance={
params.governance_proposal_market_minProposerBalance params.governance_proposal_market_minProposerBalance
} }
spamProtectionMin={params.spam_protection_proposal_min_tokens} spamProtectionMin={params.spam_protection_proposal_min_tokens}
userAction={ProposalUserAction.CREATE}
/> />
{VEGA_DOCS_URL && ( {VEGA_DOCS_URL && (

View File

@ -1,26 +1,30 @@
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
useProposalSubmit,
getClosingTimestamp, getClosingTimestamp,
getEnactmentTimestamp, getEnactmentTimestamp,
useProposalSubmit,
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { validateJson } from '@vegaprotocol/react-helpers';
import { import {
ProposalFormMinRequirements, NetworkParams,
ProposalFormTitle, useNetworkParams,
validateJson,
} from '@vegaprotocol/react-helpers';
import {
ProposalFormDescription, ProposalFormDescription,
ProposalFormTerms,
ProposalFormSubmit,
ProposalFormTransactionDialog,
ProposalFormSubheader, ProposalFormSubheader,
ProposalFormSubmit,
ProposalFormTerms,
ProposalFormTitle,
ProposalFormTransactionDialog,
ProposalFormVoteAndEnactmentDeadline, ProposalFormVoteAndEnactmentDeadline,
} from '../../components/propose'; } from '../../components/propose';
import { ProposalMinRequirements } from '../../components/shared';
import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit'; import { AsyncRenderer, Link } from '@vegaprotocol/ui-toolkit';
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers'; import { ProposalUserAction } from '@vegaprotocol/types';
export interface UpdateAssetProposalFormFields { export interface UpdateAssetProposalFormFields {
proposalVoteDeadline: string; proposalVoteDeadline: string;
@ -85,11 +89,12 @@ export const ProposeUpdateAsset = () => {
<VegaWalletContainer> <VegaWalletContainer>
{() => ( {() => (
<> <>
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance={ minProposalBalance={
params.governance_proposal_updateAsset_minProposerBalance params.governance_proposal_updateAsset_minProposerBalance
} }
spamProtectionMin={params.spam_protection_proposal_min_tokens} spamProtectionMin={params.spam_protection_proposal_min_tokens}
userAction={ProposalUserAction.CREATE}
/> />
{VEGA_DOCS_URL && ( {VEGA_DOCS_URL && (

View File

@ -3,22 +3,26 @@ import { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { import {
useProposalSubmit,
getClosingTimestamp, getClosingTimestamp,
getEnactmentTimestamp, getEnactmentTimestamp,
useProposalSubmit,
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { validateJson } from '@vegaprotocol/react-helpers';
import { import {
ProposalFormSubheader, NetworkParams,
ProposalFormMinRequirements, useNetworkParams,
ProposalFormTitle, validateJson,
} from '@vegaprotocol/react-helpers';
import {
ProposalFormDescription, ProposalFormDescription,
ProposalFormTerms, ProposalFormSubheader,
ProposalFormSubmit, ProposalFormSubmit,
ProposalFormTerms,
ProposalFormTitle,
ProposalFormTransactionDialog, ProposalFormTransactionDialog,
ProposalFormVoteAndEnactmentDeadline, ProposalFormVoteAndEnactmentDeadline,
} from '../../components/propose'; } from '../../components/propose';
import { ProposalMinRequirements } from '../../components/shared';
import { import {
AsyncRenderer, AsyncRenderer,
FormGroup, FormGroup,
@ -31,7 +35,7 @@ import {
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import type { ProposalMarketsQuery } from './__generated__/ProposalMarketsQuery'; import type { ProposalMarketsQuery } from './__generated__/ProposalMarketsQuery';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers'; import { ProposalUserAction } from '@vegaprotocol/types';
export const MARKETS_QUERY = gql` export const MARKETS_QUERY = gql`
query ProposalMarketsQuery { query ProposalMarketsQuery {
@ -148,11 +152,12 @@ export const ProposeUpdateMarket = () => {
<VegaWalletContainer> <VegaWalletContainer>
{() => ( {() => (
<> <>
<ProposalFormMinRequirements <ProposalMinRequirements
minProposerBalance={ minProposalBalance={
params.governance_proposal_updateMarket_minProposerBalance params.governance_proposal_updateMarket_minProposerBalance
} }
spamProtectionMin={params.spam_protection_proposal_min_tokens} spamProtectionMin={params.spam_protection_proposal_min_tokens}
userAction={ProposalUserAction.CREATE}
/> />
{VEGA_DOCS_URL && ( {VEGA_DOCS_URL && (

View File

@ -25,12 +25,16 @@ export const NetworkParams = {
reward_asset: 'reward_asset', reward_asset: 'reward_asset',
reward_staking_delegation_payoutDelay: reward_staking_delegation_payoutDelay:
'reward_staking_delegation_payoutDelay', 'reward_staking_delegation_payoutDelay',
governance_proposal_updateMarket_requiredMajority: governance_proposal_market_minVoterBalance:
'governance_proposal_updateMarket_requiredMajority', 'governance_proposal_market_minVoterBalance',
governance_proposal_market_minClose: 'governance_proposal_market_minClose', governance_proposal_market_minClose: 'governance_proposal_market_minClose',
governance_proposal_market_maxClose: 'governance_proposal_market_maxClose', governance_proposal_market_maxClose: 'governance_proposal_market_maxClose',
governance_proposal_market_minEnact: 'governance_proposal_market_minEnact', governance_proposal_market_minEnact: 'governance_proposal_market_minEnact',
governance_proposal_market_maxEnact: 'governance_proposal_market_maxEnact', governance_proposal_market_maxEnact: 'governance_proposal_market_maxEnact',
governance_proposal_updateMarket_minVoterBalance:
'governance_proposal_updateMarket_minVoterBalance',
governance_proposal_updateMarket_requiredMajority:
'governance_proposal_updateMarket_requiredMajority',
governance_proposal_updateMarket_minClose: governance_proposal_updateMarket_minClose:
'governance_proposal_updateMarket_minClose', 'governance_proposal_updateMarket_minClose',
governance_proposal_updateMarket_maxClose: governance_proposal_updateMarket_maxClose:
@ -39,10 +43,14 @@ export const NetworkParams = {
'governance_proposal_updateMarket_minEnact', 'governance_proposal_updateMarket_minEnact',
governance_proposal_updateMarket_maxEnact: governance_proposal_updateMarket_maxEnact:
'governance_proposal_updateMarket_maxEnact', 'governance_proposal_updateMarket_maxEnact',
governance_proposal_asset_minVoterBalance:
'governance_proposal_asset_minVoterBalance',
governance_proposal_asset_minClose: 'governance_proposal_asset_minClose', governance_proposal_asset_minClose: 'governance_proposal_asset_minClose',
governance_proposal_asset_maxClose: 'governance_proposal_asset_maxClose', governance_proposal_asset_maxClose: 'governance_proposal_asset_maxClose',
governance_proposal_asset_minEnact: 'governance_proposal_asset_minEnact', governance_proposal_asset_minEnact: 'governance_proposal_asset_minEnact',
governance_proposal_asset_maxEnact: 'governance_proposal_asset_maxEnact', governance_proposal_asset_maxEnact: 'governance_proposal_asset_maxEnact',
governance_proposal_updateAsset_minVoterBalance:
'governance_proposal_updateAsset_minVoterBalance',
governance_proposal_updateAsset_minClose: governance_proposal_updateAsset_minClose:
'governance_proposal_updateAsset_minClose', 'governance_proposal_updateAsset_minClose',
governance_proposal_updateAsset_maxClose: governance_proposal_updateAsset_maxClose:
@ -53,12 +61,16 @@ export const NetworkParams = {
'governance_proposal_updateAsset_maxEnact', 'governance_proposal_updateAsset_maxEnact',
governance_proposal_updateNetParam_minClose: governance_proposal_updateNetParam_minClose:
'governance_proposal_updateNetParam_minClose', 'governance_proposal_updateNetParam_minClose',
governance_proposal_updateNetParam_minVoterBalance:
'governance_proposal_updateNetParam_minVoterBalance',
governance_proposal_updateNetParam_maxClose: governance_proposal_updateNetParam_maxClose:
'governance_proposal_updateNetParam_maxClose', 'governance_proposal_updateNetParam_maxClose',
governance_proposal_updateNetParam_minEnact: governance_proposal_updateNetParam_minEnact:
'governance_proposal_updateNetParam_minEnact', 'governance_proposal_updateNetParam_minEnact',
governance_proposal_updateNetParam_maxEnact: governance_proposal_updateNetParam_maxEnact:
'governance_proposal_updateNetParam_maxEnact', 'governance_proposal_updateNetParam_maxEnact',
governance_proposal_freeform_minVoterBalance:
'governance_proposal_freeform_minVoterBalance',
governance_proposal_freeform_minClose: governance_proposal_freeform_minClose:
'governance_proposal_freeform_minClose', 'governance_proposal_freeform_minClose',
governance_proposal_freeform_maxClose: governance_proposal_freeform_maxClose:
@ -94,6 +106,7 @@ export const NetworkParams = {
governance_proposal_freeform_minProposerBalance: governance_proposal_freeform_minProposerBalance:
'governance_proposal_freeform_minProposerBalance', 'governance_proposal_freeform_minProposerBalance',
validators_delegation_minAmount: 'validators_delegation_minAmount', validators_delegation_minAmount: 'validators_delegation_minAmount',
spam_protection_voting_min_tokens: 'spam_protection_voting_min_tokens',
spam_protection_proposal_min_tokens: 'spam_protection_proposal_min_tokens', spam_protection_proposal_min_tokens: 'spam_protection_proposal_min_tokens',
market_liquidity_stakeToCcySiskas: 'market_liquidity_stakeToCcySiskas', market_liquidity_stakeToCcySiskas: 'market_liquidity_stakeToCcySiskas',
} as const; } as const;

View File

@ -11,225 +11,225 @@
* The various account types in Vega (used by collateral) * The various account types in Vega (used by collateral)
*/ */
export enum AccountType { export enum AccountType {
ACCOUNT_TYPE_BOND = "ACCOUNT_TYPE_BOND", ACCOUNT_TYPE_BOND = 'ACCOUNT_TYPE_BOND',
ACCOUNT_TYPE_EXTERNAL = "ACCOUNT_TYPE_EXTERNAL", ACCOUNT_TYPE_EXTERNAL = 'ACCOUNT_TYPE_EXTERNAL',
ACCOUNT_TYPE_FEES_INFRASTRUCTURE = "ACCOUNT_TYPE_FEES_INFRASTRUCTURE", ACCOUNT_TYPE_FEES_INFRASTRUCTURE = 'ACCOUNT_TYPE_FEES_INFRASTRUCTURE',
ACCOUNT_TYPE_FEES_LIQUIDITY = "ACCOUNT_TYPE_FEES_LIQUIDITY", ACCOUNT_TYPE_FEES_LIQUIDITY = 'ACCOUNT_TYPE_FEES_LIQUIDITY',
ACCOUNT_TYPE_FEES_MAKER = "ACCOUNT_TYPE_FEES_MAKER", ACCOUNT_TYPE_FEES_MAKER = 'ACCOUNT_TYPE_FEES_MAKER',
ACCOUNT_TYPE_GENERAL = "ACCOUNT_TYPE_GENERAL", ACCOUNT_TYPE_GENERAL = 'ACCOUNT_TYPE_GENERAL',
ACCOUNT_TYPE_GLOBAL_INSURANCE = "ACCOUNT_TYPE_GLOBAL_INSURANCE", ACCOUNT_TYPE_GLOBAL_INSURANCE = 'ACCOUNT_TYPE_GLOBAL_INSURANCE',
ACCOUNT_TYPE_GLOBAL_REWARD = "ACCOUNT_TYPE_GLOBAL_REWARD", ACCOUNT_TYPE_GLOBAL_REWARD = 'ACCOUNT_TYPE_GLOBAL_REWARD',
ACCOUNT_TYPE_INSURANCE = "ACCOUNT_TYPE_INSURANCE", ACCOUNT_TYPE_INSURANCE = 'ACCOUNT_TYPE_INSURANCE',
ACCOUNT_TYPE_MARGIN = "ACCOUNT_TYPE_MARGIN", ACCOUNT_TYPE_MARGIN = 'ACCOUNT_TYPE_MARGIN',
ACCOUNT_TYPE_PENDING_TRANSFERS = "ACCOUNT_TYPE_PENDING_TRANSFERS", ACCOUNT_TYPE_PENDING_TRANSFERS = 'ACCOUNT_TYPE_PENDING_TRANSFERS',
ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES = "ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES", ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES = 'ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES',
ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES = "ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES", ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES = 'ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES',
ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES = "ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES", ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES = 'ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES',
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS = "ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS", ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS = 'ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS',
ACCOUNT_TYPE_SETTLEMENT = "ACCOUNT_TYPE_SETTLEMENT", ACCOUNT_TYPE_SETTLEMENT = 'ACCOUNT_TYPE_SETTLEMENT',
} }
export enum AssetStatus { export enum AssetStatus {
STATUS_ENABLED = "STATUS_ENABLED", STATUS_ENABLED = 'STATUS_ENABLED',
STATUS_PENDING_LISTING = "STATUS_PENDING_LISTING", STATUS_PENDING_LISTING = 'STATUS_PENDING_LISTING',
STATUS_PROPOSED = "STATUS_PROPOSED", STATUS_PROPOSED = 'STATUS_PROPOSED',
STATUS_REJECTED = "STATUS_REJECTED", STATUS_REJECTED = 'STATUS_REJECTED',
} }
export enum AuctionTrigger { export enum AuctionTrigger {
AUCTION_TRIGGER_BATCH = "AUCTION_TRIGGER_BATCH", AUCTION_TRIGGER_BATCH = 'AUCTION_TRIGGER_BATCH',
AUCTION_TRIGGER_LIQUIDITY = "AUCTION_TRIGGER_LIQUIDITY", AUCTION_TRIGGER_LIQUIDITY = 'AUCTION_TRIGGER_LIQUIDITY',
AUCTION_TRIGGER_OPENING = "AUCTION_TRIGGER_OPENING", AUCTION_TRIGGER_OPENING = 'AUCTION_TRIGGER_OPENING',
AUCTION_TRIGGER_PRICE = "AUCTION_TRIGGER_PRICE", AUCTION_TRIGGER_PRICE = 'AUCTION_TRIGGER_PRICE',
AUCTION_TRIGGER_UNSPECIFIED = "AUCTION_TRIGGER_UNSPECIFIED", AUCTION_TRIGGER_UNSPECIFIED = 'AUCTION_TRIGGER_UNSPECIFIED',
} }
export enum BusEventType { export enum BusEventType {
Account = "Account", Account = 'Account',
Asset = "Asset", Asset = 'Asset',
Auction = "Auction", Auction = 'Auction',
Deposit = "Deposit", Deposit = 'Deposit',
LiquidityProvision = "LiquidityProvision", LiquidityProvision = 'LiquidityProvision',
LossSocialization = "LossSocialization", LossSocialization = 'LossSocialization',
MarginLevels = "MarginLevels", MarginLevels = 'MarginLevels',
Market = "Market", Market = 'Market',
MarketCreated = "MarketCreated", MarketCreated = 'MarketCreated',
MarketData = "MarketData", MarketData = 'MarketData',
MarketTick = "MarketTick", MarketTick = 'MarketTick',
MarketUpdated = "MarketUpdated", MarketUpdated = 'MarketUpdated',
NodeSignature = "NodeSignature", NodeSignature = 'NodeSignature',
OracleSpec = "OracleSpec", OracleSpec = 'OracleSpec',
Order = "Order", Order = 'Order',
Party = "Party", Party = 'Party',
PositionResolution = "PositionResolution", PositionResolution = 'PositionResolution',
Proposal = "Proposal", Proposal = 'Proposal',
RiskFactor = "RiskFactor", RiskFactor = 'RiskFactor',
SettleDistressed = "SettleDistressed", SettleDistressed = 'SettleDistressed',
SettlePosition = "SettlePosition", SettlePosition = 'SettlePosition',
TimeUpdate = "TimeUpdate", TimeUpdate = 'TimeUpdate',
Trade = "Trade", Trade = 'Trade',
TransferResponses = "TransferResponses", TransferResponses = 'TransferResponses',
Vote = "Vote", Vote = 'Vote',
Withdrawal = "Withdrawal", Withdrawal = 'Withdrawal',
} }
/** /**
* Comparator describes the type of comparison. * Comparator describes the type of comparison.
*/ */
export enum ConditionOperator { export enum ConditionOperator {
OPERATOR_EQUALS = "OPERATOR_EQUALS", OPERATOR_EQUALS = 'OPERATOR_EQUALS',
OPERATOR_GREATER_THAN = "OPERATOR_GREATER_THAN", OPERATOR_GREATER_THAN = 'OPERATOR_GREATER_THAN',
OPERATOR_GREATER_THAN_OR_EQUAL = "OPERATOR_GREATER_THAN_OR_EQUAL", OPERATOR_GREATER_THAN_OR_EQUAL = 'OPERATOR_GREATER_THAN_OR_EQUAL',
OPERATOR_LESS_THAN = "OPERATOR_LESS_THAN", OPERATOR_LESS_THAN = 'OPERATOR_LESS_THAN',
OPERATOR_LESS_THAN_OR_EQUAL = "OPERATOR_LESS_THAN_OR_EQUAL", OPERATOR_LESS_THAN_OR_EQUAL = 'OPERATOR_LESS_THAN_OR_EQUAL',
} }
/** /**
* The interval for trade candles when subscribing via Vega GraphQL, default is I15M * The interval for trade candles when subscribing via Vega GraphQL, default is I15M
*/ */
export enum Interval { export enum Interval {
INTERVAL_I15M = "INTERVAL_I15M", INTERVAL_I15M = 'INTERVAL_I15M',
INTERVAL_I1D = "INTERVAL_I1D", INTERVAL_I1D = 'INTERVAL_I1D',
INTERVAL_I1H = "INTERVAL_I1H", INTERVAL_I1H = 'INTERVAL_I1H',
INTERVAL_I1M = "INTERVAL_I1M", INTERVAL_I1M = 'INTERVAL_I1M',
INTERVAL_I5M = "INTERVAL_I5M", INTERVAL_I5M = 'INTERVAL_I5M',
INTERVAL_I6H = "INTERVAL_I6H", INTERVAL_I6H = 'INTERVAL_I6H',
} }
/** /**
* Status of a liquidity provision order * Status of a liquidity provision order
*/ */
export enum LiquidityProvisionStatus { export enum LiquidityProvisionStatus {
STATUS_ACTIVE = "STATUS_ACTIVE", STATUS_ACTIVE = 'STATUS_ACTIVE',
STATUS_CANCELLED = "STATUS_CANCELLED", STATUS_CANCELLED = 'STATUS_CANCELLED',
STATUS_PENDING = "STATUS_PENDING", STATUS_PENDING = 'STATUS_PENDING',
STATUS_REJECTED = "STATUS_REJECTED", STATUS_REJECTED = 'STATUS_REJECTED',
STATUS_STOPPED = "STATUS_STOPPED", STATUS_STOPPED = 'STATUS_STOPPED',
STATUS_UNDEPLOYED = "STATUS_UNDEPLOYED", STATUS_UNDEPLOYED = 'STATUS_UNDEPLOYED',
} }
/** /**
* The current state of a market * The current state of a market
*/ */
export enum MarketState { export enum MarketState {
STATE_ACTIVE = "STATE_ACTIVE", STATE_ACTIVE = 'STATE_ACTIVE',
STATE_CANCELLED = "STATE_CANCELLED", STATE_CANCELLED = 'STATE_CANCELLED',
STATE_CLOSED = "STATE_CLOSED", STATE_CLOSED = 'STATE_CLOSED',
STATE_PENDING = "STATE_PENDING", STATE_PENDING = 'STATE_PENDING',
STATE_PROPOSED = "STATE_PROPOSED", STATE_PROPOSED = 'STATE_PROPOSED',
STATE_REJECTED = "STATE_REJECTED", STATE_REJECTED = 'STATE_REJECTED',
STATE_SETTLED = "STATE_SETTLED", STATE_SETTLED = 'STATE_SETTLED',
STATE_SUSPENDED = "STATE_SUSPENDED", STATE_SUSPENDED = 'STATE_SUSPENDED',
STATE_TRADING_TERMINATED = "STATE_TRADING_TERMINATED", STATE_TRADING_TERMINATED = 'STATE_TRADING_TERMINATED',
} }
/** /**
* What market trading mode is the market in * What market trading mode is the market in
*/ */
export enum MarketTradingMode { export enum MarketTradingMode {
TRADING_MODE_BATCH_AUCTION = "TRADING_MODE_BATCH_AUCTION", TRADING_MODE_BATCH_AUCTION = 'TRADING_MODE_BATCH_AUCTION',
TRADING_MODE_CONTINUOUS = "TRADING_MODE_CONTINUOUS", TRADING_MODE_CONTINUOUS = 'TRADING_MODE_CONTINUOUS',
TRADING_MODE_MONITORING_AUCTION = "TRADING_MODE_MONITORING_AUCTION", TRADING_MODE_MONITORING_AUCTION = 'TRADING_MODE_MONITORING_AUCTION',
TRADING_MODE_NO_TRADING = "TRADING_MODE_NO_TRADING", TRADING_MODE_NO_TRADING = 'TRADING_MODE_NO_TRADING',
TRADING_MODE_OPENING_AUCTION = "TRADING_MODE_OPENING_AUCTION", TRADING_MODE_OPENING_AUCTION = 'TRADING_MODE_OPENING_AUCTION',
} }
/** /**
* Validating status of a node, i.e. validator or non-validator * Validating status of a node, i.e. validator or non-validator
*/ */
export enum NodeStatus { export enum NodeStatus {
NODE_STATUS_NON_VALIDATOR = "NODE_STATUS_NON_VALIDATOR", NODE_STATUS_NON_VALIDATOR = 'NODE_STATUS_NON_VALIDATOR',
NODE_STATUS_VALIDATOR = "NODE_STATUS_VALIDATOR", NODE_STATUS_VALIDATOR = 'NODE_STATUS_VALIDATOR',
} }
/** /**
* Status describe the status of the oracle spec * Status describe the status of the oracle spec
*/ */
export enum OracleSpecStatus { export enum OracleSpecStatus {
STATUS_ACTIVE = "STATUS_ACTIVE", STATUS_ACTIVE = 'STATUS_ACTIVE',
STATUS_DEACTIVATED = "STATUS_DEACTIVATED", STATUS_DEACTIVATED = 'STATUS_DEACTIVATED',
} }
/** /**
* Why the order was rejected by the core node * Why the order was rejected by the core node
*/ */
export enum OrderRejectionReason { export enum OrderRejectionReason {
ORDER_ERROR_AMEND_FAILURE = "ORDER_ERROR_AMEND_FAILURE", ORDER_ERROR_AMEND_FAILURE = 'ORDER_ERROR_AMEND_FAILURE',
ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE = "ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE", ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE = 'ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE',
ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN = "ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN", ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN = 'ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN',
ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER = "ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER", ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER = 'ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER',
ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC = "ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC", ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC = 'ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC',
ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN = "ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN", ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN = 'ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN',
ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT = "ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT", ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT = 'ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT',
ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT = "ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT", ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT = 'ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT',
ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION = "ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION", ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION = 'ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION',
ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION = "ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION", ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION = 'ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION',
ORDER_ERROR_EDIT_NOT_ALLOWED = "ORDER_ERROR_EDIT_NOT_ALLOWED", ORDER_ERROR_EDIT_NOT_ALLOWED = 'ORDER_ERROR_EDIT_NOT_ALLOWED',
ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT = "ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT", ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT = 'ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT',
ORDER_ERROR_GFA_ORDER_DURING_CONTINUOUS_TRADING = "ORDER_ERROR_GFA_ORDER_DURING_CONTINUOUS_TRADING", ORDER_ERROR_GFA_ORDER_DURING_CONTINUOUS_TRADING = 'ORDER_ERROR_GFA_ORDER_DURING_CONTINUOUS_TRADING',
ORDER_ERROR_GFN_ORDER_DURING_AN_AUCTION = "ORDER_ERROR_GFN_ORDER_DURING_AN_AUCTION", ORDER_ERROR_GFN_ORDER_DURING_AN_AUCTION = 'ORDER_ERROR_GFN_ORDER_DURING_AN_AUCTION',
ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE = "ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE", ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE = 'ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE',
ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES = "ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES", ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES = 'ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES',
ORDER_ERROR_INTERNAL_ERROR = "ORDER_ERROR_INTERNAL_ERROR", ORDER_ERROR_INTERNAL_ERROR = 'ORDER_ERROR_INTERNAL_ERROR',
ORDER_ERROR_INVALID_EXPIRATION_DATETIME = "ORDER_ERROR_INVALID_EXPIRATION_DATETIME", ORDER_ERROR_INVALID_EXPIRATION_DATETIME = 'ORDER_ERROR_INVALID_EXPIRATION_DATETIME',
ORDER_ERROR_INVALID_MARKET_ID = "ORDER_ERROR_INVALID_MARKET_ID", ORDER_ERROR_INVALID_MARKET_ID = 'ORDER_ERROR_INVALID_MARKET_ID',
ORDER_ERROR_INVALID_ORDER_ID = "ORDER_ERROR_INVALID_ORDER_ID", ORDER_ERROR_INVALID_ORDER_ID = 'ORDER_ERROR_INVALID_ORDER_ID',
ORDER_ERROR_INVALID_ORDER_REFERENCE = "ORDER_ERROR_INVALID_ORDER_REFERENCE", ORDER_ERROR_INVALID_ORDER_REFERENCE = 'ORDER_ERROR_INVALID_ORDER_REFERENCE',
ORDER_ERROR_INVALID_PARTY_ID = "ORDER_ERROR_INVALID_PARTY_ID", ORDER_ERROR_INVALID_PARTY_ID = 'ORDER_ERROR_INVALID_PARTY_ID',
ORDER_ERROR_INVALID_PERSISTENCE = "ORDER_ERROR_INVALID_PERSISTENCE", ORDER_ERROR_INVALID_PERSISTENCE = 'ORDER_ERROR_INVALID_PERSISTENCE',
ORDER_ERROR_INVALID_REMAINING_SIZE = "ORDER_ERROR_INVALID_REMAINING_SIZE", ORDER_ERROR_INVALID_REMAINING_SIZE = 'ORDER_ERROR_INVALID_REMAINING_SIZE',
ORDER_ERROR_INVALID_SIZE = "ORDER_ERROR_INVALID_SIZE", ORDER_ERROR_INVALID_SIZE = 'ORDER_ERROR_INVALID_SIZE',
ORDER_ERROR_INVALID_TIME_IN_FORCE = "ORDER_ERROR_INVALID_TIME_IN_FORCE", ORDER_ERROR_INVALID_TIME_IN_FORCE = 'ORDER_ERROR_INVALID_TIME_IN_FORCE',
ORDER_ERROR_INVALID_TYPE = "ORDER_ERROR_INVALID_TYPE", ORDER_ERROR_INVALID_TYPE = 'ORDER_ERROR_INVALID_TYPE',
ORDER_ERROR_MARGIN_CHECK_FAILED = "ORDER_ERROR_MARGIN_CHECK_FAILED", ORDER_ERROR_MARGIN_CHECK_FAILED = 'ORDER_ERROR_MARGIN_CHECK_FAILED',
ORDER_ERROR_MARKET_CLOSED = "ORDER_ERROR_MARKET_CLOSED", ORDER_ERROR_MARKET_CLOSED = 'ORDER_ERROR_MARKET_CLOSED',
ORDER_ERROR_MISSING_GENERAL_ACCOUNT = "ORDER_ERROR_MISSING_GENERAL_ACCOUNT", ORDER_ERROR_MISSING_GENERAL_ACCOUNT = 'ORDER_ERROR_MISSING_GENERAL_ACCOUNT',
ORDER_ERROR_MUST_BE_GTT_OR_GTC = "ORDER_ERROR_MUST_BE_GTT_OR_GTC", ORDER_ERROR_MUST_BE_GTT_OR_GTC = 'ORDER_ERROR_MUST_BE_GTT_OR_GTC',
ORDER_ERROR_MUST_BE_LIMIT_ORDER = "ORDER_ERROR_MUST_BE_LIMIT_ORDER", ORDER_ERROR_MUST_BE_LIMIT_ORDER = 'ORDER_ERROR_MUST_BE_LIMIT_ORDER',
ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS = "ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS", ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS = 'ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS',
ORDER_ERROR_NOT_FOUND = "ORDER_ERROR_NOT_FOUND", ORDER_ERROR_NOT_FOUND = 'ORDER_ERROR_NOT_FOUND',
ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO = "ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO", ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO = 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO',
ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO = "ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO", ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO = 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO',
ORDER_ERROR_OUT_OF_SEQUENCE = "ORDER_ERROR_OUT_OF_SEQUENCE", ORDER_ERROR_OUT_OF_SEQUENCE = 'ORDER_ERROR_OUT_OF_SEQUENCE',
ORDER_ERROR_REMOVAL_FAILURE = "ORDER_ERROR_REMOVAL_FAILURE", ORDER_ERROR_REMOVAL_FAILURE = 'ORDER_ERROR_REMOVAL_FAILURE',
ORDER_ERROR_SELF_TRADING = "ORDER_ERROR_SELF_TRADING", ORDER_ERROR_SELF_TRADING = 'ORDER_ERROR_SELF_TRADING',
ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE = "ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE", ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE = 'ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE',
ORDER_ERROR_TIME_FAILURE = "ORDER_ERROR_TIME_FAILURE", ORDER_ERROR_TIME_FAILURE = 'ORDER_ERROR_TIME_FAILURE',
ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER = "ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER", ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER = 'ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER',
ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER = "ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER", ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER = 'ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER',
ORDER_ERROR_WITHOUT_REFERENCE_PRICE = "ORDER_ERROR_WITHOUT_REFERENCE_PRICE", ORDER_ERROR_WITHOUT_REFERENCE_PRICE = 'ORDER_ERROR_WITHOUT_REFERENCE_PRICE',
} }
/** /**
* Valid order statuses, these determine several states for an order that cannot be expressed with other fields in Order. * Valid order statuses, these determine several states for an order that cannot be expressed with other fields in Order.
*/ */
export enum OrderStatus { export enum OrderStatus {
STATUS_ACTIVE = "STATUS_ACTIVE", STATUS_ACTIVE = 'STATUS_ACTIVE',
STATUS_CANCELLED = "STATUS_CANCELLED", STATUS_CANCELLED = 'STATUS_CANCELLED',
STATUS_EXPIRED = "STATUS_EXPIRED", STATUS_EXPIRED = 'STATUS_EXPIRED',
STATUS_FILLED = "STATUS_FILLED", STATUS_FILLED = 'STATUS_FILLED',
STATUS_PARKED = "STATUS_PARKED", STATUS_PARKED = 'STATUS_PARKED',
STATUS_PARTIALLY_FILLED = "STATUS_PARTIALLY_FILLED", STATUS_PARTIALLY_FILLED = 'STATUS_PARTIALLY_FILLED',
STATUS_REJECTED = "STATUS_REJECTED", STATUS_REJECTED = 'STATUS_REJECTED',
STATUS_STOPPED = "STATUS_STOPPED", STATUS_STOPPED = 'STATUS_STOPPED',
} }
/** /**
* Valid order types, these determine what happens when an order is added to the book * Valid order types, these determine what happens when an order is added to the book
*/ */
export enum OrderTimeInForce { export enum OrderTimeInForce {
TIME_IN_FORCE_FOK = "TIME_IN_FORCE_FOK", TIME_IN_FORCE_FOK = 'TIME_IN_FORCE_FOK',
TIME_IN_FORCE_GFA = "TIME_IN_FORCE_GFA", TIME_IN_FORCE_GFA = 'TIME_IN_FORCE_GFA',
TIME_IN_FORCE_GFN = "TIME_IN_FORCE_GFN", TIME_IN_FORCE_GFN = 'TIME_IN_FORCE_GFN',
TIME_IN_FORCE_GTC = "TIME_IN_FORCE_GTC", TIME_IN_FORCE_GTC = 'TIME_IN_FORCE_GTC',
TIME_IN_FORCE_GTT = "TIME_IN_FORCE_GTT", TIME_IN_FORCE_GTT = 'TIME_IN_FORCE_GTT',
TIME_IN_FORCE_IOC = "TIME_IN_FORCE_IOC", TIME_IN_FORCE_IOC = 'TIME_IN_FORCE_IOC',
} }
export enum OrderType { export enum OrderType {
TYPE_LIMIT = "TYPE_LIMIT", TYPE_LIMIT = 'TYPE_LIMIT',
TYPE_MARKET = "TYPE_MARKET", TYPE_MARKET = 'TYPE_MARKET',
TYPE_NETWORK = "TYPE_NETWORK", TYPE_NETWORK = 'TYPE_NETWORK',
} }
/** /**
@ -237,56 +237,56 @@ export enum OrderType {
* engine. * engine.
*/ */
export enum PropertyKeyType { export enum PropertyKeyType {
TYPE_BOOLEAN = "TYPE_BOOLEAN", TYPE_BOOLEAN = 'TYPE_BOOLEAN',
TYPE_DECIMAL = "TYPE_DECIMAL", TYPE_DECIMAL = 'TYPE_DECIMAL',
TYPE_EMPTY = "TYPE_EMPTY", TYPE_EMPTY = 'TYPE_EMPTY',
TYPE_INTEGER = "TYPE_INTEGER", TYPE_INTEGER = 'TYPE_INTEGER',
TYPE_STRING = "TYPE_STRING", TYPE_STRING = 'TYPE_STRING',
TYPE_TIMESTAMP = "TYPE_TIMESTAMP", TYPE_TIMESTAMP = 'TYPE_TIMESTAMP',
} }
/** /**
* Why the proposal was rejected by the core node * Why the proposal was rejected by the core node
*/ */
export enum ProposalRejectionReason { export enum ProposalRejectionReason {
PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE = "PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE", PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE = 'PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE',
PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON = "PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON", PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON = 'PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON',
PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET = "PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET", PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET = 'PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET',
PROPOSAL_ERROR_ENACT_TIME_TOO_LATE = "PROPOSAL_ERROR_ENACT_TIME_TOO_LATE", PROPOSAL_ERROR_ENACT_TIME_TOO_LATE = 'PROPOSAL_ERROR_ENACT_TIME_TOO_LATE',
PROPOSAL_ERROR_ENACT_TIME_TOO_SOON = "PROPOSAL_ERROR_ENACT_TIME_TOO_SOON", PROPOSAL_ERROR_ENACT_TIME_TOO_SOON = 'PROPOSAL_ERROR_ENACT_TIME_TOO_SOON',
PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = "PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS", PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = 'PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS',
PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = "PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE", PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = 'PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE',
PROPOSAL_ERROR_INSUFFICIENT_TOKENS = "PROPOSAL_ERROR_INSUFFICIENT_TOKENS", PROPOSAL_ERROR_INSUFFICIENT_TOKENS = 'PROPOSAL_ERROR_INSUFFICIENT_TOKENS',
PROPOSAL_ERROR_INVALID_ASSET = "PROPOSAL_ERROR_INVALID_ASSET", PROPOSAL_ERROR_INVALID_ASSET = 'PROPOSAL_ERROR_INVALID_ASSET',
PROPOSAL_ERROR_INVALID_ASSET_DETAILS = "PROPOSAL_ERROR_INVALID_ASSET_DETAILS", PROPOSAL_ERROR_INVALID_ASSET_DETAILS = 'PROPOSAL_ERROR_INVALID_ASSET_DETAILS',
PROPOSAL_ERROR_INVALID_FEE_AMOUNT = "PROPOSAL_ERROR_INVALID_FEE_AMOUNT", PROPOSAL_ERROR_INVALID_FEE_AMOUNT = 'PROPOSAL_ERROR_INVALID_FEE_AMOUNT',
PROPOSAL_ERROR_INVALID_FREEFORM = "PROPOSAL_ERROR_INVALID_FREEFORM", PROPOSAL_ERROR_INVALID_FREEFORM = 'PROPOSAL_ERROR_INVALID_FREEFORM',
PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = "PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT", PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = 'PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT',
PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = "PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY", PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = 'PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY',
PROPOSAL_ERROR_INVALID_MARKET = "PROPOSAL_ERROR_INVALID_MARKET", PROPOSAL_ERROR_INVALID_MARKET = 'PROPOSAL_ERROR_INVALID_MARKET',
PROPOSAL_ERROR_INVALID_RISK_PARAMETER = "PROPOSAL_ERROR_INVALID_RISK_PARAMETER", PROPOSAL_ERROR_INVALID_RISK_PARAMETER = 'PROPOSAL_ERROR_INVALID_RISK_PARAMETER',
PROPOSAL_ERROR_INVALID_SHAPE = "PROPOSAL_ERROR_INVALID_SHAPE", PROPOSAL_ERROR_INVALID_SHAPE = 'PROPOSAL_ERROR_INVALID_SHAPE',
PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED = "PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED", PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED = 'PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED',
PROPOSAL_ERROR_MARKET_MISSING_LIQUIDITY_COMMITMENT = "PROPOSAL_ERROR_MARKET_MISSING_LIQUIDITY_COMMITMENT", PROPOSAL_ERROR_MARKET_MISSING_LIQUIDITY_COMMITMENT = 'PROPOSAL_ERROR_MARKET_MISSING_LIQUIDITY_COMMITMENT',
PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD = "PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD", PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD = 'PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD',
PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT = "PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT", PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT = 'PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT',
PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS = "PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS", PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS = 'PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS',
PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY = "PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY", PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY = 'PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY',
PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE = "PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE", PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE = 'PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE',
PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = "PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED", PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = 'PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED',
PROPOSAL_ERROR_NODE_VALIDATION_FAILED = "PROPOSAL_ERROR_NODE_VALIDATION_FAILED", PROPOSAL_ERROR_NODE_VALIDATION_FAILED = 'PROPOSAL_ERROR_NODE_VALIDATION_FAILED',
PROPOSAL_ERROR_NO_PRODUCT = "PROPOSAL_ERROR_NO_PRODUCT", PROPOSAL_ERROR_NO_PRODUCT = 'PROPOSAL_ERROR_NO_PRODUCT',
PROPOSAL_ERROR_NO_RISK_PARAMETERS = "PROPOSAL_ERROR_NO_RISK_PARAMETERS", PROPOSAL_ERROR_NO_RISK_PARAMETERS = 'PROPOSAL_ERROR_NO_RISK_PARAMETERS',
PROPOSAL_ERROR_NO_TRADING_MODE = "PROPOSAL_ERROR_NO_TRADING_MODE", PROPOSAL_ERROR_NO_TRADING_MODE = 'PROPOSAL_ERROR_NO_TRADING_MODE',
PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE = "PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE", PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE = 'PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE',
PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL = "PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL", PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL = 'PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL',
PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED = "PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED", PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED = 'PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED',
PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES = "PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES", PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES = 'PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES',
PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS = "PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS", PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS = 'PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS',
PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE = "PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE", PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE = 'PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE',
PROPOSAL_ERROR_UNKNOWN_TYPE = "PROPOSAL_ERROR_UNKNOWN_TYPE", PROPOSAL_ERROR_UNKNOWN_TYPE = 'PROPOSAL_ERROR_UNKNOWN_TYPE',
PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = "PROPOSAL_ERROR_UNSUPPORTED_PRODUCT", PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = 'PROPOSAL_ERROR_UNSUPPORTED_PRODUCT',
PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE = "PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE", PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE = 'PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE',
} }
/** /**
@ -297,50 +297,55 @@ export enum ProposalRejectionReason {
* Proposal can enter Failed state from any other state. * Proposal can enter Failed state from any other state.
*/ */
export enum ProposalState { export enum ProposalState {
STATE_DECLINED = "STATE_DECLINED", STATE_DECLINED = 'STATE_DECLINED',
STATE_ENACTED = "STATE_ENACTED", STATE_ENACTED = 'STATE_ENACTED',
STATE_FAILED = "STATE_FAILED", STATE_FAILED = 'STATE_FAILED',
STATE_OPEN = "STATE_OPEN", STATE_OPEN = 'STATE_OPEN',
STATE_PASSED = "STATE_PASSED", STATE_PASSED = 'STATE_PASSED',
STATE_REJECTED = "STATE_REJECTED", STATE_REJECTED = 'STATE_REJECTED',
STATE_WAITING_FOR_NODE_VOTE = "STATE_WAITING_FOR_NODE_VOTE", STATE_WAITING_FOR_NODE_VOTE = 'STATE_WAITING_FOR_NODE_VOTE',
} }
/** /**
* Whether the placer of an order is aiming to buy or sell on the market * Whether the placer of an order is aiming to buy or sell on the market
*/ */
export enum Side { export enum Side {
SIDE_BUY = "SIDE_BUY", SIDE_BUY = 'SIDE_BUY',
SIDE_SELL = "SIDE_SELL", SIDE_SELL = 'SIDE_SELL',
} }
/** /**
* The status of the stake linking * The status of the stake linking
*/ */
export enum StakeLinkingStatus { export enum StakeLinkingStatus {
STATUS_ACCEPTED = "STATUS_ACCEPTED", STATUS_ACCEPTED = 'STATUS_ACCEPTED',
STATUS_PENDING = "STATUS_PENDING", STATUS_PENDING = 'STATUS_PENDING',
STATUS_REJECTED = "STATUS_REJECTED", STATUS_REJECTED = 'STATUS_REJECTED',
} }
export enum ValidatorStatus { export enum ValidatorStatus {
VALIDATOR_NODE_STATUS_ERSATZ = "VALIDATOR_NODE_STATUS_ERSATZ", VALIDATOR_NODE_STATUS_ERSATZ = 'VALIDATOR_NODE_STATUS_ERSATZ',
VALIDATOR_NODE_STATUS_PENDING = "VALIDATOR_NODE_STATUS_PENDING", VALIDATOR_NODE_STATUS_PENDING = 'VALIDATOR_NODE_STATUS_PENDING',
VALIDATOR_NODE_STATUS_TENDERMINT = "VALIDATOR_NODE_STATUS_TENDERMINT", VALIDATOR_NODE_STATUS_TENDERMINT = 'VALIDATOR_NODE_STATUS_TENDERMINT',
} }
export enum VoteValue { export enum VoteValue {
VALUE_NO = "VALUE_NO", VALUE_NO = 'VALUE_NO',
VALUE_YES = "VALUE_YES", VALUE_YES = 'VALUE_YES',
}
export enum ProposalUserAction {
CREATE = 'CREATE',
VOTE = 'VOTE',
} }
/** /**
* The status of a withdrawal * The status of a withdrawal
*/ */
export enum WithdrawalStatus { export enum WithdrawalStatus {
STATUS_FINALIZED = "STATUS_FINALIZED", STATUS_FINALIZED = 'STATUS_FINALIZED',
STATUS_OPEN = "STATUS_OPEN", STATUS_OPEN = 'STATUS_OPEN',
STATUS_REJECTED = "STATUS_REJECTED", STATUS_REJECTED = 'STATUS_REJECTED',
} }
/** /**