@reservoir0x/reservoir-sdk
Advanced tools
Comparing version 0.2.6 to 0.3.0
@@ -39,2 +39,3 @@ var $lPQI4$etherslibutils = require("ethers/lib/utils"); | ||
$parcel$export($86e1aed4c9e0543e$exports, "isOpenSeaBanned", () => $80a2a4e18145ef5d$export$feaa73ad8ed3f2b9); | ||
$parcel$export($86e1aed4c9e0543e$exports, "request", () => $b3114c59012a233a$export$b5fe3f66a567bec0); | ||
@@ -86,3 +87,3 @@ | ||
var $134f7602d1733f79$exports = {}; | ||
$134f7602d1733f79$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.2.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":"npx openapi-typescript https://api.reservoir.tools/swagger.json --output ./src/types/api.ts","changelog":"node ../../scripts/generate-changelog.js package=client"},"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.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","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=client"},"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,3 +286,4 @@ | ||
async function $80a2a4e18145ef5d$export$feaa73ad8ed3f2b9(contract, tokenId) { | ||
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"; | ||
@@ -315,2 +317,19 @@ const url = new URL(`/api/v1/asset/${contract}/${tokenId}`, base); | ||
function $b3114c59012a233a$export$b5fe3f66a567bec0(config = {}) { | ||
const client = (0, $3ba04d43fdd1e5a5$export$6bb76d6eba7e258c)(); | ||
const headers = { | ||
"Content-Type": "application/json", | ||
"x-rkc-version": (0, $134f7602d1733f79$exports.version) | ||
}; | ||
if (client === null || client === void 0 ? void 0 : client.apiKey) headers["x-api-key"] = client.apiKey; | ||
return (0, ($parcel$interopDefault($lPQI4$axios))).request({ | ||
headers: headers, | ||
...config | ||
}); | ||
} | ||
async function $6aa510e6f7e872cf$export$ed27da83bcbea2e5(data) { | ||
@@ -338,2 +357,10 @@ const { token: token , expectedPrice: expectedPrice , signer: signer , onProgress: onProgress } = data; | ||
console.error(err); | ||
const data = { | ||
token: `${token.contract}:${token.tokenId}` | ||
}; | ||
(0, $b3114c59012a233a$export$b5fe3f66a567bec0)({ | ||
method: "POST", | ||
url: `${client.apiBase}/tokens/simulate-top-bid/v1`, | ||
data: JSON.stringify(data) | ||
}); | ||
throw err; | ||
@@ -346,4 +373,2 @@ } | ||
async function $2900a3fccc680cdb$export$5e1997c166a16792(data1) { | ||
@@ -380,19 +405,13 @@ const { tokens: tokens , orderIds: orderIds , rawOrders: rawOrders , expectedPrice: expectedPrice , signer: signer , onProgress: onProgress } = data1; | ||
} catch (err) { | ||
if (tokens) { | ||
const headers = { | ||
"Content-Type": "application/json", | ||
"x-rkc-version": (0, $134f7602d1733f79$exports.version) | ||
if (tokens) tokens.forEach((token)=>{ | ||
const data = { | ||
router: "v6", | ||
token: `${token.contract}:${token.tokenId}` | ||
}; | ||
if (client === null || client === void 0 ? void 0 : client.apiKey) headers["x-api-key"] = client.apiKey; | ||
tokens.forEach((token)=>{ | ||
const data = { | ||
router: "v6", | ||
token: `${token.contract}:${token.tokenId}` | ||
}; | ||
(0, ($parcel$interopDefault($lPQI4$axios))).post(`${client.apiBase}/tokens/simulate-floor/v1`, JSON.stringify(data), { | ||
method: "POST", | ||
headers: headers | ||
}); | ||
(0, $b3114c59012a233a$export$b5fe3f66a567bec0)({ | ||
method: "POST", | ||
url: `${client.apiBase}/tokens/simulate-floor/v1`, | ||
data: JSON.stringify(data) | ||
}); | ||
} | ||
}); | ||
throw err; | ||
@@ -442,3 +461,3 @@ } | ||
listings.forEach((listing)=>{ | ||
if (listing.orderbook === "reservoir" && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in listing)) listing.fees = [ | ||
if ((!listing.orderbook || listing.orderbook === "reservoir") && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in listing)) listing.fees = [ | ||
`${client.marketplaceFeeRecipient}:${client.marketplaceFee}`, | ||
@@ -490,3 +509,3 @@ ]; | ||
}; | ||
if (bid.orderbook === "reservoir" && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in bid)) bid.fees = [ | ||
if ((!bid.orderbook || bid.orderbook === "reservoir") && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in bid)) bid.fees = [ | ||
`${client.marketplaceFeeRecipient}:${client.marketplaceFee}`, | ||
@@ -493,0 +512,0 @@ ]; |
@@ -36,2 +36,3 @@ import {arrayify as $9C8uf$arrayify} from "ethers/lib/utils"; | ||
$parcel$export($7de07f425a625121$exports, "isOpenSeaBanned", () => $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9); | ||
$parcel$export($7de07f425a625121$exports, "request", () => $ce40c15ff138f6b7$export$b5fe3f66a567bec0); | ||
@@ -83,3 +84,3 @@ | ||
var $d3dd819ecb91ce83$exports = {}; | ||
$d3dd819ecb91ce83$exports = JSON.parse('{"name":"@reservoir0x/reservoir-sdk","version":"0.2.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":"npx openapi-typescript https://api.reservoir.tools/swagger.json --output ./src/types/api.ts","changelog":"node ../../scripts/generate-changelog.js package=client"},"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.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","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=client"},"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,3 +283,4 @@ | ||
async function $9c301d2c7b66eaf9$export$feaa73ad8ed3f2b9(contract, tokenId) { | ||
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"; | ||
@@ -312,2 +314,19 @@ const url = new URL(`/api/v1/asset/${contract}/${tokenId}`, base); | ||
function $ce40c15ff138f6b7$export$b5fe3f66a567bec0(config = {}) { | ||
const client = (0, $6496f8ee40d0c4eb$export$6bb76d6eba7e258c)(); | ||
const headers = { | ||
"Content-Type": "application/json", | ||
"x-rkc-version": (0, $d3dd819ecb91ce83$exports.version) | ||
}; | ||
if (client === null || client === void 0 ? void 0 : client.apiKey) headers["x-api-key"] = client.apiKey; | ||
return (0, $9C8uf$axios).request({ | ||
headers: headers, | ||
...config | ||
}); | ||
} | ||
async function $824b3a5b2fb74e30$export$ed27da83bcbea2e5(data) { | ||
@@ -335,2 +354,10 @@ const { token: token , expectedPrice: expectedPrice , signer: signer , onProgress: onProgress } = data; | ||
console.error(err); | ||
const data = { | ||
token: `${token.contract}:${token.tokenId}` | ||
}; | ||
(0, $ce40c15ff138f6b7$export$b5fe3f66a567bec0)({ | ||
method: "POST", | ||
url: `${client.apiBase}/tokens/simulate-top-bid/v1`, | ||
data: JSON.stringify(data) | ||
}); | ||
throw err; | ||
@@ -343,4 +370,2 @@ } | ||
async function $c65638fb1735b828$export$5e1997c166a16792(data1) { | ||
@@ -377,19 +402,13 @@ const { tokens: tokens , orderIds: orderIds , rawOrders: rawOrders , expectedPrice: expectedPrice , signer: signer , onProgress: onProgress } = data1; | ||
} catch (err) { | ||
if (tokens) { | ||
const headers = { | ||
"Content-Type": "application/json", | ||
"x-rkc-version": (0, $d3dd819ecb91ce83$exports.version) | ||
if (tokens) tokens.forEach((token)=>{ | ||
const data = { | ||
router: "v6", | ||
token: `${token.contract}:${token.tokenId}` | ||
}; | ||
if (client === null || client === void 0 ? void 0 : client.apiKey) headers["x-api-key"] = client.apiKey; | ||
tokens.forEach((token)=>{ | ||
const data = { | ||
router: "v6", | ||
token: `${token.contract}:${token.tokenId}` | ||
}; | ||
(0, $9C8uf$axios).post(`${client.apiBase}/tokens/simulate-floor/v1`, JSON.stringify(data), { | ||
method: "POST", | ||
headers: headers | ||
}); | ||
(0, $ce40c15ff138f6b7$export$b5fe3f66a567bec0)({ | ||
method: "POST", | ||
url: `${client.apiBase}/tokens/simulate-floor/v1`, | ||
data: JSON.stringify(data) | ||
}); | ||
} | ||
}); | ||
throw err; | ||
@@ -439,3 +458,3 @@ } | ||
listings.forEach((listing)=>{ | ||
if (listing.orderbook === "reservoir" && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in listing)) listing.fees = [ | ||
if ((!listing.orderbook || listing.orderbook === "reservoir") && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in listing)) listing.fees = [ | ||
`${client.marketplaceFeeRecipient}:${client.marketplaceFee}`, | ||
@@ -487,3 +506,3 @@ ]; | ||
}; | ||
if (bid.orderbook === "reservoir" && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in bid)) bid.fees = [ | ||
if ((!bid.orderbook || bid.orderbook === "reservoir") && client.marketplaceFee && client.marketplaceFeeRecipient && !("fees" in bid)) bid.fees = [ | ||
`${client.marketplaceFeeRecipient}:${client.marketplaceFee}`, | ||
@@ -575,3 +594,3 @@ ]; | ||
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}; | ||
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}; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@reservoir0x/reservoir-sdk", | ||
"version": "0.2.6", | ||
"version": "0.3.0", | ||
"description": "An SDK that can be used in any javascript/typescript context to easily interact with Reservoir liquidity APIs", | ||
@@ -19,3 +19,3 @@ "source": "src/index.ts", | ||
"version:update": "yarn version ${0}; PACKAGE_VERSION=$(yarn version:package); git add -A; git commit -m \"🎉 Release client package v$PACKAGE_VERSION\"; git push", | ||
"syncApi": "npx openapi-typescript https://api.reservoir.tools/swagger.json --output ./src/types/api.ts", | ||
"syncApi": "node ./sync-api.mjs", | ||
"changelog": "node ../../scripts/generate-changelog.js package=client" | ||
@@ -22,0 +22,0 @@ }, |
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
670762
9222