@exodus/solana-api 3.11.2 → 3.11.3

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,15 @@
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.3](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.2...@exodus/solana-api@3.11.3) (2024-10-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * solana-api to use the right tokenAssetType ([#4331](https://github.com/ExodusMovement/assets/issues/4331)) ([d8f0be9](https://github.com/ExodusMovement/assets/commit/d8f0be9be29f286a75a6fdc2c112f004d7816842))
12
+
13
+
14
+
6
15
  ## [3.11.2](https://github.com/ExodusMovement/assets/compare/@exodus/solana-api@3.11.1...@exodus/solana-api@3.11.2) (2024-10-10)
7
16
 
8
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-api",
3
- "version": "3.11.2",
3
+ "version": "3.11.3",
4
4
  "description": "Exodus internal Solana asset API wrapper",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -31,7 +31,7 @@
31
31
  "@exodus/models": "^12.0.1",
32
32
  "@exodus/simple-retry": "^0.0.6",
33
33
  "@exodus/solana-lib": "^3.6.0",
34
- "@exodus/solana-meta": "^2.0.0",
34
+ "@exodus/solana-meta": "^2.0.2",
35
35
  "@exodus/timer": "^1.1.1",
36
36
  "bn.js": "^4.11.0",
37
37
  "debug": "^4.1.1",
@@ -45,9 +45,9 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@exodus/assets-testing": "^1.0.0",
48
- "@exodus/solana-web3.js": "^1.63.1-exodus.9-rc2"
48
+ "@exodus/solana-web3.js": "^1.63.1-exodus.9-rc3"
49
49
  },
50
- "gitHead": "45abf17ba22cc6a66b112118ee2157dc55bcbde0",
50
+ "gitHead": "f40ca3367fd84bc4c899c2dfea76004547fb111d",
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
@@ -33,10 +33,11 @@ const FORCE_HTTP = true // use https over ws
33
33
 
34
34
  // Tokens + SOL api support
35
35
  export class Api {
36
- constructor({ rpcUrl, wsUrl, assets, txsLimit }) {
36
+ constructor({ rpcUrl, wsUrl, assets, txsLimit, tokenAssetType = 'SOLANA_TOKEN' }) {
37
37
  this.setServer(rpcUrl)
38
38
  this.setWsEndpoint(wsUrl)
39
39
  this.setTokens(assets)
40
+ this.tokenAssetType = tokenAssetType
40
41
  this.tokensToSkip = {}
41
42
  this.txsLimit = txsLimit
42
43
  this.connections = {}
@@ -57,7 +58,7 @@ export class Api {
57
58
  }
58
59
 
59
60
  setTokens(assets = {}) {
60
- const solTokens = lodash.pickBy(assets, (asset) => asset.assetType === 'SOLANA_TOKEN')
61
+ const solTokens = lodash.pickBy(assets, (asset) => asset.assetType === this.tokenAssetType)
61
62
  this.tokens = new Map(Object.values(solTokens).map((v) => [v.mintAddress, v]))
62
63
  }
63
64
 
@@ -266,7 +266,11 @@ export class SolanaMonitor extends BaseMonitor {
266
266
  item.data.meta = tx.data.meta
267
267
  }
268
268
 
269
- if (asset.assetType === 'SOLANA_TOKEN' && item.feeAmount && item.feeAmount.isPositive) {
269
+ if (
270
+ asset.assetType === this.api.tokenAssetType &&
271
+ item.feeAmount &&
272
+ item.feeAmount.isPositive
273
+ ) {
270
274
  const feeItem = {
271
275
  ..._.clone(item),
272
276
  coinName: feeAsset.name,
package/src/tx-send.js CHANGED
@@ -44,7 +44,7 @@ export const createAndBroadcastTXFactory =
44
44
  walletAccount,
45
45
  })
46
46
 
47
- const isToken = asset.assetType === 'SOLANA_TOKEN'
47
+ const isToken = asset.assetType === api.tokenAssetType
48
48
 
49
49
  // Check if receiver has address active when sending tokens.
50
50
  if (isToken) {