@exodus/solana-lib 3.3.1 → 3.4.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.1",
3
+ "version": "3.4.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": "45964c12e52066c643ee1b6c906eb898baad1088"
43
+ "gitHead": "b6fa8852ada6a3b2de7d2a8c6f0f74c3c6aac7e7"
44
44
  }
@@ -1,5 +1,6 @@
1
1
  import { isNumberUnit } from '@exodus/currency'
2
2
  import BN from 'bn.js'
3
+ import { VersionedTransaction } from '@exodus/solana-web3.js'
3
4
 
4
5
  import { ComputeBudgetProgram, PublicKey } from '../vendor'
5
6
  import Transaction from '../transaction'
@@ -25,7 +26,19 @@ const addComputeBudgetToTransaction = ({ transaction, computeUnits }) => {
25
26
  * @returns a Solana Web3.js Transaction object
26
27
  */
27
28
  export function prepareForSigning(unsignedTx) {
28
- const { amount: unitAmount, fee: feeAmount, from, method, transaction } = unsignedTx.txData
29
+ const {
30
+ amount: unitAmount,
31
+ fee: feeAmount,
32
+ from,
33
+ method,
34
+ transaction,
35
+ transactionBuffer,
36
+ } = unsignedTx.txData
37
+
38
+ // Recreate a Web3.js Transaction instance if the buffer provided.
39
+ if (transactionBuffer) {
40
+ return VersionedTransaction.deserialize(transactionBuffer)
41
+ }
29
42
 
30
43
  if (!transaction) {
31
44
  // Create a transaction in web3.js format