@exodus/solana-lib 1.6.1 → 1.6.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-lib",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Exodus internal Solana low-level library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@exodus/asset-lib": "^3.7.1",
|
|
17
|
-
"@exodus/assets": "^8.0.74",
|
|
18
17
|
"@exodus/buffer-layout": "^1.2.0-exodus1",
|
|
19
18
|
"@exodus/models": "^8.10.4",
|
|
19
|
+
"@exodus/solana-meta": "^1.0.2",
|
|
20
20
|
"@exodus/solana-spl-token": "0.1.8-exodus.1",
|
|
21
21
|
"@project-serum/serum": "0.13.64",
|
|
22
22
|
"bn.js": "^4.11.0",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"lodash": "^4.17.11",
|
|
27
27
|
"tweetnacl": "^1.0.3"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "a7b27e4f299057c16dda446f006fa61a945a6cbf"
|
|
30
30
|
}
|
package/src/fee-data/solana.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeeData } from '@exodus/asset-lib'
|
|
2
|
-
import
|
|
2
|
+
import { asset } from '@exodus/solana-meta'
|
|
3
3
|
|
|
4
4
|
export default new FeeData({
|
|
5
5
|
config: {
|
|
@@ -7,5 +7,5 @@ export default new FeeData({
|
|
|
7
7
|
fuelThreshold: '0.000015 SOL',
|
|
8
8
|
},
|
|
9
9
|
mainKey: 'fee',
|
|
10
|
-
currency:
|
|
10
|
+
currency: asset.currency,
|
|
11
11
|
})
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { asset } from '@exodus/solana-meta'
|
|
2
2
|
import type { UnsignedTransaction, ParsedTransaction } from '@exodus/models/lib/types'
|
|
3
3
|
|
|
4
4
|
export function parseUnsignedTx(unsignedTx: UnsignedTransaction): ParsedTransaction {
|
|
5
|
-
const asset = assets.solana
|
|
6
5
|
const {
|
|
7
6
|
from,
|
|
8
7
|
to,
|
|
@@ -32,7 +31,6 @@ export function parseUnsignedTx(unsignedTx: UnsignedTransaction): ParsedTransact
|
|
|
32
31
|
const amount = asset.currency.baseUnit(txData.amount)
|
|
33
32
|
const fee = asset.currency.baseUnit(txData.fee)
|
|
34
33
|
return {
|
|
35
|
-
asset,
|
|
36
34
|
from: [from],
|
|
37
35
|
to,
|
|
38
36
|
amount,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import assets from '@exodus/assets'
|
|
1
|
+
import { asset } from '@exodus/solana-meta'
|
|
3
2
|
import type { UnsignedTransaction, SignedTransaction } from '@exodus/models/lib/types'
|
|
4
3
|
|
|
5
4
|
import { Transaction, getTransactionStrategy } from '../'
|
|
@@ -14,17 +13,12 @@ export function signUnsignedTx(
|
|
|
14
13
|
return _signTx({ tx: transaction, privateKey })
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
const asset = assets.solana
|
|
18
16
|
const address = from
|
|
19
17
|
const amount = unitAmount ? asset.currency.baseUnit(unitAmount).toNumber() : unitAmount
|
|
20
18
|
|
|
21
|
-
const
|
|
22
|
-
asset,
|
|
23
|
-
address,
|
|
24
|
-
amount,
|
|
25
|
-
})
|
|
19
|
+
const txData = { ...unsignedTx.txData, address, amount }
|
|
26
20
|
|
|
27
|
-
const tx = createTx({ txData
|
|
21
|
+
const tx = createTx({ txData, method })
|
|
28
22
|
return _signTx({ tx, privateKey })
|
|
29
23
|
}
|
|
30
24
|
|
|
@@ -12,15 +12,17 @@ export function getTransactionSimulationParams(transactionMessage) {
|
|
|
12
12
|
commitment: 'confirmed',
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const accountAddresses = new Set()
|
|
16
|
+
|
|
16
17
|
if (!transactionMessage.accountKeys) {
|
|
17
18
|
const programIds = new Set(
|
|
18
19
|
transactionMessage.instructions.map((instruction) => instruction.programId.toString())
|
|
19
20
|
)
|
|
21
|
+
|
|
20
22
|
transactionMessage.instructions.forEach((instruction) => {
|
|
21
23
|
instruction.keys.forEach((key) => {
|
|
22
24
|
if (!programIds.has(key.pubkey.toString())) {
|
|
23
|
-
accountAddresses.
|
|
25
|
+
accountAddresses.add(key.pubkey.toString())
|
|
24
26
|
}
|
|
25
27
|
})
|
|
26
28
|
})
|
|
@@ -35,19 +37,19 @@ export function getTransactionSimulationParams(transactionMessage) {
|
|
|
35
37
|
)
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
transactionMessage.accountKeys
|
|
39
41
|
.filter((_, index) => !indexToProgramIds.has(index))
|
|
40
|
-
.
|
|
42
|
+
.forEach((account) => accountAddresses.add(account.toString()))
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
config['accounts'] = {
|
|
44
46
|
encoding: 'base64',
|
|
45
|
-
addresses: accountAddresses,
|
|
47
|
+
addresses: Array.from(accountAddresses),
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
return {
|
|
49
51
|
config,
|
|
50
|
-
accountAddresses,
|
|
52
|
+
accountAddresses: Array.from(accountAddresses),
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
|