@unchainedshop/plugins 2.5.7 → 2.5.8

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.
@@ -3,7 +3,7 @@ import { CryptopayTransactionsCollection } from '../db/CryptopayTransactions.js'
3
3
  export const configureCryptopayModule = ({ db }) => {
4
4
  const CryptoTransactions = CryptopayTransactionsCollection(db);
5
5
  const getWalletAddress = async (addressId) => {
6
- return CryptoTransactions.findOne({ _id: addressId });
6
+ return CryptoTransactions.findOne({ _id: addressId.toLowerCase() });
7
7
  };
8
8
  const updateMostRecentBlock = async (currency, blockHeight) => {
9
9
  await CryptoTransactions.updateMany({
@@ -16,10 +16,10 @@ export const configureCryptopayModule = ({ db }) => {
16
16
  };
17
17
  const mapOrderPaymentToWalletAddress = async ({ addressId, contract, currency, orderPaymentId, }) => {
18
18
  await CryptoTransactions.updateOne({
19
- _id: addressId,
19
+ _id: addressId.toLowerCase(),
20
20
  }, {
21
21
  $setOnInsert: {
22
- _id: addressId,
22
+ _id: addressId.toLowerCase(),
23
23
  contract,
24
24
  currency,
25
25
  decimals: null,
@@ -33,7 +33,7 @@ export const configureCryptopayModule = ({ db }) => {
33
33
  updated: new Date(),
34
34
  },
35
35
  }, { upsert: true });
36
- return CryptoTransactions.findOne({ _id: addressId });
36
+ return CryptoTransactions.findOne({ _id: addressId.toLowerCase() });
37
37
  };
38
38
  const getNextDerivationNumber = async (currency) => {
39
39
  return (await CryptoTransactions.countDocuments({ currency })) + 1;
@@ -45,10 +45,10 @@ export const configureCryptopayModule = ({ db }) => {
45
45
  };
46
46
  const updateWalletAddress = async ({ addressId, blockHeight, amount, contract, currency, decimals, }) => {
47
47
  await CryptoTransactions.updateOne({
48
- _id: addressId,
48
+ _id: addressId.toLowerCase(),
49
49
  }, {
50
50
  $setOnInsert: {
51
- _id: addressId,
51
+ _id: addressId.toLowerCase(),
52
52
  currency,
53
53
  contract,
54
54
  created: new Date(),
@@ -61,7 +61,7 @@ export const configureCryptopayModule = ({ db }) => {
61
61
  updated: new Date(),
62
62
  },
63
63
  }, { upsert: true });
64
- return CryptoTransactions.findOne({ _id: addressId });
64
+ return CryptoTransactions.findOne({ _id: addressId.toLowerCase() });
65
65
  };
66
66
  return {
67
67
  getWalletAddress,
@@ -1 +1 @@
1
- {"version":3,"file":"configureCryptopayModule.js","sourceRoot":"","sources":["../../../../src/payment/cryptopay/module/configureCryptopayModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAwB,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAuBvG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,EAAE,EAAc,EAAmB,EAAE;IAC9E,MAAM,kBAAkB,GAAG,+BAA+B,CAAC,EAAE,CAAC,CAAC;IAE/D,MAAM,gBAAgB,GAAwC,KAAK,EAAE,SAAS,EAAE,EAAE;QAChF,OAAO,kBAAkB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC;IAEF,MAAM,qBAAqB,GAA6C,KAAK,EAC3E,QAAQ,EACR,WAAW,EACX,EAAE;QACF,MAAM,kBAAkB,CAAC,UAAU,CACjC;YACE,QAAQ;SACT,EACD;YACE,IAAI,EAAE;gBACJ,qBAAqB,EAAE,WAAW;aACnC;SACF,CACF,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,8BAA8B,GAAsD,KAAK,EAAE,EAC/F,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,GACf,EAAE,EAAE;QACH,MAAM,kBAAkB,CAAC,SAAS,CAChC;YACE,GAAG,EAAE,SAAS;SACf,EACD;YACE,YAAY,EAAE;gBACZ,GAAG,EAAE,SAAS;gBACd,QAAQ;gBACR,QAAQ;gBACR,QAAQ,EAAE,IAAI;gBACd,qBAAqB,EAAE,CAAC;gBACxB,WAAW,EAAE,CAAC;gBACd,MAAM,EAAE,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AAE,CAAC,CAAC;IACxD,CAAC,CAAC;IAEF,OAAO;QACL,gBAAgB;QAChB,qBAAqB;QACrB,mBAAmB;QACnB,8BAA8B;QAC9B,uBAAuB;QACvB,kCAAkC;KACnC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"configureCryptopayModule.js","sourceRoot":"","sources":["../../../../src/payment/cryptopay/module/configureCryptopayModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAwB,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAuBvG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,EAAE,EAAc,EAAmB,EAAE;IAC9E,MAAM,kBAAkB,GAAG,+BAA+B,CAAC,EAAE,CAAC,CAAC;IAE/D,MAAM,gBAAgB,GAAwC,KAAK,EAAE,SAAS,EAAE,EAAE;QAChF,OAAO,kBAAkB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC;IAEF,MAAM,qBAAqB,GAA6C,KAAK,EAC3E,QAAQ,EACR,WAAW,EACX,EAAE;QACF,MAAM,kBAAkB,CAAC,UAAU,CACjC;YACE,QAAQ;SACT,EACD;YACE,IAAI,EAAE;gBACJ,qBAAqB,EAAE,WAAW;aACnC;SACF,CACF,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,8BAA8B,GAAsD,KAAK,EAAE,EAC/F,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,GACf,EAAE,EAAE;QACH,MAAM,kBAAkB,CAAC,SAAS,CAChC;YACE,GAAG,EAAE,SAAS,CAAC,WAAW,EAAE;SAC7B,EACD;YACE,YAAY,EAAE;gBACZ,GAAG,EAAE,SAAS,CAAC,WAAW,EAAE;gBAC5B,QAAQ;gBACR,QAAQ;gBACR,QAAQ,EAAE,IAAI;gBACd,qBAAqB,EAAE,CAAC;gBACx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AM,EAAE,IAAI,EAAE,CACjB,CAAC;QAEF,OAAO,kBAAkB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC;IAEF,OAAO;QACL,gBAAgB;QAChB,qBAAqB;QACrB,mBAAmB;QACnB,8BAA8B;QAC9B,uBAAuB;QACvB,kCAAkC;KACnC,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/plugins",
3
- "version": "2.5.7",
3
+ "version": "2.5.8",
4
4
  "main": "lib/plugins-index.js",
5
5
  "types": "lib/plugins-index.d.ts",
6
6
  "exports": {
@@ -75,7 +75,7 @@
75
75
  "@redis/client": "^1.5.8",
76
76
  "bip32": "^4.0.0",
77
77
  "escape-string-regexp": "^5.0.0",
78
- "ethers": "^6.8.0",
78
+ "ethers": "^6.8.1",
79
79
  "express": "^4.18.2",
80
80
  "mongodb": "^5.9.0",
81
81
  "postfinancecheckout": "^4.1.1",
@@ -86,22 +86,22 @@
86
86
  "devDependencies": {
87
87
  "@redis/client": "^1.5.11",
88
88
  "@types/node": "^18.18.8",
89
- "@unchainedshop/api": "^2.5.7",
90
- "@unchainedshop/core-delivery": "^2.5.7",
91
- "@unchainedshop/core-enrollments": "^2.5.7",
92
- "@unchainedshop/core-filters": "^2.5.7",
93
- "@unchainedshop/core-messaging": "^2.5.7",
94
- "@unchainedshop/core-orders": "^2.5.7",
95
- "@unchainedshop/core-payment": "^2.5.7",
96
- "@unchainedshop/core-products": "^2.5.7",
97
- "@unchainedshop/core-quotations": "^2.5.7",
98
- "@unchainedshop/core-warehousing": "^2.5.7",
99
- "@unchainedshop/core-worker": "^2.5.7",
100
- "@unchainedshop/events": "^2.5.7",
101
- "@unchainedshop/file-upload": "^2.5.7",
102
- "@unchainedshop/logger": "^2.5.7",
103
- "@unchainedshop/types": "^2.5.7",
104
- "@unchainedshop/utils": "^2.5.7",
89
+ "@unchainedshop/api": "^2.5.8",
90
+ "@unchainedshop/core-delivery": "^2.5.8",
91
+ "@unchainedshop/core-enrollments": "^2.5.8",
92
+ "@unchainedshop/core-filters": "^2.5.8",
93
+ "@unchainedshop/core-messaging": "^2.5.8",
94
+ "@unchainedshop/core-orders": "^2.5.8",
95
+ "@unchainedshop/core-payment": "^2.5.8",
96
+ "@unchainedshop/core-products": "^2.5.8",
97
+ "@unchainedshop/core-quotations": "^2.5.8",
98
+ "@unchainedshop/core-warehousing": "^2.5.8",
99
+ "@unchainedshop/core-worker": "^2.5.8",
100
+ "@unchainedshop/events": "^2.5.8",
101
+ "@unchainedshop/file-upload": "^2.5.8",
102
+ "@unchainedshop/logger": "^2.5.8",
103
+ "@unchainedshop/types": "^2.5.8",
104
+ "@unchainedshop/utils": "^2.5.8",
105
105
  "bluebird": "^3.7.2",
106
106
  "event-iterator": "^2.0.0",
107
107
  "express": "^4.18.2",
@@ -27,7 +27,7 @@ export const configureCryptopayModule = ({ db }: { db: Db }): CryptopayModule =>
27
27
  const CryptoTransactions = CryptopayTransactionsCollection(db);
28
28
 
29
29
  const getWalletAddress: CryptopayModule['getWalletAddress'] = async (addressId) => {
30
- return CryptoTransactions.findOne({ _id: addressId });
30
+ return CryptoTransactions.findOne({ _id: addressId.toLowerCase() });
31
31
  };
32
32
 
33
33
  const updateMostRecentBlock: CryptopayModule['updateMostRecentBlock'] = async (
@@ -54,11 +54,11 @@ export const configureCryptopayModule = ({ db }: { db: Db }): CryptopayModule =>
54
54
  }) => {
55
55
  await CryptoTransactions.updateOne(
56
56
  {
57
- _id: addressId,
57
+ _id: addressId.toLowerCase(),
58
58
  },
59
59
  {
60
60
  $setOnInsert: {
61
- _id: addressId,
61
+ _id: addressId.toLowerCase(),
62
62
  contract,
63
63
  currency,
64
64
  decimals: null,
@@ -75,7 +75,7 @@ export const configureCryptopayModule = ({ db }: { db: Db }): CryptopayModule =>
75
75
  { upsert: true },
76
76
  );
77
77
 
78
- return CryptoTransactions.findOne({ _id: addressId });
78
+ return CryptoTransactions.findOne({ _id: addressId.toLowerCase() });
79
79
  };
80
80
 
81
81
  const getNextDerivationNumber: CryptopayModule['getNextDerivationNumber'] = async (currency) => {
@@ -99,11 +99,11 @@ export const configureCryptopayModule = ({ db }: { db: Db }): CryptopayModule =>
99
99
  }) => {
100
100
  await CryptoTransactions.updateOne(
101
101
  {
102
- _id: addressId,
102
+ _id: addressId.toLowerCase(),
103
103
  },
104
104
  {
105
105
  $setOnInsert: {
106
- _id: addressId,
106
+ _id: addressId.toLowerCase(),
107
107
  currency,
108
108
  contract,
109
109
  created: new Date(),
@@ -119,7 +119,7 @@ export const configureCryptopayModule = ({ db }: { db: Db }): CryptopayModule =>
119
119
  { upsert: true },
120
120
  );
121
121
 
122
- return CryptoTransactions.findOne({ _id: addressId });
122
+ return CryptoTransactions.findOne({ _id: addressId.toLowerCase() });
123
123
  };
124
124
 
125
125
  return {