Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::gift_card::rest_api::MarketDataApi Class Reference

#include <market_data_api.hpp>

Public Member Functions

 MarketDataApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< CreateADualTokenGiftCardResponse > create_a_dual_token_gift_card (const CreateADualTokenGiftCardParams &params) const
 Create a dual-token gift card (fixed value, discount feature) (TRADE).
template<class CompletionToken>
auto async_create_a_dual_token_gift_card (const CreateADualTokenGiftCardParams &params, CompletionToken &&token) const
 Asynchronous create_a_dual_token_gift_card().
common::RestApiResponse< CreateASingleTokenGiftCardResponse > create_a_single_token_gift_card (const CreateASingleTokenGiftCardParams &params) const
 Create a single-token gift card (USER_DATA).
template<class CompletionToken>
auto async_create_a_single_token_gift_card (const CreateASingleTokenGiftCardParams &params, CompletionToken &&token) const
 Asynchronous create_a_single_token_gift_card().
common::RestApiResponse< FetchRsaPublicKeyResponse > fetch_rsa_public_key (const FetchRsaPublicKeyParams &params={}) const
 Fetch RSA Public Key (USER_DATA).
template<class CompletionToken>
auto async_fetch_rsa_public_key (const FetchRsaPublicKeyParams &params, CompletionToken &&token) const
 Asynchronous fetch_rsa_public_key().
common::RestApiResponse< FetchTokenLimitResponse > fetch_token_limit (const FetchTokenLimitParams &params) const
 Fetch Token Limit (USER_DATA).
template<class CompletionToken>
auto async_fetch_token_limit (const FetchTokenLimitParams &params, CompletionToken &&token) const
 Asynchronous fetch_token_limit().
common::RestApiResponse< RedeemABinanceGiftCardResponse > redeem_a_binance_gift_card (const RedeemABinanceGiftCardParams &params) const
 Redeem a Binance Gift Card (USER_DATA).
template<class CompletionToken>
auto async_redeem_a_binance_gift_card (const RedeemABinanceGiftCardParams &params, CompletionToken &&token) const
 Asynchronous redeem_a_binance_gift_card().
common::RestApiResponse< VerifyBinanceGiftCardByGiftCardNumberResponse > verify_binance_gift_card_by_gift_card_number (const VerifyBinanceGiftCardByGiftCardNumberParams &params) const
 Verify Binance Gift Card by Gift Card Number (USER_DATA).
template<class CompletionToken>
auto async_verify_binance_gift_card_by_gift_card_number (const VerifyBinanceGiftCardByGiftCardNumberParams &params, CompletionToken &&token) const
 Asynchronous verify_binance_gift_card_by_gift_card_number().

Constructor & Destructor Documentation

◆ MarketDataApi()

binance::gift_card::rest_api::MarketDataApi::MarketDataApi ( std::shared_ptr< common::RestClient > client)
explicit

Member Function Documentation

◆ create_a_dual_token_gift_card()

common::RestApiResponse< CreateADualTokenGiftCardResponse > binance::gift_card::rest_api::MarketDataApi::create_a_dual_token_gift_card ( const CreateADualTokenGiftCardParams & params) const
nodiscard

Create a dual-token gift card (fixed value, discount feature) (TRADE).

POST /sapi/v1/giftcard/buyCode.

  • This API is for creating a dual-token ( stablecoin-denominated) Binance Gift Card. You may create a gift card using USDT as baseToken, that is redeemable to another designated token (faceToken). For example, you can create a fixed-value BTC gift card and pay with 100 USDT plus minting fee. This gift card can keep the value fixed at 100 USDT before redemption, and will be redeemable to BTC equivalent to 100 USDT upon redemption.
  • Once successfully created, the amount of baseToken (e.g. USDT) in the fixed-value gift card along with the fee would be deducted from your Spot wallet.
    • To get started with, please make sure:
    • You have a Binance account
    • You have passed KYB
    • You have a sufficient balance(Gift Card amount and fee amount) in your Binance Spot wallet
    • You need Enable Withdrawals for the API Key which requests this endpoint.

Weight(IP): 1

Security Type: TRADE

See https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#create-adual-token-gift-card

◆ async_create_a_dual_token_gift_card()

template<class CompletionToken>
auto binance::gift_card::rest_api::MarketDataApi::async_create_a_dual_token_gift_card ( const CreateADualTokenGiftCardParams & params,
CompletionToken && token ) const
inline

Asynchronous create_a_dual_token_gift_card().

Completes with void(std::exception_ptr, common::RestApiResponse<CreateADualTokenGiftCardResponse>).

◆ create_a_single_token_gift_card()

common::RestApiResponse< CreateASingleTokenGiftCardResponse > binance::gift_card::rest_api::MarketDataApi::create_a_single_token_gift_card ( const CreateASingleTokenGiftCardParams & params) const
nodiscard

Create a single-token gift card (USER_DATA).

POST /sapi/v1/giftcard/createCode.

This API is for creating a Binance Gift Card.

To get started with, please make sure:

  • You have a Binance account
  • You have passed KYB
  • You have a sufficient balance(Gift Card amount and fee amount) in your Binance Spot wallet
  • You need Enable Withdrawals for the API Key which requests this endpoint.

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#create-asingle-token-gift-card

◆ async_create_a_single_token_gift_card()

template<class CompletionToken>
auto binance::gift_card::rest_api::MarketDataApi::async_create_a_single_token_gift_card ( const CreateASingleTokenGiftCardParams & params,
CompletionToken && token ) const
inline

Asynchronous create_a_single_token_gift_card().

Completes with void(std::exception_ptr, common::RestApiResponse<CreateASingleTokenGiftCardResponse>).

◆ fetch_rsa_public_key()

common::RestApiResponse< FetchRsaPublicKeyResponse > binance::gift_card::rest_api::MarketDataApi::fetch_rsa_public_key ( const FetchRsaPublicKeyParams & params = {}) const
nodiscard

Fetch RSA Public Key (USER_DATA).

GET /sapi/v1/giftcard/cryptography/rsa-public-key.

This API is for fetching the RSA Public Key. This RSA Public key will be used to encrypt the card code.

Please note that the RSA Public key fetched is valid only for the current day.

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#fetch-rsa-public-key

◆ async_fetch_rsa_public_key()

template<class CompletionToken>
auto binance::gift_card::rest_api::MarketDataApi::async_fetch_rsa_public_key ( const FetchRsaPublicKeyParams & params,
CompletionToken && token ) const
inline

Asynchronous fetch_rsa_public_key().

Completes with void(std::exception_ptr, common::RestApiResponse<FetchRsaPublicKeyResponse>).

◆ fetch_token_limit()

common::RestApiResponse< FetchTokenLimitResponse > binance::gift_card::rest_api::MarketDataApi::fetch_token_limit ( const FetchTokenLimitParams & params) const
nodiscard

Fetch Token Limit (USER_DATA).

GET /sapi/v1/giftcard/buyCode/token-limit.

This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#fetch-token-limit

◆ async_fetch_token_limit()

template<class CompletionToken>
auto binance::gift_card::rest_api::MarketDataApi::async_fetch_token_limit ( const FetchTokenLimitParams & params,
CompletionToken && token ) const
inline

Asynchronous fetch_token_limit().

Completes with void(std::exception_ptr, common::RestApiResponse<FetchTokenLimitResponse>).

◆ redeem_a_binance_gift_card()

common::RestApiResponse< RedeemABinanceGiftCardResponse > binance::gift_card::rest_api::MarketDataApi::redeem_a_binance_gift_card ( const RedeemABinanceGiftCardParams & params) const
nodiscard

Redeem a Binance Gift Card (USER_DATA).

POST /sapi/v1/giftcard/redeemCode.

This API is for redeeming a Binance Gift Card. Once redeemed, the coins will be deposited in your Spot wallet.

Weight(IP): 1

Security Type: USER_DATA

Notes:

  • Parameter code can be sent in two formats: Plaintext and Encrypted.
  • Sending code in encrypted format is more secure than plaintext.
  • To send encrypted code:
    • Fetch RSA public key from GET /sapi/v1/giftcard/cryptography/rsa-public-key.
    • Encrypt card code using RSA/ECB/OAEPWithSHA-256AndMGF1Padding.
  • If you enter the wrong redemption code 5 times within 24 hours, you will no longer be able to redeem any Binance Gift Cards that day.

See https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#redeem-abinance-gift-card

◆ async_redeem_a_binance_gift_card()

template<class CompletionToken>
auto binance::gift_card::rest_api::MarketDataApi::async_redeem_a_binance_gift_card ( const RedeemABinanceGiftCardParams & params,
CompletionToken && token ) const
inline

Asynchronous redeem_a_binance_gift_card().

Completes with void(std::exception_ptr, common::RestApiResponse<RedeemABinanceGiftCardResponse>).

◆ verify_binance_gift_card_by_gift_card_number()

common::RestApiResponse< VerifyBinanceGiftCardByGiftCardNumberResponse > binance::gift_card::rest_api::MarketDataApi::verify_binance_gift_card_by_gift_card_number ( const VerifyBinanceGiftCardByGiftCardNumberParams & params) const
nodiscard

Verify Binance Gift Card by Gift Card Number (USER_DATA).

GET /sapi/v1/giftcard/verify.

This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.

Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/investment-and-services-gift-card/api/rest-api/market-data#verify-binance-gift-card-by-gift-card-number

◆ async_verify_binance_gift_card_by_gift_card_number()

template<class CompletionToken>
auto binance::gift_card::rest_api::MarketDataApi::async_verify_binance_gift_card_by_gift_card_number ( const VerifyBinanceGiftCardByGiftCardNumberParams & params,
CompletionToken && token ) const
inline