New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@elevenyellow.com/switchain-api-client

Package Overview
Dependencies
Maintainers
6
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elevenyellow.com/switchain-api-client - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0

2

package.json
{
"name": "@elevenyellow.com/switchain-api-client",
"version": "3.1.1",
"version": "3.2.0",
"description": "client module to access switchains's api",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -30,3 +30,5 @@ // const request = require("request-promise");

}),
getOrderStatus: ({ orderId }) => getOrderStatus({ orderId, apiKey, mode })
getOrderStatus: ({ orderId }) => getOrderStatus({ orderId, apiKey, mode }),
getOrdersInfo: ({ page, limit, sort }) =>
getOrdersInfo({ page, limit, sort, apiKey, mode })
};

@@ -121,4 +123,32 @@ }

module.exports = { init, getMarketInfo, getOffer, postOrder, getOrderStatus };
async function getOrdersInfo({ limit, page, sort, apiKey, mode }) {
const apiUrl = getApiUrl({ mode });
const params = {};
if (limit) params.limit = limit;
if (page) params.page = page;
if (sort) params.sort = sort;
const uri = buildUrl({ url: `${apiUrl}ordersinfo/`, params });
try {
const response = await fetch(uri, {
headers: { Authorization: `Bearer ${apiKey}` }
});
return response.json();
} catch (error) {
console.log(`switchainApiClient.getOrdersInfo.error: ${error}`);
throw error;
}
}
module.exports = {
init,
getMarketInfo,
getOffer,
postOrder,
getOrderStatus,
getOrdersInfo
};
// private

@@ -125,0 +155,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc