rwagenthub-mcp 1.0.4 → 1.0.5
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 +2 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -35,7 +35,7 @@ async function callGateway(api, inputs) {
|
|
|
35
35
|
});
|
|
36
36
|
if (res.status === 402) {
|
|
37
37
|
const body = await res.json().catch(() => ({}));
|
|
38
|
-
const reason = body?.error?.invalidReason ?? body?.error ?? "payment_failed";
|
|
38
|
+
const reason = body?.details ?? body?.error?.invalidReason ?? body?.error ?? "payment_failed";
|
|
39
39
|
throw new Error(`payment_failed:${reason}`);
|
|
40
40
|
}
|
|
41
41
|
return res.json();
|
|
@@ -104,15 +104,8 @@ async function main() {
|
|
|
104
104
|
msg.toLowerCase().includes("insufficient_funds") ||
|
|
105
105
|
msg.toLowerCase().includes("failed to create payment payload");
|
|
106
106
|
if (isPaymentError) {
|
|
107
|
-
const isNoFunds =
|
|
108
|
-
msg.includes("insufficient_funds") ||
|
|
109
|
-
msg.toLowerCase().includes("insufficient funds") ||
|
|
110
|
-
msg.toLowerCase().includes("failed to create payment payload");
|
|
111
|
-
const detail = isNoFunds
|
|
112
|
-
? `Insufficient USDC balance on Base.\nWallet: ${account.address}\n\nTop up your wallet with USDC on Base and try again.`
|
|
113
|
-
: `Payment rejected by gateway (${msg.replace("payment_failed:", "")}).\nWallet: ${account.address}`;
|
|
114
107
|
return {
|
|
115
|
-
content: [{ type: "text", text: `Payment failed: ${
|
|
108
|
+
content: [{ type: "text", text: `Payment failed: insufficient USDC balance on Base.\nWallet: ${account.address}\n\nTop up your wallet with USDC on Base and try again.` }],
|
|
116
109
|
isError: true,
|
|
117
110
|
};
|
|
118
111
|
}
|
package/package.json
CHANGED