Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WALL]Jim/WALL-4045/dxtrade account should be selected as the reciever on transfer button click #15132

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api-v2/src/hooks/useCreateOtherCFDAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const useCreateOtherCFDAccount = () => {
const modified_data = useMemo(() => {
if (!data) return undefined;

return { ...data };
return { ...data.trading_platform_new_account };
}, [data]);

return {
Expand Down
98 changes: 50 additions & 48 deletions packages/api-v2/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1516,54 +1516,56 @@ type TPrivateSocketEndpoints = {
req_id?: number;
};
response: {
/**
* ID of Trading account.
*/
account_id?: string;
/**
* Account type.
*/
account_type?: 'demo' | 'real' | 'all';
/**
* Agent Details.
*/
agent?: null | string;
/**
* Balance of the Trading account.
*/
balance?: number;
/**
* Currency of the Trading account.
*/
currency?: string;
/**
* Account balance, formatted to appropriate decimal places.
*/
display_balance?: string;
/**
* Account enabled status
*/
enabled?: number;
/**
* Landing company shortcode of the Trading account.
*/
landing_company_short?: 'bvi' | 'labuan' | 'malta' | 'maltainvest' | 'svg' | 'vanuatu' | 'seychelles';
/**
* Login name used to log in into Trading platform.
*/
login?: string;
/**
* Market type.
*/
market_type?: 'financial' | 'synthetic' | 'all';
/**
* Name of trading platform.
*/
platform?: 'dxtrade' | 'ctrader';
/**
* Sub account type.
*/
sub_account_type?: 'financial' | 'financial_stp' | 'swap_free';
trading_platform_new_account: {
/**
* ID of Trading account.
*/
account_id?: string;
/**
* Account type.
*/
account_type?: 'demo' | 'real' | 'all';
/**
* Agent Details.
*/
agent?: null | string;
/**
* Balance of the Trading account.
*/
balance?: number;
/**
* Currency of the Trading account.
*/
currency?: string;
/**
* Account balance, formatted to appropriate decimal places.
*/
display_balance?: string;
/**
* Account enabled status
*/
enabled?: number;
/**
* Landing company shortcode of the Trading account.
*/
landing_company_short?: 'bvi' | 'labuan' | 'malta' | 'maltainvest' | 'svg' | 'vanuatu' | 'seychelles';
/**
* Login name used to log in into Trading platform.
*/
login?: string;
/**
* Market type.
*/
market_type?: 'financial' | 'synthetic' | 'all';
/**
* Name of trading platform.
*/
platform?: 'dxtrade' | 'ctrader';
/**
* Sub account type.
*/
sub_account_type?: 'financial' | 'financial_stp' | 'swap_free';
};
};
/**
* Echo of the request made.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DxtradeEnterPasswordModal = () => {
const { isMobile } = useDevice();
const [password, setPassword] = useState('');
const { data: getAccountStatus, isSuccess: accountStatusSuccess } = useAccountStatus();
const { error, isLoading, isSuccess, mutateAsync, status } = useCreateOtherCFDAccount();
const { data: createdAccount, error, isLoading, isSuccess, mutateAsync, status } = useCreateOtherCFDAccount();
const { data: dxtradeAccount, isSuccess: dxtradeAccountListSuccess } = useDxtradeAccountsList();
const { data: activeWallet } = useActiveWalletAccount();
const { hide, show } = useModal();
Expand Down Expand Up @@ -68,7 +68,7 @@ const DxtradeEnterPasswordModal = () => {
<WalletButton
onClick={() => {
hide();
history.push('/wallets/cashier/transfer');
history.push('/wallets/cashier/transfer', { toAccountLoginId: createdAccount?.account_id });
}}
size={isMobile ? 'lg' : 'md'}
>
Expand Down Expand Up @@ -121,6 +121,7 @@ const DxtradeEnterPasswordModal = () => {
);
}, [
accountType,
createdAccount?.account_id,
dxtradePlatform,
hide,
history,
Expand Down
Loading