Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reservoir0x/reservoir-sdk

Package Overview
Dependencies
Maintainers
8
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reservoir0x/reservoir-sdk - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

17

dist/index.js

@@ -90,3 +90,3 @@ var $lPQI4$etherslibutils = require("ethers/lib/utils");

var $134f7602d1733f79$exports = {};
$134f7602d1733f79$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.6.3","description":"An SDK that can be used in any javascript/typescript context to easily interact with Reservoir liquidity APIs","source":"src/index.ts","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","author":"Reservoir Protocol","license":"MIT","files":["dist"],"scripts":{"clean":"rm -rf dist","version":"yarn version","version:package":"sh ../../scripts/package-version.sh","version:update":"yarn version ${0}; PACKAGE_VERSION=$(yarn version:package); git add -A; git commit -m \\"\uD83C\uDF89 Release client package v$PACKAGE_VERSION\\"; git push","syncApi":"node ./sync-api.mjs","changelog":"node ../../scripts/generate-changelog.js package=sdk"},"repository":{"type":"git","url":"https://github.com/reservoirprotocol/reservoir-kit"},"sideEffects":false,"keywords":["nft","reservoir","reservoir-sdk","reservoirkit","protocol","sdk"],"peerDependencies":{"ethers":"^5.6.1"},"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"openapi-typescript":"^5.4.1"}}');
$134f7602d1733f79$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.6.4","description":"An SDK that can be used in any javascript/typescript context to easily interact with Reservoir liquidity APIs","source":"src/index.ts","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","author":"Reservoir Protocol","license":"MIT","files":["dist"],"scripts":{"clean":"rm -rf dist","version":"yarn version","version:package":"sh ../../scripts/package-version.sh","version:update":"yarn version ${0}; PACKAGE_VERSION=$(yarn version:package); git add -A; git commit -m \\"\uD83C\uDF89 Release client package v$PACKAGE_VERSION\\"; git push","syncApi":"node ./sync-api.mjs","changelog":"node ../../scripts/generate-changelog.js package=sdk"},"repository":{"type":"git","url":"https://github.com/reservoirprotocol/reservoir-kit"},"sideEffects":false,"keywords":["nft","reservoir","reservoir-sdk","reservoirkit","protocol","sdk"],"peerDependencies":{"ethers":"^5.6.1"},"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"openapi-typescript":"^5.4.1"}}');

@@ -116,5 +116,6 @@

// than expected when buying and selling for less than expected
if (json1.path && expectedPrice) {
const quote = json1.path.reduce((total, path)=>{
total += path.quote || 0;
const path = json1.path;
if (path && expectedPrice) {
const quote1 = path.reduce((total, { quote: quote , buyInQuote: buyInQuote })=>{
total += buyInQuote || quote || 0;
return total;

@@ -124,10 +125,10 @@ }, 0);

let error = null;
if (isSell && Number((quote - expectedPrice).toFixed(6)) < -0.00001) error = {
if (isSell && Number((quote1 - expectedPrice).toFixed(6)) < -0.00001) error = {
type: "price mismatch",
message: `Attention: the offer price of this token is now ${quote}`
message: `Attention: the offer price of this token is now ${quote1}`
};
// Check if the user is buying
if (isBuy && Number((quote - expectedPrice).toFixed(6)) > 0.00001) error = {
if (isBuy && Number((quote1 - expectedPrice).toFixed(6)) > 0.00001) error = {
type: "price mismatch",
message: `Attention: the price of this token is now ${quote}`
message: `Attention: the price of this token is now ${quote1}`
};

@@ -134,0 +135,0 @@ if (error) {

@@ -87,3 +87,3 @@ import {arrayify as $9C8uf$arrayify} from "ethers/lib/utils";

var $d3dd819ecb91ce83$exports = {};
$d3dd819ecb91ce83$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.6.3","description":"An SDK that can be used in any javascript/typescript context to easily interact with Reservoir liquidity APIs","source":"src/index.ts","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","author":"Reservoir Protocol","license":"MIT","files":["dist"],"scripts":{"clean":"rm -rf dist","version":"yarn version","version:package":"sh ../../scripts/package-version.sh","version:update":"yarn version ${0}; PACKAGE_VERSION=$(yarn version:package); git add -A; git commit -m \\"\uD83C\uDF89 Release client package v$PACKAGE_VERSION\\"; git push","syncApi":"node ./sync-api.mjs","changelog":"node ../../scripts/generate-changelog.js package=sdk"},"repository":{"type":"git","url":"https://github.com/reservoirprotocol/reservoir-kit"},"sideEffects":false,"keywords":["nft","reservoir","reservoir-sdk","reservoirkit","protocol","sdk"],"peerDependencies":{"ethers":"^5.6.1"},"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"openapi-typescript":"^5.4.1"}}');
$d3dd819ecb91ce83$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.6.4","description":"An SDK that can be used in any javascript/typescript context to easily interact with Reservoir liquidity APIs","source":"src/index.ts","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","author":"Reservoir Protocol","license":"MIT","files":["dist"],"scripts":{"clean":"rm -rf dist","version":"yarn version","version:package":"sh ../../scripts/package-version.sh","version:update":"yarn version ${0}; PACKAGE_VERSION=$(yarn version:package); git add -A; git commit -m \\"\uD83C\uDF89 Release client package v$PACKAGE_VERSION\\"; git push","syncApi":"node ./sync-api.mjs","changelog":"node ../../scripts/generate-changelog.js package=sdk"},"repository":{"type":"git","url":"https://github.com/reservoirprotocol/reservoir-kit"},"sideEffects":false,"keywords":["nft","reservoir","reservoir-sdk","reservoirkit","protocol","sdk"],"peerDependencies":{"ethers":"^5.6.1"},"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"openapi-typescript":"^5.4.1"}}');

@@ -113,5 +113,6 @@

// than expected when buying and selling for less than expected
if (json1.path && expectedPrice) {
const quote = json1.path.reduce((total, path)=>{
total += path.quote || 0;
const path = json1.path;
if (path && expectedPrice) {
const quote1 = path.reduce((total, { quote: quote , buyInQuote: buyInQuote })=>{
total += buyInQuote || quote || 0;
return total;

@@ -121,10 +122,10 @@ }, 0);

let error = null;
if (isSell && Number((quote - expectedPrice).toFixed(6)) < -0.00001) error = {
if (isSell && Number((quote1 - expectedPrice).toFixed(6)) < -0.00001) error = {
type: "price mismatch",
message: `Attention: the offer price of this token is now ${quote}`
message: `Attention: the offer price of this token is now ${quote1}`
};
// Check if the user is buying
if (isBuy && Number((quote - expectedPrice).toFixed(6)) > 0.00001) error = {
if (isBuy && Number((quote1 - expectedPrice).toFixed(6)) > 0.00001) error = {
type: "price mismatch",
message: `Attention: the price of this token is now ${quote}`
message: `Attention: the price of this token is now ${quote1}`
};

@@ -131,0 +132,0 @@ if (error) {

{
"name": "@reservoir0x/reservoir-sdk",
"version": "0.6.3",
"version": "0.6.4",
"description": "An SDK that can be used in any javascript/typescript context to easily interact with Reservoir liquidity APIs",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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