Files
ritmex-bot/docs/ccxt/wiki/examples/js/binance-futures-transfer-from-sub-account-to-master.md
T
2025-10-03 15:28:16 +08:00

47 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- [Binance Futures Transfer From Sub Account To Master](./examples/js/)
```javascript
import ccxt from '../../js/ccxt.js';
console.log ('CCXT Version:', ccxt.version)
// https://github.com/ccxt/ccxt/issues/10181
async function main () {
const exchange = new ccxt.binance ({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
})
const markets = await exchange.loadMarkets ()
// exchange.verbose = true // uncomment for debugging purposes
const fromEmail = 'sender@example.com' // edit for your values
, toEmail = 'receiver@example.com' // edit for your values
, code = 'USDT' // edit for your values
, amount = 100 // edit for your values
, futuresType = 1 // 1 for USDT-margined futures2 for coin-margined futures
const currency = exchange.currency (code);
const response = await exchange.sapiPostSubAccountFuturesInternalTransfer ({
'fromEmail': fromEmail, // sender email
'toEmail': toEmail, // recipient email
'futuresType': futuresType, // 1 for USDT-margined futures2 for coin-margined futures
'asset': currency['id'],
'amount': exchange.currencyToPrecision (code, amount),
})
console.log (response)
}
main ()
```