Add Privy type wallet

This commit is contained in:
2025-03-05 10:36:54 +07:00
parent 30bf9d26f6
commit 988cc9eb61
21 changed files with 287 additions and 53 deletions

View File

@@ -59,14 +59,14 @@ const BacktestRowDetails: React.FC<IBotRowDetails> = ({
<CardText
title="Money Management"
content={
"SL: " +(moneyManagement.stopLoss * 100).toFixed(2) + "% TP: " +
(moneyManagement.takeProfit * 100).toFixed(2) + "%"
"SL: " +(moneyManagement?.stopLoss * 100).toFixed(2) + "% TP: " +
(moneyManagement?.takeProfit * 100).toFixed(2) + "%"
}
></CardText>
<CardText
title="Optimized Money Management"
content={
"SL: " +optimizedMoneyManagement.stopLoss.toFixed(2) + "% TP: " + optimizedMoneyManagement.takeProfit.toFixed(2) + "%"
"SL: " +optimizedMoneyManagement?.stopLoss.toFixed(2) + "% TP: " + optimizedMoneyManagement?.takeProfit.toFixed(2) + "%"
}
></CardText>

View File

@@ -275,9 +275,9 @@ const BacktestTable: React.FC<IBacktestCards> = ({ list, isFetching }) => {
// Get average optimized money management for every backtest
const optimized = list!.map((b) => b.optimizedMoneyManagement)
const stopLoss = optimized.reduce((acc, curr) => acc + curr.stopLoss, 0)
const stopLoss = optimized.reduce((acc, curr) => acc + (curr?.stopLoss ?? 0), 0)
const takeProfit = optimized.reduce(
(acc, curr) => acc + curr.takeProfit,
(acc, curr) => acc + (curr?.takeProfit ?? 0),
0
)

View File

@@ -1631,7 +1631,7 @@ export class TradingClient extends AuthorizedApiBase {
url_ = url_.replace(/[?&]$/, "");
let options_: RequestInit = {
method: "GET",
method: "POST",
headers: {
"Accept": "application/json"
}
@@ -1960,6 +1960,7 @@ export enum AccountType {
Trader = "Trader",
Watch = "Watch",
Auth = "Auth",
Privy = "Privy",
}
export interface User {

View File

@@ -116,8 +116,8 @@ const AccountModal: React.FC<IModalProps> = ({ showModal, toggleModal }) => {
</div>
</div>
{selectedExchange != TradingExchanges.Evm &&
selectedType != AccountType.Trader ? (
{(selectedExchange != TradingExchanges.Evm && selectedType != AccountType.Trader ) ||
(selectedExchange == TradingExchanges.Evm && selectedType == AccountType.Privy )? (
<>
<div className="form-control">
<div className="input-group">