@kasarlabs/transaction-mcp 0.1.1 → 0.1.3
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/build/index.js +9 -31
- package/build/index.js.map +1 -1
- package/build/schemas/index.d.ts +31 -31
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
import { registerToolsWithServer,
|
|
4
|
+
import { registerToolsWithServer, getOnchainWrite, } from '@kasarlabs/ask-starknet-core';
|
|
5
5
|
import dotenv from 'dotenv';
|
|
6
6
|
import { simulateInvokeTransaction, simulateDeployAccountTransaction, simulateDeployTransaction, simulateDeclareTransaction, } from './tools/simulateTransaction.js';
|
|
7
7
|
import { simulateInvokeTransactionSchema, simulateDeployAccountTransactionSchema, simulateDeployTransactionSchema, simulateDeclareTransactionSchema, } from './schemas/index.js';
|
|
@@ -16,8 +16,8 @@ const registerTools = (TransactionToolRegistry) => {
|
|
|
16
16
|
description: 'Simulate a transaction without executing it',
|
|
17
17
|
schema: simulateInvokeTransactionSchema,
|
|
18
18
|
execute: async (params) => {
|
|
19
|
-
const
|
|
20
|
-
return await simulateInvokeTransaction(
|
|
19
|
+
const onchainWrite = getOnchainWrite();
|
|
20
|
+
return await simulateInvokeTransaction(onchainWrite, params);
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
TransactionToolRegistry.push({
|
|
@@ -25,8 +25,8 @@ const registerTools = (TransactionToolRegistry) => {
|
|
|
25
25
|
description: 'Simulate Deploy transaction',
|
|
26
26
|
schema: simulateDeployTransactionSchema,
|
|
27
27
|
execute: async (params) => {
|
|
28
|
-
const
|
|
29
|
-
return await simulateDeployTransaction(
|
|
28
|
+
const onchainWrite = getOnchainWrite();
|
|
29
|
+
return await simulateDeployTransaction(onchainWrite, params);
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
TransactionToolRegistry.push({
|
|
@@ -34,8 +34,8 @@ const registerTools = (TransactionToolRegistry) => {
|
|
|
34
34
|
description: 'Simulate Declare transaction',
|
|
35
35
|
schema: simulateDeclareTransactionSchema,
|
|
36
36
|
execute: async (params) => {
|
|
37
|
-
const
|
|
38
|
-
return await simulateDeclareTransaction(
|
|
37
|
+
const onchainWrite = getOnchainWrite();
|
|
38
|
+
return await simulateDeclareTransaction(onchainWrite, params);
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
TransactionToolRegistry.push({
|
|
@@ -43,8 +43,8 @@ const registerTools = (TransactionToolRegistry) => {
|
|
|
43
43
|
description: 'Simulate Deploy Account transaction',
|
|
44
44
|
schema: simulateDeployAccountTransactionSchema,
|
|
45
45
|
execute: async (params) => {
|
|
46
|
-
const
|
|
47
|
-
return await simulateDeployAccountTransaction(
|
|
46
|
+
const onchainWrite = getOnchainWrite();
|
|
47
|
+
return await simulateDeployAccountTransaction(onchainWrite, params);
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
};
|
|
@@ -53,30 +53,8 @@ export const RegisterToolInServer = async () => {
|
|
|
53
53
|
registerTools(tools);
|
|
54
54
|
await registerToolsWithServer(server, tools);
|
|
55
55
|
};
|
|
56
|
-
const checkEnv = () => {
|
|
57
|
-
const rpcUrl = process.env.STARKNET_RPC_URL;
|
|
58
|
-
const accountAddress = process.env.STARKNET_ACCOUNT_ADDRESS;
|
|
59
|
-
const privateKey = process.env.STARKNET_PRIVATE_KEY;
|
|
60
|
-
if (!rpcUrl) {
|
|
61
|
-
console.error('Missing required environment variable: STARKNET_RPC_URL');
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
if (!accountAddress) {
|
|
65
|
-
console.error('Missing required environment variable: STARKNET_ACCOUNT_ADDRESS');
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
if (!privateKey) {
|
|
69
|
-
console.error('Missing required environment variable: STARKNET_PRIVATE_KEY');
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
};
|
|
74
56
|
async function main() {
|
|
75
57
|
const transport = new StdioServerTransport();
|
|
76
|
-
if (!checkEnv()) {
|
|
77
|
-
console.error('Failed to initialize Transaction Server');
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
58
|
await RegisterToolInServer();
|
|
81
59
|
await server.connect(transport);
|
|
82
60
|
console.error('Starknet Transaction MCP Server running on stdio');
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAEL,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAEL,uBAAuB,EACvB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AA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,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE;IAC7C,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,aAAa,CAAC,KAAK,CAAC,CAAC;IACrB,MAAM,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,oBAAoB,EAAE,CAAC;IAC7B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACpE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/build/schemas/index.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ export declare const declareContractSchema: z.ZodObject<{
|
|
|
4
4
|
classHash: z.ZodOptional<z.ZodString>;
|
|
5
5
|
compiledClassHash: z.ZodOptional<z.ZodString>;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
contract?: any;
|
|
8
7
|
classHash?: string | undefined;
|
|
8
|
+
contract?: any;
|
|
9
9
|
compiledClassHash?: string | undefined;
|
|
10
10
|
}, {
|
|
11
|
-
contract?: any;
|
|
12
11
|
classHash?: string | undefined;
|
|
12
|
+
contract?: any;
|
|
13
13
|
compiledClassHash?: string | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
export declare const simulateInvokeTransactionSchema: z.ZodObject<{
|
|
@@ -51,29 +51,29 @@ export declare const simulateDeployAccountTransactionSchema: z.ZodObject<{
|
|
|
51
51
|
contractAddressSchema: z.ZodOptional<z.ZodString>;
|
|
52
52
|
}, "strip", z.ZodTypeAny, {
|
|
53
53
|
classHash: string;
|
|
54
|
-
constructorCalldata?: string[] | undefined;
|
|
55
54
|
addressSalt?: string | undefined;
|
|
55
|
+
constructorCalldata?: string[] | undefined;
|
|
56
56
|
contractAddressSchema?: string | undefined;
|
|
57
57
|
}, {
|
|
58
58
|
classHash: string;
|
|
59
|
-
constructorCalldata?: string[] | undefined;
|
|
60
59
|
addressSalt?: string | undefined;
|
|
60
|
+
constructorCalldata?: string[] | undefined;
|
|
61
61
|
contractAddressSchema?: string | undefined;
|
|
62
62
|
}>, "many">;
|
|
63
63
|
}, "strip", z.ZodTypeAny, {
|
|
64
64
|
accountAddress: string;
|
|
65
65
|
payloads: {
|
|
66
66
|
classHash: string;
|
|
67
|
-
constructorCalldata?: string[] | undefined;
|
|
68
67
|
addressSalt?: string | undefined;
|
|
68
|
+
constructorCalldata?: string[] | undefined;
|
|
69
69
|
contractAddressSchema?: string | undefined;
|
|
70
70
|
}[];
|
|
71
71
|
}, {
|
|
72
72
|
accountAddress: string;
|
|
73
73
|
payloads: {
|
|
74
74
|
classHash: string;
|
|
75
|
-
constructorCalldata?: string[] | undefined;
|
|
76
75
|
addressSalt?: string | undefined;
|
|
76
|
+
constructorCalldata?: string[] | undefined;
|
|
77
77
|
contractAddressSchema?: string | undefined;
|
|
78
78
|
}[];
|
|
79
79
|
}>;
|
|
@@ -86,30 +86,30 @@ export declare const simulateDeployTransactionSchema: z.ZodObject<{
|
|
|
86
86
|
constructorCalldata: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
87
87
|
}, "strip", z.ZodTypeAny, {
|
|
88
88
|
classHash: string;
|
|
89
|
-
constructorCalldata?: string[] | undefined;
|
|
90
89
|
addressSalt?: string | undefined;
|
|
91
90
|
unique?: string | undefined;
|
|
91
|
+
constructorCalldata?: string[] | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
classHash: string;
|
|
94
|
-
constructorCalldata?: string[] | undefined;
|
|
95
94
|
addressSalt?: string | undefined;
|
|
96
95
|
unique?: string | undefined;
|
|
96
|
+
constructorCalldata?: string[] | undefined;
|
|
97
97
|
}>, "many">;
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
99
|
accountAddress: string;
|
|
100
100
|
payloads: {
|
|
101
101
|
classHash: string;
|
|
102
|
-
constructorCalldata?: string[] | undefined;
|
|
103
102
|
addressSalt?: string | undefined;
|
|
104
103
|
unique?: string | undefined;
|
|
104
|
+
constructorCalldata?: string[] | undefined;
|
|
105
105
|
}[];
|
|
106
106
|
}, {
|
|
107
107
|
accountAddress: string;
|
|
108
108
|
payloads: {
|
|
109
109
|
classHash: string;
|
|
110
|
-
constructorCalldata?: string[] | undefined;
|
|
111
110
|
addressSalt?: string | undefined;
|
|
112
111
|
unique?: string | undefined;
|
|
112
|
+
constructorCalldata?: string[] | undefined;
|
|
113
113
|
}[];
|
|
114
114
|
}>;
|
|
115
115
|
export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
@@ -135,59 +135,59 @@ export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
|
135
135
|
L1_HANDLER: any[];
|
|
136
136
|
}>;
|
|
137
137
|
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
prime: string;
|
|
139
|
+
compiler_version: string;
|
|
140
|
+
bytecode: string[];
|
|
141
|
+
hints: Record<string, any>;
|
|
138
142
|
entry_points_by_type: {
|
|
139
143
|
CONSTRUCTOR: any[];
|
|
140
144
|
EXTERNAL: any[];
|
|
141
145
|
L1_HANDLER: any[];
|
|
142
146
|
};
|
|
147
|
+
}, {
|
|
143
148
|
prime: string;
|
|
144
149
|
compiler_version: string;
|
|
145
150
|
bytecode: string[];
|
|
146
151
|
hints: Record<string, any>;
|
|
147
|
-
}, {
|
|
148
152
|
entry_points_by_type: {
|
|
149
153
|
CONSTRUCTOR: any[];
|
|
150
154
|
EXTERNAL: any[];
|
|
151
155
|
L1_HANDLER: any[];
|
|
152
156
|
};
|
|
153
|
-
prime: string;
|
|
154
|
-
compiler_version: string;
|
|
155
|
-
bytecode: string[];
|
|
156
|
-
hints: Record<string, any>;
|
|
157
157
|
}>>;
|
|
158
158
|
compiledClassHash: z.ZodOptional<z.ZodString>;
|
|
159
159
|
}, "strip", z.ZodTypeAny, {
|
|
160
|
-
contract: string;
|
|
161
160
|
accountAddress: string;
|
|
161
|
+
contract: string;
|
|
162
162
|
classHash?: string | undefined;
|
|
163
|
-
compiledClassHash?: string | undefined;
|
|
164
163
|
casm?: {
|
|
164
|
+
prime: string;
|
|
165
|
+
compiler_version: string;
|
|
166
|
+
bytecode: string[];
|
|
167
|
+
hints: Record<string, any>;
|
|
165
168
|
entry_points_by_type: {
|
|
166
169
|
CONSTRUCTOR: any[];
|
|
167
170
|
EXTERNAL: any[];
|
|
168
171
|
L1_HANDLER: any[];
|
|
169
172
|
};
|
|
170
|
-
prime: string;
|
|
171
|
-
compiler_version: string;
|
|
172
|
-
bytecode: string[];
|
|
173
|
-
hints: Record<string, any>;
|
|
174
173
|
} | undefined;
|
|
174
|
+
compiledClassHash?: string | undefined;
|
|
175
175
|
}, {
|
|
176
|
-
contract: string;
|
|
177
176
|
accountAddress: string;
|
|
177
|
+
contract: string;
|
|
178
178
|
classHash?: string | undefined;
|
|
179
|
-
compiledClassHash?: string | undefined;
|
|
180
179
|
casm?: {
|
|
180
|
+
prime: string;
|
|
181
|
+
compiler_version: string;
|
|
182
|
+
bytecode: string[];
|
|
183
|
+
hints: Record<string, any>;
|
|
181
184
|
entry_points_by_type: {
|
|
182
185
|
CONSTRUCTOR: any[];
|
|
183
186
|
EXTERNAL: any[];
|
|
184
187
|
L1_HANDLER: any[];
|
|
185
188
|
};
|
|
186
|
-
prime: string;
|
|
187
|
-
compiler_version: string;
|
|
188
|
-
bytecode: string[];
|
|
189
|
-
hints: Record<string, any>;
|
|
190
189
|
} | undefined;
|
|
190
|
+
compiledClassHash?: string | undefined;
|
|
191
191
|
}>;
|
|
192
192
|
export declare const estimateAccountDeployFeeSchema: z.ZodObject<{
|
|
193
193
|
accountAddress: z.ZodString;
|
|
@@ -198,29 +198,29 @@ export declare const estimateAccountDeployFeeSchema: z.ZodObject<{
|
|
|
198
198
|
contractAddressSchema: z.ZodOptional<z.ZodString>;
|
|
199
199
|
}, "strip", z.ZodTypeAny, {
|
|
200
200
|
classHash: string;
|
|
201
|
-
constructorCalldata?: string[] | undefined;
|
|
202
201
|
addressSalt?: string | undefined;
|
|
202
|
+
constructorCalldata?: string[] | undefined;
|
|
203
203
|
contractAddressSchema?: string | undefined;
|
|
204
204
|
}, {
|
|
205
205
|
classHash: string;
|
|
206
|
-
constructorCalldata?: string[] | undefined;
|
|
207
206
|
addressSalt?: string | undefined;
|
|
207
|
+
constructorCalldata?: string[] | undefined;
|
|
208
208
|
contractAddressSchema?: string | undefined;
|
|
209
209
|
}>, "many">;
|
|
210
210
|
}, "strip", z.ZodTypeAny, {
|
|
211
211
|
accountAddress: string;
|
|
212
212
|
payloads: {
|
|
213
213
|
classHash: string;
|
|
214
|
-
constructorCalldata?: string[] | undefined;
|
|
215
214
|
addressSalt?: string | undefined;
|
|
215
|
+
constructorCalldata?: string[] | undefined;
|
|
216
216
|
contractAddressSchema?: string | undefined;
|
|
217
217
|
}[];
|
|
218
218
|
}, {
|
|
219
219
|
accountAddress: string;
|
|
220
220
|
payloads: {
|
|
221
221
|
classHash: string;
|
|
222
|
-
constructorCalldata?: string[] | undefined;
|
|
223
222
|
addressSalt?: string | undefined;
|
|
223
|
+
constructorCalldata?: string[] | undefined;
|
|
224
224
|
contractAddressSchema?: string | undefined;
|
|
225
225
|
}[];
|
|
226
226
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kasarlabs/transaction-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@kasarlabs/ask-starknet-core": "0.1.
|
|
19
|
+
"@kasarlabs/ask-starknet-core": "0.1.1",
|
|
20
20
|
"@langchain/core": "^0.3.42",
|
|
21
21
|
"@modelcontextprotocol/sdk": "^1.11.2",
|
|
22
22
|
"dotenv": "^16.4.7",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "4212f968456c2a170aac99306a899ae43458e23c"
|
|
43
43
|
}
|