@usherlabs/cex-broker 0.1.5 → 0.1.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/commands/cli.js +12 -6
- package/dist/index.js +14 -6
- package/dist/index.js.map +730 -0
- package/package.json +5 -5
package/dist/commands/cli.js
CHANGED
|
@@ -73465,6 +73465,7 @@ class Exchange {
|
|
|
73465
73465
|
this.countries = undefined;
|
|
73466
73466
|
this.userAgent = undefined;
|
|
73467
73467
|
this.user_agent = undefined;
|
|
73468
|
+
this.redact_exclusion = "api-key";
|
|
73468
73469
|
this.userAgents = {
|
|
73469
73470
|
chrome: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
|
|
73470
73471
|
chrome39: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
|
|
@@ -73479,6 +73480,7 @@ class Exchange {
|
|
|
73479
73480
|
this.httpsAgent = undefined;
|
|
73480
73481
|
this.useVerity = false;
|
|
73481
73482
|
this.verityProverUrl = "http://localhost:8080";
|
|
73483
|
+
this.verityMethods = ["fetchBalance", "fetchDepositAddress", "fetchDepositAddress", "fetchDepositAddresses", "fetchDepositAddressesByNetwork", "fetchDeposits", "withdraw", "fetchFundingHistory", "fetchWithdrawals", "fetchWithdrawal"];
|
|
73482
73484
|
this.minFundingAddressLength = 1;
|
|
73483
73485
|
this.substituteCommonCurrencyCodes = true;
|
|
73484
73486
|
this.quoteJsonNumbers = true;
|
|
@@ -73973,9 +73975,9 @@ RequestBody:
|
|
|
73973
73975
|
this.log("MethodCalled:", methodCalled + `
|
|
73974
73976
|
`);
|
|
73975
73977
|
}
|
|
73976
|
-
if (this.useVerity && ["get", "post"].includes(method.toLowerCase()) &&
|
|
73978
|
+
if (this.useVerity && ["get", "post"].includes(method.toLowerCase()) && this.verityMethods.includes(methodCalled)) {
|
|
73977
73979
|
const client = new import_verity_client.default.VerityClient({ prover_url: this.verityProverUrl });
|
|
73978
|
-
const lowercase = Object.keys(axiosConfig.headers).map((h) => `req:header:${h.toLowerCase()}`).join(",");
|
|
73980
|
+
const lowercase = Object.keys(axiosConfig.headers).filter((header) => !header.toLowerCase().includes(this.redact_exclusion.toLowerCase())).map((h) => `req:header:${h.toLowerCase()}`).join(",");
|
|
73979
73981
|
const response = await client.get(axiosConfig.url, axiosConfig).redact(lowercase);
|
|
73980
73982
|
if (this.verbose) {
|
|
73981
73983
|
this.log("verityProof:", response.proof, `
|
|
@@ -290142,7 +290144,7 @@ function validateOrder(policy, fromToken, toToken, amount, broker) {
|
|
|
290142
290144
|
var grpc = __toESM(require_src3(), 1);
|
|
290143
290145
|
var protoLoader = __toESM(require_src2(), 1);
|
|
290144
290146
|
|
|
290145
|
-
// proto/cex_broker/Action.ts
|
|
290147
|
+
// src/proto/cex_broker/Action.ts
|
|
290146
290148
|
var Action = {
|
|
290147
290149
|
NoAction: 0,
|
|
290148
290150
|
Deposit: 1,
|
|
@@ -290154,7 +290156,7 @@ var Action = {
|
|
|
290154
290156
|
FetchDepositAddresses: 7
|
|
290155
290157
|
};
|
|
290156
290158
|
|
|
290157
|
-
// proto/cex_broker/SubscriptionType.ts
|
|
290159
|
+
// src/proto/cex_broker/SubscriptionType.ts
|
|
290158
290160
|
var SubscriptionType = {
|
|
290159
290161
|
ORDERBOOK: 0,
|
|
290160
290162
|
TRADES: 1,
|
|
@@ -290166,8 +290168,12 @@ var SubscriptionType = {
|
|
|
290166
290168
|
|
|
290167
290169
|
// src/server.ts
|
|
290168
290170
|
var import_joi2 = __toESM(require_lib4(), 1);
|
|
290169
|
-
|
|
290170
|
-
|
|
290171
|
+
import path from "path";
|
|
290172
|
+
import { fileURLToPath } from "url";
|
|
290173
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
290174
|
+
var __dirname2 = path.dirname(__filename2);
|
|
290175
|
+
var protoPath = path.join(__dirname2, ".", "proto", "node.proto");
|
|
290176
|
+
var packageDef = protoLoader.loadSync(protoPath);
|
|
290171
290177
|
var grpcObj = grpc.loadPackageDefinition(packageDef);
|
|
290172
290178
|
var cexNode = grpcObj.cex_broker;
|
|
290173
290179
|
function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
|
package/dist/index.js
CHANGED
|
@@ -68512,6 +68512,7 @@ class Exchange {
|
|
|
68512
68512
|
this.countries = undefined;
|
|
68513
68513
|
this.userAgent = undefined;
|
|
68514
68514
|
this.user_agent = undefined;
|
|
68515
|
+
this.redact_exclusion = "api-key";
|
|
68515
68516
|
this.userAgents = {
|
|
68516
68517
|
chrome: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
|
|
68517
68518
|
chrome39: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
|
|
@@ -68526,6 +68527,7 @@ class Exchange {
|
|
|
68526
68527
|
this.httpsAgent = undefined;
|
|
68527
68528
|
this.useVerity = false;
|
|
68528
68529
|
this.verityProverUrl = "http://localhost:8080";
|
|
68530
|
+
this.verityMethods = ["fetchBalance", "fetchDepositAddress", "fetchDepositAddress", "fetchDepositAddresses", "fetchDepositAddressesByNetwork", "fetchDeposits", "withdraw", "fetchFundingHistory", "fetchWithdrawals", "fetchWithdrawal"];
|
|
68529
68531
|
this.minFundingAddressLength = 1;
|
|
68530
68532
|
this.substituteCommonCurrencyCodes = true;
|
|
68531
68533
|
this.quoteJsonNumbers = true;
|
|
@@ -69020,9 +69022,9 @@ RequestBody:
|
|
|
69020
69022
|
this.log("MethodCalled:", methodCalled + `
|
|
69021
69023
|
`);
|
|
69022
69024
|
}
|
|
69023
|
-
if (this.useVerity && ["get", "post"].includes(method.toLowerCase()) &&
|
|
69025
|
+
if (this.useVerity && ["get", "post"].includes(method.toLowerCase()) && this.verityMethods.includes(methodCalled)) {
|
|
69024
69026
|
const client = new import_verity_client.default.VerityClient({ prover_url: this.verityProverUrl });
|
|
69025
|
-
const lowercase = Object.keys(axiosConfig.headers).map((h) => `req:header:${h.toLowerCase()}`).join(",");
|
|
69027
|
+
const lowercase = Object.keys(axiosConfig.headers).filter((header) => !header.toLowerCase().includes(this.redact_exclusion.toLowerCase())).map((h) => `req:header:${h.toLowerCase()}`).join(",");
|
|
69026
69028
|
const response = await client.get(axiosConfig.url, axiosConfig).redact(lowercase);
|
|
69027
69029
|
if (this.verbose) {
|
|
69028
69030
|
this.log("verityProof:", response.proof, `
|
|
@@ -285189,7 +285191,7 @@ function validateOrder(policy, fromToken, toToken, amount, broker) {
|
|
|
285189
285191
|
var grpc = __toESM(require_src3(), 1);
|
|
285190
285192
|
var protoLoader = __toESM(require_src2(), 1);
|
|
285191
285193
|
|
|
285192
|
-
// proto/cex_broker/Action.ts
|
|
285194
|
+
// src/proto/cex_broker/Action.ts
|
|
285193
285195
|
var Action = {
|
|
285194
285196
|
NoAction: 0,
|
|
285195
285197
|
Deposit: 1,
|
|
@@ -285201,7 +285203,7 @@ var Action = {
|
|
|
285201
285203
|
FetchDepositAddresses: 7
|
|
285202
285204
|
};
|
|
285203
285205
|
|
|
285204
|
-
// proto/cex_broker/SubscriptionType.ts
|
|
285206
|
+
// src/proto/cex_broker/SubscriptionType.ts
|
|
285205
285207
|
var SubscriptionType = {
|
|
285206
285208
|
ORDERBOOK: 0,
|
|
285207
285209
|
TRADES: 1,
|
|
@@ -285213,8 +285215,12 @@ var SubscriptionType = {
|
|
|
285213
285215
|
|
|
285214
285216
|
// src/server.ts
|
|
285215
285217
|
var import_joi2 = __toESM(require_lib4(), 1);
|
|
285216
|
-
|
|
285217
|
-
|
|
285218
|
+
import path from "path";
|
|
285219
|
+
import { fileURLToPath } from "url";
|
|
285220
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
285221
|
+
var __dirname2 = path.dirname(__filename2);
|
|
285222
|
+
var protoPath = path.join(__dirname2, ".", "proto", "node.proto");
|
|
285223
|
+
var packageDef = protoLoader.loadSync(protoPath);
|
|
285218
285224
|
var grpcObj = grpc.loadPackageDefinition(packageDef);
|
|
285219
285225
|
var cexNode = grpcObj.cex_broker;
|
|
285220
285226
|
function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
|
|
@@ -286075,3 +286081,5 @@ class CEXBroker {
|
|
|
286075
286081
|
export {
|
|
286076
286082
|
CEXBroker as default
|
|
286077
286083
|
};
|
|
286084
|
+
|
|
286085
|
+
//# debugId=18C1DCDB521AE71364756E2164756E21
|