# Wallet Deposits and Withdrawals

## Deposit records

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Deposit+records>
{% endhint %}

#### Function Name:

```javascript
getDepositRecords()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getDepositRecords(exchange, options) {
    try {
        let result = await exchange.getDepositRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getDepositRecords(myBingxExchange);
```

## Withdraw records

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Withdraw+records>
{% endhint %}

#### Function Name:

```javascript
getWithdrawRecords()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getWithdrawRecords(exchange, options) {
    try {
        let result = await exchange.getWithdrawRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getWithdrawRecords(myBingxExchange);
```

## Query currency deposit and withdrawal data

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query+currency+deposit+and+withdrawal+data>
{% endhint %}

#### Function Name:

```javascript
getCurrencyDepositAndWithdrawalData()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getCurrencyDepositAndWithdrawalData(exchange, options) {
    try {
        let result = await exchange.getCurrencyDepositAndWithdrawalData(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getCurrencyDepositAndWithdrawalData(myBingxExchange);
```

## Withdraw

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Withdraw>
{% endhint %}

#### Function Name:

```javascript
withdraw()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function withdraw(exchange, options) {
    try {
        let result = await exchange.withdraw(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await withdraw(myBingxExchange, {
	coin: "<string>",
	address: "<string>",
	amount: "<float64>",
	walletType: "<int64>"
});
```

## Main Account Deposit Address

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Main+Account+Deposit+Address>
{% endhint %}

#### Function Name:

```javascript
getMainAccountDepositAddress()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getMainAccountDepositAddress(exchange, options) {
    try {
        let result = await exchange.getMainAccountDepositAddress(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getMainAccountDepositAddress(myBingxExchange);
```

## Deposit risk control records

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Deposit+risk+control+records>
{% endhint %}

#### Function Name:

```javascript
getDepositRiskControlRecords()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getDepositRiskControlRecords(exchange, options) {
    try {
        let result = await exchange.getDepositRiskControlRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getDepositRiskControlRecords(myBingxExchange);
```
