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",
"NewRawProposal": "New raw 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",
"viaWallet": "via wallet",
"viaContract": "via vesting",

View File

@ -1,5 +1,4 @@
export * from './proposal-form-subheader';
export * from './proposal-form-min-requirements';
export * from './proposal-form-title';
export * from './proposal-form-description';
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 { ProposalFormMinRequirements } from './proposal-form-min-requirements';
import { ProposalMinRequirements } from './proposal-min-requirements';
import { ProposalUserAction } from '@vegaprotocol/types';
describe('ProposalFormMinRequirements', () => {
it('should render successfully with spam protection value, if larger', () => {
const { baseElement } = render(
<ProposalFormMinRequirements
minProposerBalance="1000000000000000000"
<ProposalMinRequirements
minProposalBalance="1000000000000000000"
spamProtectionMin="2000000000000000000"
userAction={ProposalUserAction.CREATE}
/>
);
expect(baseElement).toBeTruthy();
@ -18,9 +20,10 @@ describe('ProposalFormMinRequirements', () => {
it('should render successfully with min proposer value, if larger', () => {
const { baseElement } = render(
<ProposalFormMinRequirements
minProposerBalance="3000000000000000000"
<ProposalMinRequirements
minProposalBalance="3000000000000000000"
spamProtectionMin="1000000000000000000"
userAction={ProposalUserAction.CREATE}
/>
);
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.
// ====================================================
// GraphQL query operation: VoteButtons
// GraphQL query operation: VoteButtonsQuery
// ====================================================
export interface VoteButtons_party_stake {
export interface VoteButtonsQuery_party_stake {
__typename: "PartyStake";
/**
* The stake currently available for the party
@ -19,7 +19,7 @@ export interface VoteButtons_party_stake {
currentStakeAvailableFormatted: string;
}
export interface VoteButtons_party {
export interface VoteButtonsQuery_party {
__typename: "Party";
/**
* Party identifier
@ -28,16 +28,16 @@ export interface VoteButtons_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
*/
party: VoteButtons_party | null;
party: VoteButtonsQuery_party | null;
}
export interface VoteButtonsVariables {
export interface VoteButtonsQueryVariables {
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 { DATE_FORMAT_LONG } from '../../../../lib/date-formats';
import type {
VoteButtons as VoteButtonsQueryResult,
VoteButtonsVariables,
} from './__generated__/VoteButtons';
VoteButtonsQuery as VoteButtonsQueryResult,
VoteButtonsQueryVariables,
} from './__generated__/VoteButtonsQuery';
import { VoteState } from './use-user-vote';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { ProposalState, VoteValue } from '@vegaprotocol/types';
import { Button, ButtonLink } from '@vegaprotocol/ui-toolkit';
import {
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 {
voteState: VoteState | null;
castVote: (vote: VoteValue) => void;
voteDatetime: Date | null;
proposalState: ProposalState;
minVoterBalance: string | null;
spamProtectionMinTokens: string | null;
className?: string;
}
const VOTE_BUTTONS_QUERY = gql`
query VoteButtons($partyId: ID!) {
export const VOTE_BUTTONS_QUERY = gql`
query VoteButtonsQuery($partyId: ID!) {
party(id: $partyId) {
id
stake {
@ -40,23 +48,23 @@ const VOTE_BUTTONS_QUERY = gql`
export const VoteButtonsContainer = (props: VoteButtonsContainerProps) => {
const { pubKey } = useVegaWallet();
const { data, loading } = useQuery<
const { data, loading, error } = useQuery<
VoteButtonsQueryResult,
VoteButtonsVariables
VoteButtonsQueryVariables
>(VOTE_BUTTONS_QUERY, {
variables: { partyId: pubKey || '' },
skip: !pubKey,
});
if (loading) return null;
return (
<VoteButtons
{...props}
currentStakeAvailable={
new BigNumber(data?.party?.stake.currentStakeAvailableFormatted || 0)
}
/>
<AsyncRenderer loading={loading} error={error} data={data}>
<VoteButtons
{...props}
currentStakeAvailable={
new BigNumber(data?.party?.stake.currentStakeAvailableFormatted || 0)
}
/>
</AsyncRenderer>
);
};
@ -70,6 +78,8 @@ export const VoteButtons = ({
voteDatetime,
proposalState,
currentStakeAvailable,
minVoterBalance,
spamProtectionMinTokens,
}: VoteButtonsProps) => {
const { t } = useTranslation();
const { appDispatch } = useAppState();
@ -83,7 +93,7 @@ export const VoteButtons = ({
if (!pubKey) {
return (
<>
<div data-testid="connect-wallet">
<ButtonLink
onClick={() =>
appDispatch({
@ -95,7 +105,7 @@ export const VoteButtons = ({
{t('connectVegaWallet')}
</ButtonLink>{' '}
{t('toVote')}
</>
</div>
);
}
@ -103,8 +113,38 @@ export const VoteButtons = ({
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;
}, [t, pubKey, currentStakeAvailable, proposalState, appDispatch]);
}, [
t,
pubKey,
currentStakeAvailable,
proposalState,
appDispatch,
minVoterBalance,
spamProtectionMinTokens,
]);
function submitVote(vote: VoteValue) {
setChangeVote(false);
@ -118,15 +158,15 @@ export const VoteButtons = ({
}
if (cantVoteUI) {
return <p>{cantVoteUI}</p>;
return <div>{cantVoteUI}</div>;
}
if (voteState === VoteState.Requested) {
return <p>{t('voteRequested')}...</p>;
return <p data-testid="vote-requested">{t('voteRequested')}...</p>;
}
if (voteState === VoteState.Pending) {
return <p>{t('votePending')}...</p>;
return <p data-testid="vote-pending">{t('votePending')}...</p>;
}
// If voted show current vote info`
@ -137,7 +177,7 @@ export const VoteButtons = ({
const className =
voteState === VoteState.Yes ? 'text-success' : 'text-danger';
return (
<p>
<p data-testid="you-voted">
<span>{t('youVoted')}:</span>{' '}
<span className={className}>{t(`voteState_${voteState}`)}</span>{' '}
{voteDatetime ? (
@ -158,18 +198,24 @@ export const VoteButtons = ({
}
if (!changeVote && voteState === VoteState.Failed) {
return <p>{t('voteError')}</p>;
return <p data-testid="vote-failure">{t('voteError')}</p>;
}
return (
<div className="flex gap-4" data-testid="vote-buttons">
<div className="flex-1">
<Button onClick={() => submitVote(VoteValue.VALUE_YES)}>
<Button
data-testid="vote-for"
onClick={() => submitVote(VoteValue.VALUE_YES)}
>
{t('voteFor')}
</Button>
</div>
<div className="flex-1">
<Button onClick={() => submitVote(VoteValue.VALUE_NO)}>
<Button
data-testid="vote-against"
onClick={() => submitVote(VoteValue.VALUE_NO)}
>
{t('voteAgainst')}
</Button>
</div>

View File

@ -1,6 +1,5 @@
import { formatDistanceToNow } from 'date-fns';
import { useTranslation } from 'react-i18next';
import { formatNumber } from '../../../../lib/format-number';
import { ConnectToVega } from '../../../staking/connect-to-vega';
import { useVoteInformation } from '../../hooks';
@ -11,6 +10,7 @@ import { VoteProgress } from './vote-progress';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { ProposalState } from '@vegaprotocol/types';
import type { Proposal_proposal } from '../../proposal/__generated__/Proposal';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
interface VoteDetailsProps {
proposal: Proposal_proposal;
@ -30,6 +30,43 @@ export const VoteDetails = ({ proposal }: VoteDetailsProps) => {
requiredParticipation,
} = 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 { voteState, voteDatetime, castVote } = useUserVote(
proposal.id,
@ -122,6 +159,8 @@ export const VoteDetails = ({ proposal }: VoteDetailsProps) => {
castVote={castVote}
voteDatetime={voteDatetime}
proposalState={proposal.state}
minVoterBalance={minVoterBalance}
spamProtectionMinTokens={params.spam_protection_voting_min_tokens}
className="flex"
/>
</>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,12 +25,16 @@ export const NetworkParams = {
reward_asset: 'reward_asset',
reward_staking_delegation_payoutDelay:
'reward_staking_delegation_payoutDelay',
governance_proposal_updateMarket_requiredMajority:
'governance_proposal_updateMarket_requiredMajority',
governance_proposal_market_minVoterBalance:
'governance_proposal_market_minVoterBalance',
governance_proposal_market_minClose: 'governance_proposal_market_minClose',
governance_proposal_market_maxClose: 'governance_proposal_market_maxClose',
governance_proposal_market_minEnact: 'governance_proposal_market_minEnact',
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_maxClose:
@ -39,10 +43,14 @@ export const NetworkParams = {
'governance_proposal_updateMarket_minEnact',
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_maxClose: 'governance_proposal_asset_maxClose',
governance_proposal_asset_minEnact: 'governance_proposal_asset_minEnact',
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_maxClose:
@ -53,12 +61,16 @@ export const NetworkParams = {
'governance_proposal_updateAsset_maxEnact',
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_minEnact:
'governance_proposal_updateNetParam_minEnact',
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_maxClose:
@ -94,6 +106,7 @@ export const NetworkParams = {
governance_proposal_freeform_minProposerBalance:
'governance_proposal_freeform_minProposerBalance',
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',
market_liquidity_stakeToCcySiskas: 'market_liquidity_stakeToCcySiskas',
} as const;

View File

@ -11,225 +11,225 @@
* The various account types in Vega (used by collateral)
*/
export enum AccountType {
ACCOUNT_TYPE_BOND = "ACCOUNT_TYPE_BOND",
ACCOUNT_TYPE_EXTERNAL = "ACCOUNT_TYPE_EXTERNAL",
ACCOUNT_TYPE_FEES_INFRASTRUCTURE = "ACCOUNT_TYPE_FEES_INFRASTRUCTURE",
ACCOUNT_TYPE_FEES_LIQUIDITY = "ACCOUNT_TYPE_FEES_LIQUIDITY",
ACCOUNT_TYPE_FEES_MAKER = "ACCOUNT_TYPE_FEES_MAKER",
ACCOUNT_TYPE_GENERAL = "ACCOUNT_TYPE_GENERAL",
ACCOUNT_TYPE_GLOBAL_INSURANCE = "ACCOUNT_TYPE_GLOBAL_INSURANCE",
ACCOUNT_TYPE_GLOBAL_REWARD = "ACCOUNT_TYPE_GLOBAL_REWARD",
ACCOUNT_TYPE_INSURANCE = "ACCOUNT_TYPE_INSURANCE",
ACCOUNT_TYPE_MARGIN = "ACCOUNT_TYPE_MARGIN",
ACCOUNT_TYPE_PENDING_TRANSFERS = "ACCOUNT_TYPE_PENDING_TRANSFERS",
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_RECEIVED_FEES = "ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES",
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS = "ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS",
ACCOUNT_TYPE_SETTLEMENT = "ACCOUNT_TYPE_SETTLEMENT",
ACCOUNT_TYPE_BOND = 'ACCOUNT_TYPE_BOND',
ACCOUNT_TYPE_EXTERNAL = 'ACCOUNT_TYPE_EXTERNAL',
ACCOUNT_TYPE_FEES_INFRASTRUCTURE = 'ACCOUNT_TYPE_FEES_INFRASTRUCTURE',
ACCOUNT_TYPE_FEES_LIQUIDITY = 'ACCOUNT_TYPE_FEES_LIQUIDITY',
ACCOUNT_TYPE_FEES_MAKER = 'ACCOUNT_TYPE_FEES_MAKER',
ACCOUNT_TYPE_GENERAL = 'ACCOUNT_TYPE_GENERAL',
ACCOUNT_TYPE_GLOBAL_INSURANCE = 'ACCOUNT_TYPE_GLOBAL_INSURANCE',
ACCOUNT_TYPE_GLOBAL_REWARD = 'ACCOUNT_TYPE_GLOBAL_REWARD',
ACCOUNT_TYPE_INSURANCE = 'ACCOUNT_TYPE_INSURANCE',
ACCOUNT_TYPE_MARGIN = 'ACCOUNT_TYPE_MARGIN',
ACCOUNT_TYPE_PENDING_TRANSFERS = 'ACCOUNT_TYPE_PENDING_TRANSFERS',
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_RECEIVED_FEES = 'ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES',
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS = 'ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS',
ACCOUNT_TYPE_SETTLEMENT = 'ACCOUNT_TYPE_SETTLEMENT',
}
export enum AssetStatus {
STATUS_ENABLED = "STATUS_ENABLED",
STATUS_PENDING_LISTING = "STATUS_PENDING_LISTING",
STATUS_PROPOSED = "STATUS_PROPOSED",
STATUS_REJECTED = "STATUS_REJECTED",
STATUS_ENABLED = 'STATUS_ENABLED',
STATUS_PENDING_LISTING = 'STATUS_PENDING_LISTING',
STATUS_PROPOSED = 'STATUS_PROPOSED',
STATUS_REJECTED = 'STATUS_REJECTED',
}
export enum AuctionTrigger {
AUCTION_TRIGGER_BATCH = "AUCTION_TRIGGER_BATCH",
AUCTION_TRIGGER_LIQUIDITY = "AUCTION_TRIGGER_LIQUIDITY",
AUCTION_TRIGGER_OPENING = "AUCTION_TRIGGER_OPENING",
AUCTION_TRIGGER_PRICE = "AUCTION_TRIGGER_PRICE",
AUCTION_TRIGGER_UNSPECIFIED = "AUCTION_TRIGGER_UNSPECIFIED",
AUCTION_TRIGGER_BATCH = 'AUCTION_TRIGGER_BATCH',
AUCTION_TRIGGER_LIQUIDITY = 'AUCTION_TRIGGER_LIQUIDITY',
AUCTION_TRIGGER_OPENING = 'AUCTION_TRIGGER_OPENING',
AUCTION_TRIGGER_PRICE = 'AUCTION_TRIGGER_PRICE',
AUCTION_TRIGGER_UNSPECIFIED = 'AUCTION_TRIGGER_UNSPECIFIED',
}
export enum BusEventType {
Account = "Account",
Asset = "Asset",
Auction = "Auction",
Deposit = "Deposit",
LiquidityProvision = "LiquidityProvision",
LossSocialization = "LossSocialization",
MarginLevels = "MarginLevels",
Market = "Market",
MarketCreated = "MarketCreated",
MarketData = "MarketData",
MarketTick = "MarketTick",
MarketUpdated = "MarketUpdated",
NodeSignature = "NodeSignature",
OracleSpec = "OracleSpec",
Order = "Order",
Party = "Party",
PositionResolution = "PositionResolution",
Proposal = "Proposal",
RiskFactor = "RiskFactor",
SettleDistressed = "SettleDistressed",
SettlePosition = "SettlePosition",
TimeUpdate = "TimeUpdate",
Trade = "Trade",
TransferResponses = "TransferResponses",
Vote = "Vote",
Withdrawal = "Withdrawal",
Account = 'Account',
Asset = 'Asset',
Auction = 'Auction',
Deposit = 'Deposit',
LiquidityProvision = 'LiquidityProvision',
LossSocialization = 'LossSocialization',
MarginLevels = 'MarginLevels',
Market = 'Market',
MarketCreated = 'MarketCreated',
MarketData = 'MarketData',
MarketTick = 'MarketTick',
MarketUpdated = 'MarketUpdated',
NodeSignature = 'NodeSignature',
OracleSpec = 'OracleSpec',
Order = 'Order',
Party = 'Party',
PositionResolution = 'PositionResolution',
Proposal = 'Proposal',
RiskFactor = 'RiskFactor',
SettleDistressed = 'SettleDistressed',
SettlePosition = 'SettlePosition',
TimeUpdate = 'TimeUpdate',
Trade = 'Trade',
TransferResponses = 'TransferResponses',
Vote = 'Vote',
Withdrawal = 'Withdrawal',
}
/**
* Comparator describes the type of comparison.
*/
export enum ConditionOperator {
OPERATOR_EQUALS = "OPERATOR_EQUALS",
OPERATOR_GREATER_THAN = "OPERATOR_GREATER_THAN",
OPERATOR_GREATER_THAN_OR_EQUAL = "OPERATOR_GREATER_THAN_OR_EQUAL",
OPERATOR_LESS_THAN = "OPERATOR_LESS_THAN",
OPERATOR_LESS_THAN_OR_EQUAL = "OPERATOR_LESS_THAN_OR_EQUAL",
OPERATOR_EQUALS = 'OPERATOR_EQUALS',
OPERATOR_GREATER_THAN = 'OPERATOR_GREATER_THAN',
OPERATOR_GREATER_THAN_OR_EQUAL = 'OPERATOR_GREATER_THAN_OR_EQUAL',
OPERATOR_LESS_THAN = 'OPERATOR_LESS_THAN',
OPERATOR_LESS_THAN_OR_EQUAL = 'OPERATOR_LESS_THAN_OR_EQUAL',
}
/**
* The interval for trade candles when subscribing via Vega GraphQL, default is I15M
*/
export enum Interval {
INTERVAL_I15M = "INTERVAL_I15M",
INTERVAL_I1D = "INTERVAL_I1D",
INTERVAL_I1H = "INTERVAL_I1H",
INTERVAL_I1M = "INTERVAL_I1M",
INTERVAL_I5M = "INTERVAL_I5M",
INTERVAL_I6H = "INTERVAL_I6H",
INTERVAL_I15M = 'INTERVAL_I15M',
INTERVAL_I1D = 'INTERVAL_I1D',
INTERVAL_I1H = 'INTERVAL_I1H',
INTERVAL_I1M = 'INTERVAL_I1M',
INTERVAL_I5M = 'INTERVAL_I5M',
INTERVAL_I6H = 'INTERVAL_I6H',
}
/**
* Status of a liquidity provision order
*/
export enum LiquidityProvisionStatus {
STATUS_ACTIVE = "STATUS_ACTIVE",
STATUS_CANCELLED = "STATUS_CANCELLED",
STATUS_PENDING = "STATUS_PENDING",
STATUS_REJECTED = "STATUS_REJECTED",
STATUS_STOPPED = "STATUS_STOPPED",
STATUS_UNDEPLOYED = "STATUS_UNDEPLOYED",
STATUS_ACTIVE = 'STATUS_ACTIVE',
STATUS_CANCELLED = 'STATUS_CANCELLED',
STATUS_PENDING = 'STATUS_PENDING',
STATUS_REJECTED = 'STATUS_REJECTED',
STATUS_STOPPED = 'STATUS_STOPPED',
STATUS_UNDEPLOYED = 'STATUS_UNDEPLOYED',
}
/**
* The current state of a market
*/
export enum MarketState {
STATE_ACTIVE = "STATE_ACTIVE",
STATE_CANCELLED = "STATE_CANCELLED",
STATE_CLOSED = "STATE_CLOSED",
STATE_PENDING = "STATE_PENDING",
STATE_PROPOSED = "STATE_PROPOSED",
STATE_REJECTED = "STATE_REJECTED",
STATE_SETTLED = "STATE_SETTLED",
STATE_SUSPENDED = "STATE_SUSPENDED",
STATE_TRADING_TERMINATED = "STATE_TRADING_TERMINATED",
STATE_ACTIVE = 'STATE_ACTIVE',
STATE_CANCELLED = 'STATE_CANCELLED',
STATE_CLOSED = 'STATE_CLOSED',
STATE_PENDING = 'STATE_PENDING',
STATE_PROPOSED = 'STATE_PROPOSED',
STATE_REJECTED = 'STATE_REJECTED',
STATE_SETTLED = 'STATE_SETTLED',
STATE_SUSPENDED = 'STATE_SUSPENDED',
STATE_TRADING_TERMINATED = 'STATE_TRADING_TERMINATED',
}
/**
* What market trading mode is the market in
*/
export enum MarketTradingMode {
TRADING_MODE_BATCH_AUCTION = "TRADING_MODE_BATCH_AUCTION",
TRADING_MODE_CONTINUOUS = "TRADING_MODE_CONTINUOUS",
TRADING_MODE_MONITORING_AUCTION = "TRADING_MODE_MONITORING_AUCTION",
TRADING_MODE_NO_TRADING = "TRADING_MODE_NO_TRADING",
TRADING_MODE_OPENING_AUCTION = "TRADING_MODE_OPENING_AUCTION",
TRADING_MODE_BATCH_AUCTION = 'TRADING_MODE_BATCH_AUCTION',
TRADING_MODE_CONTINUOUS = 'TRADING_MODE_CONTINUOUS',
TRADING_MODE_MONITORING_AUCTION = 'TRADING_MODE_MONITORING_AUCTION',
TRADING_MODE_NO_TRADING = 'TRADING_MODE_NO_TRADING',
TRADING_MODE_OPENING_AUCTION = 'TRADING_MODE_OPENING_AUCTION',
}
/**
* Validating status of a node, i.e. validator or non-validator
*/
export enum NodeStatus {
NODE_STATUS_NON_VALIDATOR = "NODE_STATUS_NON_VALIDATOR",
NODE_STATUS_VALIDATOR = "NODE_STATUS_VALIDATOR",
NODE_STATUS_NON_VALIDATOR = 'NODE_STATUS_NON_VALIDATOR',
NODE_STATUS_VALIDATOR = 'NODE_STATUS_VALIDATOR',
}
/**
* Status describe the status of the oracle spec
*/
export enum OracleSpecStatus {
STATUS_ACTIVE = "STATUS_ACTIVE",
STATUS_DEACTIVATED = "STATUS_DEACTIVATED",
STATUS_ACTIVE = 'STATUS_ACTIVE',
STATUS_DEACTIVATED = 'STATUS_DEACTIVATED',
}
/**
* Why the order was rejected by the core node
*/
export enum OrderRejectionReason {
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_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_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_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_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_EDIT_NOT_ALLOWED = "ORDER_ERROR_EDIT_NOT_ALLOWED",
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_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_FUNDS_TO_PAY_FEES = "ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES",
ORDER_ERROR_INTERNAL_ERROR = "ORDER_ERROR_INTERNAL_ERROR",
ORDER_ERROR_INVALID_EXPIRATION_DATETIME = "ORDER_ERROR_INVALID_EXPIRATION_DATETIME",
ORDER_ERROR_INVALID_MARKET_ID = "ORDER_ERROR_INVALID_MARKET_ID",
ORDER_ERROR_INVALID_ORDER_ID = "ORDER_ERROR_INVALID_ORDER_ID",
ORDER_ERROR_INVALID_ORDER_REFERENCE = "ORDER_ERROR_INVALID_ORDER_REFERENCE",
ORDER_ERROR_INVALID_PARTY_ID = "ORDER_ERROR_INVALID_PARTY_ID",
ORDER_ERROR_INVALID_PERSISTENCE = "ORDER_ERROR_INVALID_PERSISTENCE",
ORDER_ERROR_INVALID_REMAINING_SIZE = "ORDER_ERROR_INVALID_REMAINING_SIZE",
ORDER_ERROR_INVALID_SIZE = "ORDER_ERROR_INVALID_SIZE",
ORDER_ERROR_INVALID_TIME_IN_FORCE = "ORDER_ERROR_INVALID_TIME_IN_FORCE",
ORDER_ERROR_INVALID_TYPE = "ORDER_ERROR_INVALID_TYPE",
ORDER_ERROR_MARGIN_CHECK_FAILED = "ORDER_ERROR_MARGIN_CHECK_FAILED",
ORDER_ERROR_MARKET_CLOSED = "ORDER_ERROR_MARKET_CLOSED",
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_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_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_THAN_ZERO = "ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO",
ORDER_ERROR_OUT_OF_SEQUENCE = "ORDER_ERROR_OUT_OF_SEQUENCE",
ORDER_ERROR_REMOVAL_FAILURE = "ORDER_ERROR_REMOVAL_FAILURE",
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_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_REPRICE_PEGGED_ORDER = "ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER",
ORDER_ERROR_WITHOUT_REFERENCE_PRICE = "ORDER_ERROR_WITHOUT_REFERENCE_PRICE",
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_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_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_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_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_EDIT_NOT_ALLOWED = 'ORDER_ERROR_EDIT_NOT_ALLOWED',
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_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_FUNDS_TO_PAY_FEES = 'ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES',
ORDER_ERROR_INTERNAL_ERROR = 'ORDER_ERROR_INTERNAL_ERROR',
ORDER_ERROR_INVALID_EXPIRATION_DATETIME = 'ORDER_ERROR_INVALID_EXPIRATION_DATETIME',
ORDER_ERROR_INVALID_MARKET_ID = 'ORDER_ERROR_INVALID_MARKET_ID',
ORDER_ERROR_INVALID_ORDER_ID = 'ORDER_ERROR_INVALID_ORDER_ID',
ORDER_ERROR_INVALID_ORDER_REFERENCE = 'ORDER_ERROR_INVALID_ORDER_REFERENCE',
ORDER_ERROR_INVALID_PARTY_ID = 'ORDER_ERROR_INVALID_PARTY_ID',
ORDER_ERROR_INVALID_PERSISTENCE = 'ORDER_ERROR_INVALID_PERSISTENCE',
ORDER_ERROR_INVALID_REMAINING_SIZE = 'ORDER_ERROR_INVALID_REMAINING_SIZE',
ORDER_ERROR_INVALID_SIZE = 'ORDER_ERROR_INVALID_SIZE',
ORDER_ERROR_INVALID_TIME_IN_FORCE = 'ORDER_ERROR_INVALID_TIME_IN_FORCE',
ORDER_ERROR_INVALID_TYPE = 'ORDER_ERROR_INVALID_TYPE',
ORDER_ERROR_MARGIN_CHECK_FAILED = 'ORDER_ERROR_MARGIN_CHECK_FAILED',
ORDER_ERROR_MARKET_CLOSED = 'ORDER_ERROR_MARKET_CLOSED',
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_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_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_THAN_ZERO = 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO',
ORDER_ERROR_OUT_OF_SEQUENCE = 'ORDER_ERROR_OUT_OF_SEQUENCE',
ORDER_ERROR_REMOVAL_FAILURE = 'ORDER_ERROR_REMOVAL_FAILURE',
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_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_REPRICE_PEGGED_ORDER = 'ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER',
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.
*/
export enum OrderStatus {
STATUS_ACTIVE = "STATUS_ACTIVE",
STATUS_CANCELLED = "STATUS_CANCELLED",
STATUS_EXPIRED = "STATUS_EXPIRED",
STATUS_FILLED = "STATUS_FILLED",
STATUS_PARKED = "STATUS_PARKED",
STATUS_PARTIALLY_FILLED = "STATUS_PARTIALLY_FILLED",
STATUS_REJECTED = "STATUS_REJECTED",
STATUS_STOPPED = "STATUS_STOPPED",
STATUS_ACTIVE = 'STATUS_ACTIVE',
STATUS_CANCELLED = 'STATUS_CANCELLED',
STATUS_EXPIRED = 'STATUS_EXPIRED',
STATUS_FILLED = 'STATUS_FILLED',
STATUS_PARKED = 'STATUS_PARKED',
STATUS_PARTIALLY_FILLED = 'STATUS_PARTIALLY_FILLED',
STATUS_REJECTED = 'STATUS_REJECTED',
STATUS_STOPPED = 'STATUS_STOPPED',
}
/**
* Valid order types, these determine what happens when an order is added to the book
*/
export enum OrderTimeInForce {
TIME_IN_FORCE_FOK = "TIME_IN_FORCE_FOK",
TIME_IN_FORCE_GFA = "TIME_IN_FORCE_GFA",
TIME_IN_FORCE_GFN = "TIME_IN_FORCE_GFN",
TIME_IN_FORCE_GTC = "TIME_IN_FORCE_GTC",
TIME_IN_FORCE_GTT = "TIME_IN_FORCE_GTT",
TIME_IN_FORCE_IOC = "TIME_IN_FORCE_IOC",
TIME_IN_FORCE_FOK = 'TIME_IN_FORCE_FOK',
TIME_IN_FORCE_GFA = 'TIME_IN_FORCE_GFA',
TIME_IN_FORCE_GFN = 'TIME_IN_FORCE_GFN',
TIME_IN_FORCE_GTC = 'TIME_IN_FORCE_GTC',
TIME_IN_FORCE_GTT = 'TIME_IN_FORCE_GTT',
TIME_IN_FORCE_IOC = 'TIME_IN_FORCE_IOC',
}
export enum OrderType {
TYPE_LIMIT = "TYPE_LIMIT",
TYPE_MARKET = "TYPE_MARKET",
TYPE_NETWORK = "TYPE_NETWORK",
TYPE_LIMIT = 'TYPE_LIMIT',
TYPE_MARKET = 'TYPE_MARKET',
TYPE_NETWORK = 'TYPE_NETWORK',
}
/**
@ -237,56 +237,56 @@ export enum OrderType {
* engine.
*/
export enum PropertyKeyType {
TYPE_BOOLEAN = "TYPE_BOOLEAN",
TYPE_DECIMAL = "TYPE_DECIMAL",
TYPE_EMPTY = "TYPE_EMPTY",
TYPE_INTEGER = "TYPE_INTEGER",
TYPE_STRING = "TYPE_STRING",
TYPE_TIMESTAMP = "TYPE_TIMESTAMP",
TYPE_BOOLEAN = 'TYPE_BOOLEAN',
TYPE_DECIMAL = 'TYPE_DECIMAL',
TYPE_EMPTY = 'TYPE_EMPTY',
TYPE_INTEGER = 'TYPE_INTEGER',
TYPE_STRING = 'TYPE_STRING',
TYPE_TIMESTAMP = 'TYPE_TIMESTAMP',
}
/**
* Why the proposal was rejected by the core node
*/
export enum ProposalRejectionReason {
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_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_SOON = "PROPOSAL_ERROR_ENACT_TIME_TOO_SOON",
PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = "PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS",
PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = "PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE",
PROPOSAL_ERROR_INSUFFICIENT_TOKENS = "PROPOSAL_ERROR_INSUFFICIENT_TOKENS",
PROPOSAL_ERROR_INVALID_ASSET = "PROPOSAL_ERROR_INVALID_ASSET",
PROPOSAL_ERROR_INVALID_ASSET_DETAILS = "PROPOSAL_ERROR_INVALID_ASSET_DETAILS",
PROPOSAL_ERROR_INVALID_FEE_AMOUNT = "PROPOSAL_ERROR_INVALID_FEE_AMOUNT",
PROPOSAL_ERROR_INVALID_FREEFORM = "PROPOSAL_ERROR_INVALID_FREEFORM",
PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = "PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT",
PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = "PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY",
PROPOSAL_ERROR_INVALID_MARKET = "PROPOSAL_ERROR_INVALID_MARKET",
PROPOSAL_ERROR_INVALID_RISK_PARAMETER = "PROPOSAL_ERROR_INVALID_RISK_PARAMETER",
PROPOSAL_ERROR_INVALID_SHAPE = "PROPOSAL_ERROR_INVALID_SHAPE",
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_MISSING_BUILTIN_ASSET_FIELD = "PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD",
PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT = "PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT",
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_VALUE = "PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE",
PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = "PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED",
PROPOSAL_ERROR_NODE_VALIDATION_FAILED = "PROPOSAL_ERROR_NODE_VALIDATION_FAILED",
PROPOSAL_ERROR_NO_PRODUCT = "PROPOSAL_ERROR_NO_PRODUCT",
PROPOSAL_ERROR_NO_RISK_PARAMETERS = "PROPOSAL_ERROR_NO_RISK_PARAMETERS",
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_SMALL = "PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL",
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_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_TYPE = "PROPOSAL_ERROR_UNKNOWN_TYPE",
PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = "PROPOSAL_ERROR_UNSUPPORTED_PRODUCT",
PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE = "PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE",
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_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_SOON = 'PROPOSAL_ERROR_ENACT_TIME_TOO_SOON',
PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = 'PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS',
PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = 'PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE',
PROPOSAL_ERROR_INSUFFICIENT_TOKENS = 'PROPOSAL_ERROR_INSUFFICIENT_TOKENS',
PROPOSAL_ERROR_INVALID_ASSET = 'PROPOSAL_ERROR_INVALID_ASSET',
PROPOSAL_ERROR_INVALID_ASSET_DETAILS = 'PROPOSAL_ERROR_INVALID_ASSET_DETAILS',
PROPOSAL_ERROR_INVALID_FEE_AMOUNT = 'PROPOSAL_ERROR_INVALID_FEE_AMOUNT',
PROPOSAL_ERROR_INVALID_FREEFORM = 'PROPOSAL_ERROR_INVALID_FREEFORM',
PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = 'PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT',
PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = 'PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY',
PROPOSAL_ERROR_INVALID_MARKET = 'PROPOSAL_ERROR_INVALID_MARKET',
PROPOSAL_ERROR_INVALID_RISK_PARAMETER = 'PROPOSAL_ERROR_INVALID_RISK_PARAMETER',
PROPOSAL_ERROR_INVALID_SHAPE = 'PROPOSAL_ERROR_INVALID_SHAPE',
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_MISSING_BUILTIN_ASSET_FIELD = 'PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD',
PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT = 'PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT',
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_VALUE = 'PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE',
PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = 'PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED',
PROPOSAL_ERROR_NODE_VALIDATION_FAILED = 'PROPOSAL_ERROR_NODE_VALIDATION_FAILED',
PROPOSAL_ERROR_NO_PRODUCT = 'PROPOSAL_ERROR_NO_PRODUCT',
PROPOSAL_ERROR_NO_RISK_PARAMETERS = 'PROPOSAL_ERROR_NO_RISK_PARAMETERS',
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_SMALL = 'PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL',
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_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_TYPE = 'PROPOSAL_ERROR_UNKNOWN_TYPE',
PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = 'PROPOSAL_ERROR_UNSUPPORTED_PRODUCT',
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.
*/
export enum ProposalState {
STATE_DECLINED = "STATE_DECLINED",
STATE_ENACTED = "STATE_ENACTED",
STATE_FAILED = "STATE_FAILED",
STATE_OPEN = "STATE_OPEN",
STATE_PASSED = "STATE_PASSED",
STATE_REJECTED = "STATE_REJECTED",
STATE_WAITING_FOR_NODE_VOTE = "STATE_WAITING_FOR_NODE_VOTE",
STATE_DECLINED = 'STATE_DECLINED',
STATE_ENACTED = 'STATE_ENACTED',
STATE_FAILED = 'STATE_FAILED',
STATE_OPEN = 'STATE_OPEN',
STATE_PASSED = 'STATE_PASSED',
STATE_REJECTED = 'STATE_REJECTED',
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
*/
export enum Side {
SIDE_BUY = "SIDE_BUY",
SIDE_SELL = "SIDE_SELL",
SIDE_BUY = 'SIDE_BUY',
SIDE_SELL = 'SIDE_SELL',
}
/**
* The status of the stake linking
*/
export enum StakeLinkingStatus {
STATUS_ACCEPTED = "STATUS_ACCEPTED",
STATUS_PENDING = "STATUS_PENDING",
STATUS_REJECTED = "STATUS_REJECTED",
STATUS_ACCEPTED = 'STATUS_ACCEPTED',
STATUS_PENDING = 'STATUS_PENDING',
STATUS_REJECTED = 'STATUS_REJECTED',
}
export enum ValidatorStatus {
VALIDATOR_NODE_STATUS_ERSATZ = "VALIDATOR_NODE_STATUS_ERSATZ",
VALIDATOR_NODE_STATUS_PENDING = "VALIDATOR_NODE_STATUS_PENDING",
VALIDATOR_NODE_STATUS_TENDERMINT = "VALIDATOR_NODE_STATUS_TENDERMINT",
VALIDATOR_NODE_STATUS_ERSATZ = 'VALIDATOR_NODE_STATUS_ERSATZ',
VALIDATOR_NODE_STATUS_PENDING = 'VALIDATOR_NODE_STATUS_PENDING',
VALIDATOR_NODE_STATUS_TENDERMINT = 'VALIDATOR_NODE_STATUS_TENDERMINT',
}
export enum VoteValue {
VALUE_NO = "VALUE_NO",
VALUE_YES = "VALUE_YES",
VALUE_NO = 'VALUE_NO',
VALUE_YES = 'VALUE_YES',
}
export enum ProposalUserAction {
CREATE = 'CREATE',
VOTE = 'VOTE',
}
/**
* The status of a withdrawal
*/
export enum WithdrawalStatus {
STATUS_FINALIZED = "STATUS_FINALIZED",
STATUS_OPEN = "STATUS_OPEN",
STATUS_REJECTED = "STATUS_REJECTED",
STATUS_FINALIZED = 'STATUS_FINALIZED',
STATUS_OPEN = 'STATUS_OPEN',
STATUS_REJECTED = 'STATUS_REJECTED',
}
/**