MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / makeQueryString

Method makeQueryString

src/node-binance-api.ts:644–659  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

642 // XXX: This one works with array (e.g. for dust.transfer)
643 // XXX: I _guess_ we could use replace this function with the `qs` module
644 makeQueryString(q) {
645
646 const res = Object.keys(q)
647 .reduce((a, k) => {
648 if (Array.isArray(q[k])) {
649 q[k].forEach(v => {
650 a.push(k + "=" + encodeURIComponent(v));
651 });
652 } else if (q[k] !== undefined) {
653 a.push(k + "=" + encodeURIComponent(q[k]));
654 }
655 return a;
656 }, [])
657 .join("&");
658 return res;
659 }
660
661 /**
662 * Create a http request to the public API

Callers 3

publicRequestMethod · 0.95
futuresRequestMethod · 0.95
signedRequestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected