@exodus/solana-api 1.4.4 → 1.4.6

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.js +8 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Exodus internal Solana asset API wrapper",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@exodus/asset-json-rpc": "^1.0.0",
17
- "@exodus/solana-lib": "^1.3.3",
17
+ "@exodus/solana-lib": "^1.3.4",
18
18
  "lodash": "^4.17.11",
19
19
  "url-join": "4.0.0",
20
20
  "wretch": "^1.5.2"
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "node-fetch": "~1.6.3"
24
24
  },
25
- "gitHead": "e0c7ce8b006cb8cfc78bbd86769b7b5b1890e72b"
25
+ "gitHead": "76290b106fad2a9a5c16aac54efce3e6f60b4ec4"
26
26
  }
package/src/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  TOKEN_PROGRAM_ID,
11
11
  SOL_DECIMAL,
12
12
  computeBalance,
13
+ buildRawTransaction,
13
14
  } from '@exodus/solana-lib'
14
15
  import assets from '@exodus/assets'
15
16
  import assert from 'assert'
@@ -67,8 +68,7 @@ class Api {
67
68
  const {
68
69
  value: { blockhash },
69
70
  } = await this.api.post({
70
- method: 'getLatestBlockhash',
71
- params: [{ commitment : 'confirmed' }],
71
+ method: 'getRecentBlockhash',
72
72
  })
73
73
  return blockhash
74
74
  }
@@ -629,12 +629,12 @@ class Api {
629
629
  return result || null
630
630
  }
631
631
 
632
- simulateTransaction = async (transaction, options) => {
632
+ simulateTransaction = async (encodedTransaction, options) => {
633
633
  const {
634
634
  value: { accounts },
635
635
  } = await this.api.post({
636
636
  method: 'simulateTransaction',
637
- params: [transaction.serialize({ verifySignatures: false }).toString('base64'), options],
637
+ params: [encodedTransaction, options],
638
638
  })
639
639
 
640
640
  return accounts
@@ -702,9 +702,10 @@ class Api {
702
702
  /**
703
703
  * Simulate transaction and return side effects
704
704
  */
705
- simulateAndRetrieveSideEffects = async (transaction, publicKey: string) => {
706
- const { config, accountAddresses } = getTransactionSimulationParams(transaction)
707
- const futureAccountsState = await this.simulateTransaction(transaction, config)
705
+ simulateAndRetrieveSideEffects = async (transactionMessage, publicKey: string) => {
706
+ const { config, accountAddresses } = getTransactionSimulationParams(transactionMessage)
707
+ const encodedTransaction = buildRawTransaction(transactionMessage.serialize()).toString('base64')
708
+ const futureAccountsState = await this.simulateTransaction(encodedTransaction, config)
708
709
  const { solAccounts, tokenAccounts } = filterAccountsByOwner(
709
710
  futureAccountsState,
710
711
  accountAddresses,