@exodus/solana-api 2.0.1 → 2.0.2

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 +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
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.6",
17
+ "@exodus/solana-lib": "^1.3.7",
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": "90859f94717cf2b928cb93b030ecfba523b8179e"
25
+ "gitHead": "342e5908cd9a4b4806acbb2b7286549e2ed3d80b"
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
+ SolanaWeb3Message,
13
14
  buildRawTransaction,
14
15
  } from '@exodus/solana-lib'
15
16
  import assets from '@exodus/assets'
@@ -458,7 +459,9 @@ class Api {
458
459
  }
459
460
 
460
461
  async getSupply(mintAddress: string): string {
461
- const { value: { amount } } = await this.api.post({
462
+ const {
463
+ value: { amount },
464
+ } = await this.api.post({
462
465
  method: 'getTokenSupply',
463
466
  params: [mintAddress],
464
467
  })
@@ -788,11 +791,15 @@ class Api {
788
791
  /**
789
792
  * Simulate transaction and return side effects
790
793
  */
791
- simulateAndRetrieveSideEffects = async (transactionMessage, publicKey: string) => {
794
+ simulateAndRetrieveSideEffects = async (
795
+ transactionMessage: SolanaWeb3Message,
796
+ publicKey: string
797
+ ) => {
792
798
  const { config, accountAddresses } = getTransactionSimulationParams(transactionMessage)
799
+ const signatures = new Array(transactionMessage.header.numRequiredSignatures || 1).fill(null)
793
800
  const encodedTransaction = buildRawTransaction(
794
801
  transactionMessage.serialize(),
795
- transactionMessage.header.numRequiredSignatures || 1
802
+ signatures
796
803
  ).toString('base64')
797
804
  const futureAccountsState = await this.simulateTransaction(encodedTransaction, config)
798
805
  const { solAccounts, tokenAccounts } = filterAccountsByOwner(