Skip to contents

BinanceDeposit: Deposit Management

BinanceDeposit: Deposit Management

Details

Provides methods for retrieving deposit addresses and deposit history on Binance. Inherits from BinanceBase.

Purpose and Scope

  • Deposit Address: Retrieve deposit addresses for any supported coin and network.

  • Deposit History: Query deposit transaction records with status tracking, timestamps, and on-chain transaction IDs.

Usage

All methods require authentication (valid API key and secret). These are wallet (/sapi/) endpoints, not spot (/api/) endpoints.

Official Documentation

Binance Deposit Endpoints

Endpoints Covered

MethodEndpointHTTP
get_deposit_addressGET /sapi/v1/capital/deposit/addressGET
get_deposit_historyGET /sapi/v1/capital/deposit/hisrecGET

Deposit Status Codes

  • 0: Pending

  • 1: Success (confirmed and credited)

  • 6: Credited but cannot withdraw

  • 7: Wrong deposit

  • 8: Waiting user confirm

Super class

binance::BinanceBase -> BinanceDeposit

Methods

Inherited methods


Method get_deposit_address()

Get Deposit Address

Retrieves the deposit address for a specific coin. If network is not specified, returns the address for the coin's default network.

API Endpoint

GET https://api.binance.com/sapi/v1/capital/deposit/address

Official Documentation

Binance Deposit Address Verified: 2026-03-10

Automated Trading Usage

  • Address Lookup: Retrieve deposit addresses to share with external systems or users.

  • Multi-Network Support: Specify network (e.g., "ETH", "TRX", "BSC") to get the address on the correct chain.

  • Pre-Flight Check: Verify the deposit address exists before initiating an external transfer.

curl

curl -X GET 'https://api.binance.com/sapi/v1/capital/deposit/address?coin=BTC&timestamp=...&signature=...' \
  -H 'X-MBX-APIKEY: your-api-key'

JSON Response

{
  "address": "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv",
  "coin": "BTC",
  "tag": "",
  "url": "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
}

Usage

BinanceDeposit$get_deposit_address(coin, network = NULL, recvWindow = NULL)

Arguments

coin

Character; coin symbol (e.g., "BTC", "ETH", "USDT").

network

Character or NULL; blockchain network (e.g., "ETH", "TRX", "BSC"). If NULL, uses the coin's default network.

recvWindow

Integer or NULL; max 60000.

Returns

data.table (or promise<data.table> if async = TRUE) with columns:

  • address (character): The deposit wallet address.

  • coin (character): Coin symbol (e.g., "BTC").

  • tag (character): Address tag/memo (empty string if not applicable).

  • url (character): Blockchain explorer URL for the address.

Examples

\dontrun{
deposit <- BinanceDeposit$new()

# Get BTC deposit address (default network)
btc <- deposit$get_deposit_address(coin = "BTC")
print(btc$address)

# Get USDT deposit address on TRC20
usdt <- deposit$get_deposit_address(coin = "USDT", network = "TRX")
print(usdt[, .(address, coin, tag)])
}


Method get_deposit_history()

Get Deposit History

Retrieves deposit transaction history with optional filtering by coin, status, and time range. Converts insertTime timestamps to POSIXct.

API Endpoint

GET https://api.binance.com/sapi/v1/capital/deposit/hisrec

Official Documentation

Binance Deposit History Verified: 2026-03-10

Automated Trading Usage

  • Deposit Monitoring: Poll for status 1 (success) deposits to trigger trading logic when funds arrive.

  • Reconciliation: Match tx_id against on-chain transaction hashes for audit.

  • Time-Windowed Queries: Use startTime/endTime to retrieve deposits within a specific period. Max range is 90 days.

curl

curl -X GET 'https://api.binance.com/sapi/v1/capital/deposit/hisrec?coin=BTC&status=1&timestamp=...&signature=...' \
  -H 'X-MBX-APIKEY: your-api-key'

JSON Response

[
  {
    "id": "769800519366885376",
    "amount": "0.001",
    "coin": "BNB",
    "network": "BNB",
    "status": 1,
    "address": "bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23",
    "addressTag": "101764890",
    "txId": "98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC",
    "insertTime": 1661493146000,
    "completeTime": 1661493146000,
    "transferType": 0,
    "confirmTimes": "1/1",
    "unlockConfirm": 0,
    "walletType": 0
  }
]

Usage

BinanceDeposit$get_deposit_history(
  coin = NULL,
  status = NULL,
  startTime = NULL,
  endTime = NULL,
  offset = NULL,
  limit = NULL,
  txId = NULL,
  recvWindow = NULL
)

Arguments

coin

Character or NULL; filter by coin (e.g., "BTC", "USDT").

status

Integer or NULL; filter by status: 0 (pending), 1 (success), 6 (credited), 7 (wrong), 8 (waiting confirm).

startTime

Integer or NULL; start timestamp in milliseconds.

endTime

Integer or NULL; end timestamp in milliseconds.

offset

Integer or NULL; pagination offset (default 0).

limit

Integer or NULL; max results (default 1000, max 1000).

txId

Character or NULL; filter by transaction ID.

recvWindow

Integer or NULL; max 60000.

Returns

data.table (or promise<data.table> if async = TRUE) with columns:

  • id (character): Unique deposit identifier.

  • amount (character): Deposit amount.

  • coin (character): Deposited coin symbol.

  • network (character): Blockchain network used.

  • status (integer): Deposit status code (0=pending, 1=success, 6=credited).

  • address (character): Deposit address.

  • address_tag (character): Address tag/memo.

  • tx_id (character): On-chain transaction hash.

  • transfer_type (integer): 0=external, 1=internal.

  • confirm_times (character): Confirmation progress (e.g., "1/1").

  • unlock_confirm (integer): Confirmations needed to unlock.

  • wallet_type (integer): 0=spot, 1=funding.

  • insert_time (POSIXct): Deposit time converted from insertTime.

  • complete_time (POSIXct): Completion time converted from completeTime.

Examples

\dontrun{
deposit <- BinanceDeposit$new()

# Get all successful BTC deposits
history <- deposit$get_deposit_history(coin = "BTC", status = 1)
print(history[, .(amount, coin, status, insert_time)])

# Get deposits from the last 24 hours
now_ms <- as.integer(as.numeric(Sys.time()) * 1000)
recent <- deposit$get_deposit_history(
  startTime = now_ms - 86400000L,
  endTime = now_ms
)
}


Method clone()

The objects of this class are cloneable with this method.

Usage

BinanceDeposit$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Synchronous
deposit <- BinanceDeposit$new()
addr <- deposit$get_deposit_address(coin = "BTC")
print(addr)

# Asynchronous
deposit_async <- BinanceDeposit$new(async = TRUE)
main <- coro::async(function() {
  addr <- await(deposit_async$get_deposit_address(coin = "BTC"))
  print(addr)
})
main()
while (!later::loop_empty()) later::run_now()
} # }


## ------------------------------------------------
## Method `BinanceDeposit$get_deposit_address`
## ------------------------------------------------

if (FALSE) { # \dontrun{
deposit <- BinanceDeposit$new()

# Get BTC deposit address (default network)
btc <- deposit$get_deposit_address(coin = "BTC")
print(btc$address)

# Get USDT deposit address on TRC20
usdt <- deposit$get_deposit_address(coin = "USDT", network = "TRX")
print(usdt[, .(address, coin, tag)])
} # }

## ------------------------------------------------
## Method `BinanceDeposit$get_deposit_history`
## ------------------------------------------------

if (FALSE) { # \dontrun{
deposit <- BinanceDeposit$new()

# Get all successful BTC deposits
history <- deposit$get_deposit_history(coin = "BTC", status = 1)
print(history[, .(amount, coin, status, insert_time)])

# Get deposits from the last 24 hours
now_ms <- as.integer(as.numeric(Sys.time()) * 1000)
recent <- deposit$get_deposit_history(
  startTime = now_ms - 86400000L,
  endTime = now_ms
)
} # }