Binance Connector JS
    Preparing search index...
    Index

    Constructors

    Methods

      • 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 funding 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 funding wallet You need Enable Withdrawals for the API Key which requests this endpoint.

      Weight(IP): 1

      Security Type: TRADE

      Parameters

      Returns Promise<RestApiResponse<CreateADualTokenGiftCardResponse>>

    • This API is for redeeming a Binance Gift Card. Once redeemed, the coins will be deposited in your funding 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.

      Parameters

      Returns Promise<RestApiResponse<RedeemABinanceGiftCardResponse>>

    • Generic function to send a request.

      Type Parameters

      • T

      Parameters

      • endpoint: string

        The API endpoint to call.

      • method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH"

        HTTP method to use (GET, POST, DELETE, etc.).

      • queryParams: Record<string, unknown> = {}

        Query parameters for the request.

      • bodyParams: Record<string, unknown> = {}

        Body parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.

    • Generic function to send a signed request.

      Type Parameters

      • T

      Parameters

      • endpoint: string

        The API endpoint to call.

      • method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH"

        HTTP method to use (GET, POST, DELETE, etc.).

      • queryParams: Record<string, unknown> = {}

        Query parameters for the request.

      • bodyParams: Record<string, unknown> = {}

        Body parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.