Skip to content

Commit

Permalink
Merge pull request #170 from Qsilver97/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
Qsilver97 authored May 29, 2024
2 parents a3e38bc + e18ad29 commit 8f25a5c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
15 changes: 10 additions & 5 deletions app/client/src/contexts/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface AuthContextType {
setTxModalStatus: Dispatch<SetStateAction<'middle' | 'bottom' | 'closed' | string>>;
setTxStatus: Dispatch<SetStateAction<string>>;
setCurrentToken: Dispatch<SetStateAction<TokenOption>>;
fetchTradingInfoPage: () => Promise<void>;
fetchTradingInfoPage: (token?: string) => Promise<void>;
setRecoverStatus: Dispatch<SetStateAction<boolean>>;
setSeedType: Dispatch<SetStateAction<"55chars" | "24words">>;
setMode: Dispatch<SetStateAction<ModeProps>>;
Expand Down Expand Up @@ -292,16 +292,18 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({
}
};

const fetchTradingInfoPage = async (): Promise<any> => {
const fetchTradingInfoPage = async (token?: string): Promise<any> => {
setTradingPageLoading(true);
let _token = currentToken.value;
if (token) _token = token;
let orders;
try {
const resp = await axios.post(`${SERVER_URL}/api/trading-page-info`, {
token: currentToken.value
token: _token
});
console.log(resp.data, 'fffffffffffffffffffffffff')
console.log(resp.data, _token, 'fffffffffffffffffffffffff')
if (resp.data.error) {
console.log(resp.data, currentToken);
console.log(resp.data, _token);
} else {
orders = resp.data;
}
Expand Down Expand Up @@ -385,6 +387,9 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({
newSocket.on('txSocketStatus', (data) => {
console.log('txSocketStatus', data);
setTxSocketStatus(data);
if (data.txStatus.status) {
fetchTradingInfoPage(data.currentToken);
}
})

return () => {
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/pages/Trading/TradingAside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TradingAside = ({ options, quantity, price, setQuantity, setPrice, setComm
toast.error('Input valid quantity or price.');
return false;
}
if (command == 'buy' && tokenBalances['QU'][currentAddress] < parseInt(price)) {
if (command == 'buy' && tokenBalances['QU'][currentAddress] < parseInt(price) * parseInt(quantity)) {
toast.error('Not enough QU balance');
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions qshared/qhelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ struct issuerpub ASSETS[] =
{ "QTRY" },
{ "RANDOM" },
{ "QUTIL" },
{ "MLM" },
{ "QPOOL" },
{ "QFT", "TFUYVBXYIYBVTEMJHAJGEJOOZHJBQFVQLTBBKMEHPEVIZFXZRPEYFUWGTIWG" },
{ "QWALLET", "QWALLETSGQVAGBHUCVVXWZXMBKQBPQQSHRYKZGEJWFVNUFCEDDPRMKTAUVHA" },
{ "TEST", "LIYVCGRCGBDMKCPOBSXRJLKFPTABHMQSVWOATAMVGFCTSXXJZZTMLOGCSEKB" },
Expand Down

0 comments on commit 8f25a5c

Please sign in to comment.