@binance/wallet
Version:
Official Binance Wallet Connector - A lightweight library that provides a convenient interface to Binance's Wallet REST API.
1 lines • 358 kB
Source Map (JSON)
{"version":3,"sources":["../src/wallet.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/account-api.ts","../src/rest-api/modules/asset-api.ts","../src/rest-api/modules/capital-api.ts","../src/rest-api/modules/others-api.ts","../src/rest-api/modules/travel-rule-api.ts","../src/rest-api/rest-api.ts","../src/index.ts"],"sourcesContent":["import { buildUserAgent, ConfigurationRestAPI, WALLET_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationWallet {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Wallet {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationWallet) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || WALLET_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n","{\n \"name\": \"@binance/wallet\",\n \"description\": \"Official Binance Wallet Connector - A lightweight library that provides a convenient interface to Binance's Wallet REST API.\",\n \"version\": \"11.0.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Wallet\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"1.2.5\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Wallet REST API\n *\n * OpenAPI Specification for the Binance Wallet REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","/**\n * Binance Wallet REST API\n *\n * OpenAPI Specification for the Binance Wallet REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n AccountApiTradingStatusResponse,\n AccountInfoResponse,\n AccountStatusResponse,\n DailyAccountSnapshotResponse,\n GetApiKeyPermissionResponse,\n} from '../types';\n\n/**\n * AccountApi - axios parameter creator\n */\nconst AccountApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Fetch account api trading status detail.\n *\n * Weight: 1\n *\n * @summary Account API Trading Status (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n accountApiTradingStatus: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/account/apiTradingStatus',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetch account info detail.\n *\n * Weight: 1\n *\n * @summary Account info (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n accountInfo: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/account/info',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Fetch account status detail.\n *\n * Weight: 1\n *\n * @summary Account Status (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n accountStatus: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/account/status',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Daily account snapshot\n *\n * The query time period must be less then 30 days\n * Support query within the last one month only\n * If startTimeand endTime not sent, return records of the last 7 days by default\n *\n * Weight: 2400\n *\n * @summary Daily Account Snapshot (USER_DATA)\n * @param {string} type\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [limit] min 7, max 30, default 7\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n dailyAccountSnapshot: async (\n type: string,\n startTime?: number,\n endTime?: number,\n limit?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'type' is not null or undefined\n assertParamExists('dailyAccountSnapshot', 'type', type);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (type !== undefined && type !== null) {\n localVarQueryParameter['type'] = type;\n }\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/accountSnapshot',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n *\n * Weight: 1\n *\n * @summary Disable Fast Withdraw Switch (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n disableFastWithdrawSwitch: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/account/disableFastWithdrawSwitch',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Enable Fast Withdraw Switch (USER_DATA)\n *\n * This request will enable fastwithdraw switch under your account. <br></br>\n * 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.\n *\n * Weight: 1\n *\n * @summary Enable Fast Withdraw Switch (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n enableFastWithdrawSwitch: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/account/enableFastWithdrawSwitch',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get API Key Permission\n *\n * Weight: 1\n *\n * @summary Get API Key Permission (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getApiKeyPermission: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/account/apiRestrictions',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * AccountApi - interface\n * @interface AccountApi\n */\nexport interface AccountApiInterface {\n /**\n * Fetch account api trading status detail.\n *\n * Weight: 1\n *\n * @summary Account API Trading Status (USER_DATA)\n * @param {AccountApiTradingStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n accountApiTradingStatus(\n requestParameters?: AccountApiTradingStatusRequest\n ): Promise<RestApiResponse<AccountApiTradingStatusResponse>>;\n /**\n * Fetch account info detail.\n *\n * Weight: 1\n *\n * @summary Account info (USER_DATA)\n * @param {AccountInfoRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n accountInfo(\n requestParameters?: AccountInfoRequest\n ): Promise<RestApiResponse<AccountInfoResponse>>;\n /**\n * Fetch account status detail.\n *\n * Weight: 1\n *\n * @summary Account Status (USER_DATA)\n * @param {AccountStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n accountStatus(\n requestParameters?: AccountStatusRequest\n ): Promise<RestApiResponse<AccountStatusResponse>>;\n /**\n * Daily account snapshot\n *\n * The query time period must be less then 30 days\n * Support query within the last one month only\n * If startTimeand endTime not sent, return records of the last 7 days by default\n *\n * Weight: 2400\n *\n * @summary Daily Account Snapshot (USER_DATA)\n * @param {DailyAccountSnapshotRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n dailyAccountSnapshot(\n requestParameters: DailyAccountSnapshotRequest\n ): Promise<RestApiResponse<DailyAccountSnapshotResponse>>;\n /**\n *\n * Weight: 1\n *\n * @summary Disable Fast Withdraw Switch (USER_DATA)\n * @param {DisableFastWithdrawSwitchRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n disableFastWithdrawSwitch(\n requestParameters?: DisableFastWithdrawSwitchRequest\n ): Promise<RestApiResponse<void>>;\n /**\n * Enable Fast Withdraw Switch (USER_DATA)\n *\n * This request will enable fastwithdraw switch under your account. <br></br>\n * 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.\n *\n * Weight: 1\n *\n * @summary Enable Fast Withdraw Switch (USER_DATA)\n * @param {EnableFastWithdrawSwitchRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n enableFastWithdrawSwitch(\n requestParameters?: EnableFastWithdrawSwitchRequest\n ): Promise<RestApiResponse<void>>;\n /**\n * Get API Key Permission\n *\n * Weight: 1\n *\n * @summary Get API Key Permission (USER_DATA)\n * @param {GetApiKeyPermissionRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n getApiKeyPermission(\n requestParameters?: GetApiKeyPermissionRequest\n ): Promise<RestApiResponse<GetApiKeyPermissionResponse>>;\n}\n\n/**\n * Request parameters for accountApiTradingStatus operation in AccountApi.\n * @interface AccountApiTradingStatusRequest\n */\nexport interface AccountApiTradingStatusRequest {\n /**\n *\n * @type {number}\n * @memberof AccountApiAccountApiTradingStatus\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for accountInfo operation in AccountApi.\n * @interface AccountInfoRequest\n */\nexport interface AccountInfoRequest {\n /**\n *\n * @type {number}\n * @memberof AccountApiAccountInfo\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for accountStatus operation in AccountApi.\n * @interface AccountStatusRequest\n */\nexport interface AccountStatusRequest {\n /**\n *\n * @type {number}\n * @memberof AccountApiAccountStatus\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for dailyAccountSnapshot operation in AccountApi.\n * @interface DailyAccountSnapshotRequest\n */\nexport interface DailyAccountSnapshotRequest {\n /**\n *\n * @type {string}\n * @memberof AccountApiDailyAccountSnapshot\n */\n readonly type: string;\n\n /**\n *\n * @type {number}\n * @memberof AccountApiDailyAccountSnapshot\n */\n readonly startTime?: number;\n\n /**\n *\n * @type {number}\n * @memberof AccountApiDailyAccountSnapshot\n */\n readonly endTime?: number;\n\n /**\n * min 7, max 30, default 7\n * @type {number}\n * @memberof AccountApiDailyAccountSnapshot\n */\n readonly limit?: number;\n\n /**\n *\n * @type {number}\n * @memberof AccountApiDailyAccountSnapshot\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for disableFastWithdrawSwitch operation in AccountApi.\n * @interface DisableFastWithdrawSwitchRequest\n */\nexport interface DisableFastWithdrawSwitchRequest {\n /**\n *\n * @type {number}\n * @memberof AccountApiDisableFastWithdrawSwitch\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for enableFastWithdrawSwitch operation in AccountApi.\n * @interface EnableFastWithdrawSwitchRequest\n */\nexport interface EnableFastWithdrawSwitchRequest {\n /**\n *\n * @type {number}\n * @memberof AccountApiEnableFastWithdrawSwitch\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getApiKeyPermission operation in AccountApi.\n * @interface GetApiKeyPermissionRequest\n */\nexport interface GetApiKeyPermissionRequest {\n /**\n *\n * @type {number}\n * @memberof AccountApiGetApiKeyPermission\n */\n readonly recvWindow?: number;\n}\n\n/**\n * AccountApi - object-oriented interface\n * @class AccountApi\n */\nexport class AccountApi implements AccountApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);\n }\n\n /**\n * Fetch account api trading status detail.\n *\n * Weight: 1\n *\n * @summary Account API Trading Status (USER_DATA)\n * @param {AccountApiTradingStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AccountApiTradingStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/Account-API-Trading-Status Binance API Documentation}\n */\n public async accountApiTradingStatus(\n requestParameters: AccountApiTradingStatusRequest = {}\n ): Promise<RestApiResponse<AccountApiTradingStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountApiTradingStatus(\n requestParameters?.recvWindow\n );\n return sendRequest<AccountApiTradingStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Fetch account info detail.\n *\n * Weight: 1\n *\n * @summary Account info (USER_DATA)\n * @param {AccountInfoRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AccountInfoResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/Account-info Binance API Documentation}\n */\n public async accountInfo(\n requestParameters: AccountInfoRequest = {}\n ): Promise<RestApiResponse<AccountInfoResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountInfo(\n requestParameters?.recvWindow\n );\n return sendRequest<AccountInfoResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Fetch account status detail.\n *\n * Weight: 1\n *\n * @summary Account Status (USER_DATA)\n * @param {AccountStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AccountStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/Account-Status Binance API Documentation}\n */\n public async accountStatus(\n requestParameters: AccountStatusRequest = {}\n ): Promise<RestApiResponse<AccountStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountStatus(\n requestParameters?.recvWindow\n );\n return sendRequest<AccountStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Daily account snapshot\n *\n * The query time period must be less then 30 days\n * Support query within the last one month only\n * If startTimeand endTime not sent, return records of the last 7 days by default\n *\n * Weight: 2400\n *\n * @summary Daily Account Snapshot (USER_DATA)\n * @param {DailyAccountSnapshotRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<DailyAccountSnapshotResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/daily-account-snapshoot Binance API Documentation}\n */\n public async dailyAccountSnapshot(\n requestParameters: DailyAccountSnapshotRequest\n ): Promise<RestApiResponse<DailyAccountSnapshotResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.dailyAccountSnapshot(\n requestParameters?.type,\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit,\n requestParameters?.recvWindow\n );\n return sendRequest<DailyAccountSnapshotResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n *\n * Weight: 1\n *\n * @summary Disable Fast Withdraw Switch (USER_DATA)\n * @param {DisableFastWithdrawSwitchRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<void>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/Disable-Fast-Withdraw-Switch Binance API Documentation}\n */\n public async disableFastWithdrawSwitch(\n requestParameters: DisableFastWithdrawSwitchRequest = {}\n ): Promise<RestApiResponse<void>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.disableFastWithdrawSwitch(\n requestParameters?.recvWindow\n );\n return sendRequest<void>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Enable Fast Withdraw Switch (USER_DATA)\n *\n * This request will enable fastwithdraw switch under your account. <br></br>\n * 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.\n *\n * Weight: 1\n *\n * @summary Enable Fast Withdraw Switch (USER_DATA)\n * @param {EnableFastWithdrawSwitchRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<void>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/Enable-Fast-Withdraw-Switch Binance API Documentation}\n */\n public async enableFastWithdrawSwitch(\n requestParameters: EnableFastWithdrawSwitchRequest = {}\n ): Promise<RestApiResponse<void>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.enableFastWithdrawSwitch(\n requestParameters?.recvWindow\n );\n return sendRequest<void>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get API Key Permission\n *\n * Weight: 1\n *\n * @summary Get API Key Permission (USER_DATA)\n * @param {GetApiKeyPermissionRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetApiKeyPermissionResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/wallet/account/api-key-permission Binance API Documentation}\n */\n public async getApiKeyPermission(\n requestParameters: GetApiKeyPermissionRequest = {}\n ): Promise<RestApiResponse<GetApiKeyPermissionResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getApiKeyPermission(\n requestParameters?.recvWindow\n );\n return sendRequest<GetApiKeyPermissionResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Wallet REST API\n *\n * OpenAPI Specification for the Binance Wallet REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n AssetDetailResponse,\n AssetDividendRecordResponse,\n DustTransferResponse,\n DustlogResponse,\n FundingWalletResponse,\n GetAssetsThatCanBeConvertedIntoBnbResponse,\n GetCloudMiningPaymentAndRefundHistoryResponse,\n GetOpenSymbolListResponse,\n QueryUserDelegationHistoryResponse,\n QueryUserUniversalTransferHistoryResponse,\n QueryUserWalletBalanceResponse,\n ToggleBnbBurnOnSpotTradeAndMarginInterestResponse,\n TradeFeeResponse,\n UserAssetResponse,\n UserUniversalTransferResponse,\n} from '../types';\n\n/**\n * AssetApi - axios parameter creator\n */\nconst AssetApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Fetch details of assets supported on Binance.\n *\n *\n * Please get network and other deposit or withdraw details from ``GET /sapi/v1/capital/config/getall``.\n *\n * Weight: 1\n *\n * @summary Asset Detail (USER_DATA)\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n assetDetail: async (recvWindow?: number): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/assetDetail',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query asset dividend record.\n *\n *\n * There cannot be more than 180 days between parameter `startTime` and `endTime`.\n *\n * Weight: 10\n *\n * @summary Asset Dividend Record (USER_DATA)\n * @param {string} [asset] If asset is blank, then query all positive assets user have.\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [limit] min 7, max 30, default 7\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n assetDividendRecord: async (\n asset?: string,\n startTime?: number,\n endTime?: number,\n limit?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (asset !== undefined && asset !== null) {\n localVarQueryParameter['asset'] = asset;\n }\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/assetDividend',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Convert dust assets to BNB.\n *\n * You need to open`Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.\n *\n * Weight: 10\n *\n * @summary Dust Transfer (USER_DATA)\n * @param {string} asset\n * @param {string} [accountType] `SPOT` or `MARGIN`,default `SPOT`\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n dustTransfer: async (\n asset: string,\n accountType?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'asset' is not null or undefined\n assertParamExists('dustTransfer', 'asset', asset);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (asset !== undefined && asset !== null) {\n localVarQueryParameter['asset'] = asset;\n }\n\n if (accountType !== undefined && accountType !== null) {\n localVarQueryParameter['accountType'] = accountType;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/dust',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Dustlog\n *\n * Only return last 100 records\n * Only return records after 2020/12/01\n *\n * Weight: 1\n *\n * @summary DustLog(USER_DATA)\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n dustlog: async (\n startTime?: number,\n endTime?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/dribblet',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query Funding Wallet\n *\n *\n * Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token\n *\n * Weight: 1\n *\n * @summary Funding Wallet (USER_DATA)\n * @param {string} [asset] If asset is blank, then query all positive assets user have.\n * @param {string} [needBtcValuation] true or false\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n fundingWallet: async (\n asset?: string,\n needBtcValuation?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (asset !== undefined && asset !== null) {\n localVarQueryParameter['asset'] = asset;\n }\n\n if (needBtcValuation !== undefined && needBtcValuation !== null) {\n localVarQueryParameter['needBtcValuation'] = needBtcValuation;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/get-funding-asset',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Assets That Can Be Converted Into BNB\n *\n * Weight: 1\n *\n * @summary Get Assets That Can Be Converted Into BNB (USER_DATA)\n * @param {string} [accountType] `SPOT` or `MARGIN`,default `SPOT`\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getAssetsThatCanBeConvertedIntoBnb: async (\n accountType?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (accountType !== undefined && accountType !== null) {\n localVarQueryParameter['accountType'] = accountType;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/dust-btc',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * The query of Cloud-Mining payment and refund history\n *\n * Just return the SUCCESS records of payment and refund.\n * For response, type = 248 means payment, type = 249 means refund, status =S means SUCCESS.\n *\n * Weight: 600\n *\n * @summary Get Cloud-Mining payment and refund history (USER_DATA)\n * @param {number} startTime\n * @param {number} endTime\n * @param {number} [tranId] The transaction id\n * @param {string} [clientTranId] The unique flag\n * @param {string} [asset] If asset is blank, then query all positive assets user have.\n * @param {number} [current] current page, default 1, the min value is 1\n * @param {number} [size] page size, default 10, the max value is 100\n *\n * @throws {RequiredError}\n */\n getCloudMiningPaymentAndRefundHistory: async (\n startTime: number,\n endTime: number,\n tranId?: number,\n clientTranId?: string,\n asset?: string,\n current?: number,\n size?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'startTime' is not null or undefined\n assertParamExists('getCloudMiningPaymentAndRefundHistory', 'startTime', startTime);\n // verify required parameter 'endTime' is not null or undefined\n assertParamExists('getCloudMiningPaymentAndRefundHistory', 'endTime', endTime);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (tranId !== undefined && tranId !== null) {\n localVarQueryParameter['tranId'] = tranId;\n }\n\n if (clientTranId !== undefined && clientTranId !== null) {\n localVarQueryParameter['clientTranId'] = clientTranId;\n }\n\n if (asset !== undefined && asset !== null) {\n localVarQueryParameter['asset'] = asset;\n }\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get the list of symbols that are scheduled to be opened for trading in the market.\n *\n * Weight: 100\n *\n * @summary Get Open Symbol List (MARKET_DATA)\n *\n * @throws {RequiredError}\n */\n getOpenSymbolList: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/spot/open-symbol-list',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query User Delegation History\n *\n * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint\n *\n * Weight: 60\n *\n * @summary Query User Delegation History(For Master Account)(USER_DATA)\n * @param {string} email\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} [type] Delegate/Undelegate\n * @param {string} [asset] If asset is blank, then query all positive assets user have.\n * @param {number} [current] current page, default 1, the min value is 1\n * @param {number} [size] page size, default 10, the max value is 100\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n queryUserDelegationHistory: async (\n email: string,\n startTime: number,\n endTime: number,\n type?: string,\n asset?: string,\n current?: number,\n size?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'email' is not null or undefined\n assertParamExists('queryUserDelegationHistory', 'email', email);\n // verify required parameter 'startTime' is not null or undefined\n assertParamExists('queryUserDelegationHistory', 'startTime', startTime);\n // verify required parameter 'endTime' is not null or undefined\n assertParamExists('queryUserDelegationHistory', 'endTime', endTime);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (email !== undefined && email !== null) {\n localVarQueryParameter['email'] = email;\n }\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (type !== undefined && type !== null) {\n localVarQueryParameter['type'] = type;\n }\n\n if (asset !== undefined && asset !== null) {\n localVarQueryParameter['asset'] = asset;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/asset/custody/transfer-history',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query User Universal Transfer History\n *\n *\n * `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN\n * `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN\n * Support query within the last 6 months only\n * If `startTime`and `endTime` not sent, return records of the last 7 days by default\n *\n * Weight: 1\n *\n * @summary Query User Universal Transfer History(USER_DATA)\n * @param {string} type\n * @param {number} [startTime]\n * @param {number} [endTime]\n * @param {number} [current] current page, default 1, the min value is 1\n * @param {number} [size] page size, default 10, the max value is 100\n * @param {string} [fromSymbol]\n * @param {string} [toSymbol]\n * @param {number} [recvWindow]\n *\n * @throws {RequiredError}\n */\n queryUserUniversalTransferHistory: async (\n type: string,\n startTime?: number,\n endTime?: number,\n current?: number,\n size?: number,\n fromSymbol?: string,\n toSymbol?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'type' is not null or undefined\n assertParamExists('queryUserUniversalTransferHistory', 'type', type);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (type !== undefined && type !== null) {\n localVarQueryParameter['type'] = type;\n }\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (current !== undefined && current !== null) {\n localVarQueryParameter['current'] = current;\n }\n\n if (size !== undefined && size !== null) {\n localVarQueryParameter['size'] = size;\n }\n\n if (fromSymbol !== undefined && fromSymbol !== null) {\n localVarQueryParameter['fromSymbol'] = fromSymbol;\n }\n\n if (toSymbol !== undefined && toSymbol !== null) {\n localVarQueryParameter['toSymbol'] = toSymbol;\n }