cryptoiz-mcp 4.16.9 → 4.16.10

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.
Files changed (3) hide show
  1. package/index.js +15 -13
  2. package/package.json +15 -5
  3. package/setup.js +0 -0
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- var VERSION = 'v4.16.9';
2
+ var VERSION = 'v4.16.10';
3
3
  var GATEWAY = 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-x402-gateway';
4
4
  var TOOL_ENDPOINTS = {
5
5
  get_whale_alpha: 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-alpha-scanner',
@@ -68,7 +68,6 @@ async function buildV2PaymentPayload(amount, feePayerAddr) {
68
68
  var recipientATA = findATA(RECIPIENT, USDC_MINT);
69
69
  var feePayerPk = new PublicKey(feePayerAddr);
70
70
  var computeBudgetPk = new PublicKey(COMPUTE_BUDGET_PROGRAM);
71
- var memoProgramPk = new PublicKey(MEMO_PROGRAM);
72
71
  var tokenProgramPk = new PublicKey(TOKEN_PROGRAM);
73
72
  var usdcMintPk = new PublicKey(USDC_MINT);
74
73
  // ComputeUnitLimit(20000)
@@ -94,21 +93,18 @@ async function buildV2PaymentPayload(amount, feePayerAddr) {
94
93
  transferData.writeUInt32LE(Math.floor(amount / 0x100000000) & 0xFFFFFFFF, 5);
95
94
  transferData[9] = 6;
96
95
  var transferIx = { programId: tokenProgramPk, keys: transferKeys, data: transferData };
97
- // Memo with nonce
98
- var nonceBytes = new Uint8Array(16);
99
- for (var i = 0; i < 16; i++) nonceBytes[i] = Math.floor(Math.random() * 256);
100
- var nonceHex = Array.from(nonceBytes).map(function(b) { return b.toString(16).padStart(2,'0'); }).join('');
101
- var memoIx = { programId: memoProgramPk, keys: [], data: Buffer.from(nonceHex, 'utf8') };
96
+ // FIX v4.16.10: NO Memo instruction in V2 — Dexter scheme_exact_svm whitelist
97
+ // only allows ComputeBudget + SPL Token + Lighthouse. Memo would be rejected.
102
98
  var bh = await conn.getLatestBlockhash('confirmed');
103
99
  var message = new TransactionMessage({
104
100
  payerKey: feePayerPk,
105
101
  recentBlockhash: bh.blockhash,
106
- instructions: [setLimitIx, setPriceIx, transferIx, memoIx],
102
+ instructions: [setLimitIx, setPriceIx, transferIx],
107
103
  }).compileToV0Message();
108
104
  var vtx = new VersionedTransaction(message);
109
105
  vtx.sign([kp]);
110
106
  var txB64 = Buffer.from(vtx.serialize()).toString('base64');
111
- console.error('[cryptoiz-mcp] V2 tx built (Dexter gas-sponsored), nonce=' + nonceHex.substring(0,8) + '...');
107
+ console.error('[cryptoiz-mcp] V2 tx built (Dexter gas-sponsored), 3 ix: limit+price+transferChecked');
112
108
  return txB64;
113
109
  }
114
110
 
@@ -124,11 +120,12 @@ async function sendUSDC(amount, toolName) {
124
120
  { pubkey: recipientATA, isSigner: false, isWritable: true },
125
121
  { pubkey: kp.publicKey, isSigner: true, isWritable: false },
126
122
  ];
127
- var data = Buffer.alloc(9);
123
+ // FIX v4.16.10: TransferChecked needs 10 bytes (1 disc + 8 amount + 1 decimals)
124
+ var data = Buffer.alloc(10);
128
125
  data[0] = 0x0c;
129
126
  data.writeUInt32LE(amount & 0xFFFFFFFF, 1);
130
127
  data.writeUInt32LE(Math.floor(amount / 0x100000000) & 0xFFFFFFFF, 5);
131
- data[8] = 6;
128
+ data[9] = 6;
132
129
  var transferIx = { programId: new PublicKey(TOKEN_PROGRAM), keys: keys, data: data };
133
130
  var nonce = Date.now().toString(16) + Math.floor(Math.random()*0xffff).toString(16);
134
131
  var memoIx = {
@@ -190,11 +187,16 @@ async function callTool(toolName, args) {
190
187
  console.error('[cryptoiz-mcp] V2 mode: Dexter gas-sponsored, paying ' + (amount/1000000).toFixed(4) + ' USDC');
191
188
  try {
192
189
  var txB64 = await buildV2PaymentPayload(amount, payReq.extra.feePayer);
190
+ // FIX v4.16.10: x402Version:2 (was 1), add 'accepted' (chosen PaymentRequirements
191
+ // verbatim — Dexter /verify needs this to match amount/asset/payTo). Removed bogus
192
+ // signature field — V2 schema only has payload.transaction.
193
193
  var v2Payload = {
194
- x402Version: 1,
194
+ x402Version: 2,
195
195
  scheme: 'exact',
196
196
  network: payReq.network || 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
197
- payload: { transaction: txB64, signature: '' }
197
+ accepted: payReq,
198
+ payload: { transaction: txB64 },
199
+ extensions: {}
198
200
  };
199
201
  paymentHeader = Buffer.from(JSON.stringify(v2Payload)).toString('base64');
200
202
  headerName = 'payment-signature';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptoiz-mcp",
3
- "version": "4.16.9",
3
+ "version": "4.16.10",
4
4
  "description": "CryptoIZ MCP Server - Solana DEX whale intelligence via Claude Desktop with x402 USDC micropayments",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -8,14 +8,24 @@
8
8
  "cryptoiz-mcp": "./index.js",
9
9
  "cryptoiz-mcp-setup": "./setup.js"
10
10
  },
11
- "files": ["index.js", "setup.js", "package.json", "README.md"],
11
+ "files": [
12
+ "index.js",
13
+ "setup.js",
14
+ "package.json",
15
+ "README.md"
16
+ ],
12
17
  "dependencies": {
13
18
  "@modelcontextprotocol/sdk": "^1.0.4",
14
19
  "@solana/web3.js": "^1.95.8",
15
20
  "bs58": "^6.0.0"
16
21
  },
17
- "engines": { "node": ">=18.0.0" },
22
+ "engines": {
23
+ "node": ">=18.0.0"
24
+ },
18
25
  "author": "CryptoIZ",
19
26
  "license": "MIT",
20
- "repository": { "type": "git", "url": "git+https://github.com/dadang11/cryptoiz-mcp.git" }
21
- }
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/dadang11/cryptoiz-mcp.git"
30
+ }
31
+ }
package/setup.js CHANGED
File without changes