Function
transferBetweenMainAndFutures
(
asset,
amount,
type,
callback
)
Source from the content-addressed store, hash-verified
| 2224 | * @return {undefined} |
| 2225 | */ |
| 2226 | const transferBetweenMainAndFutures = function ( |
| 2227 | asset, |
| 2228 | amount, |
| 2229 | type, |
| 2230 | callback |
| 2231 | ) { |
| 2232 | let parameters = Object.assign({ |
| 2233 | asset, |
| 2234 | amount, |
| 2235 | type, |
| 2236 | }); |
| 2237 | if (!callback) { |
| 2238 | return new Promise((resolve, reject) => { |
| 2239 | signedRequest( |
| 2240 | sapi + "v1/futures/transfer", |
| 2241 | parameters, |
| 2242 | function (error, data) { |
| 2243 | if (error) return reject(error); |
| 2244 | return resolve(data); |
| 2245 | }, |
| 2246 | "POST" |
| 2247 | ); |
| 2248 | }); |
| 2249 | } |
| 2250 | signedRequest( |
| 2251 | sapi + "v1/futures/transfer", |
| 2252 | parameters, |
| 2253 | function (error, data) { |
| 2254 | if (callback) return callback(error, data); |
| 2255 | }, |
| 2256 | "POST" |
| 2257 | ); |
| 2258 | }; |
| 2259 | |
| 2260 | /** |
| 2261 | * Converts the previous day stream into friendly object |
Tested by
no test coverage detected