@exodus/solana-api 1.4.4 → 1.4.5

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 +7 -5
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.5",
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": "bb5c9d32448313fc724739be2e3583926946c42e"
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'
@@ -629,12 +630,12 @@ class Api {
629
630
  return result || null
630
631
  }
631
632
 
632
- simulateTransaction = async (transaction, options) => {
633
+ simulateTransaction = async (encodedTransaction, options) => {
633
634
  const {
634
635
  value: { accounts },
635
636
  } = await this.api.post({
636
637
  method: 'simulateTransaction',
637
- params: [transaction.serialize({ verifySignatures: false }).toString('base64'), options],
638
+ params: [encodedTransaction, options],
638
639
  })
639
640
 
640
641
  return accounts
@@ -702,9 +703,10 @@ class Api {
702
703
  /**
703
704
  * Simulate transaction and return side effects
704
705
  */
705
- simulateAndRetrieveSideEffects = async (transaction, publicKey: string) => {
706
- const { config, accountAddresses } = getTransactionSimulationParams(transaction)
707
- const futureAccountsState = await this.simulateTransaction(transaction, config)
706
+ simulateAndRetrieveSideEffects = async (transactionMessage, publicKey: string) => {
707
+ const { config, accountAddresses } = getTransactionSimulationParams(transactionMessage)
708
+ const encodedTransaction = buildRawTransaction(transactionMessage.serialize()).toString('base64')
709
+ const futureAccountsState = await this.simulateTransaction(encodedTransaction, config)
708
710
  const { solAccounts, tokenAccounts } = filterAccountsByOwner(
709
711
  futureAccountsState,
710
712
  accountAddresses,