@unchainedshop/plugins 3.1.13 → 4.0.0-rc.3
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/lib/delivery/pick-mup.js +0 -2
- package/lib/delivery/pick-mup.js.map +1 -1
- package/lib/files/gridfs/handler-express.d.ts.map +1 -1
- package/lib/files/gridfs/handler-express.js +5 -0
- package/lib/files/gridfs/handler-express.js.map +1 -1
- package/lib/files/gridfs/handler-fastify.d.ts.map +1 -1
- package/lib/files/gridfs/handler-fastify.js +4 -0
- package/lib/files/gridfs/handler-fastify.js.map +1 -1
- package/lib/files/gridfs/module.d.ts +2 -2
- package/lib/files/gridfs/module.d.ts.map +1 -1
- package/lib/filters/local-search.d.ts.map +1 -1
- package/lib/filters/local-search.js +9 -2
- package/lib/filters/local-search.js.map +1 -1
- package/lib/filters/strict-equal.js +18 -0
- package/lib/filters/strict-equal.js.map +1 -1
- package/lib/payment/apple-iap/adapter.js +5 -12
- package/lib/payment/apple-iap/adapter.js.map +1 -1
- package/lib/payment/apple-iap/fix-periods.d.ts.map +1 -1
- package/lib/payment/apple-iap/fix-periods.js +3 -5
- package/lib/payment/apple-iap/fix-periods.js.map +1 -1
- package/lib/payment/apple-iap/handler-express.js +3 -3
- package/lib/payment/apple-iap/handler-express.js.map +1 -1
- package/lib/payment/apple-iap/handler-fastify.js +3 -3
- package/lib/payment/apple-iap/handler-fastify.js.map +1 -1
- package/lib/payment/apple-iap/module.d.ts +2 -2
- package/lib/payment/apple-iap/module.d.ts.map +1 -1
- package/lib/payment/braintree.js +3 -4
- package/lib/payment/braintree.js.map +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts +1 -2
- package/lib/payment/cryptopay/db/CryptopayTransactions.d.ts.map +1 -1
- package/lib/payment/cryptopay/db/CryptopayTransactions.js.map +1 -1
- package/lib/payment/cryptopay/handler-express.d.ts.map +1 -1
- package/lib/payment/cryptopay/handler-express.js +3 -56
- package/lib/payment/cryptopay/handler-express.js.map +1 -1
- package/lib/payment/cryptopay/handler-fastify.d.ts.map +1 -1
- package/lib/payment/cryptopay/handler-fastify.js +3 -55
- package/lib/payment/cryptopay/handler-fastify.js.map +1 -1
- package/lib/payment/cryptopay/module.d.ts +26 -26
- package/lib/payment/cryptopay/module.d.ts.map +1 -1
- package/lib/payment/cryptopay/module.js +26 -24
- package/lib/payment/cryptopay/module.js.map +1 -1
- package/lib/payment/cryptopay/plugin.d.ts.map +1 -1
- package/lib/payment/cryptopay/plugin.js +33 -79
- package/lib/payment/cryptopay/plugin.js.map +1 -1
- package/lib/payment/datatrans-v2/api/types.d.ts +41 -41
- package/lib/payment/datatrans-v2/api/types.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/getPaths.d.ts +2 -2
- package/lib/payment/datatrans-v2/getPaths.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/index.js +16 -14
- package/lib/payment/datatrans-v2/index.js.map +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.d.ts.map +1 -1
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js +3 -3
- package/lib/payment/datatrans-v2/roundedAmountFromOrder.js.map +1 -1
- package/lib/payment/paypal-checkout.js +1 -1
- package/lib/payment/paypal-checkout.js.map +1 -1
- package/lib/payment/payrexx/api/index.d.ts +2 -2
- package/lib/payment/payrexx/api/index.d.ts.map +1 -1
- package/lib/payment/payrexx/api/makeFetcher.d.ts.map +1 -1
- package/lib/payment/payrexx/api/makeFetcher.js.map +1 -1
- package/lib/payment/payrexx/index.js +4 -4
- package/lib/payment/payrexx/index.js.map +1 -1
- package/lib/payment/payrexx/payrexx.js +2 -2
- package/lib/payment/payrexx/payrexx.js.map +1 -1
- package/lib/payment/postfinance-checkout/index.js +3 -5
- package/lib/payment/postfinance-checkout/index.js.map +1 -1
- package/lib/payment/postfinance-checkout/types.d.ts +4 -4
- package/lib/payment/postfinance-checkout/types.d.ts.map +1 -1
- package/lib/payment/postfinance-checkout/utils.js +2 -2
- package/lib/payment/postfinance-checkout/utils.js.map +1 -1
- package/lib/payment/saferpay/adapter.d.ts.map +1 -1
- package/lib/payment/saferpay/adapter.js +4 -6
- package/lib/payment/saferpay/adapter.js.map +1 -1
- package/lib/payment/saferpay/api/models/Transaction.d.ts +2 -2
- package/lib/payment/saferpay/api/models/Transaction.d.ts.map +1 -1
- package/lib/payment/saferpay/module.d.ts +2 -2
- package/lib/payment/saferpay/module.d.ts.map +1 -1
- package/lib/payment/stripe/index.js +5 -5
- package/lib/payment/stripe/index.js.map +1 -1
- package/lib/payment/stripe/stripe.js +2 -2
- package/lib/payment/stripe/stripe.js.map +1 -1
- package/lib/presets/all.d.ts +12 -12
- package/lib/presets/all.d.ts.map +1 -1
- package/lib/pricing/delivery-swiss-tax.d.ts.map +1 -1
- package/lib/pricing/delivery-swiss-tax.js +2 -2
- package/lib/pricing/delivery-swiss-tax.js.map +1 -1
- package/lib/pricing/order-delivery.js +1 -1
- package/lib/pricing/order-delivery.js.map +1 -1
- package/lib/pricing/order-discount.js +3 -3
- package/lib/pricing/order-discount.js.map +1 -1
- package/lib/pricing/order-items-discount.js +1 -1
- package/lib/pricing/order-items-discount.js.map +1 -1
- package/lib/pricing/order-items.js +1 -1
- package/lib/pricing/order-items.js.map +1 -1
- package/lib/pricing/order-payment.js +1 -1
- package/lib/pricing/order-payment.js.map +1 -1
- package/lib/pricing/order-round.d.ts +1 -1
- package/lib/pricing/order-round.d.ts.map +1 -1
- package/lib/pricing/order-round.js +8 -8
- package/lib/pricing/order-round.js.map +1 -1
- package/lib/pricing/product-catalog-price.d.ts +0 -1
- package/lib/pricing/product-catalog-price.d.ts.map +1 -1
- package/lib/pricing/product-catalog-price.js +6 -18
- package/lib/pricing/product-catalog-price.js.map +1 -1
- package/lib/pricing/product-price-rateconversion.js +2 -2
- package/lib/pricing/product-price-rateconversion.js.map +1 -1
- package/lib/pricing/product-round.d.ts +1 -1
- package/lib/pricing/product-round.d.ts.map +1 -1
- package/lib/pricing/product-round.js +2 -2
- package/lib/pricing/product-round.js.map +1 -1
- package/lib/pricing/product-swiss-tax.d.ts +1 -1
- package/lib/pricing/product-swiss-tax.d.ts.map +1 -1
- package/lib/pricing/product-swiss-tax.js +2 -2
- package/lib/pricing/product-swiss-tax.js.map +1 -1
- package/lib/warehousing/eth-minter.js +2 -2
- package/lib/warehousing/eth-minter.js.map +1 -1
- package/lib/worker/bulk-import.js +1 -1
- package/lib/worker/bulk-import.js.map +1 -1
- package/lib/worker/enrollment-order-generator.js +1 -1
- package/lib/worker/enrollment-order-generator.js.map +1 -1
- package/lib/worker/error-notifications.d.ts +4 -4
- package/lib/worker/error-notifications.d.ts.map +1 -1
- package/lib/worker/heartbeat.js +2 -8
- package/lib/worker/heartbeat.js.map +1 -1
- package/lib/worker/message.d.ts +1 -1
- package/lib/worker/message.d.ts.map +1 -1
- package/lib/worker/sms.js +16 -16
- package/lib/worker/sms.js.map +1 -1
- package/lib/worker/update-coinbase-rates.js +1 -1
- package/lib/worker/update-coinbase-rates.js.map +1 -1
- package/lib/worker/update-ecb-rates.js.map +1 -1
- package/package.json +28 -44
- package/src/delivery/pick-mup.ts +0 -2
- package/src/files/gridfs/handler-express.ts +4 -0
- package/src/files/gridfs/handler-fastify.ts +3 -0
- package/src/files/gridfs/module.ts +2 -2
- package/src/filters/local-search.ts +11 -2
- package/src/filters/strict-equal.ts +21 -0
- package/src/payment/apple-iap/adapter.ts +6 -13
- package/src/payment/apple-iap/fix-periods.ts +4 -7
- package/src/payment/apple-iap/handler-express.ts +3 -3
- package/src/payment/apple-iap/handler-fastify.ts +3 -3
- package/src/payment/apple-iap/module.ts +2 -2
- package/src/payment/braintree.ts +3 -4
- package/src/payment/cryptopay/db/CryptopayTransactions.ts +1 -2
- package/src/payment/cryptopay/denote-amount.test.ts +28 -0
- package/src/payment/cryptopay/denote-amount.ts +29 -0
- package/src/payment/cryptopay/derive-btc-address.test.ts +22 -0
- package/src/payment/cryptopay/derive-btc-address.ts +48 -0
- package/src/payment/cryptopay/derive-eth-address.test.ts +22 -0
- package/src/payment/cryptopay/derive-eth-address.ts +38 -0
- package/src/payment/cryptopay/handle-webhook.ts +103 -0
- package/src/payment/cryptopay/handler-express.ts +3 -69
- package/src/payment/cryptopay/handler-fastify.ts +5 -70
- package/src/payment/cryptopay/module.ts +44 -40
- package/src/payment/cryptopay/plugin.ts +50 -87
- package/src/payment/cryptopay/readme.md +23 -1
- package/src/payment/datatrans-v2/api/types.ts +41 -41
- package/src/payment/datatrans-v2/getPaths.ts +2 -2
- package/src/payment/datatrans-v2/index.ts +17 -15
- package/src/payment/datatrans-v2/roundedAmountFromOrder.ts +4 -4
- package/src/payment/paypal-checkout.ts +1 -1
- package/src/payment/payrexx/api/index.ts +2 -2
- package/src/payment/payrexx/api/makeFetcher.ts +1 -1
- package/src/payment/payrexx/index.ts +4 -4
- package/src/payment/payrexx/payrexx.ts +2 -2
- package/src/payment/postfinance-checkout/index.ts +3 -5
- package/src/payment/postfinance-checkout/types.ts +6 -6
- package/src/payment/postfinance-checkout/utils.ts +2 -2
- package/src/payment/saferpay/adapter.ts +4 -6
- package/src/payment/saferpay/api/models/Transaction.ts +2 -2
- package/src/payment/saferpay/module.ts +2 -2
- package/src/payment/stripe/index.ts +5 -5
- package/src/payment/stripe/stripe.ts +2 -2
- package/src/pricing/delivery-swiss-tax.ts +6 -2
- package/src/pricing/order-delivery.ts +1 -1
- package/src/pricing/order-discount.ts +3 -3
- package/src/pricing/order-items-discount.ts +1 -1
- package/src/pricing/order-items.ts +1 -1
- package/src/pricing/order-payment.ts +1 -1
- package/src/pricing/order-round.ts +9 -9
- package/src/pricing/product-catalog-price.ts +6 -25
- package/src/pricing/product-price-rateconversion.ts +2 -2
- package/src/pricing/product-round.ts +3 -3
- package/src/pricing/product-swiss-tax.test.ts +6 -6
- package/src/pricing/product-swiss-tax.ts +2 -2
- package/src/warehousing/eth-minter.ts +2 -2
- package/src/worker/bulk-import.ts +1 -1
- package/src/worker/enrollment-order-generator.ts +3 -3
- package/src/worker/error-notifications.ts +4 -4
- package/src/worker/heartbeat.ts +4 -11
- package/src/worker/message.ts +1 -1
- package/src/worker/push-notification.ts +2 -2
- package/src/worker/sms.ts +19 -17
- package/src/worker/update-coinbase-rates.ts +3 -6
- package/src/worker/update-ecb-rates.ts +3 -3
- package/src/worker/BaseWorker.ts +0 -116
- package/src/worker/EventListenerWorker.ts +0 -61
- package/src/worker/FailedRescheduler.ts +0 -80
- package/src/worker/IntervalWorker.ts +0 -54
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/plugins",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-rc.3",
|
|
4
4
|
"main": "lib/plugins-index.js",
|
|
5
5
|
"types": "lib/plugins-index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -34,46 +34,45 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@unchainedshop/
|
|
39
|
-
"@unchainedshop/core-
|
|
40
|
-
"@unchainedshop/core-
|
|
41
|
-
"@unchainedshop/core-
|
|
42
|
-
"@unchainedshop/core-
|
|
43
|
-
"@unchainedshop/core-
|
|
44
|
-
"@unchainedshop/core-
|
|
45
|
-
"@unchainedshop/
|
|
46
|
-
"@unchainedshop/
|
|
47
|
-
"@unchainedshop/
|
|
48
|
-
"@unchainedshop/
|
|
49
|
-
"@unchainedshop/utils": "^3.1.13",
|
|
37
|
+
"@unchainedshop/api": "^4.0.0-rc.3",
|
|
38
|
+
"@unchainedshop/core-delivery": "^4.0.0-rc.3",
|
|
39
|
+
"@unchainedshop/core-enrollments": "^4.0.0-rc.3",
|
|
40
|
+
"@unchainedshop/core-orders": "^4.0.0-rc.3",
|
|
41
|
+
"@unchainedshop/core-payment": "^4.0.0-rc.3",
|
|
42
|
+
"@unchainedshop/core-products": "^4.0.0-rc.3",
|
|
43
|
+
"@unchainedshop/core-warehousing": "^4.0.0-rc.3",
|
|
44
|
+
"@unchainedshop/core-worker": "^4.0.0-rc.3",
|
|
45
|
+
"@unchainedshop/events": "^4.0.0-rc.3",
|
|
46
|
+
"@unchainedshop/file-upload": "^4.0.0-rc.3",
|
|
47
|
+
"@unchainedshop/logger": "^4.0.0-rc.3",
|
|
48
|
+
"@unchainedshop/utils": "^4.0.0-rc.3",
|
|
50
49
|
"event-iterator": "^2.0.0",
|
|
51
50
|
"JSONStream": "^1.3.5"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
53
|
"@aws-sdk/client-eventbridge": ">= 3.714 < 4",
|
|
54
|
+
"@breejs/later": "^4.2.0",
|
|
55
55
|
"@paypal/checkout-server-sdk": "1.x",
|
|
56
|
-
"@redis/client": ">= 1
|
|
57
|
-
"bip32": "
|
|
58
|
-
"
|
|
59
|
-
"bs58check": "^4.0.0",
|
|
60
|
-
"ethers": ">= 6.13 < 7",
|
|
56
|
+
"@redis/client": ">= 1 < 6",
|
|
57
|
+
"@scure/bip32": ">= 1.7 < 2",
|
|
58
|
+
"@scure/btc-signer": ">= 1.8 < 2",
|
|
61
59
|
"expiry-map": "2.x",
|
|
62
60
|
"express": ">= 5 < 6",
|
|
63
61
|
"fastify": ">= 5.2 < 6",
|
|
64
|
-
"mime-types": ">=
|
|
62
|
+
"mime-types": ">= 2 < 4",
|
|
65
63
|
"minio": "8.x",
|
|
66
64
|
"nodemailer": ">= 6.9 < 8",
|
|
67
65
|
"open": "10.x",
|
|
68
66
|
"p-memoize": "7.x",
|
|
69
67
|
"postfinancecheckout": ">= 4.5.0",
|
|
70
|
-
"stripe": ">=
|
|
71
|
-
"tiny-secp256k1": "2.x",
|
|
72
|
-
"twilio": "5.x",
|
|
68
|
+
"stripe": ">= 17 < 19",
|
|
73
69
|
"web-push": ">= 3.6 <4",
|
|
74
70
|
"xml-js": ">= 1.6 < 2"
|
|
75
71
|
},
|
|
76
72
|
"peerDependenciesMeta": {
|
|
73
|
+
"@breejs/later": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
77
76
|
"@aws-sdk/client-eventbridge": {
|
|
78
77
|
"optional": true
|
|
79
78
|
},
|
|
@@ -83,16 +82,10 @@
|
|
|
83
82
|
"@redis/client": {
|
|
84
83
|
"optional": true
|
|
85
84
|
},
|
|
86
|
-
"bip32": {
|
|
87
|
-
"optional": true
|
|
88
|
-
},
|
|
89
|
-
"bitcoinjs-lib": {
|
|
85
|
+
"@scure/bip32": {
|
|
90
86
|
"optional": true
|
|
91
87
|
},
|
|
92
|
-
"
|
|
93
|
-
"optional": true
|
|
94
|
-
},
|
|
95
|
-
"ethers": {
|
|
88
|
+
"@scure/btc-signer": {
|
|
96
89
|
"optional": true
|
|
97
90
|
},
|
|
98
91
|
"expiry-map": {
|
|
@@ -125,12 +118,6 @@
|
|
|
125
118
|
"stripe": {
|
|
126
119
|
"optional": true
|
|
127
120
|
},
|
|
128
|
-
"tiny-secp256k1": {
|
|
129
|
-
"optional": true
|
|
130
|
-
},
|
|
131
|
-
"twilio": {
|
|
132
|
-
"optional": true
|
|
133
|
-
},
|
|
134
121
|
"web-push": {
|
|
135
122
|
"optional": true
|
|
136
123
|
},
|
|
@@ -142,25 +129,22 @@
|
|
|
142
129
|
"@breejs/later": "^4.2.0",
|
|
143
130
|
"@paypal/checkout-server-sdk": "^1.0.3",
|
|
144
131
|
"@redis/client": "^5.5.6",
|
|
132
|
+
"@scure/bip32": "^1.7.0",
|
|
133
|
+
"@scure/btc-signer": "^1.8.1",
|
|
134
|
+
"@types/breejs__later": "^4.1.5",
|
|
145
135
|
"@types/express": "^5.0.3",
|
|
146
136
|
"@types/node": "^24.0.4",
|
|
147
|
-
"bip32": "^5.0.0-rc.0",
|
|
148
|
-
"bitcoinjs-lib": "^6.1.7",
|
|
149
|
-
"bs58check": "^4.0.0",
|
|
150
|
-
"ethers": "^6.14.4",
|
|
151
137
|
"expiry-map": "^2.0.0",
|
|
152
138
|
"express": "^5.1.0",
|
|
153
139
|
"fastify": "^5.4.0",
|
|
154
|
-
"mime-types": "^3.0.
|
|
140
|
+
"mime-types": "^3.0.1",
|
|
155
141
|
"minio": "^8.0.5",
|
|
156
142
|
"nodemailer": "^7.0.3",
|
|
157
143
|
"open": "^10.1.2",
|
|
158
144
|
"p-memoize": "^7.1.1",
|
|
159
145
|
"postfinancecheckout": "^4.7.0",
|
|
160
146
|
"stripe": "^18.2.1",
|
|
161
|
-
"tiny-secp256k1": "^2.2.4",
|
|
162
147
|
"tsx": "^4.20.3",
|
|
163
|
-
"twilio": "^5.7.1",
|
|
164
148
|
"typescript": "^5.8.3",
|
|
165
149
|
"web-push": "^3.6.7",
|
|
166
150
|
"xml-js": "^1.6.11"
|
package/src/delivery/pick-mup.ts
CHANGED
|
@@ -22,7 +22,6 @@ const fetchPickMupLocations = async (key: string, idsFilter?: string) => {
|
|
|
22
22
|
const { stores = [] } = result || {};
|
|
23
23
|
return stores.flatMap(({ markets = [], location = {}, id }) => {
|
|
24
24
|
return markets.map(({ full_name: fullName }) => {
|
|
25
|
-
// eslint-disable-line
|
|
26
25
|
const {
|
|
27
26
|
geo: { lat, lon },
|
|
28
27
|
zip,
|
|
@@ -90,7 +89,6 @@ const PickMup: IDeliveryAdapter = {
|
|
|
90
89
|
},
|
|
91
90
|
|
|
92
91
|
configurationError: () => {
|
|
93
|
-
// eslint-disable-line
|
|
94
92
|
if (!getKey()) {
|
|
95
93
|
return DeliveryError.INCOMPLETE_CONFIGURATION;
|
|
96
94
|
}
|
|
@@ -98,6 +98,10 @@ const gridfsHandler = async (
|
|
|
98
98
|
res.end('Access restricted: Invalid signature.');
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
+
} else if (!fileDocument) {
|
|
102
|
+
res.statusCode = 404;
|
|
103
|
+
res.end();
|
|
104
|
+
return;
|
|
101
105
|
}
|
|
102
106
|
if (file?.metadata?.['content-type']) {
|
|
103
107
|
res.setHeader('Content-Type', file.metadata['content-type']);
|
|
@@ -89,6 +89,9 @@ const gridfsHandler: RouteHandlerMethod = async (
|
|
|
89
89
|
reply.status(403);
|
|
90
90
|
return reply.send('Access restricted: Invalid signature.');
|
|
91
91
|
}
|
|
92
|
+
} else if (!fileDocument) {
|
|
93
|
+
reply.status(404);
|
|
94
|
+
return reply.send();
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
if (file?.metadata?.['content-type']) {
|
|
@@ -2,6 +2,10 @@ import { mongodb } from '@unchainedshop/mongodb';
|
|
|
2
2
|
import { ProductText } from '@unchainedshop/core-products';
|
|
3
3
|
import { AssortmentText } from '@unchainedshop/core-assortments';
|
|
4
4
|
import { FilterDirector, FilterAdapter, IFilterAdapter } from '@unchainedshop/core';
|
|
5
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
6
|
+
import { isDocumentDBCompatModeEnabled } from '@unchainedshop/mongodb';
|
|
7
|
+
|
|
8
|
+
const logger = createLogger('unchained:core-filters:local-search');
|
|
5
9
|
|
|
6
10
|
const LocalSearch: IFilterAdapter = {
|
|
7
11
|
...FilterAdapter,
|
|
@@ -38,7 +42,6 @@ const LocalSearch: IFilterAdapter = {
|
|
|
38
42
|
return products.map(({ productId }) => productId);
|
|
39
43
|
},
|
|
40
44
|
|
|
41
|
-
// eslint-disable-next-line
|
|
42
45
|
searchAssortments: async ({ assortmentIds }) => {
|
|
43
46
|
const { queryString } = params.searchQuery;
|
|
44
47
|
|
|
@@ -89,4 +92,10 @@ const LocalSearch: IFilterAdapter = {
|
|
|
89
92
|
|
|
90
93
|
export default LocalSearch;
|
|
91
94
|
|
|
92
|
-
|
|
95
|
+
if (!isDocumentDBCompatModeEnabled()) {
|
|
96
|
+
FilterDirector.registerAdapter(LocalSearch);
|
|
97
|
+
} else {
|
|
98
|
+
logger.warn(
|
|
99
|
+
'Free text search queries have been disabled due to DocumentDB compatibility mode (env UNCHAINED_DOCUMENTDB_COMPAT_MODE is trueish)',
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -12,6 +12,27 @@ const StrictQualFilter: IFilterAdapter = {
|
|
|
12
12
|
return {
|
|
13
13
|
...FilterAdapter.actions(params),
|
|
14
14
|
|
|
15
|
+
searchProducts: async ({ productIds }) => {
|
|
16
|
+
// Search Products
|
|
17
|
+
const { queryString } = params.searchQuery;
|
|
18
|
+
|
|
19
|
+
if (!queryString && !productIds) {
|
|
20
|
+
// If no query string is provided, return all product IDs
|
|
21
|
+
return params.modules.products.findProductIds({});
|
|
22
|
+
}
|
|
23
|
+
return productIds;
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
searchAssortments: async ({ assortmentIds }) => {
|
|
27
|
+
// Search Assortments
|
|
28
|
+
const { queryString } = params.searchQuery;
|
|
29
|
+
if (!queryString && !assortmentIds) {
|
|
30
|
+
// If no query string is provided, return all assortment IDs
|
|
31
|
+
return params.modules.assortments.findAssortmentIds({});
|
|
32
|
+
}
|
|
33
|
+
return assortmentIds;
|
|
34
|
+
},
|
|
35
|
+
|
|
15
36
|
transformProductSelector: async (lastSelector, options) => {
|
|
16
37
|
const { key, value } = options || {};
|
|
17
38
|
|
|
@@ -26,7 +26,6 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
26
26
|
...PaymentAdapter.actions(params, context),
|
|
27
27
|
|
|
28
28
|
configurationError() {
|
|
29
|
-
// eslint-disable-line
|
|
30
29
|
if (!APPLE_IAP_SHARED_SECRET) {
|
|
31
30
|
return PaymentError.INCOMPLETE_CONFIGURATION;
|
|
32
31
|
}
|
|
@@ -38,23 +37,19 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
38
37
|
return false;
|
|
39
38
|
},
|
|
40
39
|
|
|
41
|
-
// eslint-disable-next-line
|
|
42
40
|
isPayLaterAllowed() {
|
|
43
41
|
return false;
|
|
44
42
|
},
|
|
45
43
|
|
|
46
|
-
// eslint-disable-next-line
|
|
47
44
|
async sign() {
|
|
48
45
|
throw new Error('Apple IAP does not support payment signing');
|
|
49
46
|
},
|
|
50
47
|
|
|
51
|
-
// eslint-disable-next-line
|
|
52
48
|
async validate() {
|
|
53
49
|
// once registered receipt transactions are valid by default!
|
|
54
50
|
return true;
|
|
55
51
|
},
|
|
56
52
|
|
|
57
|
-
// eslint-disable-next-line
|
|
58
53
|
async register(transactionContext) {
|
|
59
54
|
const { receiptData } = transactionContext;
|
|
60
55
|
|
|
@@ -62,13 +57,13 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
62
57
|
receiptData,
|
|
63
58
|
password: APPLE_IAP_SHARED_SECRET,
|
|
64
59
|
});
|
|
65
|
-
const { status, latest_receipt_info: latestReceiptInfo } = response;
|
|
60
|
+
const { status, latest_receipt_info: latestReceiptInfo } = response;
|
|
66
61
|
|
|
67
62
|
if (status === 0) {
|
|
68
63
|
logger.debug('Apple IAP Plugin: Receipt validated and updated for the user');
|
|
69
|
-
const latestTransaction = latestReceiptInfo[latestReceiptInfo.length - 1];
|
|
64
|
+
const latestTransaction = latestReceiptInfo[latestReceiptInfo.length - 1];
|
|
70
65
|
return {
|
|
71
|
-
token: latestTransaction.web_order_line_item_id,
|
|
66
|
+
token: latestTransaction.web_order_line_item_id,
|
|
72
67
|
latestReceiptInfo,
|
|
73
68
|
};
|
|
74
69
|
}
|
|
@@ -79,7 +74,6 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
79
74
|
return null;
|
|
80
75
|
},
|
|
81
76
|
|
|
82
|
-
// eslint-disable-next-line
|
|
83
77
|
async charge(transactionContext) {
|
|
84
78
|
const { meta, paymentCredentials, receiptData } = transactionContext || {};
|
|
85
79
|
const { transactionIdentifier } = meta || {};
|
|
@@ -100,10 +94,9 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
const transactions =
|
|
103
|
-
receiptResponse?.latest_receipt_info ||
|
|
104
|
-
paymentCredentials?.meta?.latestReceiptInfo;
|
|
97
|
+
receiptResponse?.latest_receipt_info || paymentCredentials?.meta?.latestReceiptInfo;
|
|
105
98
|
const matchedTransaction = transactions?.find(
|
|
106
|
-
(transaction) => transaction?.transaction_id === transactionIdentifier,
|
|
99
|
+
(transaction) => transaction?.transaction_id === transactionIdentifier,
|
|
107
100
|
);
|
|
108
101
|
if (!matchedTransaction) {
|
|
109
102
|
throw new Error(
|
|
@@ -131,7 +124,7 @@ const AppleIAP: IPaymentAdapter = {
|
|
|
131
124
|
|
|
132
125
|
const isMatchesTransaction =
|
|
133
126
|
parseInt(matchedTransaction.quantity, 10) === quantity &&
|
|
134
|
-
matchedTransaction.product_id === productId;
|
|
127
|
+
matchedTransaction.product_id === productId;
|
|
135
128
|
|
|
136
129
|
if (!isMatchesTransaction)
|
|
137
130
|
throw new Error('Apple IAP Plugin: Product in order does not match transaction');
|
|
@@ -4,17 +4,14 @@ export const fixPeriods = async (
|
|
|
4
4
|
{ transactionId, enrollmentId, orderId, transactions },
|
|
5
5
|
unchainedAPI: UnchainedCore,
|
|
6
6
|
) => {
|
|
7
|
-
const relevantTransactions = transactions.filter(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return original_transaction_id === transactionId; // eslint-disable-line
|
|
11
|
-
},
|
|
12
|
-
);
|
|
7
|
+
const relevantTransactions = transactions.filter(({ original_transaction_id }) => {
|
|
8
|
+
return original_transaction_id === transactionId;
|
|
9
|
+
});
|
|
13
10
|
|
|
14
11
|
const adjustedEnrollmentPeriods = relevantTransactions
|
|
15
12
|
.map((transaction) => {
|
|
16
13
|
return {
|
|
17
|
-
isTrial: transaction.is_trial_period === 'true',
|
|
14
|
+
isTrial: transaction.is_trial_period === 'true',
|
|
18
15
|
start: new Date(parseInt(transaction.purchase_date_ms, 10)),
|
|
19
16
|
end: new Date(parseInt(transaction.expires_date_ms, 10)),
|
|
20
17
|
orderId: transaction.transaction_id === transactionId ? orderId : null,
|
|
@@ -25,7 +25,7 @@ export const appleIAPHandler = async (req, res) => {
|
|
|
25
25
|
throw new Error('shared secret not valid');
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const transactions = responseBody?.unified_receipt?.latest_receipt_info;
|
|
28
|
+
const transactions = responseBody?.unified_receipt?.latest_receipt_info;
|
|
29
29
|
const latestTransaction = transactions[0];
|
|
30
30
|
|
|
31
31
|
if (responseBody.notification_type === AppleNotificationTypes.INITIAL_BUY) {
|
|
@@ -40,7 +40,7 @@ export const appleIAPHandler = async (req, res) => {
|
|
|
40
40
|
|
|
41
41
|
const order = await services.orders.checkoutOrder(orderPayment.orderId, {
|
|
42
42
|
paymentContext: {
|
|
43
|
-
|
|
43
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
46
|
const orderId = order._id;
|
|
@@ -78,7 +78,7 @@ export const appleIAPHandler = async (req, res) => {
|
|
|
78
78
|
|
|
79
79
|
await services.orders.registerPaymentCredentials(enrollment.payment.paymentProviderId, {
|
|
80
80
|
transactionContext: {
|
|
81
|
-
|
|
81
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
82
82
|
},
|
|
83
83
|
userId: enrollment.userId,
|
|
84
84
|
});
|
|
@@ -33,7 +33,7 @@ export const appleIAPHandler: RouteHandlerMethod = async (
|
|
|
33
33
|
throw new Error('shared secret not valid');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const transactions = responseBody?.unified_receipt?.latest_receipt_info;
|
|
37
37
|
const latestTransaction = transactions[0];
|
|
38
38
|
|
|
39
39
|
if (responseBody.notification_type === AppleNotificationTypes.INITIAL_BUY) {
|
|
@@ -48,7 +48,7 @@ export const appleIAPHandler: RouteHandlerMethod = async (
|
|
|
48
48
|
|
|
49
49
|
const order = await services.orders.checkoutOrder(orderPayment.orderId, {
|
|
50
50
|
paymentContext: {
|
|
51
|
-
|
|
51
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
const orderId = order._id;
|
|
@@ -86,7 +86,7 @@ export const appleIAPHandler: RouteHandlerMethod = async (
|
|
|
86
86
|
|
|
87
87
|
await services.orders.registerPaymentCredentials(enrollment.payment.paymentProviderId, {
|
|
88
88
|
transactionContext: {
|
|
89
|
-
|
|
89
|
+
receiptData: responseBody?.unified_receipt?.latest_receipt,
|
|
90
90
|
},
|
|
91
91
|
userId: enrollment.userId,
|
|
92
92
|
});
|
package/src/payment/braintree.ts
CHANGED
|
@@ -52,7 +52,6 @@ const BraintreeDirect: IPaymentAdapter = {
|
|
|
52
52
|
return BRAINTREE_SANDBOX_TOKEN;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
// eslint-disable-next-line
|
|
56
55
|
const getPrivateKey = () => {
|
|
57
56
|
return BRAINTREE_PRIVATE_KEY;
|
|
58
57
|
};
|
|
@@ -114,17 +113,17 @@ const BraintreeDirect: IPaymentAdapter = {
|
|
|
114
113
|
|
|
115
114
|
// eslint-disable-next-line
|
|
116
115
|
// @ts-ignore
|
|
117
|
-
const braintree = (await import('braintree')).default;
|
|
116
|
+
const braintree = (await import('braintree')).default;
|
|
118
117
|
const gateway = getGateway(braintree);
|
|
119
118
|
const address = order.billingAddress;
|
|
120
119
|
const pricing = OrderPricingSheet({
|
|
121
120
|
calculation: order.calculation,
|
|
122
|
-
|
|
121
|
+
currencyCode: order.currencyCode,
|
|
123
122
|
});
|
|
124
123
|
const rounded = Math.round(pricing.total({ useNetPrice: false }).amount / 10 || 0) * 10;
|
|
125
124
|
const saleRequest = {
|
|
126
125
|
amount: rounded / 100,
|
|
127
|
-
merchantAccountId: order.
|
|
126
|
+
merchantAccountId: order.currencyCode,
|
|
128
127
|
paymentMethodNonce: paypalPaymentMethodNonce,
|
|
129
128
|
orderId: order.orderNumber || order._id,
|
|
130
129
|
shipping: address
|
|
@@ -6,9 +6,8 @@ export type CryptopayTransaction = {
|
|
|
6
6
|
blockHeight: number;
|
|
7
7
|
mostRecentBlockHeight: number;
|
|
8
8
|
amount: mongodb.Decimal128;
|
|
9
|
-
|
|
9
|
+
currencyCode: string;
|
|
10
10
|
decimals: number;
|
|
11
|
-
contract: string;
|
|
12
11
|
orderPaymentId?: string;
|
|
13
12
|
} & TimestampFields;
|
|
14
13
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import denoteAmount from './denote-amount.js';
|
|
4
|
+
|
|
5
|
+
describe('Denote Amount', () => {
|
|
6
|
+
it('Handle amount with 18 decimals', () => {
|
|
7
|
+
// For example, Ethereum uses 18 decimals, this converts WEI to GWei
|
|
8
|
+
assert.equal(denoteAmount('1000000000000000000', 18), 1000000000n);
|
|
9
|
+
assert.equal(denoteAmount('100000000000000', 18), 100000n);
|
|
10
|
+
assert.equal(denoteAmount('100', 18), 0n);
|
|
11
|
+
});
|
|
12
|
+
it('Handle amount with 10 decimals', () => {
|
|
13
|
+
assert.equal(denoteAmount('100000000', 10), 10000000n);
|
|
14
|
+
assert.equal(denoteAmount('100000000000000', 10), 10000000000000n);
|
|
15
|
+
assert.equal(denoteAmount('100', 10), 10n);
|
|
16
|
+
});
|
|
17
|
+
it('Handle amount with 8 decimals', () => {
|
|
18
|
+
// For example, Bitcoin uses 8 decimals, this keeps Satoshi as is
|
|
19
|
+
assert.equal(denoteAmount('100000000', 8), 100000000n);
|
|
20
|
+
assert.equal(denoteAmount('100000000000000', 8), 100000000000000n);
|
|
21
|
+
assert.equal(denoteAmount('1', 8), 1n);
|
|
22
|
+
});
|
|
23
|
+
it('Handle amount with 2 decimals', () => {
|
|
24
|
+
assert.equal(denoteAmount('100000000', 2), 100000000n);
|
|
25
|
+
assert.equal(denoteAmount('100000000000000', 2), 100000000000000n);
|
|
26
|
+
assert.equal(denoteAmount('1', 2), 1n);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a cryptocurrency amount from its smallest unit (e.g., wei, satoshi) to a normalized value
|
|
3
|
+
* with 9 decimal places of precision.
|
|
4
|
+
*
|
|
5
|
+
* This function handles the denomination of cryptocurrency amounts by converting from the
|
|
6
|
+
* blockchain's native smallest units (like wei for Ethereum which is 10^-18 ETH, or satoshi for Bitcoin
|
|
7
|
+
* which is 10^-8 BTC) to a standardized format with 9 decimal places for consistent handling across
|
|
8
|
+
* different cryptocurrencies.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} amountAsString - The amount in the cryptocurrency's smallest unit (e.g., wei, satoshi)
|
|
11
|
+
* represented as a string to handle large numbers
|
|
12
|
+
* @param {number} decimals - The number of decimal places used by the cryptocurrency
|
|
13
|
+
* (e.g., 18 for Ethereum, 8 for Bitcoin)
|
|
14
|
+
* @returns {number} The converted amount with 9 decimal places of precision
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Convert 1 ETH in wei (1000000000000000000) to normalized format
|
|
18
|
+
* denoteAmount("1000000000000000000", 18)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Convert 1 BTC in satoshi (100000000) to normalized format
|
|
22
|
+
* denoteAmount("100000000", 8)
|
|
23
|
+
*/
|
|
24
|
+
export default function denoteAmount(amountAsString: string, decimals: number) {
|
|
25
|
+
if (decimals <= 9) return BigInt(amountAsString); // No conversion needed if decimals are 9 or less
|
|
26
|
+
const exponent = BigInt(decimals) - 9n;
|
|
27
|
+
const amount = BigInt(amountAsString);
|
|
28
|
+
return amount / 10n ** exponent; // Denote to 9 decimals
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import deriveBtcAddress from './derive-btc-address.js';
|
|
4
|
+
|
|
5
|
+
describe('BTC Address Derivation', () => {
|
|
6
|
+
it('returns a deterministic BIP44 child address', () => {
|
|
7
|
+
assert.equal(
|
|
8
|
+
deriveBtcAddress(
|
|
9
|
+
'zpub6qpRm6gMdkrXvVKw7qgayHnqJGJkpE4rnYQdyJfZW87ed4Fk6HjVaThN12hv2rrL3EzfvvBW6ZpbMEe5UxZYEjhgeMigyvAbS5LiXPkKrys',
|
|
10
|
+
1,
|
|
11
|
+
),
|
|
12
|
+
'bc1qspcam3ntdpvhgz4vnxfdhas6qr8hf8tjfaz5p4',
|
|
13
|
+
);
|
|
14
|
+
assert.equal(
|
|
15
|
+
deriveBtcAddress(
|
|
16
|
+
'zpub6qpRm6gMdkrXvVKw7qgayHnqJGJkpE4rnYQdyJfZW87ed4Fk6HjVaThN12hv2rrL3EzfvvBW6ZpbMEe5UxZYEjhgeMigyvAbS5LiXPkKrys',
|
|
17
|
+
2,
|
|
18
|
+
),
|
|
19
|
+
'bc1qd0a7znq3pz3sc4armthddkyam57ey7qjc4v6vn',
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HDKey } from '@scure/bip32';
|
|
2
|
+
import { NETWORK, p2wpkh, TEST_NETWORK } from '@scure/btc-signer';
|
|
3
|
+
|
|
4
|
+
// const resolvePath = (prefix) => {
|
|
5
|
+
// if (prefix === 'x') return `m/44'/0'`;
|
|
6
|
+
// if (prefix === 'y') return `m/49'/0'`;
|
|
7
|
+
// if (prefix === 'z') return `m/84'/0'`;
|
|
8
|
+
// if (prefix === 't') return `m/44'/1'`;
|
|
9
|
+
// if (prefix === 'u') return `m/49'/1'`;
|
|
10
|
+
// if (prefix === 'v') return `m/84'/1'`;
|
|
11
|
+
// return `m`;
|
|
12
|
+
// };
|
|
13
|
+
|
|
14
|
+
const resolveNetwork = (prefix) => {
|
|
15
|
+
if (['x', 'y', 'z'].includes(prefix)) return NETWORK;
|
|
16
|
+
return TEST_NETWORK;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default (xpub, index) => {
|
|
20
|
+
const prefix = xpub.slice(0, 1);
|
|
21
|
+
if (prefix !== 'z' && prefix !== 'v')
|
|
22
|
+
throw new Error('Cryptopay only supports native segwit (zpub/vpub) extended key format for BTC');
|
|
23
|
+
|
|
24
|
+
const hardenedMaster = HDKey.fromExtendedKey(
|
|
25
|
+
xpub,
|
|
26
|
+
prefix === 'z'
|
|
27
|
+
? {
|
|
28
|
+
public: 0x04b24746, // zpub public
|
|
29
|
+
private: 0x04b2430c, // zpriv private
|
|
30
|
+
}
|
|
31
|
+
: {
|
|
32
|
+
public: 0x045f1cf6,
|
|
33
|
+
private: 0x045f18bc,
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
hardenedMaster.wipePrivateData(); // Neuter
|
|
37
|
+
|
|
38
|
+
const child = hardenedMaster.deriveChild(0).deriveChild(index);
|
|
39
|
+
|
|
40
|
+
// We don't need this AFAIK:
|
|
41
|
+
// const derivationPath = resolvePath(prefix);
|
|
42
|
+
// const child = hardenedMaster.derive(`${derivationPath}/0/${btcDerivationNumber}`);
|
|
43
|
+
|
|
44
|
+
const network = resolveNetwork(prefix);
|
|
45
|
+
const pubKey = p2wpkh(child.publicKey /* hex.decode( as string)*/, network);
|
|
46
|
+
|
|
47
|
+
return pubKey.address;
|
|
48
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import deriveEthAddress from './derive-eth-address.js';
|
|
4
|
+
|
|
5
|
+
describe('ETH Address Derivation', () => {
|
|
6
|
+
it('returns a deterministic BIP44 child address', () => {
|
|
7
|
+
assert.equal(
|
|
8
|
+
deriveEthAddress(
|
|
9
|
+
'xpub6DTksA6DsGUgbEp1U29v3qGTt5P99iKThaqGEzerTfD73ZAg1F8j15TxWTPEjjA1uw1Zmwwc5dgVCXwTL2ZNhvdoLWNdqVuL1MDJMsQCLLs',
|
|
10
|
+
1,
|
|
11
|
+
),
|
|
12
|
+
'0x11CF7d607A1Dc45a002592891fF25DAAE6eC7dE9',
|
|
13
|
+
);
|
|
14
|
+
assert.equal(
|
|
15
|
+
deriveEthAddress(
|
|
16
|
+
'xpub6DTksA6DsGUgbEp1U29v3qGTt5P99iKThaqGEzerTfD73ZAg1F8j15TxWTPEjjA1uw1Zmwwc5dgVCXwTL2ZNhvdoLWNdqVuL1MDJMsQCLLs',
|
|
17
|
+
2,
|
|
18
|
+
),
|
|
19
|
+
'0x61663D505e3aB5b61a5344eA2c64b644c08013ea',
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HDKey } from '@scure/bip32';
|
|
2
|
+
import { keccak_256 } from '@noble/hashes/sha3';
|
|
3
|
+
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
4
|
+
|
|
5
|
+
function getChecksumAddress(address) {
|
|
6
|
+
const chars = address.split('');
|
|
7
|
+
const expanded = new Uint8Array(40);
|
|
8
|
+
for (let i = 0; i < 40; i++) {
|
|
9
|
+
expanded[i] = chars[i].charCodeAt(0);
|
|
10
|
+
}
|
|
11
|
+
const hashed = keccak_256(expanded);
|
|
12
|
+
|
|
13
|
+
for (let i = 0; i < 40; i += 2) {
|
|
14
|
+
if (hashed[i >> 1] >> 4 >= 8) {
|
|
15
|
+
chars[i] = chars[i].toUpperCase();
|
|
16
|
+
}
|
|
17
|
+
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
|
18
|
+
chars[i + 1] = chars[i + 1].toUpperCase();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return '0x' + chars.join('');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default (xpub, index) => {
|
|
26
|
+
const hardenedMaster = HDKey.fromExtendedKey(xpub);
|
|
27
|
+
hardenedMaster.wipePrivateData(); // Neuter
|
|
28
|
+
|
|
29
|
+
const child = hardenedMaster.deriveChild(0).deriveChild(index);
|
|
30
|
+
|
|
31
|
+
// ETH Address (secp256k1 + keccak_256 + checksum)
|
|
32
|
+
const childSigningKey = secp256k1.ProjectivePoint.fromHex(child.publicKey).toRawBytes(false);
|
|
33
|
+
const address = Buffer.from(keccak_256(childSigningKey.slice(1)))
|
|
34
|
+
.toString('hex')
|
|
35
|
+
.substring(24);
|
|
36
|
+
|
|
37
|
+
return getChecksumAddress(address);
|
|
38
|
+
};
|