Price reminder and init approval

* Start price reminder grain

* Add config and init grain at startup

* Save init wallet when already init
This commit is contained in:
Oda
2025-09-13 02:29:14 +07:00
committed by GitHub
parent da50b30344
commit 56b4f14eb3
69 changed files with 2373 additions and 701 deletions

View File

@@ -331,6 +331,41 @@ export class AccountClient extends AuthorizedApiBase {
}
return Promise.resolve<SwapInfos>(null as any);
}
account_GetExchangeApprovalStatus(): Promise<ExchangeApprovalStatus[]> {
let url_ = this.baseUrl + "/Account/exchange-approval-status";
url_ = url_.replace(/[?&]$/, "");
let options_: RequestInit = {
method: "GET",
headers: {
"Accept": "application/json"
}
};
return this.transformOptions(options_).then(transformedOptions_ => {
return this.http.fetch(url_, transformedOptions_);
}).then((_response: Response) => {
return this.processAccount_GetExchangeApprovalStatus(_response);
});
}
protected processAccount_GetExchangeApprovalStatus(response: Response): Promise<ExchangeApprovalStatus[]> {
const status = response.status;
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
if (status === 200) {
return response.text().then((_responseText) => {
let result200: any = null;
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ExchangeApprovalStatus[];
return result200;
});
} else if (status !== 200 && status !== 204) {
return response.text().then((_responseText) => {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve<ExchangeApprovalStatus[]>(null as any);
}
}
export class BacktestClient extends AuthorizedApiBase {
@@ -3535,6 +3570,7 @@ export interface Account {
secret?: string | null;
user?: User | null;
balances?: Balance[] | null;
isGmxInitialized?: boolean;
isPrivyWallet?: boolean;
}
@@ -3735,6 +3771,11 @@ export interface SendTokenRequest {
chainId?: number | null;
}
export interface ExchangeApprovalStatus {
exchange?: TradingExchanges;
isApproved?: boolean;
}
export interface Backtest {
id: string;
finalPnl: number;
@@ -3984,7 +4025,7 @@ export enum Confidence {
export interface Candle {
exchange: TradingExchanges;
ticker: string;
ticker: Ticker;
openTime: Date;
date: Date;
open: number;
@@ -4073,7 +4114,7 @@ export interface TradingBotConfigRequest {
botTradingBalance: number;
name: string;
flipPosition: boolean;
cooldownPeriod?: number;
cooldownPeriod?: number | null;
maxLossStreak?: number;
scenario?: ScenarioRequest | null;
scenarioName?: string | null;
@@ -4625,6 +4666,8 @@ export interface PrivyInitAddressResponse {
orderVaultHash?: string | null;
exchangeRouterHash?: string | null;
error?: string | null;
address?: string | null;
isAlreadyInitialized?: boolean;
}
export interface LoginRequest {