diff --git a/v4-client-js/src/clients/composite-client.ts b/v4-client-js/src/clients/composite-client.ts index 3ec84c76..25425e34 100644 --- a/v4-client-js/src/clients/composite-client.ts +++ b/v4-client-js/src/clients/composite-client.ts @@ -1053,7 +1053,6 @@ export class CompositeClient { type: OrderType, side: OrderSide, price: number, - // trigger_price: number, // not used for MARKET and LIMIT size: number, clientId: number, timeInForce: OrderTimeInForce, @@ -1061,6 +1060,10 @@ export class CompositeClient { execution: OrderExecution, postOnly: boolean, reduceOnly: boolean, + // trigger_price: number, // not used for MARKET and LIMIT + marketInfo?: MarketInfo, + currentHeight?: number, + goodTilBlock?: number, ): Promise { const msgs: Promise = new Promise((resolve) => { const msg = this.placeOrderMessage( @@ -1077,6 +1080,10 @@ export class CompositeClient { execution, postOnly, reduceOnly, + undefined, + marketInfo, + currentHeight, + goodTilBlock, ); msg .then((it) => resolve([it])) @@ -1084,7 +1091,7 @@ export class CompositeClient { console.log(err); }); }); - const signature = await this.sign(wallet, () => msgs, true); + const signature = await this.sign(subaccount.wallet, () => msgs, true); return Buffer.from(signature).toString('base64'); } diff --git a/v4-client-js/src/clients/lib/axios/axiosRequest.ts b/v4-client-js/src/clients/lib/axios/axiosRequest.ts index 51113740..4f8ced05 100644 --- a/v4-client-js/src/clients/lib/axios/axiosRequest.ts +++ b/v4-client-js/src/clients/lib/axios/axiosRequest.ts @@ -13,14 +13,14 @@ export interface Response { async function axiosRequest(options: AxiosRequestConfig): Promise { try { return await axios(options); - } catch (error) { - // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - if (error.isAxiosError) { - // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - if (error.response) { - throw new AxiosServerError(error.response, error); + } catch (error: unknown) { + if (typeof error === 'object' && error !== null && 'isAxiosError' in error) { + // @eslint-disable-next-line @typescript-eslint/no-explicit-any + const axiosErr = error as any; + if (axiosErr.response) { + throw new AxiosServerError(axiosErr.response, axiosErr); } - throw new AxiosError(`Axios: ${error.message}`, error); + throw new AxiosError(`Axios: ${axiosErr.message}`, axiosErr); } throw error; } diff --git a/v4-client-js/src/lib/validation.ts b/v4-client-js/src/lib/validation.ts index 55480ff9..ea9c8452 100644 --- a/v4-client-js/src/lib/validation.ts +++ b/v4-client-js/src/lib/validation.ts @@ -185,7 +185,7 @@ function verifyIsBech32(address: string): Error | undefined { try { decode(address); } catch (error) { - return error; + return error instanceof Error ? error : new Error(String(error)); } return undefined;