@exodus/solana-api 3.11.7 → 3.11.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.11.8](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.6...@exodus/solana-api@3.11.8) (2024-12-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix: prevent invalid account owner (#4485)
13
+
14
+ * fix: SOL rename deprecated methods (#4512)
15
+
16
+
17
+ ### License
18
+
19
+
20
+ * license: re-license under MIT license (#4515)
21
+
22
+
23
+
6
24
  ## [3.11.7](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.6...@exodus/solana-api@3.11.7) (2024-11-06)
7
25
 
8
26
 
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # Solana Api · [![npm version](https://img.shields.io/badge/npm-private-blue.svg?style=flat)](https://www.npmjs.com/package/@exodus/solana-api)
1
+ # @exodus/solana-api
2
+
3
+ Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Solana. See [Asset Packages](../../docs/asset-packages.md) for more detail on this package's role.
4
+
5
+ ## Known Issues
2
6
 
3
7
  - To get all transactions data from an address we gotta call 3 rpcs `getSignaturesForAddress` (get txIds) -> `getTransaction` (get tx details) -> `getBlockTime` (get tx timestamp). Pretty annoying and resource-consuming backend-side. (https://github.com/solana-labs/solana/issues/12411)
4
8
  - calling `getBlockTime` might results in an error if the slot/block requested is too old (https://github.com/solana-labs/solana/issues/12413), looks like some Solana validators can choose to not keep all the ledger blocks (fix in progress by solana team).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.11.7",
4
- "description": "Exodus internal Solana asset API wrapper",
3
+ "version": "3.11.8",
4
+ "description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Solana",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "files": [
@@ -14,7 +14,7 @@
14
14
  "author": "Exodus Movement, Inc.",
15
15
  "license": "ISC",
16
16
  "publishConfig": {
17
- "access": "restricted"
17
+ "access": "public"
18
18
  },
19
19
  "scripts": {
20
20
  "test": "run -T exodus-test --jest",
@@ -26,11 +26,11 @@
26
26
  "@exodus/asset-lib": "^5.0.0",
27
27
  "@exodus/assets": "^11.0.0",
28
28
  "@exodus/basic-utils": "^3.0.1",
29
- "@exodus/currency": "^5.0.2",
29
+ "@exodus/currency": "^6.0.1",
30
30
  "@exodus/fetch": "^1.2.0",
31
31
  "@exodus/models": "^12.0.1",
32
32
  "@exodus/simple-retry": "^0.0.6",
33
- "@exodus/solana-lib": "^3.6.0",
33
+ "@exodus/solana-lib": "^3.9.1",
34
34
  "@exodus/solana-meta": "^2.0.2",
35
35
  "@exodus/timer": "^1.1.1",
36
36
  "bn.js": "^4.11.0",
@@ -47,7 +47,7 @@
47
47
  "@exodus/assets-testing": "^1.0.0",
48
48
  "@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
49
49
  },
50
- "gitHead": "451a0342feffa7ab7dbea8ff7f8e224cbd55c31b",
50
+ "gitHead": "46f31ffb8a59f043ca4bd3855c88d6640ca35a1d",
51
51
  "bugs": {
52
52
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Asolana-api"
53
53
  },
package/src/api.js CHANGED
@@ -137,7 +137,7 @@ export class Api {
137
137
  async getRecentBlockHash(commitment) {
138
138
  const result = await this.rpcCall(
139
139
  'getLatestBlockhash',
140
- [{ commitment: commitment || 'finalized', encoding: 'jsonParsed' }],
140
+ [{ commitment: commitment || 'confirmed', encoding: 'jsonParsed' }],
141
141
  { forceHttp: true }
142
142
  )
143
143
  return lodash.get(result, 'value.blockhash')
@@ -171,7 +171,7 @@ export class Api {
171
171
  return this.rpcCall('getBlockTime', [slot])
172
172
  }
173
173
 
174
- async getConfirmedSignaturesForAddress(address, { until, before, limit } = {}) {
174
+ async getSignaturesForAddress(address, { until, before, limit } = {}) {
175
175
  until = until || undefined
176
176
  return this.rpcCall('getSignaturesForAddress', [address, { until, before, limit }], { address })
177
177
  }
@@ -195,7 +195,7 @@ export class Api {
195
195
 
196
196
  const txsResultsByAccount = await Promise.all(
197
197
  accountsToCheck.map((addr) =>
198
- this.getConfirmedSignaturesForAddress(addr, {
198
+ this.getSignaturesForAddress(addr, {
199
199
  until,
200
200
  before,
201
201
  limit,
@@ -1046,7 +1046,7 @@ export class Api {
1046
1046
  ).toString('base64')
1047
1047
  const { accounts, unitsConsumed, err } = await this.simulateTransaction(encodedTransaction, {
1048
1048
  ...config,
1049
- replaceRecentBlockhash: true,
1049
+ replaceRecentBlockhash: false,
1050
1050
  sigVerify: false,
1051
1051
  })
1052
1052
  return {
package/src/tx-send.js CHANGED
@@ -152,12 +152,14 @@ export const createAndBroadcastTXFactory =
152
152
  }
153
153
  }
154
154
 
155
- const { unitsConsumed: computeUnits } = await api.simulateUnsignedTransaction({
155
+ const { unitsConsumed: computeUnits, err } = await api.simulateUnsignedTransaction({
156
156
  message: transactionForFeeEstimation.message,
157
157
  })
158
158
 
159
+ if (err) throw new Error(err)
160
+
159
161
  unsignedTransaction.txData.priorityFee = priorityFee
160
- unsignedTransaction.txData.computeUnits = computeUnits
162
+ unsignedTransaction.txData.computeUnits = computeUnits * feeData.computeUnitsMultiplier
161
163
 
162
164
  const { txId, rawTx } = await assetClientInterface.signTransaction({
163
165
  assetName: baseAsset.name,