@binance/wallet
Version:
Official Binance Wallet Connector - A lightweight library that provides a convenient interface to Binance's Wallet REST API.
944 lines (939 loc) • 155 kB
JavaScript
//#region rolldown:runtime
var __defProp = Object.defineProperty;
var __export = (all) => {
let target = {};
for (var name$1 in all) __defProp(target, name$1, {
get: all[name$1],
enumerable: true
});
return target;
};
//#endregion
let __binance_common = require("@binance/common");
//#region package.json
var name = "@binance/wallet";
var version = "14.0.0";
//#endregion
//#region src/rest-api/modules/account-api.ts
/**
* Binance Wallet REST API
*
* OpenAPI Specification for the Binance Wallet REST API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* AccountApi - axios parameter creator
*/
const AccountApiAxiosParamCreator = function(configuration) {
return {
accountApiTradingStatus: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/account/apiTradingStatus",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
accountInfo: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/account/info",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
accountStatus: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/account/status",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
dailyAccountSnapshot: async (type, startTime, endTime, limit, recvWindow) => {
(0, __binance_common.assertParamExists)("dailyAccountSnapshot", "type", type);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (type !== void 0 && type !== null) localVarQueryParameter["type"] = type;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/accountSnapshot",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
disableFastWithdrawSwitch: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/account/disableFastWithdrawSwitch",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
enableFastWithdrawSwitch: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/account/enableFastWithdrawSwitch",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getApiKeyPermission: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/account/apiRestrictions",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
}
};
};
/**
* AccountApi - object-oriented interface
* @class AccountApi
*/
var AccountApi = class {
constructor(configuration) {
this.configuration = configuration;
this.localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);
}
/**
* Fetch account api trading status detail.
*
* Weight: 1
*
* @summary Account API Trading Status (USER_DATA)
* @param {AccountApiTradingStatusRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<AccountApiTradingStatusResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/Account-API-Trading-Status Binance API Documentation}
*/
async accountApiTradingStatus(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountApiTradingStatus(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Fetch account info detail.
*
* Weight: 1
*
* @summary Account info (USER_DATA)
* @param {AccountInfoRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<AccountInfoResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/Account-info Binance API Documentation}
*/
async accountInfo(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountInfo(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Fetch account status detail.
*
* Weight: 1
*
* @summary Account Status (USER_DATA)
* @param {AccountStatusRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<AccountStatusResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/Account-Status Binance API Documentation}
*/
async accountStatus(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountStatus(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Daily account snapshot
*
* The query time period must be less then 30 days
* Support query within the last one month only
* If startTimeand endTime not sent, return records of the last 7 days by default
*
* Weight: 2400
*
* @summary Daily Account Snapshot (USER_DATA)
* @param {DailyAccountSnapshotRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<DailyAccountSnapshotResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/daily-account-snapshoot Binance API Documentation}
*/
async dailyAccountSnapshot(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.dailyAccountSnapshot(requestParameters?.type, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
*
* Weight: 1
*
* @summary Disable Fast Withdraw Switch (USER_DATA)
* @param {DisableFastWithdrawSwitchRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<void>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/Disable-Fast-Withdraw-Switch Binance API Documentation}
*/
async disableFastWithdrawSwitch(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.disableFastWithdrawSwitch(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Enable Fast Withdraw Switch (USER_DATA)
*
* This request will enable fastwithdraw switch under your account. <br></br>
* When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee.
*
* Weight: 1
*
* @summary Enable Fast Withdraw Switch (USER_DATA)
* @param {EnableFastWithdrawSwitchRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<void>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/Enable-Fast-Withdraw-Switch Binance API Documentation}
*/
async enableFastWithdrawSwitch(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.enableFastWithdrawSwitch(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get API Key Permission
*
* Weight: 1
*
* @summary Get API Key Permission (USER_DATA)
* @param {GetApiKeyPermissionRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetApiKeyPermissionResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AccountApi
* @see {@link https://developers.binance.com/docs/wallet/account/api-key-permission Binance API Documentation}
*/
async getApiKeyPermission(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getApiKeyPermission(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
};
//#endregion
//#region src/rest-api/modules/asset-api.ts
/**
* Binance Wallet REST API
*
* OpenAPI Specification for the Binance Wallet REST API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* AssetApi - axios parameter creator
*/
const AssetApiAxiosParamCreator = function(configuration) {
return {
assetDetail: async (recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/assetDetail",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
assetDividendRecord: async (asset, startTime, endTime, limit, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/assetDividend",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
dustConvert: async (asset, clientId, targetAsset, thirdPartyClientId, dustQuotaAssetToTargetAssetPrice) => {
(0, __binance_common.assertParamExists)("dustConvert", "asset", asset);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (clientId !== void 0 && clientId !== null) localVarQueryParameter["clientId"] = clientId;
if (targetAsset !== void 0 && targetAsset !== null) localVarQueryParameter["targetAsset"] = targetAsset;
if (thirdPartyClientId !== void 0 && thirdPartyClientId !== null) localVarQueryParameter["thirdPartyClientId"] = thirdPartyClientId;
if (dustQuotaAssetToTargetAssetPrice !== void 0 && dustQuotaAssetToTargetAssetPrice !== null) localVarQueryParameter["dustQuotaAssetToTargetAssetPrice"] = dustQuotaAssetToTargetAssetPrice;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/dust-convert/convert",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
dustConvertibleAssets: async (targetAsset, dustQuotaAssetToTargetAssetPrice) => {
(0, __binance_common.assertParamExists)("dustConvertibleAssets", "targetAsset", targetAsset);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (targetAsset !== void 0 && targetAsset !== null) localVarQueryParameter["targetAsset"] = targetAsset;
if (dustQuotaAssetToTargetAssetPrice !== void 0 && dustQuotaAssetToTargetAssetPrice !== null) localVarQueryParameter["dustQuotaAssetToTargetAssetPrice"] = dustQuotaAssetToTargetAssetPrice;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/dust-convert/query-convertible-assets",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
dustTransfer: async (asset, accountType, recvWindow) => {
(0, __binance_common.assertParamExists)("dustTransfer", "asset", asset);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (accountType !== void 0 && accountType !== null) localVarQueryParameter["accountType"] = accountType;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/dust",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
dustlog: async (startTime, endTime, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/dribblet",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
fundingWallet: async (asset, needBtcValuation, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (needBtcValuation !== void 0 && needBtcValuation !== null) localVarQueryParameter["needBtcValuation"] = needBtcValuation;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/get-funding-asset",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getAssetsThatCanBeConvertedIntoBnb: async (accountType, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (accountType !== void 0 && accountType !== null) localVarQueryParameter["accountType"] = accountType;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/dust-btc",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getCloudMiningPaymentAndRefundHistory: async (startTime, endTime, tranId, clientTranId, asset, current, size) => {
(0, __binance_common.assertParamExists)("getCloudMiningPaymentAndRefundHistory", "startTime", startTime);
(0, __binance_common.assertParamExists)("getCloudMiningPaymentAndRefundHistory", "endTime", endTime);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (tranId !== void 0 && tranId !== null) localVarQueryParameter["tranId"] = tranId;
if (clientTranId !== void 0 && clientTranId !== null) localVarQueryParameter["clientTranId"] = clientTranId;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
getOpenSymbolList: async () => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/spot/open-symbol-list",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
queryUserDelegationHistory: async (email, startTime, endTime, type, asset, current, size, recvWindow) => {
(0, __binance_common.assertParamExists)("queryUserDelegationHistory", "email", email);
(0, __binance_common.assertParamExists)("queryUserDelegationHistory", "startTime", startTime);
(0, __binance_common.assertParamExists)("queryUserDelegationHistory", "endTime", endTime);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (email !== void 0 && email !== null) localVarQueryParameter["email"] = email;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (type !== void 0 && type !== null) localVarQueryParameter["type"] = type;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/custody/transfer-history",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
queryUserUniversalTransferHistory: async (type, startTime, endTime, current, size, fromSymbol, toSymbol, recvWindow) => {
(0, __binance_common.assertParamExists)("queryUserUniversalTransferHistory", "type", type);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (type !== void 0 && type !== null) localVarQueryParameter["type"] = type;
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
if (size !== void 0 && size !== null) localVarQueryParameter["size"] = size;
if (fromSymbol !== void 0 && fromSymbol !== null) localVarQueryParameter["fromSymbol"] = fromSymbol;
if (toSymbol !== void 0 && toSymbol !== null) localVarQueryParameter["toSymbol"] = toSymbol;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/transfer",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
queryUserWalletBalance: async (quoteAsset, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (quoteAsset !== void 0 && quoteAsset !== null) localVarQueryParameter["quoteAsset"] = quoteAsset;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/wallet/balance",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
toggleBnbBurnOnSpotTradeAndMarginInterest: async (spotBNBBurn, interestBNBBurn, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (spotBNBBurn !== void 0 && spotBNBBurn !== null) localVarQueryParameter["spotBNBBurn"] = spotBNBBurn;
if (interestBNBBurn !== void 0 && interestBNBBurn !== null) localVarQueryParameter["interestBNBBurn"] = interestBNBBurn;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/bnbBurn",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
tradeFee: async (symbol, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (symbol !== void 0 && symbol !== null) localVarQueryParameter["symbol"] = symbol;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/tradeFee",
method: "GET",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
userAsset: async (asset, needBtcValuation, recvWindow) => {
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (needBtcValuation !== void 0 && needBtcValuation !== null) localVarQueryParameter["needBtcValuation"] = needBtcValuation;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v3/asset/getUserAsset",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
},
userUniversalTransfer: async (type, asset, amount, fromSymbol, toSymbol, recvWindow) => {
(0, __binance_common.assertParamExists)("userUniversalTransfer", "type", type);
(0, __binance_common.assertParamExists)("userUniversalTransfer", "asset", asset);
(0, __binance_common.assertParamExists)("userUniversalTransfer", "amount", amount);
const localVarQueryParameter = {};
const localVarBodyParameter = {};
if (type !== void 0 && type !== null) localVarQueryParameter["type"] = type;
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
if (fromSymbol !== void 0 && fromSymbol !== null) localVarQueryParameter["fromSymbol"] = fromSymbol;
if (toSymbol !== void 0 && toSymbol !== null) localVarQueryParameter["toSymbol"] = toSymbol;
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
let _timeUnit;
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
return {
endpoint: "/sapi/v1/asset/transfer",
method: "POST",
queryParams: localVarQueryParameter,
bodyParams: localVarBodyParameter,
timeUnit: _timeUnit
};
}
};
};
/**
* AssetApi - object-oriented interface
* @class AssetApi
*/
var AssetApi = class {
constructor(configuration) {
this.configuration = configuration;
this.localVarAxiosParamCreator = AssetApiAxiosParamCreator(configuration);
}
/**
* Fetch details of assets supported on Binance.
*
*
* Please get network and other deposit or withdraw details from ``GET /sapi/v1/capital/config/getall``.
*
* Weight: 1
*
* @summary Asset Detail (USER_DATA)
* @param {AssetDetailRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<AssetDetailResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Asset-Detail Binance API Documentation}
*/
async assetDetail(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.assetDetail(requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Query asset dividend record.
*
*
* There cannot be more than 180 days between parameter `startTime` and `endTime`.
*
* Weight: 10
*
* @summary Asset Dividend Record (USER_DATA)
* @param {AssetDividendRecordRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<AssetDividendRecordResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/assets-divided-record Binance API Documentation}
*/
async assetDividendRecord(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.assetDividendRecord(requestParameters?.asset, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Convert dust assets
*
* Weight: 10
*
* @summary Dust Convert (USER_DATA)
* @param {DustConvertRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<DustConvertResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Dust-Convert Binance API Documentation}
*/
async dustConvert(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.dustConvert(requestParameters?.asset, requestParameters?.clientId, requestParameters?.targetAsset, requestParameters?.thirdPartyClientId, requestParameters?.dustQuotaAssetToTargetAssetPrice);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Query dust convertible assets
*
* Weight: 1
*
* @summary Dust Convertible Assets (USER_DATA)
* @param {DustConvertibleAssetsRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<DustConvertibleAssetsResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Dust-Convertible-Assets Binance API Documentation}
*/
async dustConvertibleAssets(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.dustConvertibleAssets(requestParameters?.targetAsset, requestParameters?.dustQuotaAssetToTargetAssetPrice);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Convert dust assets to BNB.
*
* You need to open`Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
*
* Weight: 10
*
* @summary Dust Transfer (USER_DATA)
* @param {DustTransferRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<DustTransferResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Dust-Transfer Binance API Documentation}
*/
async dustTransfer(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.dustTransfer(requestParameters?.asset, requestParameters?.accountType, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Dustlog
*
* Only return last 100 records
* Only return records after 2020/12/01
*
* Weight: 1
*
* @summary DustLog(USER_DATA)
* @param {DustlogRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<DustlogResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/dust-log Binance API Documentation}
*/
async dustlog(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.dustlog(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Query Funding Wallet
*
*
* Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token
*
* Weight: 1
*
* @summary Funding Wallet (USER_DATA)
* @param {FundingWalletRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<FundingWalletResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Funding-Wallet Binance API Documentation}
*/
async fundingWallet(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fundingWallet(requestParameters?.asset, requestParameters?.needBtcValuation, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get Assets That Can Be Converted Into BNB
*
* Weight: 1
*
* @summary Get Assets That Can Be Converted Into BNB (USER_DATA)
* @param {GetAssetsThatCanBeConvertedIntoBnbRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetAssetsThatCanBeConvertedIntoBnbResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/assets-can-convert-bnb Binance API Documentation}
*/
async getAssetsThatCanBeConvertedIntoBnb(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getAssetsThatCanBeConvertedIntoBnb(requestParameters?.accountType, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* The query of Cloud-Mining payment and refund history
*
* Just return the SUCCESS records of payment and refund.
* For response, type = 248 means payment, type = 249 means refund, status =S means SUCCESS.
*
* Weight: 600
*
* @summary Get Cloud-Mining payment and refund history (USER_DATA)
* @param {GetCloudMiningPaymentAndRefundHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetCloudMiningPaymentAndRefundHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/cloud-mining-payment-and-refund-history Binance API Documentation}
*/
async getCloudMiningPaymentAndRefundHistory(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCloudMiningPaymentAndRefundHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.tranId, requestParameters?.clientTranId, requestParameters?.asset, requestParameters?.current, requestParameters?.size);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get the list of symbols that are scheduled to be opened for trading in the market.
*
* Weight: 100
*
* @summary Get Open Symbol List (MARKET_DATA)
* @returns {Promise<RestApiResponse<GetOpenSymbolListResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/open-symbol-list Binance API Documentation}
*/
async getOpenSymbolList() {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getOpenSymbolList();
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
}
/**
* Query User Delegation History
*
* Weight: 60
*
* @summary Query User Delegation History(For Master Account)(USER_DATA)
* @param {QueryUserDelegationHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<QueryUserDelegationHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/query-user-delegation Binance API Documentation}
*/
async queryUserDelegationHistory(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryUserDelegationHistory(requestParameters?.email, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.type, requestParameters?.asset, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Query User Universal Transfer History
*
*
* `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
* `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
* Support query within the last 6 months only
* If `startTime`and `endTime` not sent, return records of the last 7 days by default
*
* Weight: 1
*
* @summary Query User Universal Transfer History(USER_DATA)
* @param {QueryUserUniversalTransferHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<QueryUserUniversalTransferHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer Binance API Documentation}
*/
async queryUserUniversalTransferHistory(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryUserUniversalTransferHistory(requestParameters?.type, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.fromSymbol, requestParameters?.toSymbol, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Query User Wallet Balance
*
* Weight: 60
*
* @summary Query User Wallet Balance (USER_DATA)
* @param {QueryUserWalletBalanceRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<QueryUserWalletBalanceResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Query-User-Wallet-Balance Binance API Documentation}
*/
async queryUserWalletBalance(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryUserWalletBalance(requestParameters?.quoteAsset, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Toggle BNB Burn On Spot Trade And Margin Interest
*
* "spotBNBBurn" and "interestBNBBurn" should be sent at least one.
*
* Weight: 1(IP)
*
* @summary Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA)
* @param {ToggleBnbBurnOnSpotTradeAndMarginInterestRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<ToggleBnbBurnOnSpotTradeAndMarginInterestResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Toggle-BNB-Burn-On-Spot-Trade-And-Margin-Interest Binance API Documentation}
*/
async toggleBnbBurnOnSpotTradeAndMarginInterest(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.toggleBnbBurnOnSpotTradeAndMarginInterest(requestParameters?.spotBNBBurn, requestParameters?.interestBNBBurn, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Fetch trade fee
*
* Weight: 1
*
* @summary Trade Fee (USER_DATA)
* @param {TradeFeeRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<TradeFeeResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/Trade-Fee Binance API Documentation}
*/
async tradeFee(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.tradeFee(requestParameters?.symbol, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* Get user assets, just for positive data.
*
* If asset is set, then return this asset, otherwise return all assets positive.
* If needBtcValuation is set, then return btcValudation.
*
* Weight: 5
*
* @summary User Asset (USER_DATA)
* @param {UserAssetRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<UserAssetResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/user-assets Binance API Documentation}
*/
async userAsset(requestParameters = {}) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.userAsset(requestParameters?.asset, requestParameters?.needBtcValuation, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
/**
* user universal transfer
*
* `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
* `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
* ENUM of transfer types:
* MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account
* MAIN_CMFUTURE Spot account transfer to COIN-M Futures account
* MAIN_MARGIN Spot account transfer to Margin(cross)account
* UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account
* UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account
* CMFUTURE_MAIN COIN-M Futures account transfer to Spot account
* CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account
* MARGIN_MAIN Margin(cross)account transfer to Spot account
* MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures
* MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures
* ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account
* MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account
* ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account
* MAIN_FUNDING Spot account transfer to Funding account
* FUNDING_MAIN Funding account transfer to Spot account
* FUNDING_UMFUTURE Funding account transfer to UMFUTURE account
* UMFUTURE_FUNDING UMFUTURE account transfer to Funding account
* MARGIN_FUNDING MARGIN account transfer to Funding account
* FUNDING_MARGIN Funding account transfer to Margin account
* FUNDING_CMFUTURE Funding account transfer to CMFUTURE account
* CMFUTURE_FUNDING CMFUTURE account transfer to Funding account
* MAIN_OPTION Spot account transfer to Options account
* OPTION_MAIN Options account transfer to Spot account
* UMFUTURE_OPTION USDⓈ-M Futures account transfer to Options account
* OPTION_UMFUTURE Options account transfer to USDⓈ-M Futures account
* MARGIN_OPTION Margin(cross)account transfer to Options account
* OPTION_MARGIN Options account transfer to Margin(cross)account
* FUNDING_OPTION Funding account transfer to Options account
* OPTION_FUNDING Options account transfer to Funding account
* MAIN_PORTFOLIO_MARGIN Spot account transfer to Portfolio Margin account
* PORTFOLIO_MARGIN_MAIN Portfolio Margin account transfer to Spot account
*
* Weight: 900
*
* @summary User Universal Transfer (USER_DATA)
* @param {UserUniversalTransferRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<UserUniversalTransferResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof AssetApi
* @see {@link https://developers.binance.com/docs/wallet/asset/User-Universal-Transfer Binance API Documentation}
*/
async userUniversalTransfer(requestParameters) {
const localVarAxiosArgs = await this.localVarAxiosParamCreator.userUniversalTransfer(requestParameters?.type, requestParameters?.asset, requestParameters?.amount, requestParameters?.fromSymbol, requestParameters?.toSymbol, requestParameters?.recvWindow);
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
}
};
//#endregion
//#region src/rest-api/modules/capital-api.ts
/**
* Binance Wallet REST API
*
* OpenAPI Specification for the Binance Wallet REST API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto ge