@exodus/solana-api 1.2.9 → 1.2.11
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 +4 -3
- package/src/index.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "Exodus internal Solana asset API wrapper",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@exodus/asset-json-rpc": "^1.0.0",
|
|
17
|
-
"@exodus/solana-lib": "^1.2.
|
|
17
|
+
"@exodus/solana-lib": "^1.2.10",
|
|
18
18
|
"lodash": "^4.17.11",
|
|
19
19
|
"wretch": "^1.5.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"node-fetch": "~1.6.3"
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"gitHead": "8778d0f9bea0221cbfab35c8e7781ec5dd4d00af"
|
|
24
25
|
}
|
package/src/index.js
CHANGED
|
@@ -115,21 +115,21 @@ class Api {
|
|
|
115
115
|
let txsId = txsResultsByAccount.reduce((arr, row) => arr.concat(row), []) // merge arrays
|
|
116
116
|
txsId = lodash.uniqBy(txsId, 'signature')
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
// get txs details in parallel
|
|
119
|
+
const txsDetails = await Promise.all(txsId.map((tx) => this.getTransactionById(tx.signature)))
|
|
120
|
+
txsDetails.forEach((txDetail) => {
|
|
121
|
+
if (txDetail === null) return
|
|
122
|
+
|
|
123
|
+
const timestamp = txDetail.blockTime * 1000
|
|
124
|
+
const parsedTx = Api.parseTransaction(address, txDetail, tokenAccountsByOwner)
|
|
125
|
+
if (!parsedTx.from) return // cannot parse it
|
|
126
|
+
|
|
127
127
|
transactions.push({
|
|
128
128
|
timestamp,
|
|
129
129
|
date: new Date(timestamp),
|
|
130
|
-
...
|
|
130
|
+
...parsedTx,
|
|
131
131
|
})
|
|
132
|
-
}
|
|
132
|
+
})
|
|
133
133
|
} catch (err) {
|
|
134
134
|
console.warn('Solana error:', err)
|
|
135
135
|
throw err
|