@riocrypto/common-server 1.0.2189 → 1.0.2191
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OrderDoc } from "../models/order";
|
|
2
|
-
export declare const generateIdempotencyKeyFromOrder: (order: OrderDoc, useUnderscore: boolean) => string;
|
|
2
|
+
export declare const generateIdempotencyKeyFromOrder: (order: OrderDoc, useUnderscore: boolean, withdrawalCount?: number) => string;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateIdempotencyKeyFromOrder = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
-
const generateIdempotencyKeyFromOrder = (order, useUnderscore) => {
|
|
5
|
+
const generateIdempotencyKeyFromOrder = (order, useUnderscore, withdrawalCount) => {
|
|
6
6
|
const orderMongoId = order.id;
|
|
7
7
|
const orderVersion = order.version.toString();
|
|
8
|
+
const withdrawalSuffix = withdrawalCount !== undefined ? `-withdrawal-${withdrawalCount}` : "";
|
|
8
9
|
// Create a consistent string to hash
|
|
9
|
-
const inputString = `${orderMongoId}-${orderVersion}`;
|
|
10
|
+
const inputString = `${orderMongoId}-${orderVersion}${withdrawalSuffix}`;
|
|
10
11
|
// Create a SHA-1 hash of the input string
|
|
11
12
|
const hash = (0, crypto_1.createHash)("sha1").update(inputString).digest("hex");
|
|
12
13
|
// Format as UUID v5
|
|
@@ -3,6 +3,8 @@ interface BitsoMXNWithdrawalAttrs {
|
|
|
3
3
|
createdAt: Date;
|
|
4
4
|
type: "transaction" | "bankAccountVerification" | "liquidityOrder";
|
|
5
5
|
orderId?: string;
|
|
6
|
+
numberOfParts?: number;
|
|
7
|
+
partsCompleted?: number;
|
|
6
8
|
bankAccountVerificationId?: string;
|
|
7
9
|
multipartLiquidityOrderId?: string;
|
|
8
10
|
bitsoWithdrawals: {
|
|
@@ -17,7 +19,8 @@ interface BitsoMXNWithdrawalDoc extends Document {
|
|
|
17
19
|
orderId?: string;
|
|
18
20
|
bankAccountVerificationId?: string;
|
|
19
21
|
multipartLiquidityOrderId?: string;
|
|
20
|
-
|
|
22
|
+
numberOfParts?: number;
|
|
23
|
+
partsCompleted?: number;
|
|
21
24
|
orderVersion?: number;
|
|
22
25
|
bitsoWithdrawals: {
|
|
23
26
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2191",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1931",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|