cryptoiz-mcp 4.16.11 → 4.16.12
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/index.js +22 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var VERSION = 'v4.16.
|
|
2
|
+
var VERSION = 'v4.16.12';
|
|
3
3
|
var GATEWAY = 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-x402-gateway';
|
|
4
|
+
// FIX v4.16.12: route ALL paid tools to gateway. Per-tool endpoints (mcp-alpha-scanner etc.)
|
|
5
|
+
// have stale hardcoded fee payer that breaks after Dexter key rotation. Gateway has dynamic
|
|
6
|
+
// fee payer fetched from /supported. Single source of truth = no per-tool drift.
|
|
4
7
|
var TOOL_ENDPOINTS = {
|
|
5
|
-
get_whale_alpha:
|
|
6
|
-
get_whale_divergence:
|
|
7
|
-
get_whale_accumulation:
|
|
8
|
-
get_whale_neutral:
|
|
9
|
-
get_whale_distribution:
|
|
10
|
-
get_btc_regime:
|
|
11
|
-
get_btc_futures_signal:
|
|
8
|
+
get_whale_alpha: GATEWAY,
|
|
9
|
+
get_whale_divergence: GATEWAY,
|
|
10
|
+
get_whale_accumulation: GATEWAY,
|
|
11
|
+
get_whale_neutral: GATEWAY,
|
|
12
|
+
get_whale_distribution: GATEWAY,
|
|
13
|
+
get_btc_regime: GATEWAY,
|
|
14
|
+
get_btc_futures_signal: GATEWAY,
|
|
12
15
|
get_token_ca: GATEWAY,
|
|
13
16
|
get_status: GATEWAY,
|
|
14
17
|
};
|
|
@@ -93,18 +96,25 @@ async function buildV2PaymentPayload(amount, feePayerAddr) {
|
|
|
93
96
|
transferData.writeUInt32LE(Math.floor(amount / 0x100000000) & 0xFFFFFFFF, 5);
|
|
94
97
|
transferData[9] = 6;
|
|
95
98
|
var transferIx = { programId: tokenProgramPk, keys: transferKeys, data: transferData };
|
|
96
|
-
// FIX v4.16.
|
|
97
|
-
//
|
|
99
|
+
// FIX v4.16.12: RESTORE Memo instruction in V2 (4-ix tx: Limit+Price+TransferChecked+Memo).
|
|
100
|
+
// Empirical: April 6-8 logs prove V2 with memo accepted by Dexter. Removing memo (v4.16.10)
|
|
101
|
+
// didn't fix anything — the actual bug was Dexter key rotation, fixed in gateway v44.
|
|
102
|
+
// Memo also makes TX visible to x402scan (memo carries x402 nonce marker).
|
|
103
|
+
var memoProgramPk = new PublicKey(MEMO_PROGRAM);
|
|
104
|
+
var nonceBytes = new Uint8Array(16);
|
|
105
|
+
for (var i = 0; i < 16; i++) nonceBytes[i] = Math.floor(Math.random() * 256);
|
|
106
|
+
var nonceHex = Array.from(nonceBytes).map(function(b) { return b.toString(16).padStart(2,'0'); }).join('');
|
|
107
|
+
var memoIx = { programId: memoProgramPk, keys: [], data: Buffer.from('x402:v2:' + nonceHex, 'utf8') };
|
|
98
108
|
var bh = await conn.getLatestBlockhash('confirmed');
|
|
99
109
|
var message = new TransactionMessage({
|
|
100
110
|
payerKey: feePayerPk,
|
|
101
111
|
recentBlockhash: bh.blockhash,
|
|
102
|
-
instructions: [setLimitIx, setPriceIx, transferIx],
|
|
112
|
+
instructions: [setLimitIx, setPriceIx, transferIx, memoIx],
|
|
103
113
|
}).compileToV0Message();
|
|
104
114
|
var vtx = new VersionedTransaction(message);
|
|
105
115
|
vtx.sign([kp]);
|
|
106
116
|
var txB64 = Buffer.from(vtx.serialize()).toString('base64');
|
|
107
|
-
console.error('[cryptoiz-mcp] V2 tx built (Dexter gas-sponsored),
|
|
117
|
+
console.error('[cryptoiz-mcp] V2 tx built (Dexter gas-sponsored), 4 ix: limit+price+transferChecked+memo');
|
|
108
118
|
return txB64;
|
|
109
119
|
}
|
|
110
120
|
|
package/package.json
CHANGED