@kasarlabs/transaction-mcp 0.1.0 → 0.1.2
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 +54 -69
- package/build/schemas/index.js +21 -23
- package/build/schemas/index.js.map +1 -1
- package/package.json +2 -2
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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YAAmB,EACnB,MAAM,CACP,CAAC;QACJ,CAAC;KACF,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
|
@@ -17,113 +17,104 @@ export declare const simulateInvokeTransactionSchema: z.ZodObject<{
|
|
|
17
17
|
payloads: z.ZodArray<z.ZodObject<{
|
|
18
18
|
contractAddress: z.ZodString;
|
|
19
19
|
entrypoint: z.ZodString;
|
|
20
|
-
calldata: z.ZodOptional<z.
|
|
20
|
+
calldata: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
22
|
contractAddress: string;
|
|
23
23
|
entrypoint: string;
|
|
24
|
-
calldata?: string[] |
|
|
24
|
+
calldata?: string[] | undefined;
|
|
25
25
|
}, {
|
|
26
26
|
contractAddress: string;
|
|
27
27
|
entrypoint: string;
|
|
28
|
-
calldata?: string[] |
|
|
28
|
+
calldata?: string[] | undefined;
|
|
29
29
|
}>, "many">;
|
|
30
30
|
}, "strip", z.ZodTypeAny, {
|
|
31
31
|
accountAddress: string;
|
|
32
32
|
payloads: {
|
|
33
33
|
contractAddress: string;
|
|
34
34
|
entrypoint: string;
|
|
35
|
-
calldata?: string[] |
|
|
35
|
+
calldata?: string[] | undefined;
|
|
36
36
|
}[];
|
|
37
37
|
}, {
|
|
38
38
|
accountAddress: string;
|
|
39
39
|
payloads: {
|
|
40
40
|
contractAddress: string;
|
|
41
41
|
entrypoint: string;
|
|
42
|
-
calldata?: string[] |
|
|
42
|
+
calldata?: string[] | undefined;
|
|
43
43
|
}[];
|
|
44
44
|
}>;
|
|
45
45
|
export declare const simulateDeployAccountTransactionSchema: z.ZodObject<{
|
|
46
46
|
accountAddress: z.ZodString;
|
|
47
47
|
payloads: z.ZodArray<z.ZodObject<{
|
|
48
48
|
classHash: z.ZodString;
|
|
49
|
-
constructorCalldata: z.ZodOptional<z.
|
|
50
|
-
addressSalt: z.ZodOptional<z.
|
|
49
|
+
constructorCalldata: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
addressSalt: z.ZodOptional<z.ZodString>;
|
|
51
51
|
contractAddressSchema: z.ZodOptional<z.ZodString>;
|
|
52
52
|
}, "strip", z.ZodTypeAny, {
|
|
53
53
|
classHash: string;
|
|
54
|
-
addressSalt?: string |
|
|
55
|
-
constructorCalldata?: string[] |
|
|
54
|
+
addressSalt?: string | undefined;
|
|
55
|
+
constructorCalldata?: string[] | undefined;
|
|
56
56
|
contractAddressSchema?: string | undefined;
|
|
57
57
|
}, {
|
|
58
58
|
classHash: string;
|
|
59
|
-
addressSalt?: string |
|
|
60
|
-
constructorCalldata?: string[] |
|
|
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
|
-
addressSalt?: string |
|
|
68
|
-
constructorCalldata?: string[] |
|
|
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
|
-
addressSalt?: string |
|
|
76
|
-
constructorCalldata?: string[] |
|
|
75
|
+
addressSalt?: string | undefined;
|
|
76
|
+
constructorCalldata?: string[] | undefined;
|
|
77
77
|
contractAddressSchema?: string | undefined;
|
|
78
78
|
}[];
|
|
79
79
|
}>;
|
|
80
80
|
export declare const simulateDeployTransactionSchema: z.ZodObject<{
|
|
81
81
|
accountAddress: z.ZodString;
|
|
82
82
|
payloads: z.ZodArray<z.ZodObject<{
|
|
83
|
-
classHash: z.
|
|
84
|
-
addressSalt: z.ZodOptional<z.
|
|
85
|
-
unique: z.ZodOptional<z.
|
|
86
|
-
constructorCalldata: z.ZodOptional<z.
|
|
83
|
+
classHash: z.ZodString;
|
|
84
|
+
addressSalt: z.ZodOptional<z.ZodString>;
|
|
85
|
+
unique: z.ZodOptional<z.ZodString>;
|
|
86
|
+
constructorCalldata: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
87
87
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
classHash: string
|
|
89
|
-
addressSalt?: string |
|
|
90
|
-
unique?: string |
|
|
91
|
-
constructorCalldata?: string[] |
|
|
88
|
+
classHash: string;
|
|
89
|
+
addressSalt?: string | undefined;
|
|
90
|
+
unique?: string | undefined;
|
|
91
|
+
constructorCalldata?: string[] | undefined;
|
|
92
92
|
}, {
|
|
93
|
-
classHash: string
|
|
94
|
-
addressSalt?: string |
|
|
95
|
-
unique?: string |
|
|
96
|
-
constructorCalldata?: string[] |
|
|
93
|
+
classHash: string;
|
|
94
|
+
addressSalt?: string | undefined;
|
|
95
|
+
unique?: string | undefined;
|
|
96
|
+
constructorCalldata?: string[] | undefined;
|
|
97
97
|
}>, "many">;
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
99
|
accountAddress: string;
|
|
100
100
|
payloads: {
|
|
101
|
-
classHash: string
|
|
102
|
-
addressSalt?: string |
|
|
103
|
-
unique?: string |
|
|
104
|
-
constructorCalldata?: string[] |
|
|
101
|
+
classHash: string;
|
|
102
|
+
addressSalt?: string | undefined;
|
|
103
|
+
unique?: string | undefined;
|
|
104
|
+
constructorCalldata?: string[] | undefined;
|
|
105
105
|
}[];
|
|
106
106
|
}, {
|
|
107
107
|
accountAddress: string;
|
|
108
108
|
payloads: {
|
|
109
|
-
classHash: string
|
|
110
|
-
addressSalt?: string |
|
|
111
|
-
unique?: string |
|
|
112
|
-
constructorCalldata?: string[] |
|
|
109
|
+
classHash: string;
|
|
110
|
+
addressSalt?: string | undefined;
|
|
111
|
+
unique?: string | undefined;
|
|
112
|
+
constructorCalldata?: string[] | undefined;
|
|
113
113
|
}[];
|
|
114
114
|
}>;
|
|
115
115
|
export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
116
116
|
accountAddress: z.ZodString;
|
|
117
|
-
contract: z.
|
|
118
|
-
program: z.ZodAny;
|
|
119
|
-
entry_points_by_type: z.ZodAny;
|
|
120
|
-
}, "strip", z.ZodTypeAny, {
|
|
121
|
-
program?: any;
|
|
122
|
-
entry_points_by_type?: any;
|
|
123
|
-
}, {
|
|
124
|
-
program?: any;
|
|
125
|
-
entry_points_by_type?: any;
|
|
126
|
-
}>]>;
|
|
117
|
+
contract: z.ZodString;
|
|
127
118
|
classHash: z.ZodOptional<z.ZodString>;
|
|
128
119
|
casm: z.ZodOptional<z.ZodObject<{
|
|
129
120
|
prime: z.ZodString;
|
|
@@ -135,19 +126,19 @@ export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
|
135
126
|
EXTERNAL: z.ZodArray<z.ZodAny, "many">;
|
|
136
127
|
L1_HANDLER: z.ZodArray<z.ZodAny, "many">;
|
|
137
128
|
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
L1_HANDLER: any[];
|
|
138
130
|
CONSTRUCTOR: any[];
|
|
139
131
|
EXTERNAL: any[];
|
|
140
|
-
L1_HANDLER: any[];
|
|
141
132
|
}, {
|
|
133
|
+
L1_HANDLER: any[];
|
|
142
134
|
CONSTRUCTOR: any[];
|
|
143
135
|
EXTERNAL: any[];
|
|
144
|
-
L1_HANDLER: any[];
|
|
145
136
|
}>;
|
|
146
137
|
}, "strip", z.ZodTypeAny, {
|
|
147
138
|
entry_points_by_type: {
|
|
139
|
+
L1_HANDLER: any[];
|
|
148
140
|
CONSTRUCTOR: any[];
|
|
149
141
|
EXTERNAL: any[];
|
|
150
|
-
L1_HANDLER: any[];
|
|
151
142
|
};
|
|
152
143
|
prime: string;
|
|
153
144
|
compiler_version: string;
|
|
@@ -155,9 +146,9 @@ export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
|
155
146
|
hints: Record<string, any>;
|
|
156
147
|
}, {
|
|
157
148
|
entry_points_by_type: {
|
|
149
|
+
L1_HANDLER: any[];
|
|
158
150
|
CONSTRUCTOR: any[];
|
|
159
151
|
EXTERNAL: any[];
|
|
160
|
-
L1_HANDLER: any[];
|
|
161
152
|
};
|
|
162
153
|
prime: string;
|
|
163
154
|
compiler_version: string;
|
|
@@ -167,16 +158,13 @@ export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
|
167
158
|
compiledClassHash: z.ZodOptional<z.ZodString>;
|
|
168
159
|
}, "strip", z.ZodTypeAny, {
|
|
169
160
|
accountAddress: string;
|
|
170
|
-
contract: string
|
|
171
|
-
program?: any;
|
|
172
|
-
entry_points_by_type?: any;
|
|
173
|
-
};
|
|
161
|
+
contract: string;
|
|
174
162
|
classHash?: string | undefined;
|
|
175
163
|
casm?: {
|
|
176
164
|
entry_points_by_type: {
|
|
165
|
+
L1_HANDLER: any[];
|
|
177
166
|
CONSTRUCTOR: any[];
|
|
178
167
|
EXTERNAL: any[];
|
|
179
|
-
L1_HANDLER: any[];
|
|
180
168
|
};
|
|
181
169
|
prime: string;
|
|
182
170
|
compiler_version: string;
|
|
@@ -186,16 +174,13 @@ export declare const simulateDeclareTransactionSchema: z.ZodObject<{
|
|
|
186
174
|
compiledClassHash?: string | undefined;
|
|
187
175
|
}, {
|
|
188
176
|
accountAddress: string;
|
|
189
|
-
contract: string
|
|
190
|
-
program?: any;
|
|
191
|
-
entry_points_by_type?: any;
|
|
192
|
-
};
|
|
177
|
+
contract: string;
|
|
193
178
|
classHash?: string | undefined;
|
|
194
179
|
casm?: {
|
|
195
180
|
entry_points_by_type: {
|
|
181
|
+
L1_HANDLER: any[];
|
|
196
182
|
CONSTRUCTOR: any[];
|
|
197
183
|
EXTERNAL: any[];
|
|
198
|
-
L1_HANDLER: any[];
|
|
199
184
|
};
|
|
200
185
|
prime: string;
|
|
201
186
|
compiler_version: string;
|
|
@@ -208,34 +193,34 @@ export declare const estimateAccountDeployFeeSchema: z.ZodObject<{
|
|
|
208
193
|
accountAddress: z.ZodString;
|
|
209
194
|
payloads: z.ZodArray<z.ZodObject<{
|
|
210
195
|
classHash: z.ZodString;
|
|
211
|
-
constructorCalldata: z.ZodOptional<z.
|
|
212
|
-
addressSalt: z.ZodOptional<z.
|
|
196
|
+
constructorCalldata: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
197
|
+
addressSalt: z.ZodOptional<z.ZodString>;
|
|
213
198
|
contractAddressSchema: z.ZodOptional<z.ZodString>;
|
|
214
199
|
}, "strip", z.ZodTypeAny, {
|
|
215
200
|
classHash: string;
|
|
216
|
-
addressSalt?: string |
|
|
217
|
-
constructorCalldata?: string[] |
|
|
201
|
+
addressSalt?: string | undefined;
|
|
202
|
+
constructorCalldata?: string[] | undefined;
|
|
218
203
|
contractAddressSchema?: string | undefined;
|
|
219
204
|
}, {
|
|
220
205
|
classHash: string;
|
|
221
|
-
addressSalt?: string |
|
|
222
|
-
constructorCalldata?: string[] |
|
|
206
|
+
addressSalt?: string | undefined;
|
|
207
|
+
constructorCalldata?: string[] | undefined;
|
|
223
208
|
contractAddressSchema?: string | undefined;
|
|
224
209
|
}>, "many">;
|
|
225
210
|
}, "strip", z.ZodTypeAny, {
|
|
226
211
|
accountAddress: string;
|
|
227
212
|
payloads: {
|
|
228
213
|
classHash: string;
|
|
229
|
-
addressSalt?: string |
|
|
230
|
-
constructorCalldata?: string[] |
|
|
214
|
+
addressSalt?: string | undefined;
|
|
215
|
+
constructorCalldata?: string[] | undefined;
|
|
231
216
|
contractAddressSchema?: string | undefined;
|
|
232
217
|
}[];
|
|
233
218
|
}, {
|
|
234
219
|
accountAddress: string;
|
|
235
220
|
payloads: {
|
|
236
221
|
classHash: string;
|
|
237
|
-
addressSalt?: string |
|
|
238
|
-
constructorCalldata?: string[] |
|
|
222
|
+
addressSalt?: string | undefined;
|
|
223
|
+
constructorCalldata?: string[] | undefined;
|
|
239
224
|
contractAddressSchema?: string | undefined;
|
|
240
225
|
}[];
|
|
241
226
|
}>;
|
package/build/schemas/index.js
CHANGED
|
@@ -10,7 +10,10 @@ export const declareContractSchema = z.object({
|
|
|
10
10
|
const callSchema = z.object({
|
|
11
11
|
contractAddress: z.string().describe('The contract address'),
|
|
12
12
|
entrypoint: z.string().describe('The entrypoint'),
|
|
13
|
-
calldata: z
|
|
13
|
+
calldata: z
|
|
14
|
+
.array(z.string())
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Array of calldata parameters'),
|
|
14
17
|
});
|
|
15
18
|
export const simulateInvokeTransactionSchema = z.object({
|
|
16
19
|
accountAddress: z.string().describe('Account Address/public key'),
|
|
@@ -18,10 +21,11 @@ export const simulateInvokeTransactionSchema = z.object({
|
|
|
18
21
|
});
|
|
19
22
|
const PayloadDeployAccountSchema = z.object({
|
|
20
23
|
classHash: z.string().describe('The class Hash Address'),
|
|
21
|
-
constructorCalldata: z
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
.
|
|
24
|
+
constructorCalldata: z
|
|
25
|
+
.array(z.string())
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Constructor calldata parameters'),
|
|
28
|
+
addressSalt: z.string().describe('Address Salt').optional(),
|
|
25
29
|
contractAddressSchema: z.string().describe('ContractAddress').optional(),
|
|
26
30
|
});
|
|
27
31
|
export const simulateDeployAccountTransactionSchema = z.object({
|
|
@@ -29,21 +33,21 @@ export const simulateDeployAccountTransactionSchema = z.object({
|
|
|
29
33
|
payloads: z.array(PayloadDeployAccountSchema),
|
|
30
34
|
});
|
|
31
35
|
const PayloadDeploySchema = z.object({
|
|
32
|
-
classHash: z.
|
|
33
|
-
z.string().regex(/^0x[0-9a-fA-F]+$/),
|
|
34
|
-
z.number(),
|
|
35
|
-
z.bigint().describe('The class Hash Address'),
|
|
36
|
-
]),
|
|
36
|
+
classHash: z.string().describe('The class Hash Address'),
|
|
37
37
|
addressSalt: z
|
|
38
|
-
.
|
|
38
|
+
.string()
|
|
39
|
+
.regex(/^0x[0-9a-fA-F]+$/)
|
|
40
|
+
.describe('Address salt as hex string')
|
|
39
41
|
.optional(),
|
|
40
42
|
unique: z
|
|
41
|
-
.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
])
|
|
43
|
+
.string()
|
|
44
|
+
.regex(/^0x[0-9a-fA-F]+$/)
|
|
45
|
+
.describe('Unique identifier as hex string')
|
|
45
46
|
.optional(),
|
|
46
|
-
constructorCalldata: z
|
|
47
|
+
constructorCalldata: z
|
|
48
|
+
.array(z.string())
|
|
49
|
+
.optional()
|
|
50
|
+
.describe('Constructor calldata parameters'),
|
|
47
51
|
});
|
|
48
52
|
export const simulateDeployTransactionSchema = z.object({
|
|
49
53
|
accountAddress: z.string().describe('Account Address'),
|
|
@@ -60,15 +64,9 @@ const cairoAssemblySchema = z.object({
|
|
|
60
64
|
L1_HANDLER: z.array(z.any()),
|
|
61
65
|
}),
|
|
62
66
|
});
|
|
63
|
-
const compiledContractSchema = z.object({
|
|
64
|
-
program: z.any(),
|
|
65
|
-
entry_points_by_type: z.any(),
|
|
66
|
-
});
|
|
67
67
|
export const simulateDeclareTransactionSchema = z.object({
|
|
68
68
|
accountAddress: z.string().describe('Account address'),
|
|
69
|
-
contract: z
|
|
70
|
-
.union([z.string(), compiledContractSchema])
|
|
71
|
-
.describe('Contract data'),
|
|
69
|
+
contract: z.string().describe('Contract data as string path or JSON string'),
|
|
72
70
|
classHash: z.string().optional().describe('Class hash of the contract'),
|
|
73
71
|
casm: cairoAssemblySchema.optional().describe('Cairo assembly data'),
|
|
74
72
|
compiledClassHash: z.string().optional().describe('Compiled class hash'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAClE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC7E,iBAAiB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,oDAAoD,CAAC;CAClE,CAAC,CAAC;AAIH,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAC5D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,QAAQ,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,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
|
1
1
|
{
|
|
2
2
|
"name": "@kasarlabs/transaction-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "3cbaf7bddcb451e4e414c9063b947891c2d0c377"
|
|
43
43
|
}
|