v3.5.8: feat() easier env-controlled HTTP traces. Add missing properties for asset v5 types.
This commit is contained in:
@@ -39,6 +39,7 @@ export interface GetAccountCoinBalanceParamsV5 {
|
||||
accountType: AccountTypeV5;
|
||||
coin: string;
|
||||
withBonus?: number;
|
||||
withTransferSafeAmount?: 0 | 1;
|
||||
}
|
||||
|
||||
export interface GetInternalTransferParamsV5 {
|
||||
@@ -119,6 +120,7 @@ export interface WithdrawParamsV5 {
|
||||
address: string;
|
||||
tag?: string;
|
||||
amount: string;
|
||||
timestamp: number;
|
||||
forceChain?: number;
|
||||
accountType?: 'SPOT' | 'FUND';
|
||||
}
|
||||
|
||||
@@ -11,11 +11,12 @@ import {
|
||||
} from './requestUtils';
|
||||
import { signMessage } from './node-support';
|
||||
|
||||
if (
|
||||
const ENABLE_HTTP_TRACE =
|
||||
typeof process === 'object' &&
|
||||
typeof process.env === 'object' &&
|
||||
process.env.BYBITTRACE
|
||||
) {
|
||||
process.env.BYBITTRACE;
|
||||
|
||||
if (ENABLE_HTTP_TRACE) {
|
||||
// axios.interceptors.request.use((request) => {
|
||||
// console.log(
|
||||
// new Date(),
|
||||
@@ -209,7 +210,7 @@ export default abstract class BaseRestClient {
|
||||
if (this.options.syncTimeBeforePrivateRequests) {
|
||||
this.timeOffset = await this.fetchTimeOffset();
|
||||
}
|
||||
|
||||
|
||||
return this.signRequest(params || {}, method, signMethod);
|
||||
}
|
||||
|
||||
@@ -314,6 +315,10 @@ export default abstract class BaseRestClient {
|
||||
isPublicApi,
|
||||
);
|
||||
|
||||
if (ENABLE_HTTP_TRACE) {
|
||||
console.log('full request: ', options);
|
||||
}
|
||||
|
||||
// Dispatch request
|
||||
return axios(options)
|
||||
.then((response) => {
|
||||
|
||||
Reference in New Issue
Block a user