@exodus/solana-api 1.2.17 → 1.2.18
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 +2 -2
- package/src/index.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"description": "Exodus internal Solana asset API wrapper",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"node-fetch": "~1.6.3"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "d65135b4c452dda913c1673a4465b0438f2d51ec"
|
|
26
26
|
}
|
package/src/index.js
CHANGED
|
@@ -242,7 +242,9 @@ class Api {
|
|
|
242
242
|
'tokenAccountsByOwner is required when parsing token tx'
|
|
243
243
|
)
|
|
244
244
|
let tokenTxs = lodash
|
|
245
|
-
.filter(instructions, { program
|
|
245
|
+
.filter(instructions, ({ program, type }) => {
|
|
246
|
+
return program === 'spl-token' && ['transfer', 'transferChecked'].includes(type)
|
|
247
|
+
}) // get Token transfer: could have more than 1 instructions
|
|
246
248
|
.map((ix) => {
|
|
247
249
|
// add token details based on source/destination address
|
|
248
250
|
let tokenAccount = lodash.find(tokenAccountsByOwner, { tokenAccountAddress: ix.source })
|
|
@@ -261,7 +263,7 @@ class Api {
|
|
|
261
263
|
token: tokenAccount,
|
|
262
264
|
from: ix.source,
|
|
263
265
|
to: ix.destination,
|
|
264
|
-
amount: Number(ix.amount), //
|
|
266
|
+
amount: Number(ix.amount || lodash.get(ix, 'tokenAmount.amount', 0)), // supporting both types: transfer and transferChecked
|
|
265
267
|
fee: isSending ? fee : 0, // in lamports
|
|
266
268
|
}
|
|
267
269
|
})
|