Compare commits

...
Author SHA1 Message Date
Dariusz Majcherczyk 7ad32c2c96 Merge branch 'develop' into fix/reuse-enums 2024-02-10 14:06:26 +01:00
Dexter c31a1d57cf chore: type error 2024-02-06 12:20:53 +00:00
Dexter 50208ae222 chore: reuse enums from @vegaprotocol/rest-clients 2024-02-06 11:56:22 +00:00
5 changed files with 31 additions and 15 deletions
@@ -5,7 +5,10 @@ import { useTranslation } from 'react-i18next';
import { useAppState } from '../../../contexts/app-state/app-state-context';
import type { BigNumber } from '../../../lib/bignumber';
import type { UndelegateSubmissionBody } from '@vegaprotocol/wallet';
import { useVegaWallet } from '@vegaprotocol/wallet';
import {
UndelegateSubmissionMethod,
useVegaWallet,
} from '@vegaprotocol/wallet';
import { removeDecimal } from '@vegaprotocol/utils';
interface PendingStakeProps {
@@ -38,7 +41,7 @@ export const PendingStake = ({
undelegateSubmission: {
nodeId,
amount: removeDecimal(pendingAmount.toString(), appState.decimals),
method: 'METHOD_NOW',
method: UndelegateSubmissionMethod.METHOD_NOW,
},
};
await sendTx(pubKey, command);
@@ -28,12 +28,16 @@ import {
NetworkParams,
} from '@vegaprotocol/network-parameters';
import { useBalances } from '../../../lib/balances/balances-store';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { SubHeading } from '../../../components/heading';
import type {
DelegateSubmissionBody,
UndelegateSubmissionBody,
import {
UndelegateSubmissionMethod,
useVegaWallet,
type DelegateSubmissionBody,
type UndelegateSubmissionBody,
} from '@vegaprotocol/wallet';
import { SubHeading } from '../../../components/heading';
import type {} from '@vegaprotocol/wallet';
import Routes from '../../routes';
export enum FormState {
@@ -128,8 +132,8 @@ export const StakingForm = ({
amount: removeDecimal(amount, appState.decimals),
method:
removeType === RemoveType.Now
? 'METHOD_NOW'
: 'METHOD_AT_END_OF_EPOCH',
? UndelegateSubmissionMethod.METHOD_NOW
: UndelegateSubmissionMethod.METHOD_AT_END_OF_EPOCH,
},
};
try {
+9 -6
View File
@@ -1,6 +1,10 @@
import { WalletClientError } from '@vegaprotocol/wallet-client';
import type * as Schema from '@vegaprotocol/types';
import type { PeggedReference } from '@vegaprotocol/types';
import {
vegaMarginMode,
v1UndelegateSubmissionMethod,
} from '@vegaprotocol/rest-clients/dist/trading-data';
export interface LiquidityProvisionSubmission {
liquidityProvisionSubmission: LiquidityProvisionBody;
@@ -32,7 +36,7 @@ export interface UndelegateSubmissionBody {
undelegateSubmission: {
nodeId: string;
amount: string;
method: 'METHOD_NOW' | 'METHOD_AT_END_OF_EPOCH';
method: v1UndelegateSubmissionMethod;
};
}
@@ -472,13 +476,12 @@ export type UpdateReferralSet = {
};
};
export enum MarginMode {
MARGIN_MODE_CROSS_MARGIN = 1,
MARGIN_MODE_ISOLATED_MARGIN,
}
export { vegaMarginMode as MarginMode };
export { v1UndelegateSubmissionMethod as UndelegateSubmissionMethod };
export interface UpdateMarginMode {
marketId: string;
mode: MarginMode;
mode: vegaMarginMode;
marginFactor?: string;
}
+1
View File
@@ -42,6 +42,7 @@
"@sentry/nextjs": "^6.19.3",
"@sentry/react": "^6.19.2",
"@sentry/tracing": "^6.19.2",
"@vegaprotocol/rest-clients": "^0.0.5",
"@vegaprotocol/wallet-client": "0.1.9",
"@walletconnect/ethereum-provider": "^2.6.0",
"@web3-react/coinbase-wallet": "8.1.2-beta.0",
+5
View File
@@ -7808,6 +7808,11 @@
"@typescript-eslint/types" "6.11.0"
eslint-visitor-keys "^3.4.1"
"@vegaprotocol/rest-clients@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@vegaprotocol/rest-clients/-/rest-clients-0.0.5.tgz#b75f14fc549e8d170518e973435f2b91ec19f553"
integrity sha512-UTsGJKrzMsXHkuAmRxEA3ei9GEGFKwIHPdVl2DHlRMQRnP39atSu4IZsP6kK2HqLgJi8QiEZCyIkXQk+jrNRDA==
"@vegaprotocol/wallet-client@0.1.9":
version "0.1.9"
resolved "https://registry.yarnpkg.com/@vegaprotocol/wallet-client/-/wallet-client-0.1.9.tgz#8c6a71c8b2222b3de5d73cade8fc6db57e332de9"