@quantish/agent 0.1.5 → 0.1.6
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/dist/index.js +27 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2754,12 +2754,27 @@ const result = JSON.parse(data.result.content[0].text);
|
|
|
2754
2754
|
- \`transfer_usdc\`: Send USDC. Args: { toAddress, amount }
|
|
2755
2755
|
|
|
2756
2756
|
### Key Discovery Tools (free, no auth required)
|
|
2757
|
-
Discovery uses a
|
|
2758
|
-
\`\`\`
|
|
2759
|
-
|
|
2760
|
-
|
|
2757
|
+
Discovery uses a SIMPLER request format (not full JSON-RPC):
|
|
2758
|
+
\`\`\`javascript
|
|
2759
|
+
// Discovery API - uses simple { name, arguments } format
|
|
2760
|
+
const response = await fetch('https://quantish.live/mcp/execute', {
|
|
2761
|
+
method: 'POST',
|
|
2762
|
+
headers: {
|
|
2763
|
+
'Content-Type': 'application/json',
|
|
2764
|
+
'X-API-Key': 'qm_ueQeqrmvZyHtR1zuVbLYkhx0fKyVAuV8'
|
|
2765
|
+
},
|
|
2766
|
+
body: JSON.stringify({
|
|
2767
|
+
name: 'search_markets', // Tool name at top level
|
|
2768
|
+
arguments: { query: 'bitcoin', limit: 5 } // Arguments at top level
|
|
2769
|
+
})
|
|
2770
|
+
});
|
|
2771
|
+
|
|
2772
|
+
// Response is still JSON-RPC wrapped:
|
|
2773
|
+
const data = await response.json();
|
|
2774
|
+
const result = JSON.parse(data.result.content[0].text);
|
|
2761
2775
|
\`\`\`
|
|
2762
2776
|
|
|
2777
|
+
Available Discovery Tools:
|
|
2763
2778
|
- \`search_markets\`: Find markets. Args: { query, limit?, platform?: "polymarket"|"kalshi"|"all" }
|
|
2764
2779
|
- \`get_market_details\`: Get market info. Args: { platform, marketId }
|
|
2765
2780
|
- \`get_trending_markets\`: Popular markets. Args: { limit?, platform? }
|
|
@@ -2886,29 +2901,25 @@ console.log('Order placed:', orderResult.orderId);
|
|
|
2886
2901
|
### SIMPLE EXAMPLE - Copy This Pattern Exactly
|
|
2887
2902
|
|
|
2888
2903
|
\`\`\`javascript
|
|
2889
|
-
// Simple bot that searches markets
|
|
2904
|
+
// Simple bot that searches markets using Discovery API (free, no auth)
|
|
2890
2905
|
require('dotenv').config();
|
|
2891
2906
|
|
|
2892
|
-
|
|
2907
|
+
// Discovery API uses SIMPLE format: { name, arguments }
|
|
2908
|
+
async function callDiscovery(name, args = {}) {
|
|
2893
2909
|
const res = await fetch('https://quantish.live/mcp/execute', {
|
|
2894
2910
|
method: 'POST',
|
|
2895
2911
|
headers: {
|
|
2896
2912
|
'Content-Type': 'application/json',
|
|
2897
|
-
'X-API-Key': 'qm_ueQeqrmvZyHtR1zuVbLYkhx0fKyVAuV8'
|
|
2913
|
+
'X-API-Key': 'qm_ueQeqrmvZyHtR1zuVbLYkhx0fKyVAuV8' // Public key
|
|
2898
2914
|
},
|
|
2899
|
-
body: JSON.stringify({
|
|
2900
|
-
jsonrpc: '2.0',
|
|
2901
|
-
method: 'tools/call',
|
|
2902
|
-
params: { name, arguments: args },
|
|
2903
|
-
id: 1
|
|
2904
|
-
})
|
|
2915
|
+
body: JSON.stringify({ name, arguments: args }) // Simple format!
|
|
2905
2916
|
});
|
|
2906
2917
|
const data = await res.json();
|
|
2907
2918
|
return JSON.parse(data.result.content[0].text);
|
|
2908
2919
|
}
|
|
2909
2920
|
|
|
2910
2921
|
// Use it!
|
|
2911
|
-
const markets = await
|
|
2922
|
+
const markets = await callDiscovery('search_markets', { query: 'bitcoin', limit: 5 });
|
|
2912
2923
|
console.log(markets);
|
|
2913
2924
|
\`\`\`
|
|
2914
2925
|
|
|
@@ -2976,6 +2987,7 @@ async function callTradingTool(name, args = {}) {
|
|
|
2976
2987
|
|
|
2977
2988
|
/**
|
|
2978
2989
|
* Call a discovery tool (no auth required)
|
|
2990
|
+
* Uses SIMPLE format: { name, arguments } - NOT full JSON-RPC
|
|
2979
2991
|
* Tools: search_markets, get_market_details, get_trending_markets, find_arbitrage
|
|
2980
2992
|
*/
|
|
2981
2993
|
async function callDiscoveryTool(name, args = {}) {
|
|
@@ -2985,12 +2997,7 @@ async function callDiscoveryTool(name, args = {}) {
|
|
|
2985
2997
|
'Content-Type': 'application/json',
|
|
2986
2998
|
'X-API-Key': DISCOVERY_API_KEY
|
|
2987
2999
|
},
|
|
2988
|
-
body: JSON.stringify({
|
|
2989
|
-
jsonrpc: '2.0',
|
|
2990
|
-
method: 'tools/call',
|
|
2991
|
-
params: { name, arguments: args },
|
|
2992
|
-
id: Date.now()
|
|
2993
|
-
})
|
|
3000
|
+
body: JSON.stringify({ name, arguments: args }) // Simple format for Discovery!
|
|
2994
3001
|
});
|
|
2995
3002
|
|
|
2996
3003
|
const data = await response.json();
|