kausalayer-mcp 1.0.0
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/LICENSE +201 -0
- package/README.md +82 -0
- package/dist/api/maze-client.d.ts +128 -0
- package/dist/api/maze-client.d.ts.map +1 -0
- package/dist/api/maze-client.js +187 -0
- package/dist/api/maze-client.js.map +1 -0
- package/dist/auth/api-key.d.ts +51 -0
- package/dist/auth/api-key.d.ts.map +1 -0
- package/dist/auth/api-key.js +105 -0
- package/dist/auth/api-key.js.map +1 -0
- package/dist/auth/tier.d.ts +47 -0
- package/dist/auth/tier.d.ts.map +1 -0
- package/dist/auth/tier.js +102 -0
- package/dist/auth/tier.js.map +1 -0
- package/dist/db/database.d.ts +54 -0
- package/dist/db/database.d.ts.map +1 -0
- package/dist/db/database.js +180 -0
- package/dist/db/database.js.map +1 -0
- package/dist/http-server.d.ts +7 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +207 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +181 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/check-route-status.d.ts +11 -0
- package/dist/tools/check-route-status.d.ts.map +1 -0
- package/dist/tools/check-route-status.js +51 -0
- package/dist/tools/check-route-status.js.map +1 -0
- package/dist/tools/create-pocket.d.ts +11 -0
- package/dist/tools/create-pocket.d.ts.map +1 -0
- package/dist/tools/create-pocket.js +68 -0
- package/dist/tools/create-pocket.js.map +1 -0
- package/dist/tools/estimate-fee.d.ts +10 -0
- package/dist/tools/estimate-fee.d.ts.map +1 -0
- package/dist/tools/estimate-fee.js +61 -0
- package/dist/tools/estimate-fee.js.map +1 -0
- package/dist/tools/export-pocket-key.d.ts +11 -0
- package/dist/tools/export-pocket-key.d.ts.map +1 -0
- package/dist/tools/export-pocket-key.js +51 -0
- package/dist/tools/export-pocket-key.js.map +1 -0
- package/dist/tools/get-pocket-info.d.ts +11 -0
- package/dist/tools/get-pocket-info.d.ts.map +1 -0
- package/dist/tools/get-pocket-info.js +43 -0
- package/dist/tools/get-pocket-info.js.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +38 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-pockets.d.ts +11 -0
- package/dist/tools/list-pockets.d.ts.map +1 -0
- package/dist/tools/list-pockets.js +51 -0
- package/dist/tools/list-pockets.js.map +1 -0
- package/dist/tools/maze-route.d.ts +11 -0
- package/dist/tools/maze-route.d.ts.map +1 -0
- package/dist/tools/maze-route.js +81 -0
- package/dist/tools/maze-route.js.map +1 -0
- package/dist/tools/recover-route.d.ts +11 -0
- package/dist/tools/recover-route.d.ts.map +1 -0
- package/dist/tools/recover-route.js +58 -0
- package/dist/tools/recover-route.js.map +1 -0
- package/dist/tools/retry-route.d.ts +11 -0
- package/dist/tools/retry-route.d.ts.map +1 -0
- package/dist/tools/retry-route.js +41 -0
- package/dist/tools/retry-route.js.map +1 -0
- package/dist/tools/sweep-pocket.d.ts +11 -0
- package/dist/tools/sweep-pocket.d.ts.map +1 -0
- package/dist/tools/sweep-pocket.js +62 -0
- package/dist/tools/sweep-pocket.js.map +1 -0
- package/dist/types/index.d.ts +240 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +48 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KausaLayer MCP - API Key Authentication Module
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ApiKeyAuth = void 0;
|
|
10
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
11
|
+
class ApiKeyAuth {
|
|
12
|
+
db;
|
|
13
|
+
tierManager;
|
|
14
|
+
constructor(db, tierManager) {
|
|
15
|
+
this.db = db;
|
|
16
|
+
this.tierManager = tierManager;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generate API key from wallet signature
|
|
20
|
+
* Message format: "KausaLayer MCP Access\nWallet: <pubkey>\nTimestamp: <unix>"
|
|
21
|
+
*/
|
|
22
|
+
static generateApiKey(signature) {
|
|
23
|
+
const hash = crypto_1.default.createHash('sha256').update(signature).digest();
|
|
24
|
+
const keyPart = hash.toString('base64url').substring(0, 32);
|
|
25
|
+
return `kl_${keyPart}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Register a new API key for a wallet
|
|
29
|
+
*/
|
|
30
|
+
registerApiKey(apiKey, walletAddress) {
|
|
31
|
+
return this.db.registerApiKey(apiKey, walletAddress);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Validate API key and return full auth context
|
|
35
|
+
*/
|
|
36
|
+
async authenticate(apiKey) {
|
|
37
|
+
// Validate API key format
|
|
38
|
+
if (!apiKey || !apiKey.startsWith('kl_')) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
// Lookup wallet address
|
|
42
|
+
const walletAddress = this.db.validateApiKey(apiKey);
|
|
43
|
+
if (!walletAddress) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
// Get tier info
|
|
47
|
+
const tierInfo = await this.tierManager.getWalletTier(walletAddress);
|
|
48
|
+
// Get usage info
|
|
49
|
+
const usage = this.db.getUsage(walletAddress);
|
|
50
|
+
return {
|
|
51
|
+
walletAddress,
|
|
52
|
+
tier: tierInfo.tier,
|
|
53
|
+
limits: tierInfo.limits,
|
|
54
|
+
kausaBalance: tierInfo.kausaBalance,
|
|
55
|
+
routesToday: usage.routes_today,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Check if user can make a route (rate limit check)
|
|
60
|
+
*/
|
|
61
|
+
canMakeRoute(authContext) {
|
|
62
|
+
return authContext.routesToday < authContext.limits.daily_routes;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Increment route count after successful route creation
|
|
66
|
+
*/
|
|
67
|
+
incrementRouteCount(walletAddress) {
|
|
68
|
+
return this.db.incrementRouteCount(walletAddress);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Validate route parameters against tier limits
|
|
72
|
+
*/
|
|
73
|
+
validateRouteParams(authContext, amountSol, complexity) {
|
|
74
|
+
// Check daily limit
|
|
75
|
+
if (!this.canMakeRoute(authContext)) {
|
|
76
|
+
return {
|
|
77
|
+
valid: false,
|
|
78
|
+
error: `Daily route limit reached (${authContext.limits.daily_routes}/day). Upgrade tier for more routes.`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Check amount limit
|
|
82
|
+
if (amountSol > authContext.limits.max_amount_sol) {
|
|
83
|
+
return {
|
|
84
|
+
valid: false,
|
|
85
|
+
error: `Amount ${amountSol} SOL exceeds tier limit of ${authContext.limits.max_amount_sol} SOL. Upgrade tier for higher limits.`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Check complexity
|
|
89
|
+
if (!this.tierManager.canUseComplexity(authContext.tier, complexity)) {
|
|
90
|
+
return {
|
|
91
|
+
valid: false,
|
|
92
|
+
error: `Complexity '${complexity}' not available for ${authContext.tier} tier. Max: ${authContext.limits.max_complexity}.`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return { valid: true };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get meta_address hash for REST API calls
|
|
99
|
+
*/
|
|
100
|
+
static getMetaAddress(walletAddress) {
|
|
101
|
+
return crypto_1.default.createHash('sha256').update(walletAddress).digest('hex');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.ApiKeyAuth = ApiKeyAuth;
|
|
105
|
+
//# sourceMapping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AAI,eAAe,WAAW,CAAC,MAAM,CAAC,cAAc,GAAG;aAC3H,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,aAAqB;QACzC,OAAO,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzE,CAAC;CACF;AA/GD,gCA+GC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KausaLayer MCP - Tier Module
|
|
3
|
+
* Check KAUSA token balance and determine user tier
|
|
4
|
+
*/
|
|
5
|
+
import { Tier, TierLimits } from '../types';
|
|
6
|
+
export declare class TierManager {
|
|
7
|
+
private connection;
|
|
8
|
+
private kausaMint;
|
|
9
|
+
constructor(rpcUrl: string, kausaMint: string);
|
|
10
|
+
/**
|
|
11
|
+
* Get KAUSA token balance for a wallet
|
|
12
|
+
*/
|
|
13
|
+
getKausaBalance(walletAddress: string): Promise<number>;
|
|
14
|
+
/**
|
|
15
|
+
* Determine tier based on KAUSA balance
|
|
16
|
+
*/
|
|
17
|
+
determineTier(kausaBalance: number): Tier;
|
|
18
|
+
/**
|
|
19
|
+
* Get tier limits for a tier
|
|
20
|
+
*/
|
|
21
|
+
getTierLimits(tier: Tier): TierLimits;
|
|
22
|
+
/**
|
|
23
|
+
* Get full tier info for a wallet
|
|
24
|
+
*/
|
|
25
|
+
getWalletTier(walletAddress: string): Promise<{
|
|
26
|
+
tier: Tier;
|
|
27
|
+
limits: TierLimits;
|
|
28
|
+
kausaBalance: number;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Validate if user can use a specific complexity level
|
|
32
|
+
*/
|
|
33
|
+
canUseComplexity(tier: Tier, requestedComplexity: 'low' | 'medium' | 'high'): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Validate if amount is within tier limits
|
|
36
|
+
*/
|
|
37
|
+
isAmountAllowed(tier: Tier, amountSol: number): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get fee percentage for tier
|
|
40
|
+
*/
|
|
41
|
+
getFeePercent(tier: Tier): number;
|
|
42
|
+
/**
|
|
43
|
+
* Calculate fee in SOL
|
|
44
|
+
*/
|
|
45
|
+
calculateFee(tier: Tier, amountSol: number): number;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=tier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../src/auth/tier.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAgC,MAAM,UAAU,CAAC;AAK1E,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,SAAS,CAAY;gBAEjB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK7C;;OAEG;IACG,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmB7D;;OAEG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAazC;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU;IAIrC;;OAEG;IACG,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;QAClD,IAAI,EAAE,IAAI,CAAC;QACX,MAAM,EAAE,UAAU,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAQF;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO;IAQrF;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAKvD;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;IAIjC;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;CAIpD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KausaLayer MCP - Tier Module
|
|
4
|
+
* Check KAUSA token balance and determine user tier
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TierManager = void 0;
|
|
8
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
9
|
+
const spl_token_1 = require("@solana/spl-token");
|
|
10
|
+
const types_1 = require("../types");
|
|
11
|
+
// KAUSA token has 6 decimals (pump.fun standard)
|
|
12
|
+
const KAUSA_DECIMALS = 6;
|
|
13
|
+
class TierManager {
|
|
14
|
+
connection;
|
|
15
|
+
kausaMint;
|
|
16
|
+
constructor(rpcUrl, kausaMint) {
|
|
17
|
+
this.connection = new web3_js_1.Connection(rpcUrl, 'confirmed');
|
|
18
|
+
this.kausaMint = new web3_js_1.PublicKey(kausaMint);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get KAUSA token balance for a wallet
|
|
22
|
+
*/
|
|
23
|
+
async getKausaBalance(walletAddress) {
|
|
24
|
+
try {
|
|
25
|
+
const wallet = new web3_js_1.PublicKey(walletAddress);
|
|
26
|
+
const ata = await (0, spl_token_1.getAssociatedTokenAddress)(this.kausaMint, wallet);
|
|
27
|
+
const account = await (0, spl_token_1.getAccount)(this.connection, ata);
|
|
28
|
+
const balance = Number(account.amount) / Math.pow(10, KAUSA_DECIMALS);
|
|
29
|
+
return balance;
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
// Token account doesn't exist = 0 balance
|
|
33
|
+
if (error.name === 'TokenAccountNotFoundError') {
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
console.error('Error fetching KAUSA balance:', error.message);
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Determine tier based on KAUSA balance
|
|
42
|
+
*/
|
|
43
|
+
determineTier(kausaBalance) {
|
|
44
|
+
if (kausaBalance >= types_1.TIER_THRESHOLDS[types_1.Tier.ENTERPRISE]) {
|
|
45
|
+
return types_1.Tier.ENTERPRISE;
|
|
46
|
+
}
|
|
47
|
+
if (kausaBalance >= types_1.TIER_THRESHOLDS[types_1.Tier.PRO]) {
|
|
48
|
+
return types_1.Tier.PRO;
|
|
49
|
+
}
|
|
50
|
+
if (kausaBalance >= types_1.TIER_THRESHOLDS[types_1.Tier.BASIC]) {
|
|
51
|
+
return types_1.Tier.BASIC;
|
|
52
|
+
}
|
|
53
|
+
return types_1.Tier.FREE;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get tier limits for a tier
|
|
57
|
+
*/
|
|
58
|
+
getTierLimits(tier) {
|
|
59
|
+
return types_1.TIER_LIMITS[tier];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get full tier info for a wallet
|
|
63
|
+
*/
|
|
64
|
+
async getWalletTier(walletAddress) {
|
|
65
|
+
const kausaBalance = await this.getKausaBalance(walletAddress);
|
|
66
|
+
const tier = this.determineTier(kausaBalance);
|
|
67
|
+
const limits = this.getTierLimits(tier);
|
|
68
|
+
return { tier, limits, kausaBalance };
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Validate if user can use a specific complexity level
|
|
72
|
+
*/
|
|
73
|
+
canUseComplexity(tier, requestedComplexity) {
|
|
74
|
+
const limits = types_1.TIER_LIMITS[tier];
|
|
75
|
+
const complexityOrder = ['low', 'medium', 'high'];
|
|
76
|
+
const maxIndex = complexityOrder.indexOf(limits.max_complexity);
|
|
77
|
+
const requestedIndex = complexityOrder.indexOf(requestedComplexity);
|
|
78
|
+
return requestedIndex <= maxIndex;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Validate if amount is within tier limits
|
|
82
|
+
*/
|
|
83
|
+
isAmountAllowed(tier, amountSol) {
|
|
84
|
+
const limits = types_1.TIER_LIMITS[tier];
|
|
85
|
+
return amountSol <= limits.max_amount_sol;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get fee percentage for tier
|
|
89
|
+
*/
|
|
90
|
+
getFeePercent(tier) {
|
|
91
|
+
return types_1.TIER_LIMITS[tier].fee_percent;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Calculate fee in SOL
|
|
95
|
+
*/
|
|
96
|
+
calculateFee(tier, amountSol) {
|
|
97
|
+
const feePercent = this.getFeePercent(tier);
|
|
98
|
+
return amountSol * (feePercent / 100);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.TierManager = TierManager;
|
|
102
|
+
//# sourceMappingURL=tier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.js","sourceRoot":"","sources":["../../src/auth/tier.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAAwD;AACxD,iDAA0E;AAC1E,oCAA0E;AAE1E,iDAAiD;AACjD,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAa,WAAW;IACd,UAAU,CAAa;IACvB,SAAS,CAAY;IAE7B,YAAY,MAAc,EAAE,SAAiB;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,aAAa,CAAC,CAAC;YAC5C,MAAM,GAAG,GAAG,MAAM,IAAA,qCAAyB,EAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAEpE,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C9C,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAExC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,IAAU,EAAE,mBAA8C;QACzE,MAAM,MAAM,GAAG,mBAAW,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAChE,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACpE,OAAO,cAAc,IAAI,QAAQ,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,IAAU,EAAE,SAAiB;QAC3C,MAAM,MAAM,GAAG,mBAAW,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAU;QACtB,OAAO,mBAAW,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,IAAU,EAAE,SAAiB;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,SAAS,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;IACxC,CAAC;CACF;AAtGD,kCAsGC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KausaLayer MCP - Database Layer
|
|
3
|
+
* SQLite database for API keys and usage tracking
|
|
4
|
+
*/
|
|
5
|
+
import { ApiKeyRecord, UsageRecord } from '../types';
|
|
6
|
+
export declare class MCPDatabase {
|
|
7
|
+
private db;
|
|
8
|
+
constructor(dbPath: string);
|
|
9
|
+
/**
|
|
10
|
+
* Initialize database tables
|
|
11
|
+
*/
|
|
12
|
+
private initTables;
|
|
13
|
+
/**
|
|
14
|
+
* Hash an API key for storage
|
|
15
|
+
*/
|
|
16
|
+
static hashApiKey(apiKey: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Generate a new API key from wallet signature
|
|
19
|
+
*/
|
|
20
|
+
static generateApiKey(signature: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Register a new API key
|
|
23
|
+
*/
|
|
24
|
+
registerApiKey(apiKey: string, walletAddress: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Validate an API key and return wallet address
|
|
27
|
+
*/
|
|
28
|
+
validateApiKey(apiKey: string): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Get API key record by wallet address
|
|
31
|
+
*/
|
|
32
|
+
getApiKeyByWallet(walletAddress: string): ApiKeyRecord | null;
|
|
33
|
+
/**
|
|
34
|
+
* Get usage for a wallet
|
|
35
|
+
*/
|
|
36
|
+
getUsage(walletAddress: string): UsageRecord;
|
|
37
|
+
/**
|
|
38
|
+
* Increment route count for a wallet
|
|
39
|
+
*/
|
|
40
|
+
incrementRouteCount(walletAddress: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* Check if wallet can make more routes today
|
|
43
|
+
*/
|
|
44
|
+
canMakeRoute(walletAddress: string, dailyLimit: number): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Delete an API key
|
|
47
|
+
*/
|
|
48
|
+
deleteApiKey(walletAddress: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Close database connection
|
|
51
|
+
*/
|
|
52
|
+
close(): void;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErD,qBAAa,WAAW;IACtB,OAAO,CAAC,EAAE,CAAoB;gBAElB,MAAM,EAAE,MAAM;IAO1B;;OAEG;IACH,OAAO,CAAC,UAAU;IA0BlB;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAIzC;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAMhD;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO;IAoB9D;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAoB7C;;OAEG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAS7D;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW;IA+B5C;;OAEG;IACH,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAYlD;;OAEG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAKhE;;OAEG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAQ5C;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KausaLayer MCP - Database Layer
|
|
4
|
+
* SQLite database for API keys and usage tracking
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MCPDatabase = void 0;
|
|
11
|
+
const better_sqlite3_1 = __importDefault(require("better-sqlite3"));
|
|
12
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
13
|
+
const path_1 = __importDefault(require("path"));
|
|
14
|
+
class MCPDatabase {
|
|
15
|
+
db;
|
|
16
|
+
constructor(dbPath) {
|
|
17
|
+
const resolvedPath = path_1.default.resolve(dbPath);
|
|
18
|
+
this.db = new better_sqlite3_1.default(resolvedPath);
|
|
19
|
+
this.db.pragma('journal_mode = WAL');
|
|
20
|
+
this.initTables();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Initialize database tables
|
|
24
|
+
*/
|
|
25
|
+
initTables() {
|
|
26
|
+
// API keys table
|
|
27
|
+
this.db.exec(`
|
|
28
|
+
CREATE TABLE IF NOT EXISTS api_keys (
|
|
29
|
+
api_key_hash TEXT PRIMARY KEY,
|
|
30
|
+
wallet_address TEXT NOT NULL UNIQUE,
|
|
31
|
+
created_at INTEGER NOT NULL,
|
|
32
|
+
last_used_at INTEGER NOT NULL
|
|
33
|
+
)
|
|
34
|
+
`);
|
|
35
|
+
// Usage tracking table
|
|
36
|
+
this.db.exec(`
|
|
37
|
+
CREATE TABLE IF NOT EXISTS usage (
|
|
38
|
+
wallet_address TEXT PRIMARY KEY,
|
|
39
|
+
routes_today INTEGER DEFAULT 0,
|
|
40
|
+
last_reset_date TEXT NOT NULL
|
|
41
|
+
)
|
|
42
|
+
`);
|
|
43
|
+
// Create indexes
|
|
44
|
+
this.db.exec(`
|
|
45
|
+
CREATE INDEX IF NOT EXISTS idx_api_keys_wallet ON api_keys(wallet_address)
|
|
46
|
+
`);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Hash an API key for storage
|
|
50
|
+
*/
|
|
51
|
+
static hashApiKey(apiKey) {
|
|
52
|
+
return crypto_1.default.createHash('sha256').update(apiKey).digest('hex');
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Generate a new API key from wallet signature
|
|
56
|
+
*/
|
|
57
|
+
static generateApiKey(signature) {
|
|
58
|
+
const hash = crypto_1.default.createHash('sha256').update(signature).digest();
|
|
59
|
+
const keyPart = hash.toString('base64url').substring(0, 32);
|
|
60
|
+
return `kl_${keyPart}`;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Register a new API key
|
|
64
|
+
*/
|
|
65
|
+
registerApiKey(apiKey, walletAddress) {
|
|
66
|
+
const apiKeyHash = MCPDatabase.hashApiKey(apiKey);
|
|
67
|
+
const now = Date.now();
|
|
68
|
+
try {
|
|
69
|
+
const stmt = this.db.prepare(`
|
|
70
|
+
INSERT INTO api_keys (api_key_hash, wallet_address, created_at, last_used_at)
|
|
71
|
+
VALUES (?, ?, ?, ?)
|
|
72
|
+
ON CONFLICT(wallet_address) DO UPDATE SET
|
|
73
|
+
api_key_hash = excluded.api_key_hash,
|
|
74
|
+
last_used_at = excluded.last_used_at
|
|
75
|
+
`);
|
|
76
|
+
stmt.run(apiKeyHash, walletAddress, now, now);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error('Failed to register API key:', error);
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Validate an API key and return wallet address
|
|
86
|
+
*/
|
|
87
|
+
validateApiKey(apiKey) {
|
|
88
|
+
const apiKeyHash = MCPDatabase.hashApiKey(apiKey);
|
|
89
|
+
const stmt = this.db.prepare(`
|
|
90
|
+
SELECT wallet_address FROM api_keys WHERE api_key_hash = ?
|
|
91
|
+
`);
|
|
92
|
+
const row = stmt.get(apiKeyHash);
|
|
93
|
+
if (row) {
|
|
94
|
+
// Update last_used_at
|
|
95
|
+
const updateStmt = this.db.prepare(`
|
|
96
|
+
UPDATE api_keys SET last_used_at = ? WHERE api_key_hash = ?
|
|
97
|
+
`);
|
|
98
|
+
updateStmt.run(Date.now(), apiKeyHash);
|
|
99
|
+
return row.wallet_address;
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get API key record by wallet address
|
|
105
|
+
*/
|
|
106
|
+
getApiKeyByWallet(walletAddress) {
|
|
107
|
+
const stmt = this.db.prepare(`
|
|
108
|
+
SELECT api_key_hash, wallet_address, created_at, last_used_at
|
|
109
|
+
FROM api_keys WHERE wallet_address = ?
|
|
110
|
+
`);
|
|
111
|
+
const row = stmt.get(walletAddress);
|
|
112
|
+
return row || null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get usage for a wallet
|
|
116
|
+
*/
|
|
117
|
+
getUsage(walletAddress) {
|
|
118
|
+
const today = new Date().toISOString().split('T')[0];
|
|
119
|
+
const stmt = this.db.prepare(`
|
|
120
|
+
SELECT wallet_address, routes_today, last_reset_date
|
|
121
|
+
FROM usage WHERE wallet_address = ?
|
|
122
|
+
`);
|
|
123
|
+
const row = stmt.get(walletAddress);
|
|
124
|
+
if (!row) {
|
|
125
|
+
// Create new usage record
|
|
126
|
+
const insertStmt = this.db.prepare(`
|
|
127
|
+
INSERT INTO usage (wallet_address, routes_today, last_reset_date)
|
|
128
|
+
VALUES (?, 0, ?)
|
|
129
|
+
`);
|
|
130
|
+
insertStmt.run(walletAddress, today);
|
|
131
|
+
return { wallet_address: walletAddress, routes_today: 0, last_reset_date: today };
|
|
132
|
+
}
|
|
133
|
+
// Reset if new day
|
|
134
|
+
if (row.last_reset_date !== today) {
|
|
135
|
+
const updateStmt = this.db.prepare(`
|
|
136
|
+
UPDATE usage SET routes_today = 0, last_reset_date = ? WHERE wallet_address = ?
|
|
137
|
+
`);
|
|
138
|
+
updateStmt.run(today, walletAddress);
|
|
139
|
+
return { ...row, routes_today: 0, last_reset_date: today };
|
|
140
|
+
}
|
|
141
|
+
return row;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Increment route count for a wallet
|
|
145
|
+
*/
|
|
146
|
+
incrementRouteCount(walletAddress) {
|
|
147
|
+
const usage = this.getUsage(walletAddress);
|
|
148
|
+
const newCount = usage.routes_today + 1;
|
|
149
|
+
const stmt = this.db.prepare(`
|
|
150
|
+
UPDATE usage SET routes_today = ? WHERE wallet_address = ?
|
|
151
|
+
`);
|
|
152
|
+
stmt.run(newCount, walletAddress);
|
|
153
|
+
return newCount;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Check if wallet can make more routes today
|
|
157
|
+
*/
|
|
158
|
+
canMakeRoute(walletAddress, dailyLimit) {
|
|
159
|
+
const usage = this.getUsage(walletAddress);
|
|
160
|
+
return usage.routes_today < dailyLimit;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Delete an API key
|
|
164
|
+
*/
|
|
165
|
+
deleteApiKey(walletAddress) {
|
|
166
|
+
const stmt = this.db.prepare(`
|
|
167
|
+
DELETE FROM api_keys WHERE wallet_address = ?
|
|
168
|
+
`);
|
|
169
|
+
const result = stmt.run(walletAddress);
|
|
170
|
+
return result.changes > 0;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Close database connection
|
|
174
|
+
*/
|
|
175
|
+
close() {
|
|
176
|
+
this.db.close();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.MCPDatabase = MCPDatabase;
|
|
180
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oEAAsC;AACtC,oDAA4B;AAC5B,gDAAwB;AAGxB,MAAa,WAAW;IACd,EAAE,CAAoB;IAE9B,YAAY,MAAc;QACxB,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,GAAG,IAAI,wBAAQ,CAAC,YAAY,CAAC,CAAC;QACrC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACK,UAAU;QAChB,iBAAiB;QACj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