cryptoiz-mcp 4.16.12 → 4.16.13
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 +10 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var VERSION = 'v4.16.
|
|
2
|
+
var VERSION = 'v4.16.13';
|
|
3
3
|
var GATEWAY = 'https://rehqwsypjnjirhuiapqh.supabase.co/functions/v1/mcp-x402-gateway';
|
|
4
4
|
// FIX v4.16.12: route ALL paid tools to gateway. Per-tool endpoints (mcp-alpha-scanner etc.)
|
|
5
5
|
// have stale hardcoded fee payer that breaks after Dexter key rotation. Gateway has dynamic
|
|
@@ -73,10 +73,13 @@ async function buildV2PaymentPayload(amount, feePayerAddr) {
|
|
|
73
73
|
var computeBudgetPk = new PublicKey(COMPUTE_BUDGET_PROGRAM);
|
|
74
74
|
var tokenProgramPk = new PublicKey(TOKEN_PROGRAM);
|
|
75
75
|
var usdcMintPk = new PublicKey(USDC_MINT);
|
|
76
|
-
// ComputeUnitLimit
|
|
76
|
+
// FIX v4.16.13: ComputeUnitLimit 20000 -> 30000.
|
|
77
|
+
// Memo program needs >13500 CU when content is 'x402:v2:'+32char hex; old (April 6-8)
|
|
78
|
+
// working code used just 32-char nonceHex which fit in 20000 budget. Bumping limit gives
|
|
79
|
+
// headroom for slightly longer memo content. Dexter spec allows up to 40000.
|
|
77
80
|
var setLimitData = Buffer.alloc(5);
|
|
78
81
|
setLimitData[0] = 0x02;
|
|
79
|
-
setLimitData.writeUInt32LE(
|
|
82
|
+
setLimitData.writeUInt32LE(30000, 1);
|
|
80
83
|
var setLimitIx = { programId: computeBudgetPk, keys: [], data: setLimitData };
|
|
81
84
|
// ComputeUnitPrice(1)
|
|
82
85
|
var setPriceData = Buffer.alloc(9);
|
|
@@ -104,7 +107,9 @@ async function buildV2PaymentPayload(amount, feePayerAddr) {
|
|
|
104
107
|
var nonceBytes = new Uint8Array(16);
|
|
105
108
|
for (var i = 0; i < 16; i++) nonceBytes[i] = Math.floor(Math.random() * 256);
|
|
106
109
|
var nonceHex = Array.from(nonceBytes).map(function(b) { return b.toString(16).padStart(2,'0'); }).join('');
|
|
107
|
-
|
|
110
|
+
// FIX v4.16.13: memo = just nonceHex (matches April 6-8 working V2 format).
|
|
111
|
+
// Adding 'x402:v2:' prefix made memo too long for 20000 CU budget.
|
|
112
|
+
var memoIx = { programId: memoProgramPk, keys: [], data: Buffer.from(nonceHex, 'utf8') };
|
|
108
113
|
var bh = await conn.getLatestBlockhash('confirmed');
|
|
109
114
|
var message = new TransactionMessage({
|
|
110
115
|
payerKey: feePayerPk,
|
|
@@ -114,7 +119,7 @@ async function buildV2PaymentPayload(amount, feePayerAddr) {
|
|
|
114
119
|
var vtx = new VersionedTransaction(message);
|
|
115
120
|
vtx.sign([kp]);
|
|
116
121
|
var txB64 = Buffer.from(vtx.serialize()).toString('base64');
|
|
117
|
-
console.error('[cryptoiz-mcp] V2 tx built (Dexter gas-sponsored), 4 ix
|
|
122
|
+
console.error('[cryptoiz-mcp] V2 tx built (Dexter gas-sponsored), 4 ix limit=30000');
|
|
118
123
|
return txB64;
|
|
119
124
|
}
|
|
120
125
|
|
package/package.json
CHANGED