@binance/fiat
Version:
Official Binance Fiat Connector - A lightweight library that provides a convenient interface to Binance's Fiat REST API.
554 lines (539 loc) • 17.7 kB
TypeScript
import { RestApiResponse, ConfigurationRestAPI } from '@binance/common';
export { BadRequestError, ConnectorClientError, FIAT_REST_API_PROD_URL, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError } from '@binance/common';
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
/**
*
* @export
* @interface GetFiatDepositWithdrawHistoryResponseDataInner
*/
interface GetFiatDepositWithdrawHistoryResponseDataInner {
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
orderNo?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
fiatCurrency?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
indicatedAmount?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
amount?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
totalFee?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
method?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
status?: string;
/**
*
* @type {number}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
createTime?: number;
/**
*
* @type {number}
* @memberof GetFiatDepositWithdrawHistoryResponseDataInner
*/
updateTime?: number;
}
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
/**
*
* @export
* @interface GetFiatDepositWithdrawHistoryResponse
*/
interface GetFiatDepositWithdrawHistoryResponse {
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponse
*/
code?: string;
/**
*
* @type {string}
* @memberof GetFiatDepositWithdrawHistoryResponse
*/
message?: string;
/**
*
* @type {Array<GetFiatDepositWithdrawHistoryResponseDataInner>}
* @memberof GetFiatDepositWithdrawHistoryResponse
*/
data?: Array<GetFiatDepositWithdrawHistoryResponseDataInner>;
/**
*
* @type {number}
* @memberof GetFiatDepositWithdrawHistoryResponse
*/
total?: number;
/**
*
* @type {boolean}
* @memberof GetFiatDepositWithdrawHistoryResponse
*/
success?: boolean;
}
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
/**
*
* @export
* @interface GetFiatPaymentsHistoryResponseDataInner
*/
interface GetFiatPaymentsHistoryResponseDataInner {
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
orderNo?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
sourceAmount?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
fiatCurrency?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
obtainAmount?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
cryptoCurrency?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
totalFee?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
price?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
status?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
paymentMethod?: string;
/**
*
* @type {number}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
createTime?: number;
/**
*
* @type {number}
* @memberof GetFiatPaymentsHistoryResponseDataInner
*/
updateTime?: number;
}
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
/**
*
* @export
* @interface GetFiatPaymentsHistoryResponse
*/
interface GetFiatPaymentsHistoryResponse {
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponse
*/
code?: string;
/**
*
* @type {string}
* @memberof GetFiatPaymentsHistoryResponse
*/
message?: string;
/**
*
* @type {Array<GetFiatPaymentsHistoryResponseDataInner>}
* @memberof GetFiatPaymentsHistoryResponse
*/
data?: Array<GetFiatPaymentsHistoryResponseDataInner>;
/**
*
* @type {number}
* @memberof GetFiatPaymentsHistoryResponse
*/
total?: number;
/**
*
* @type {boolean}
* @memberof GetFiatPaymentsHistoryResponse
*/
success?: boolean;
}
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
/**
* FiatApi - interface
* @interface FiatApi
*/
interface FiatApiInterface {
/**
* Get Fiat Deposit/Withdraw History
*
* If beginTime and endTime are not sent, the recent 30-day data will be returned.
*
* Weight: 90000
*
* @summary Get Fiat Deposit/Withdraw History (USER_DATA)
* @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
*
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof FiatApiInterface
*/
getFiatDepositWithdrawHistory(requestParameters: GetFiatDepositWithdrawHistoryRequest): Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>;
/**
* Get Fiat Deposit/Withdraw History
*
* If beginTime and endTime are not sent, the recent 30-day data will be returned.
* paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
* Cash Balance
* Credit Card
* Online Banking
* Bank Transfer
*
* Weight: 1
*
* @summary Get Fiat Payments History (USER_DATA)
* @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
*
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof FiatApiInterface
*/
getFiatPaymentsHistory(requestParameters: GetFiatPaymentsHistoryRequest): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;
}
/**
* Request parameters for getFiatDepositWithdrawHistory operation in FiatApi.
* @interface GetFiatDepositWithdrawHistoryRequest
*/
interface GetFiatDepositWithdrawHistoryRequest {
/**
* 0-buy,1-sell
* @type {string}
* @memberof FiatApiGetFiatDepositWithdrawHistory
*/
readonly transactionType: string;
/**
*
* @type {number}
* @memberof FiatApiGetFiatDepositWithdrawHistory
*/
readonly beginTime?: number;
/**
*
* @type {number}
* @memberof FiatApiGetFiatDepositWithdrawHistory
*/
readonly endTime?: number;
/**
* default 1
* @type {number}
* @memberof FiatApiGetFiatDepositWithdrawHistory
*/
readonly page?: number;
/**
* default 100, max 500
* @type {number}
* @memberof FiatApiGetFiatDepositWithdrawHistory
*/
readonly rows?: number;
/**
*
* @type {number}
* @memberof FiatApiGetFiatDepositWithdrawHistory
*/
readonly recvWindow?: number;
}
/**
* Request parameters for getFiatPaymentsHistory operation in FiatApi.
* @interface GetFiatPaymentsHistoryRequest
*/
interface GetFiatPaymentsHistoryRequest {
/**
* 0-buy,1-sell
* @type {string}
* @memberof FiatApiGetFiatPaymentsHistory
*/
readonly transactionType: string;
/**
*
* @type {number}
* @memberof FiatApiGetFiatPaymentsHistory
*/
readonly beginTime?: number;
/**
*
* @type {number}
* @memberof FiatApiGetFiatPaymentsHistory
*/
readonly endTime?: number;
/**
* default 1
* @type {number}
* @memberof FiatApiGetFiatPaymentsHistory
*/
readonly page?: number;
/**
* default 100, max 500
* @type {number}
* @memberof FiatApiGetFiatPaymentsHistory
*/
readonly rows?: number;
/**
*
* @type {number}
* @memberof FiatApiGetFiatPaymentsHistory
*/
readonly recvWindow?: number;
}
/**
* FiatApi - object-oriented interface
* @class FiatApi
*/
declare class FiatApi implements FiatApiInterface {
private readonly configuration;
private localVarAxiosParamCreator;
constructor(configuration: ConfigurationRestAPI);
/**
* Get Fiat Deposit/Withdraw History
*
* If beginTime and endTime are not sent, the recent 30-day data will be returned.
*
* Weight: 90000
*
* @summary Get Fiat Deposit/Withdraw History (USER_DATA)
* @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof FiatApi
* @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
*/
getFiatDepositWithdrawHistory(requestParameters: GetFiatDepositWithdrawHistoryRequest): Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>;
/**
* Get Fiat Deposit/Withdraw History
*
* If beginTime and endTime are not sent, the recent 30-day data will be returned.
* paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
* Cash Balance
* Credit Card
* Online Banking
* Bank Transfer
*
* Weight: 1
*
* @summary Get Fiat Payments History (USER_DATA)
* @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @memberof FiatApi
* @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
*/
getFiatPaymentsHistory(requestParameters: GetFiatPaymentsHistoryRequest): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;
}
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
declare class RestAPI {
private configuration;
private fiatApi;
constructor(configuration: ConfigurationRestAPI);
/**
* Generic function to send a request.
* @param endpoint - The API endpoint to call.
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
* @param params - Query parameters for the request.
*
* @returns A promise resolving to the response data object.
*/
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
/**
* Generic function to send a signed request.
* @param endpoint - The API endpoint to call.
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
* @param params - Query parameters for the request.
*
* @returns A promise resolving to the response data object.
*/
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
/**
* Get Fiat Deposit/Withdraw History
*
* If beginTime and endTime are not sent, the recent 30-day data will be returned.
*
* Weight: 90000
*
* @summary Get Fiat Deposit/Withdraw History (USER_DATA)
* @param {GetFiatDepositWithdrawHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History Binance API Documentation}
*/
getFiatDepositWithdrawHistory(requestParameters: GetFiatDepositWithdrawHistoryRequest): Promise<RestApiResponse<GetFiatDepositWithdrawHistoryResponse>>;
/**
* Get Fiat Deposit/Withdraw History
*
* If beginTime and endTime are not sent, the recent 30-day data will be returned.
* paymentMethod: Only when requesting payments history for buy (transactionType=0), response contains paymentMethod representing the way of purchase. Now we have:
* Cash Balance
* Credit Card
* Online Banking
* Bank Transfer
*
* Weight: 1
*
* @summary Get Fiat Payments History (USER_DATA)
* @param {GetFiatPaymentsHistoryRequest} requestParameters Request parameters.
* @returns {Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>}
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
* @see {@link https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History Binance API Documentation}
*/
getFiatPaymentsHistory(requestParameters: GetFiatPaymentsHistoryRequest): Promise<RestApiResponse<GetFiatPaymentsHistoryResponse>>;
}
/**
* Binance Fiat REST API
*
* OpenAPI Specification for the Binance Fiat 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.
*/
type index_FiatApi = FiatApi;
declare const index_FiatApi: typeof FiatApi;
type index_FiatApiInterface = FiatApiInterface;
type index_GetFiatDepositWithdrawHistoryRequest = GetFiatDepositWithdrawHistoryRequest;
type index_GetFiatDepositWithdrawHistoryResponse = GetFiatDepositWithdrawHistoryResponse;
type index_GetFiatDepositWithdrawHistoryResponseDataInner = GetFiatDepositWithdrawHistoryResponseDataInner;
type index_GetFiatPaymentsHistoryRequest = GetFiatPaymentsHistoryRequest;
type index_GetFiatPaymentsHistoryResponse = GetFiatPaymentsHistoryResponse;
type index_GetFiatPaymentsHistoryResponseDataInner = GetFiatPaymentsHistoryResponseDataInner;
type index_RestAPI = RestAPI;
declare const index_RestAPI: typeof RestAPI;
declare namespace index {
export { index_FiatApi as FiatApi, type index_FiatApiInterface as FiatApiInterface, type index_GetFiatDepositWithdrawHistoryRequest as GetFiatDepositWithdrawHistoryRequest, type index_GetFiatDepositWithdrawHistoryResponse as GetFiatDepositWithdrawHistoryResponse, type index_GetFiatDepositWithdrawHistoryResponseDataInner as GetFiatDepositWithdrawHistoryResponseDataInner, type index_GetFiatPaymentsHistoryRequest as GetFiatPaymentsHistoryRequest, type index_GetFiatPaymentsHistoryResponse as GetFiatPaymentsHistoryResponse, type index_GetFiatPaymentsHistoryResponseDataInner as GetFiatPaymentsHistoryResponseDataInner, index_RestAPI as RestAPI };
}
interface ConfigurationFiat {
configurationRestAPI?: ConfigurationRestAPI;
}
declare class Fiat {
restAPI: RestAPI;
constructor(config: ConfigurationFiat);
}
export { type ConfigurationFiat, Fiat, index as FiatRestAPI };