@exodus/solana-plugin 1.9.0 → 1.9.1
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-plugin",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Exodus internal Solana asset plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@exodus/assets": "^9.0.1",
|
|
23
23
|
"@exodus/bip44-constants": "^195.0.0",
|
|
24
24
|
"@exodus/solana-api": "^3.4.1",
|
|
25
|
-
"@exodus/solana-lib": "^3.
|
|
25
|
+
"@exodus/solana-lib": "^3.3.1",
|
|
26
26
|
"@exodus/solana-meta": "^1.0.7",
|
|
27
27
|
"@exodus/web3-solana-utils": "^1.65.0",
|
|
28
28
|
"minimalistic-assert": "^1.0.1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@exodus/assets-testing": "^1.0.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "45964c12e52066c643ee1b6c906eb898baad1088"
|
|
35
35
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createGetKeyIdentifier,
|
|
5
5
|
getAddressFromPublicKey,
|
|
6
6
|
getEncodedSecretKey,
|
|
7
|
+
fillTransactionWithEmptySignatureSlot,
|
|
7
8
|
isValidAddress,
|
|
8
9
|
parseUnsignedTx,
|
|
9
10
|
prepareForSigning,
|
|
@@ -173,7 +174,11 @@ export const createSolanaAssetFactory =
|
|
|
173
174
|
: signMessageNew({ privateKey, message }),
|
|
174
175
|
staking: assetStakingApi,
|
|
175
176
|
validateAssetId: isValidAddress,
|
|
176
|
-
web3: createWeb3API({
|
|
177
|
+
web3: createWeb3API({
|
|
178
|
+
asset: base,
|
|
179
|
+
prepareForSigning,
|
|
180
|
+
fillTransactionWithEmptySignatureSlot,
|
|
181
|
+
}),
|
|
177
182
|
}
|
|
178
183
|
|
|
179
184
|
const fullAsset = {
|
|
@@ -2,16 +2,29 @@ import assert from 'minimalistic-assert'
|
|
|
2
2
|
import { createSimulateTransactions as createSimulateSolanaTransactions } from '@exodus/web3-solana-utils'
|
|
3
3
|
|
|
4
4
|
// This function accepts either a list of transactions created by a wallet (unsignedTxs) or a web3 transaction (transactionBuffers).
|
|
5
|
-
export const createSimulateTransactions = ({
|
|
5
|
+
export const createSimulateTransactions = ({
|
|
6
|
+
asset,
|
|
7
|
+
prepareForSigning,
|
|
8
|
+
fillTransactionWithEmptySignatureSlot,
|
|
9
|
+
}) => {
|
|
6
10
|
assert(asset, '"asset" should be passed.')
|
|
7
11
|
assert(prepareForSigning, '"prepareForSigning" should be passed.')
|
|
12
|
+
assert(
|
|
13
|
+
fillTransactionWithEmptySignatureSlot,
|
|
14
|
+
'"fillTransactionWithEmptySignatureSlot" should be passed.'
|
|
15
|
+
)
|
|
8
16
|
|
|
9
17
|
const simulateSolanaTransactions = createSimulateSolanaTransactions()
|
|
10
18
|
|
|
11
19
|
return function simulateTransactions({ transactionBuffers, unsignedTxs, ...restParameters }) {
|
|
12
20
|
if (unsignedTxs) {
|
|
13
21
|
// Converts to web3.js Transaction class instances.
|
|
14
|
-
const transactions = unsignedTxs.map(
|
|
22
|
+
const transactions = unsignedTxs.map((unsignedTx) => {
|
|
23
|
+
const transaction = prepareForSigning(unsignedTx)
|
|
24
|
+
fillTransactionWithEmptySignatureSlot({ transaction, publicKey: transaction.feePayer })
|
|
25
|
+
|
|
26
|
+
return transaction
|
|
27
|
+
})
|
|
15
28
|
|
|
16
29
|
return simulateSolanaTransactions({
|
|
17
30
|
asset,
|