@unchainedshop/plugins 4.0.0-rc.13 → 4.0.0-rc.14
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,6 +1,6 @@
|
|
|
1
1
|
import { HDKey } from '@scure/bip32';
|
|
2
|
-
import { keccak_256 } from '@noble/hashes/sha3';
|
|
3
|
-
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
2
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
3
|
+
import { secp256k1 } from '@noble/curves/secp256k1.js';
|
|
4
4
|
function getChecksumAddress(address) {
|
|
5
5
|
const chars = address.split('');
|
|
6
6
|
const expanded = new Uint8Array(40);
|
|
@@ -23,7 +23,7 @@ export default (xpub, index) => {
|
|
|
23
23
|
hardenedMaster.wipePrivateData(); // Neuter
|
|
24
24
|
const child = hardenedMaster.deriveChild(0).deriveChild(index);
|
|
25
25
|
// ETH Address (secp256k1 + keccak_256 + checksum)
|
|
26
|
-
const childSigningKey = secp256k1.
|
|
26
|
+
const childSigningKey = secp256k1.Point.fromBytes(child.publicKey).toBytes(false);
|
|
27
27
|
const address = Buffer.from(keccak_256(childSigningKey.slice(1)))
|
|
28
28
|
.toString('hex')
|
|
29
29
|
.substring(24);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-eth-address.js","sourceRoot":"","sources":["../../../src/payment/cryptopay/derive-eth-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"derive-eth-address.js","sourceRoot":"","sources":["../../../src/payment/cryptopay/derive-eth-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CA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AC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE/D,kDAAkD;IAClD,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClF,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9D,QAAQ,CAAC,KAAK,CAAC;SACf,SAAS,CAAC,EAAE,CAAC,CAAC;IAEjB,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/plugins",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.14",
|
|
4
4
|
"main": "lib/plugins-index.js",
|
|
5
5
|
"types": "lib/plugins-index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@unchainedshop/api": "^4.0.0-rc.
|
|
38
|
-
"@unchainedshop/core-delivery": "^4.0.0-rc.
|
|
39
|
-
"@unchainedshop/core-enrollments": "^4.0.0-rc.
|
|
40
|
-
"@unchainedshop/core-orders": "^4.0.0-rc.
|
|
41
|
-
"@unchainedshop/core-payment": "^4.0.0-rc.
|
|
42
|
-
"@unchainedshop/core-products": "^4.0.0-rc.
|
|
43
|
-
"@unchainedshop/core-warehousing": "^4.0.0-rc.
|
|
44
|
-
"@unchainedshop/core-worker": "^4.0.0-rc.
|
|
45
|
-
"@unchainedshop/events": "^4.0.0-rc.
|
|
46
|
-
"@unchainedshop/file-upload": "^4.0.0-rc.
|
|
47
|
-
"@unchainedshop/logger": "^4.0.0-rc.
|
|
48
|
-
"@unchainedshop/utils": "^4.0.0-rc.
|
|
37
|
+
"@unchainedshop/api": "^4.0.0-rc.14",
|
|
38
|
+
"@unchainedshop/core-delivery": "^4.0.0-rc.14",
|
|
39
|
+
"@unchainedshop/core-enrollments": "^4.0.0-rc.14",
|
|
40
|
+
"@unchainedshop/core-orders": "^4.0.0-rc.14",
|
|
41
|
+
"@unchainedshop/core-payment": "^4.0.0-rc.14",
|
|
42
|
+
"@unchainedshop/core-products": "^4.0.0-rc.14",
|
|
43
|
+
"@unchainedshop/core-warehousing": "^4.0.0-rc.14",
|
|
44
|
+
"@unchainedshop/core-worker": "^4.0.0-rc.14",
|
|
45
|
+
"@unchainedshop/events": "^4.0.0-rc.14",
|
|
46
|
+
"@unchainedshop/file-upload": "^4.0.0-rc.14",
|
|
47
|
+
"@unchainedshop/logger": "^4.0.0-rc.14",
|
|
48
|
+
"@unchainedshop/utils": "^4.0.0-rc.14",
|
|
49
49
|
"event-iterator": "^2.0.0",
|
|
50
50
|
"JSONStream": "^1.3.5"
|
|
51
51
|
},
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@breejs/later": "^4.2.0",
|
|
55
55
|
"@paypal/checkout-server-sdk": "1.x",
|
|
56
56
|
"@redis/client": ">= 1 < 6",
|
|
57
|
-
"@scure/bip32": ">=
|
|
58
|
-
"@scure/btc-signer": ">=
|
|
57
|
+
"@scure/bip32": ">= 2",
|
|
58
|
+
"@scure/btc-signer": ">= 2",
|
|
59
59
|
"expiry-map": "2.x",
|
|
60
60
|
"express": ">= 5 < 6",
|
|
61
61
|
"fastify": ">= 5.2 < 6",
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"@breejs/later": "^4.2.0",
|
|
126
126
|
"@paypal/checkout-server-sdk": "^1.0.3",
|
|
127
127
|
"@redis/client": "^5.6.0",
|
|
128
|
-
"@scure/bip32": "^
|
|
129
|
-
"@scure/btc-signer": "^
|
|
128
|
+
"@scure/bip32": "^2.0.0",
|
|
129
|
+
"@scure/btc-signer": "^2.0.0",
|
|
130
130
|
"@types/breejs__later": "^4.1.5",
|
|
131
131
|
"@types/express": "^5.0.3",
|
|
132
132
|
"@types/node": "^24.0.13",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HDKey } from '@scure/bip32';
|
|
2
|
-
import { keccak_256 } from '@noble/hashes/sha3';
|
|
3
|
-
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
2
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
3
|
+
import { secp256k1 } from '@noble/curves/secp256k1.js';
|
|
4
4
|
|
|
5
5
|
function getChecksumAddress(address) {
|
|
6
6
|
const chars = address.split('');
|
|
@@ -29,7 +29,7 @@ export default (xpub, index) => {
|
|
|
29
29
|
const child = hardenedMaster.deriveChild(0).deriveChild(index);
|
|
30
30
|
|
|
31
31
|
// ETH Address (secp256k1 + keccak_256 + checksum)
|
|
32
|
-
const childSigningKey = secp256k1.
|
|
32
|
+
const childSigningKey = secp256k1.Point.fromBytes(child.publicKey).toBytes(false);
|
|
33
33
|
const address = Buffer.from(keccak_256(childSigningKey.slice(1)))
|
|
34
34
|
.toString('hex')
|
|
35
35
|
.substring(24);
|