@exodus/solana-api 2.5.7 → 2.5.9
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/package.json +3 -3
- package/src/api.js +3 -3
- package/src/tx-log/solana-monitor.js +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.9",
|
|
4
4
|
"description": "Exodus internal Solana asset API wrapper",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@exodus/models": "^8.10.4",
|
|
24
24
|
"@exodus/nfts-core": "^0.5.0",
|
|
25
25
|
"@exodus/simple-retry": "^0.0.6",
|
|
26
|
-
"@exodus/solana-lib": "^1.6.
|
|
26
|
+
"@exodus/solana-lib": "^1.6.4",
|
|
27
27
|
"@exodus/solana-meta": "^1.0.2",
|
|
28
28
|
"bn.js": "^4.11.0",
|
|
29
29
|
"debug": "^4.1.1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"url-join": "4.0.0",
|
|
32
32
|
"wretch": "^1.5.2"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "123d67b94e313496373a6ec97447361bb6bec6d7"
|
|
35
35
|
}
|
package/src/api.js
CHANGED
|
@@ -48,7 +48,7 @@ export class Api {
|
|
|
48
48
|
|
|
49
49
|
setTokens(assets = {}) {
|
|
50
50
|
const solTokens = lodash.pickBy(assets, (asset) => asset.assetType === 'SOLANA_TOKEN')
|
|
51
|
-
this.tokens =
|
|
51
|
+
this.tokens = new Map(Object.values(solTokens).map((v) => [v.mintAddress, v]))
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
request(path, contentType = 'application/json'): Wretcher {
|
|
@@ -102,11 +102,11 @@ export class Api {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
getTokenByAddress(mint: string) {
|
|
105
|
-
return this.tokens
|
|
105
|
+
return this.tokens.get(mint)
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
isTokenSupported(mint: string) {
|
|
109
|
-
return
|
|
109
|
+
return this.tokens.has(mint)
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
async getEpochInfo(): number {
|
|
@@ -68,7 +68,7 @@ export class SolanaMonitor extends BaseMonitor {
|
|
|
68
68
|
async emitUnknownTokensEvent({ tokenAccounts }) {
|
|
69
69
|
const tokensList = await this.api.getWalletTokensList({ tokenAccounts })
|
|
70
70
|
const unknownTokensList = tokensList.filter((mintAddress) => {
|
|
71
|
-
return !this.api.tokens
|
|
71
|
+
return !this.api.tokens.has(mintAddress)
|
|
72
72
|
})
|
|
73
73
|
if (unknownTokensList.length > 0) {
|
|
74
74
|
this.emit('unknown-tokens', unknownTokensList)
|
|
@@ -146,6 +146,7 @@ export class SolanaMonitor extends BaseMonitor {
|
|
|
146
146
|
// send transaction
|
|
147
147
|
item.to = tx.to
|
|
148
148
|
item.feeAmount = baseAsset.currency.baseUnit(tx.fee).toDefault() // in SOL
|
|
149
|
+
item.feeCointName = baseAsset.name
|
|
149
150
|
item.coinAmount = item.coinAmount.negate()
|
|
150
151
|
|
|
151
152
|
if (tx.to === tx.owner) {
|
|
@@ -153,7 +154,10 @@ export class SolanaMonitor extends BaseMonitor {
|
|
|
153
154
|
item.coinAmount = asset.currency.ZERO
|
|
154
155
|
}
|
|
155
156
|
} else if (tx.unparsed) {
|
|
156
|
-
if (tx.fee !== 0)
|
|
157
|
+
if (tx.fee !== 0) {
|
|
158
|
+
item.feeAmount = baseAsset.currency.baseUnit(tx.fee).toDefault() // in SOL
|
|
159
|
+
item.feeCointName = baseAsset.name
|
|
160
|
+
}
|
|
157
161
|
|
|
158
162
|
item.data.meta = tx.data.meta
|
|
159
163
|
}
|