Update to webhook
This commit is contained in:
@@ -3595,6 +3595,50 @@ export class TradingClient extends AuthorizedApiBase {
|
||||
}
|
||||
return Promise.resolve<PrivyInitAddressResponse>(null as any);
|
||||
}
|
||||
|
||||
trading_RequestIndicator(request: IndicatorRequestDto): Promise<FileResponse> {
|
||||
let url_ = this.baseUrl + "/Trading/RequestIndicator";
|
||||
url_ = url_.replace(/[?&]$/, "");
|
||||
|
||||
const content_ = JSON.stringify(request);
|
||||
|
||||
let options_: RequestInit = {
|
||||
body: content_,
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/octet-stream"
|
||||
}
|
||||
};
|
||||
|
||||
return this.transformOptions(options_).then(transformedOptions_ => {
|
||||
return this.http.fetch(url_, transformedOptions_);
|
||||
}).then((_response: Response) => {
|
||||
return this.processTrading_RequestIndicator(_response);
|
||||
});
|
||||
}
|
||||
|
||||
protected processTrading_RequestIndicator(response: Response): Promise<FileResponse> {
|
||||
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 || status === 206) {
|
||||
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
||||
let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
|
||||
let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
|
||||
if (fileName) {
|
||||
fileName = decodeURIComponent(fileName);
|
||||
} else {
|
||||
fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
||||
fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
||||
}
|
||||
return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
|
||||
} else if (status !== 200 && status !== 204) {
|
||||
return response.text().then((_responseText) => {
|
||||
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
||||
});
|
||||
}
|
||||
return Promise.resolve<FileResponse>(null as any);
|
||||
}
|
||||
}
|
||||
|
||||
export class UserClient extends AuthorizedApiBase {
|
||||
@@ -5058,6 +5102,14 @@ export interface PrivyInitAddressResponse {
|
||||
isAlreadyInitialized?: boolean;
|
||||
}
|
||||
|
||||
export interface IndicatorRequestDto {
|
||||
indicatorName?: string;
|
||||
strategyDescription?: string;
|
||||
documentationUrl?: string;
|
||||
imageUrl?: string | null;
|
||||
requesterName?: string;
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
name: string;
|
||||
address: string;
|
||||
|
||||
Reference in New Issue
Block a user