Update SDK (#35)

* Update SDK for swap

* Fix web3proxy build

* Update types

* Fix swap

* Send token test and BASE transfer

* fix cache and hook

* Fix send

* Update health check with uiFeereceiver

* Fix sdk

* Fix get positions

* Fix timeoutloop

* Fix open position

* Fix closes positions

* Review
This commit is contained in:
Oda
2025-09-17 14:28:56 +07:00
committed by GitHub
parent 271dd70ad7
commit cee3902a4d
91 changed files with 21375 additions and 2831 deletions

View File

@@ -332,8 +332,8 @@ export class AccountClient extends AuthorizedApiBase {
return Promise.resolve<SwapInfos>(null as any);
}
account_GetExchangeApprovalStatus(): Promise<ExchangeApprovalStatus[]> {
let url_ = this.baseUrl + "/Account/exchange-approval-status";
account_GetExchangeApprovalStatus(): Promise<ExchangeInitializedStatus[]> {
let url_ = this.baseUrl + "/Account/exchanges-initialized-status";
url_ = url_.replace(/[?&]$/, "");
let options_: RequestInit = {
@@ -350,13 +350,13 @@ export class AccountClient extends AuthorizedApiBase {
});
}
protected processAccount_GetExchangeApprovalStatus(response: Response): Promise<ExchangeApprovalStatus[]> {
protected processAccount_GetExchangeApprovalStatus(response: Response): Promise<ExchangeInitializedStatus[]> {
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[];
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ExchangeInitializedStatus[];
return result200;
});
} else if (status !== 200 && status !== 204) {
@@ -364,7 +364,7 @@ export class AccountClient extends AuthorizedApiBase {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve<ExchangeApprovalStatus[]>(null as any);
return Promise.resolve<ExchangeInitializedStatus[]>(null as any);
}
}
@@ -3771,9 +3771,9 @@ export interface SendTokenRequest {
chainId?: number | null;
}
export interface ExchangeApprovalStatus {
export interface ExchangeInitializedStatus {
exchange?: TradingExchanges;
isApproved?: boolean;
isInitialized?: boolean;
}
export interface Backtest {

View File

@@ -219,9 +219,9 @@ export interface SendTokenRequest {
chainId?: number | null;
}
export interface ExchangeApprovalStatus {
export interface ExchangeInitializedStatus {
exchange?: TradingExchanges;
isApproved?: boolean;
isInitialized?: boolean;
}
export interface Backtest {

View File

@@ -206,12 +206,12 @@ const AccountRowDetails: React.FC<IAccountRowDetailProps> = ({
<div
key={status.exchange}
className={`badge ${
status.isApproved
status.isInitialized
? 'badge-success'
: 'badge-outline'
}`}
>
{status.exchange}: {status.isApproved ? 'Approved' : 'Not Approved'}
{status.exchange}: {status.isInitialized ? 'Initialized' : 'Not Initialized'}
</div>
))}
</div>