@reservoir0x/reservoir-sdk
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -111,3 +111,3 @@ var $lPQI4$axios = require("axios"); | ||
var $134f7602d1733f79$exports = {}; | ||
$134f7602d1733f79$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"1.0.2","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","test":"jest","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 tag v${PACKAGE_VERSION}-SDK; git push --tags;","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"],"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"@types/jest":"^29.5.2","jest":"^29.5.0","openapi-typescript":"^5.4.1","ts-jest":"^29.1.0"},"peerDependencies":{"viem":"~0.3.18"}}'); | ||
$134f7602d1733f79$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"1.1.0","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","test":"jest","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 tag v${PACKAGE_VERSION}-SDK; git push --tags;","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"],"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"@types/jest":"^29.5.2","jest":"^29.5.0","openapi-typescript":"^5.4.1","ts-jest":"^29.1.0"},"peerDependencies":{"viem":"~0.3.18"}}'); | ||
@@ -814,3 +814,2 @@ | ||
$parcel$export($86e1aed4c9e0543e$exports, "pollUntilHasData", () => $8f16fb6674bc87a2$export$f014594cc879f602); | ||
$parcel$export($86e1aed4c9e0543e$exports, "isOpenSeaBanned", () => $80a2a4e18145ef5d$export$feaa73ad8ed3f2b9); | ||
$parcel$export($86e1aed4c9e0543e$exports, "request", () => $b3114c59012a233a$export$b5fe3f66a567bec0); | ||
@@ -826,39 +825,2 @@ $parcel$export($86e1aed4c9e0543e$exports, "log", () => $b747246cb5dd2c78$export$bef1f36f5486a6a3); | ||
async function $80a2a4e18145ef5d$export$feaa73ad8ed3f2b9(ids, chainId) { | ||
const client = (0, $3ba04d43fdd1e5a5$export$6bb76d6eba7e258c)(); | ||
const currentReservoirChain = client?.currentChain(); | ||
const baseApiUrl = currentReservoirChain?.baseApiUrl; | ||
let url = (chainId || client?.currentChain()?.id) === 5 ? "https://testnets-api.opensea.io/api/v1/assets" : "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, $af1a36115b20e29b$export$4432d0b5215ac33e).get(url); | ||
const json = res.data; | ||
const statuses = json.assets.reduce((statuses, asset)=>{ | ||
statuses[`${asset.asset_contract.address}:${asset.token_id}`] = !asset.supports_wyvern; | ||
return statuses; | ||
}, {}); | ||
if (res.status === 200 && baseApiUrl) { | ||
const apiKey = currentReservoirChain.apiKey; | ||
const headers = { | ||
"Content-Type": "application/json", | ||
"x-rkc-version": (0, $134f7602d1733f79$exports.version) | ||
}; | ||
Object.keys(statuses).forEach((token)=>{ | ||
const status = statuses[token]; | ||
const body = { | ||
token: token, | ||
flag: status ? 1 : 0 | ||
}; | ||
if (apiKey) headers["x-api-key"] = apiKey; | ||
if (client?.uiVersion) headers["x-rkui-version"] = client.uiVersion; | ||
(0, $af1a36115b20e29b$export$4432d0b5215ac33e).post(`${baseApiUrl}/tokens/flag/v1`, JSON.stringify(body), { | ||
headers: headers | ||
}).catch(()=>{}); | ||
}); | ||
} | ||
return statuses; | ||
} | ||
@@ -868,7 +830,2 @@ | ||
let $3ba04d43fdd1e5a5$var$_client; | ||
@@ -875,0 +832,0 @@ let $3ba04d43fdd1e5a5$var$_eventListeners = []; |
@@ -108,3 +108,3 @@ import $9C8uf$axios from "axios"; | ||
var $d3dd819ecb91ce83$exports = {}; | ||
$d3dd819ecb91ce83$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"1.0.2","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","test":"jest","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 tag v${PACKAGE_VERSION}-SDK; git push --tags;","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"],"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"@types/jest":"^29.5.2","jest":"^29.5.0","openapi-typescript":"^5.4.1","ts-jest":"^29.1.0"},"peerDependencies":{"viem":"~0.3.18"}}'); | ||
$d3dd819ecb91ce83$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"1.1.0","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","test":"jest","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 tag v${PACKAGE_VERSION}-SDK; git push --tags;","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"],"dependencies":{"axios":"^0.27.2"},"publishConfig":{"access":"public"},"devDependencies":{"@types/jest":"^29.5.2","jest":"^29.5.0","openapi-typescript":"^5.4.1","ts-jest":"^29.1.0"},"peerDependencies":{"viem":"~0.3.18"}}'); | ||
@@ -811,3 +811,2 @@ | ||
$parcel$export($7de07f425a625121$exports, "pollUntilHasData", () => $8b98f6fc3beebe05$export$f014594cc879f602); | ||
$parcel$export($7de07f425a625121$exports, "isOpenSeaBanned", () => $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9); | ||
$parcel$export($7de07f425a625121$exports, "request", () => $ce40c15ff138f6b7$export$b5fe3f66a567bec0); | ||
@@ -823,39 +822,2 @@ $parcel$export($7de07f425a625121$exports, "log", () => $e1b436840b45b1d8$export$bef1f36f5486a6a3); | ||
async function $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9(ids, chainId) { | ||
const client = (0, $6496f8ee40d0c4eb$export$6bb76d6eba7e258c)(); | ||
const currentReservoirChain = client?.currentChain(); | ||
const baseApiUrl = currentReservoirChain?.baseApiUrl; | ||
let url = (chainId || client?.currentChain()?.id) === 5 ? "https://testnets-api.opensea.io/api/v1/assets" : "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, $fdcbfa195c0a28a6$export$4432d0b5215ac33e).get(url); | ||
const json = res.data; | ||
const statuses = json.assets.reduce((statuses, asset)=>{ | ||
statuses[`${asset.asset_contract.address}:${asset.token_id}`] = !asset.supports_wyvern; | ||
return statuses; | ||
}, {}); | ||
if (res.status === 200 && baseApiUrl) { | ||
const apiKey = currentReservoirChain.apiKey; | ||
const headers = { | ||
"Content-Type": "application/json", | ||
"x-rkc-version": (0, $d3dd819ecb91ce83$exports.version) | ||
}; | ||
Object.keys(statuses).forEach((token)=>{ | ||
const status = statuses[token]; | ||
const body = { | ||
token: token, | ||
flag: status ? 1 : 0 | ||
}; | ||
if (apiKey) headers["x-api-key"] = apiKey; | ||
if (client?.uiVersion) headers["x-rkui-version"] = client.uiVersion; | ||
(0, $fdcbfa195c0a28a6$export$4432d0b5215ac33e).post(`${baseApiUrl}/tokens/flag/v1`, JSON.stringify(body), { | ||
headers: headers | ||
}).catch(()=>{}); | ||
}); | ||
} | ||
return statuses; | ||
} | ||
@@ -865,7 +827,2 @@ | ||
let $6496f8ee40d0c4eb$var$_client; | ||
@@ -964,3 +921,3 @@ let $6496f8ee40d0c4eb$var$_eventListeners = []; | ||
export {$6496f8ee40d0c4eb$export$d0c36b5db6a81704 as ReservoirClient, $6496f8ee40d0c4eb$export$6bb76d6eba7e258c as getClient, $6496f8ee40d0c4eb$export$5d730b7aed1a3eb0 as createClient, $13b5a8bc45044506$export$21ece85d7636deb as executeSteps, $3d06f0c5a9f29ddf$export$dc1827290674c112 as setParams, $8b98f6fc3beebe05$export$d2c70568ef790b87 as pollUntilOk, $8b98f6fc3beebe05$export$f014594cc879f602 as pollUntilHasData, $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9 as isOpenSeaBanned, $ce40c15ff138f6b7$export$b5fe3f66a567bec0 as request, $e1b436840b45b1d8$export$bef1f36f5486a6a3 as log, $e1b436840b45b1d8$export$243e62d78d3b544d as LogLevel, $fdcbfa195c0a28a6$export$4432d0b5215ac33e as axios}; | ||
export {$6496f8ee40d0c4eb$export$d0c36b5db6a81704 as ReservoirClient, $6496f8ee40d0c4eb$export$6bb76d6eba7e258c as getClient, $6496f8ee40d0c4eb$export$5d730b7aed1a3eb0 as createClient, $13b5a8bc45044506$export$21ece85d7636deb as executeSteps, $3d06f0c5a9f29ddf$export$dc1827290674c112 as setParams, $8b98f6fc3beebe05$export$d2c70568ef790b87 as pollUntilOk, $8b98f6fc3beebe05$export$f014594cc879f602 as pollUntilHasData, $ce40c15ff138f6b7$export$b5fe3f66a567bec0 as request, $e1b436840b45b1d8$export$bef1f36f5486a6a3 as log, $e1b436840b45b1d8$export$243e62d78d3b544d as LogLevel, $fdcbfa195c0a28a6$export$4432d0b5215ac33e as axios}; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@reservoir0x/reservoir-sdk", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1755445
13093