@zkp2p/sdk 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -47219,7 +47219,7 @@ async function apiPostDepositDetails(req, baseApiUrl, timeoutMs) {
|
|
|
47219
47219
|
timeoutMs
|
|
47220
47220
|
});
|
|
47221
47221
|
}
|
|
47222
|
-
async function apiGetQuote(req, baseApiUrl, timeoutMs) {
|
|
47222
|
+
async function apiGetQuote(req, baseApiUrl, timeoutMs, apiKey) {
|
|
47223
47223
|
if (req.quotesToReturn !== void 0) {
|
|
47224
47224
|
if (!Number.isInteger(req.quotesToReturn) || req.quotesToReturn < 1) {
|
|
47225
47225
|
throw new exports.ValidationError("quotesToReturn must be a positive integer", "quotesToReturn");
|
|
@@ -47254,10 +47254,11 @@ async function apiGetQuote(req, baseApiUrl, timeoutMs) {
|
|
|
47254
47254
|
url,
|
|
47255
47255
|
method: "POST",
|
|
47256
47256
|
body: requestBody,
|
|
47257
|
+
apiKey,
|
|
47257
47258
|
timeoutMs
|
|
47258
47259
|
});
|
|
47259
47260
|
}
|
|
47260
|
-
async function apiGetQuotesBestByPlatform(req, baseApiUrl, timeoutMs) {
|
|
47261
|
+
async function apiGetQuotesBestByPlatform(req, baseApiUrl, timeoutMs, apiKey) {
|
|
47261
47262
|
const isExactFiat = req.isExactFiat !== false;
|
|
47262
47263
|
const endpoint = isExactFiat ? "best-by-platform" : "best-by-platform-exact-token";
|
|
47263
47264
|
const url = `${withApiBase(baseApiUrl)}/v2/quote/${endpoint}`;
|
|
@@ -47275,6 +47276,7 @@ async function apiGetQuotesBestByPlatform(req, baseApiUrl, timeoutMs) {
|
|
|
47275
47276
|
url,
|
|
47276
47277
|
method: "POST",
|
|
47277
47278
|
body: requestBody,
|
|
47279
|
+
apiKey,
|
|
47278
47280
|
timeoutMs
|
|
47279
47281
|
});
|
|
47280
47282
|
}
|
|
@@ -49952,7 +49954,7 @@ var Zkp2pClient = class {
|
|
|
49952
49954
|
reqWithEscrow.escrowAddresses = configuredEscrows;
|
|
49953
49955
|
}
|
|
49954
49956
|
}
|
|
49955
|
-
const quote = await apiGetQuote(reqWithEscrow, baseApiUrl, timeoutMs);
|
|
49957
|
+
const quote = await apiGetQuote(reqWithEscrow, baseApiUrl, timeoutMs, this.apiKey);
|
|
49956
49958
|
const quotes = quote?.responseObject?.quotes ?? [];
|
|
49957
49959
|
for (const q of quotes) {
|
|
49958
49960
|
const maker = q?.maker;
|
|
@@ -49990,7 +49992,12 @@ var Zkp2pClient = class {
|
|
|
49990
49992
|
reqWithEscrow.escrowAddresses = configuredEscrows;
|
|
49991
49993
|
}
|
|
49992
49994
|
}
|
|
49993
|
-
const quote = await apiGetQuotesBestByPlatform(
|
|
49995
|
+
const quote = await apiGetQuotesBestByPlatform(
|
|
49996
|
+
reqWithEscrow,
|
|
49997
|
+
baseApiUrl,
|
|
49998
|
+
timeoutMs,
|
|
49999
|
+
this.apiKey
|
|
50000
|
+
);
|
|
49994
50001
|
const enrichedQuote = quote ? {
|
|
49995
50002
|
...quote,
|
|
49996
50003
|
responseObject: {
|