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.3.5 to 0.3.6

2

CHANGELOG.md
* 🎉 Release client package v0.3.5 [9621708](https://github.com/reservoirprotocol/reservoir-kit/commit/9621708517e0b2043515510137f2584931eada51)
* Sync api [6863447](https://github.com/reservoirprotocol/reservoir-kit/commit/6863447142a5f24a046d93432e0c1b4de7d1f138)
* 🎉 Release client package v0.3.4 [a1aa27c](https://github.com/reservoirprotocol/reservoir-kit/commit/a1aa27c0ffbd2b950028e46e383b14d2fe0791c5)

@@ -3,0 +5,0 @@ * Merge pull request #136 from reservoirprotocol/pedro/grwth-1678-acceptbid-modal-price-change-update [0c71239](https://github.com/reservoirprotocol/reservoir-kit/commit/0c712394a59bd2e4113bd1143eae41ef9210b11b)

42

dist/index.js

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

var $134f7602d1733f79$exports = {};
$134f7602d1733f79$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.3.5","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.3.6","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"}}');

@@ -285,10 +285,17 @@

async function $80a2a4e18145ef5d$export$feaa73ad8ed3f2b9(collectionId, tokenId) {
const contract = collectionId ? collectionId === null || collectionId === void 0 ? void 0 : collectionId.split(":")[0] : undefined;
const base = "https://api.opensea.io";
const url = new URL(`/api/v1/asset/${contract}/${tokenId}`, base);
const res = await (0, ($parcel$interopDefault($lPQI4$axios))).get(url.href);
async function $80a2a4e18145ef5d$export$feaa73ad8ed3f2b9(ids) {
let url = "https://api.opensea.io/api/v1/assets";
ids.forEach((id, i)=>{
const [contract, tokenId] = id.split(":");
const prefix = i === 0 ? "?" : "&";
url = `${url}${prefix}token_ids=${tokenId}&asset_contract_addresses=${contract}`;
});
const res = await (0, ($parcel$interopDefault($lPQI4$axios))).get(url);
const json = res.data;
const client = (0, $3ba04d43fdd1e5a5$export$6bb76d6eba7e258c)();
const apiBase = client === null || client === void 0 ? void 0 : client.apiBase;
const statuses1 = json.assets.reduce((statuses, asset)=>{
statuses[`${asset.asset_contract.address}:${asset.token_id}`] = !asset.supports_wyvern;
return statuses;
}, {});
if (res.status === 200 && apiBase) {

@@ -300,13 +307,16 @@ const apiKey = client === null || client === void 0 ? void 0 : client.apiKey;

};
const body = {
token: `${contract}:${tokenId}`,
flag: !(json === null || json === void 0 ? void 0 : json.supports_wyvern) ? 1 : 0
};
if (apiKey) headers["x-api-key"] = apiKey;
if (client === null || client === void 0 ? void 0 : client.uiVersion) headers["x-rkui-version"] = client.uiVersion;
(0, ($parcel$interopDefault($lPQI4$axios))).post(`${apiBase}/tokens/flag/v1`, JSON.stringify(body), {
headers: headers
}).catch(()=>{});
Object.keys(statuses1).forEach((token)=>{
const status = statuses1[token];
const body = {
token: token,
flag: status ? 1 : 0
};
if (apiKey) headers["x-api-key"] = apiKey;
if (client === null || client === void 0 ? void 0 : client.uiVersion) headers["x-rkui-version"] = client.uiVersion;
(0, ($parcel$interopDefault($lPQI4$axios))).post(`${apiBase}/tokens/flag/v1`, JSON.stringify(body), {
headers: headers
}).catch(()=>{});
});
}
return !(json === null || json === void 0 ? void 0 : json.supports_wyvern);
return statuses1;
}

@@ -313,0 +323,0 @@

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

var $d3dd819ecb91ce83$exports = {};
$d3dd819ecb91ce83$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.3.5","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.3.6","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"}}');

@@ -282,10 +282,17 @@

async function $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9(collectionId, tokenId) {
const contract = collectionId ? collectionId === null || collectionId === void 0 ? void 0 : collectionId.split(":")[0] : undefined;
const base = "https://api.opensea.io";
const url = new URL(`/api/v1/asset/${contract}/${tokenId}`, base);
const res = await (0, $9C8uf$axios).get(url.href);
async function $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9(ids) {
let url = "https://api.opensea.io/api/v1/assets";
ids.forEach((id, i)=>{
const [contract, tokenId] = id.split(":");
const prefix = i === 0 ? "?" : "&";
url = `${url}${prefix}token_ids=${tokenId}&asset_contract_addresses=${contract}`;
});
const res = await (0, $9C8uf$axios).get(url);
const json = res.data;
const client = (0, $6496f8ee40d0c4eb$export$6bb76d6eba7e258c)();
const apiBase = client === null || client === void 0 ? void 0 : client.apiBase;
const statuses1 = json.assets.reduce((statuses, asset)=>{
statuses[`${asset.asset_contract.address}:${asset.token_id}`] = !asset.supports_wyvern;
return statuses;
}, {});
if (res.status === 200 && apiBase) {

@@ -297,13 +304,16 @@ const apiKey = client === null || client === void 0 ? void 0 : client.apiKey;

};
const body = {
token: `${contract}:${tokenId}`,
flag: !(json === null || json === void 0 ? void 0 : json.supports_wyvern) ? 1 : 0
};
if (apiKey) headers["x-api-key"] = apiKey;
if (client === null || client === void 0 ? void 0 : client.uiVersion) headers["x-rkui-version"] = client.uiVersion;
(0, $9C8uf$axios).post(`${apiBase}/tokens/flag/v1`, JSON.stringify(body), {
headers: headers
}).catch(()=>{});
Object.keys(statuses1).forEach((token)=>{
const status = statuses1[token];
const body = {
token: token,
flag: status ? 1 : 0
};
if (apiKey) headers["x-api-key"] = apiKey;
if (client === null || client === void 0 ? void 0 : client.uiVersion) headers["x-rkui-version"] = client.uiVersion;
(0, $9C8uf$axios).post(`${apiBase}/tokens/flag/v1`, JSON.stringify(body), {
headers: headers
}).catch(()=>{});
});
}
return !(json === null || json === void 0 ? void 0 : json.supports_wyvern);
return statuses1;
}

@@ -310,0 +320,0 @@

{
"name": "@reservoir0x/reservoir-sdk",
"version": "0.3.5",
"version": "0.3.6",
"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