@exodus/solana-lib 3.2.1 → 3.3.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-lib",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Exodus internal Solana low-level library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@solana/web3.js": "^1.90.0",
|
|
41
41
|
"bip39": "^2.6.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "50bb8d1b38409b9d099d818f6492657d4f7f6c3d"
|
|
44
44
|
}
|
package/src/key-identifier.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
export const getSupportedPurposes = () => [44]
|
|
8
8
|
|
|
9
9
|
export const createGetKeyIdentifier =
|
|
10
|
-
({ bip44 } = {}) =>
|
|
10
|
+
({ bip44, assetName } = {}) =>
|
|
11
11
|
(partialParams = {}) => {
|
|
12
12
|
assert(typeof bip44 === 'number', 'bip44 must be a number')
|
|
13
13
|
|
|
@@ -31,6 +31,7 @@ export const createGetKeyIdentifier =
|
|
|
31
31
|
case 'phantom':
|
|
32
32
|
// Phantom doesn't use chainIndex (normal vs change address)
|
|
33
33
|
return {
|
|
34
|
+
assetName,
|
|
34
35
|
derivationAlgorithm: 'SLIP10',
|
|
35
36
|
derivationPath: `m/${purpose}'/${unhardenedBip44}'/${accountIndex}'/${addressIndex}'`,
|
|
36
37
|
keyType: 'nacl',
|
|
@@ -38,17 +39,19 @@ export const createGetKeyIdentifier =
|
|
|
38
39
|
case 'ledger':
|
|
39
40
|
case 'trust':
|
|
40
41
|
return {
|
|
42
|
+
assetName,
|
|
41
43
|
derivationAlgorithm: 'SLIP10',
|
|
42
44
|
derivationPath: `m/${purpose}'/${unhardenedBip44}'/${accountIndex}'`,
|
|
43
45
|
keyType: 'nacl',
|
|
44
46
|
}
|
|
45
47
|
case 'mathwallet':
|
|
46
48
|
return {
|
|
49
|
+
assetName,
|
|
47
50
|
derivationAlgorithm: 'BIP32',
|
|
48
51
|
derivationPath: `m/${purpose}'/${unhardenedBip44}'/${accountIndex}'/${addressIndex}`,
|
|
49
52
|
keyType: 'nacl',
|
|
50
53
|
}
|
|
51
54
|
default:
|
|
52
|
-
return _createGetKeyIdentifier({ bip44, keyType: 'nacl' })(params)
|
|
55
|
+
return _createGetKeyIdentifier({ bip44, keyType: 'nacl', assetName })(params)
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -10,7 +10,7 @@ const signMessageWithSigner = async ({ signer, message }) => {
|
|
|
10
10
|
'expected signer with a sign method'
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
return signer.sign({ data: rawMessage })
|
|
13
|
+
return signer.sign({ data: rawMessage, signatureType: 'ed25519' })
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export default signMessageWithSigner
|
|
@@ -66,12 +66,12 @@ const _signTx = async ({ tx, signer }) => {
|
|
|
66
66
|
|
|
67
67
|
const _signVersionedTransaction = async ({ tx, signer, publicKey }) => {
|
|
68
68
|
const messageData = tx.message.serialize()
|
|
69
|
-
const signature = await signer.sign({ data: messageData })
|
|
69
|
+
const signature = await signer.sign({ data: messageData, signatureType: 'ed25519' })
|
|
70
70
|
tx.addSignature(publicKey, signature)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
const _signLegacyTransaction = async ({ tx, signer, publicKey }) => {
|
|
74
74
|
const messageData = tx.compileMessage().serialize()
|
|
75
|
-
const signature = await signer.sign({ data: messageData })
|
|
75
|
+
const signature = await signer.sign({ data: messageData, signatureType: 'ed25519' })
|
|
76
76
|
tx.addSignature(publicKey, signature)
|
|
77
77
|
}
|