solana-risk-engine 0.4.0 → 0.4.1
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 +1 -1
- package/src/holders.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-risk-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Explainable risk analysis for Solana tokens and wallets: creator control, real holder concentration, inflated liquidity, impostor tokens, funder clusters and PnL. Zero dependencies, runs in Node and the browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/holders.js
CHANGED
|
@@ -64,7 +64,13 @@ export async function findFunder(client, addr) {
|
|
|
64
64
|
}
|
|
65
65
|
if (!reachedEnd || !sigs || !sigs.length) return null;
|
|
66
66
|
const earliest = sigs[sigs.length - 1].signature;
|
|
67
|
-
|
|
67
|
+
// version 1 is needed for recent transactions; an older RPC that does not know it yet gets 0
|
|
68
|
+
let tx;
|
|
69
|
+
try { tx = await client.rpc("getTransaction", [earliest, { maxSupportedTransactionVersion: 1, encoding: "jsonParsed" }]); }
|
|
70
|
+
catch (e) {
|
|
71
|
+
if (isCancel(e) || !/version|invalid param/i.test(e.message || "")) throw e;
|
|
72
|
+
tx = await client.rpc("getTransaction", [earliest, { maxSupportedTransactionVersion: 0, encoding: "jsonParsed" }]);
|
|
73
|
+
}
|
|
68
74
|
const keys = tx && tx.transaction && tx.transaction.message && tx.transaction.message.accountKeys;
|
|
69
75
|
if (!keys || !keys.length) return null;
|
|
70
76
|
const payer = keys[0] && (keys[0].pubkey !== undefined ? keys[0].pubkey : keys[0]);
|