implement linear websockets

This commit is contained in:
tiagosiebler
2021-02-06 23:54:45 +00:00
parent eac3d6bf06
commit 2b112b9879
2 changed files with 108 additions and 66 deletions

View File

@@ -57,7 +57,7 @@ export function getBaseRESTInverseUrl(useLivenet?: boolean, restInverseOptions?:
}
return baseUrlsInverse.testnet;
}
export function isPublicEndpoint (endpoint: string): boolean {
if (endpoint.startsWith('v2/public')) {
return true;
@@ -67,3 +67,12 @@ export function isPublicEndpoint (endpoint: string): boolean {
}
return false;
}
export function isWsPong(response: any) {
return (
response.request &&
response.request.op === 'ping' &&
response.ret_msg === 'pong' &&
response.success === true
);
}