clodds 1.7.5 → 1.7.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/agents/index.js +137 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/tool-registry.js +7 -1
- package/dist/agents/tool-registry.js.map +1 -1
- package/dist/credentials/index.d.ts +2 -2
- package/dist/credentials/index.js.map +1 -1
- package/dist/types.d.ts +13 -1
- package/package.json +1 -1
package/dist/agents/index.js
CHANGED
|
@@ -7232,6 +7232,80 @@ function buildTools() {
|
|
|
7232
7232
|
required: ['app_key', 'session_token'],
|
|
7233
7233
|
},
|
|
7234
7234
|
},
|
|
7235
|
+
{
|
|
7236
|
+
name: 'setup_drift_credentials',
|
|
7237
|
+
description: 'Set up Drift (Solana) trading credentials. Required before trading perpetuals on Drift.',
|
|
7238
|
+
input_schema: {
|
|
7239
|
+
type: 'object',
|
|
7240
|
+
properties: {
|
|
7241
|
+
private_key: { type: 'string', description: 'Solana private key (base58 format)' },
|
|
7242
|
+
keypair_path: { type: 'string', description: 'Path to Solana keypair JSON file (alternative to private_key)' },
|
|
7243
|
+
},
|
|
7244
|
+
required: ['private_key'],
|
|
7245
|
+
},
|
|
7246
|
+
},
|
|
7247
|
+
{
|
|
7248
|
+
name: 'setup_smarkets_credentials',
|
|
7249
|
+
description: 'Set up Smarkets trading credentials. Required before trading on Smarkets.',
|
|
7250
|
+
input_schema: {
|
|
7251
|
+
type: 'object',
|
|
7252
|
+
properties: {
|
|
7253
|
+
api_token: { type: 'string', description: 'Smarkets API token' },
|
|
7254
|
+
session_token: { type: 'string', description: 'Smarkets session token (alternative auth)' },
|
|
7255
|
+
},
|
|
7256
|
+
required: ['api_token'],
|
|
7257
|
+
},
|
|
7258
|
+
},
|
|
7259
|
+
{
|
|
7260
|
+
name: 'setup_opinion_credentials',
|
|
7261
|
+
description: 'Set up Opinion.trade credentials. Required before trading on Opinion.',
|
|
7262
|
+
input_schema: {
|
|
7263
|
+
type: 'object',
|
|
7264
|
+
properties: {
|
|
7265
|
+
api_key: { type: 'string', description: 'Opinion.trade API key' },
|
|
7266
|
+
private_key: { type: 'string', description: 'BNB Chain wallet private key for trading' },
|
|
7267
|
+
multi_sig_address: { type: 'string', description: 'Vault/funder address (optional)' },
|
|
7268
|
+
},
|
|
7269
|
+
required: ['api_key'],
|
|
7270
|
+
},
|
|
7271
|
+
},
|
|
7272
|
+
{
|
|
7273
|
+
name: 'setup_virtuals_credentials',
|
|
7274
|
+
description: 'Set up Virtuals Protocol trading credentials. Required before trading AI agents on Virtuals.',
|
|
7275
|
+
input_schema: {
|
|
7276
|
+
type: 'object',
|
|
7277
|
+
properties: {
|
|
7278
|
+
private_key: { type: 'string', description: 'EVM wallet private key (Base chain)' },
|
|
7279
|
+
rpc_url: { type: 'string', description: 'Base chain RPC URL (optional, defaults to mainnet)' },
|
|
7280
|
+
},
|
|
7281
|
+
required: ['private_key'],
|
|
7282
|
+
},
|
|
7283
|
+
},
|
|
7284
|
+
{
|
|
7285
|
+
name: 'setup_hedgehog_credentials',
|
|
7286
|
+
description: 'Set up Hedgehog Markets trading credentials. Required before trading on Hedgehog.',
|
|
7287
|
+
input_schema: {
|
|
7288
|
+
type: 'object',
|
|
7289
|
+
properties: {
|
|
7290
|
+
private_key: { type: 'string', description: 'Solana wallet private key (base58)' },
|
|
7291
|
+
api_key: { type: 'string', description: 'Hedgehog API key for higher rate limits (optional)' },
|
|
7292
|
+
},
|
|
7293
|
+
required: ['private_key'],
|
|
7294
|
+
},
|
|
7295
|
+
},
|
|
7296
|
+
{
|
|
7297
|
+
name: 'setup_predictfun_credentials',
|
|
7298
|
+
description: 'Set up Predict.fun trading credentials. Required before trading on Predict.fun.',
|
|
7299
|
+
input_schema: {
|
|
7300
|
+
type: 'object',
|
|
7301
|
+
properties: {
|
|
7302
|
+
private_key: { type: 'string', description: 'BNB Chain wallet private key for signing' },
|
|
7303
|
+
predict_account: { type: 'string', description: 'Smart wallet/deposit address (optional)' },
|
|
7304
|
+
api_key: { type: 'string', description: 'Predict.fun API key (optional)' },
|
|
7305
|
+
},
|
|
7306
|
+
required: ['private_key'],
|
|
7307
|
+
},
|
|
7308
|
+
},
|
|
7235
7309
|
{
|
|
7236
7310
|
name: 'list_trading_credentials',
|
|
7237
7311
|
description: 'List which platforms the user has trading credentials set up for',
|
|
@@ -7249,7 +7323,7 @@ function buildTools() {
|
|
|
7249
7323
|
platform: {
|
|
7250
7324
|
type: 'string',
|
|
7251
7325
|
description: 'Platform to delete credentials for',
|
|
7252
|
-
enum: ['polymarket', 'kalshi', 'manifold', 'binance', 'bybit', 'hyperliquid', 'mexc', 'betfair'],
|
|
7326
|
+
enum: ['polymarket', 'kalshi', 'manifold', 'binance', 'bybit', 'hyperliquid', 'mexc', 'betfair', 'drift', 'smarkets', 'opinion', 'virtuals', 'hedgehog', 'predictfun'],
|
|
7253
7327
|
},
|
|
7254
7328
|
},
|
|
7255
7329
|
required: ['platform'],
|
|
@@ -9406,6 +9480,68 @@ async function executeTool(toolName, toolInput, context) {
|
|
|
9406
9480
|
security_notice: 'Your credentials are encrypted with AES-256-GCM. Session tokens expire — you may need to refresh periodically.',
|
|
9407
9481
|
});
|
|
9408
9482
|
}
|
|
9483
|
+
case 'setup_drift_credentials': {
|
|
9484
|
+
await context.credentials.setCredentials(userId, 'drift', {
|
|
9485
|
+
privateKey: toolInput.private_key,
|
|
9486
|
+
keypairPath: toolInput.keypair_path || undefined,
|
|
9487
|
+
});
|
|
9488
|
+
return JSON.stringify({
|
|
9489
|
+
result: 'Drift credentials saved! You can now trade perpetuals on Drift.',
|
|
9490
|
+
security_notice: 'Your Solana private key is encrypted with AES-256-GCM. Use a dedicated trading wallet.',
|
|
9491
|
+
});
|
|
9492
|
+
}
|
|
9493
|
+
case 'setup_smarkets_credentials': {
|
|
9494
|
+
await context.credentials.setCredentials(userId, 'smarkets', {
|
|
9495
|
+
apiToken: toolInput.api_token,
|
|
9496
|
+
sessionToken: toolInput.session_token || undefined,
|
|
9497
|
+
});
|
|
9498
|
+
return JSON.stringify({
|
|
9499
|
+
result: 'Smarkets credentials saved! You can now trade on Smarkets.',
|
|
9500
|
+
security_notice: 'Your credentials are encrypted with AES-256-GCM.',
|
|
9501
|
+
});
|
|
9502
|
+
}
|
|
9503
|
+
case 'setup_opinion_credentials': {
|
|
9504
|
+
await context.credentials.setCredentials(userId, 'opinion', {
|
|
9505
|
+
apiKey: toolInput.api_key,
|
|
9506
|
+
privateKey: toolInput.private_key || undefined,
|
|
9507
|
+
multiSigAddress: toolInput.multi_sig_address || undefined,
|
|
9508
|
+
});
|
|
9509
|
+
return JSON.stringify({
|
|
9510
|
+
result: 'Opinion.trade credentials saved! You can now trade on Opinion.',
|
|
9511
|
+
security_notice: 'Your credentials are encrypted with AES-256-GCM. Use a dedicated BNB Chain wallet for trading.',
|
|
9512
|
+
});
|
|
9513
|
+
}
|
|
9514
|
+
case 'setup_virtuals_credentials': {
|
|
9515
|
+
await context.credentials.setCredentials(userId, 'virtuals', {
|
|
9516
|
+
privateKey: toolInput.private_key,
|
|
9517
|
+
rpcUrl: toolInput.rpc_url || undefined,
|
|
9518
|
+
});
|
|
9519
|
+
return JSON.stringify({
|
|
9520
|
+
result: 'Virtuals Protocol credentials saved! You can now trade AI agents on Virtuals.',
|
|
9521
|
+
security_notice: 'Your EVM private key is encrypted with AES-256-GCM. Use a dedicated Base chain wallet.',
|
|
9522
|
+
});
|
|
9523
|
+
}
|
|
9524
|
+
case 'setup_hedgehog_credentials': {
|
|
9525
|
+
await context.credentials.setCredentials(userId, 'hedgehog', {
|
|
9526
|
+
privateKey: toolInput.private_key,
|
|
9527
|
+
apiKey: toolInput.api_key || undefined,
|
|
9528
|
+
});
|
|
9529
|
+
return JSON.stringify({
|
|
9530
|
+
result: 'Hedgehog Markets credentials saved! You can now trade on Hedgehog.',
|
|
9531
|
+
security_notice: 'Your Solana private key is encrypted with AES-256-GCM. Use a dedicated trading wallet.',
|
|
9532
|
+
});
|
|
9533
|
+
}
|
|
9534
|
+
case 'setup_predictfun_credentials': {
|
|
9535
|
+
await context.credentials.setCredentials(userId, 'predictfun', {
|
|
9536
|
+
privateKey: toolInput.private_key,
|
|
9537
|
+
predictAccount: toolInput.predict_account || undefined,
|
|
9538
|
+
apiKey: toolInput.api_key || undefined,
|
|
9539
|
+
});
|
|
9540
|
+
return JSON.stringify({
|
|
9541
|
+
result: 'Predict.fun credentials saved! You can now trade on Predict.fun.',
|
|
9542
|
+
security_notice: 'Your BNB Chain private key is encrypted with AES-256-GCM. Use a dedicated trading wallet.',
|
|
9543
|
+
});
|
|
9544
|
+
}
|
|
9409
9545
|
case 'list_trading_credentials': {
|
|
9410
9546
|
const platforms = await context.credentials.listUserPlatforms(userId);
|
|
9411
9547
|
if (platforms.length === 0) {
|