@riocrypto/common-server 1.0.1579 → 1.0.1581

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.
@@ -8,6 +8,7 @@ declare class BitsoClient {
8
8
  constructor(apiKey: string, apiSecret: string, env: "production" | "sandbox");
9
9
  createClabe(): Promise<string>;
10
10
  createReceivingAccount(user: User, bankAccount: BankAccount, bitsoBankAccountCode: string): Promise<string>;
11
+ deleteReceivingAccount(bitsoReceivingAccountId: string): Promise<string>;
11
12
  createWithdraw(bitsoReceivingAccountId: string, amount: number, concept: string, rfc?: string): Promise<Object>;
12
13
  getWithdrawal(withdrawalId: string): Promise<any>;
13
14
  createLimitOrder(asset: string, amount: number, price: number, side: "buy" | "sell"): Promise<{
@@ -80,6 +80,23 @@ class BitsoClient {
80
80
  return data.payload;
81
81
  });
82
82
  }
83
+ deleteReceivingAccount(bitsoReceivingAccountId) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
86
+ throw new Error("Bitso delete receiving account not allowed in sandbox");
87
+ }
88
+ const requestConfig = {
89
+ method: "DELETE",
90
+ url: `${this.baseUrl}/api/v3/consumer-contacts/${bitsoReceivingAccountId}`,
91
+ };
92
+ const signedRequestConfig = this.signRequest(requestConfig);
93
+ const { data } = yield (0, axios_1.default)(signedRequestConfig);
94
+ if (!data.success) {
95
+ throw new Error("Error deleting Bitso receiving account");
96
+ }
97
+ return data.payload;
98
+ });
99
+ }
83
100
  createWithdraw(bitsoReceivingAccountId, amount, concept, rfc) {
84
101
  return __awaiter(this, void 0, void 0, function* () {
85
102
  if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireAdminAuthIfDefined = void 0;
4
4
  const requireAdminAuthIfDefined = (value, { req, path }) => {
5
- console.log("path", path);
6
- console.log("value", value);
7
- console.log("current value", getValueByPath(req.userToUpdate, path));
8
5
  if (value !== undefined &&
9
6
  value !== "" &&
10
7
  !req.adminAuth &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1579",
3
+ "version": "1.0.1581",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
30
  "@hyperdx/node-opentelemetry": "^0.4.2",
31
- "@riocrypto/common": "^1.0.1407",
31
+ "@riocrypto/common": "^1.0.1408",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.6.0",
34
34
  "ccxt": "^3.0.30",