@kasarlabs/contract-mcp 0.1.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 +21 -0
- package/README.md +29 -0
- package/bin/contract-mcp.js +14 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +64 -0
- package/build/index.js.map +1 -0
- package/build/lib/index.d.ts +1 -0
- package/build/lib/index.js +2 -0
- package/build/lib/index.js.map +1 -0
- package/build/lib/utils/contractManager.d.ts +27 -0
- package/build/lib/utils/contractManager.js +189 -0
- package/build/lib/utils/contractManager.js.map +1 -0
- package/build/lib/utils/index.d.ts +9 -0
- package/build/lib/utils/index.js +34 -0
- package/build/lib/utils/index.js.map +1 -0
- package/build/schemas/index.d.ts +43 -0
- package/build/schemas/index.js +26 -0
- package/build/schemas/index.js.map +1 -0
- package/build/tools/declareContract.d.ts +21 -0
- package/build/tools/declareContract.js +33 -0
- package/build/tools/declareContract.js.map +1 -0
- package/build/tools/deployContract.d.ts +25 -0
- package/build/tools/deployContract.js +34 -0
- package/build/tools/deployContract.js.map +1 -0
- package/build/tools/getConstructorParams.d.ts +27 -0
- package/build/tools/getConstructorParams.js +38 -0
- package/build/tools/getConstructorParams.js.map +1 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kasar Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Snak - Contract Plugin
|
|
2
|
+
|
|
3
|
+
The Contract Plugin provides comprehensive tools for declaring, deploying, and managing Starknet smart contracts.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
This plugin adds the following tools:
|
|
8
|
+
|
|
9
|
+
- **declare_contract**: Declare a Starknet contract using sierra and casm file paths.
|
|
10
|
+
- **deploy_contract**: Deploy a declared Starknet contract using sierra and casm file paths.
|
|
11
|
+
- **get_constructor_params**: Get constructor parameters from a contract sierra file.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
The Contract Plugin is used internally by the Starknet Agent and doesn't need to be called directly. When the agent is initialized, it automatically registers these tools, making them available for use.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
When asking the agent to perform contract-related tasks, it will use the appropriate tool from this plugin:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
"Declare my contract using these files..." // Uses declare_contract
|
|
23
|
+
"Deploy the contract at class hash 0x..." // Uses deploy_contract
|
|
24
|
+
"What are the constructor parameters for this contract?" // Uses get_constructor_params
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
To extend this plugin, add new tools in the `src/tools` directory and register them in the `registerTools` function in `src/index.ts`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from 'fs';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const buildPath = join(__dirname, '..', 'build', 'index.js');
|
|
8
|
+
|
|
9
|
+
if (!existsSync(buildPath)) {
|
|
10
|
+
console.error('Build not found. Run: npm run build');
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
await import(buildPath);
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import dotenv from 'dotenv';
|
|
5
|
+
import { registerToolsWithServer } from '@kasarlabs/ask-starknet-core';
|
|
6
|
+
import { declareContract } from './tools/declareContract.js';
|
|
7
|
+
import { deployContract } from './tools/deployContract.js';
|
|
8
|
+
import { getConstructorParams } from './tools/getConstructorParams.js';
|
|
9
|
+
import { declareContractSchema, deployContractSchema, getConstructorParamsSchema, } from './schemas/index.js';
|
|
10
|
+
dotenv.config();
|
|
11
|
+
const server = new McpServer({
|
|
12
|
+
name: 'starknet-contract-mcp',
|
|
13
|
+
version: '0.0.1',
|
|
14
|
+
});
|
|
15
|
+
const registerTools = (ContractToolRegistry) => {
|
|
16
|
+
ContractToolRegistry.push({
|
|
17
|
+
name: 'declare_contract',
|
|
18
|
+
description: 'Declare a Starknet contract using sierra and casm file paths',
|
|
19
|
+
schema: declareContractSchema,
|
|
20
|
+
execute: declareContract,
|
|
21
|
+
});
|
|
22
|
+
ContractToolRegistry.push({
|
|
23
|
+
name: 'deploy_contract',
|
|
24
|
+
description: 'Deploy a declared Starknet contract using sierra and casm file paths',
|
|
25
|
+
schema: deployContractSchema,
|
|
26
|
+
execute: deployContract,
|
|
27
|
+
});
|
|
28
|
+
ContractToolRegistry.push({
|
|
29
|
+
name: 'get_constructor_params',
|
|
30
|
+
description: 'Get constructor parameters from a contract sierra file',
|
|
31
|
+
schema: getConstructorParamsSchema,
|
|
32
|
+
execute: getConstructorParams,
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export const RegisterToolInServer = async () => {
|
|
36
|
+
const tools = [];
|
|
37
|
+
registerTools(tools);
|
|
38
|
+
await registerToolsWithServer(server, tools);
|
|
39
|
+
};
|
|
40
|
+
const checkEnv = () => {
|
|
41
|
+
const accountAddress = process.env.STARKNET_ACCOUNT_ADDRESS;
|
|
42
|
+
const privateKey = process.env.STARKNET_PRIVATE_KEY;
|
|
43
|
+
const rpcUrl = process.env.STARKNET_RPC_URL;
|
|
44
|
+
if (!accountAddress || !privateKey || !rpcUrl) {
|
|
45
|
+
console.error('Missing required environment variables: STARKNET_ACCOUNT_ADDRESS, STARKNET_PRIVATE_KEY, STARKNET_RPC_URL');
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
50
|
+
async function main() {
|
|
51
|
+
const transport = new StdioServerTransport();
|
|
52
|
+
if (!checkEnv()) {
|
|
53
|
+
console.error('Failed to initialize Contract Manager - missing environment variables');
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
await RegisterToolInServer();
|
|
57
|
+
await server.connect(transport);
|
|
58
|
+
console.error('Starknet Contract MCP Server running on stdio');
|
|
59
|
+
}
|
|
60
|
+
main().catch((error) => {
|
|
61
|
+
console.error('Fatal error in main():', error);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Account, RawArgs, CompiledSierra, CompiledSierraCasm, Abi } from 'starknet';
|
|
2
|
+
export declare class ContractManager {
|
|
3
|
+
account: Account;
|
|
4
|
+
compiledSierra: CompiledSierra;
|
|
5
|
+
compiledCasm: CompiledSierraCasm;
|
|
6
|
+
abi: Abi;
|
|
7
|
+
constructor(account: Account);
|
|
8
|
+
loadContractCompilationFiles(sierraPath: string, casmPath: string): Promise<void>;
|
|
9
|
+
setAbi(abi: Abi): void;
|
|
10
|
+
loadAbiFile(abiPath?: string): Promise<void>;
|
|
11
|
+
isContractDeclared(): Promise<{
|
|
12
|
+
isDeclared: boolean;
|
|
13
|
+
classHash?: string;
|
|
14
|
+
}>;
|
|
15
|
+
declareContract(): Promise<any>;
|
|
16
|
+
deployContract(classHash: string, constructorArgs?: RawArgs): Promise<any>;
|
|
17
|
+
declareAndDeployContract(constructorArgs?: RawArgs): Promise<any>;
|
|
18
|
+
extractConstructorParams(): Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
}>;
|
|
22
|
+
convertConstructorArgs(paramDefs: Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
}>, argsStrings: string[]): RawArgs;
|
|
26
|
+
convertStringToType(value: string, type: string): any;
|
|
27
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { CallData, hash, cairo, } from 'starknet';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
export class ContractManager {
|
|
4
|
+
constructor(account) {
|
|
5
|
+
this.account = account;
|
|
6
|
+
}
|
|
7
|
+
async loadContractCompilationFiles(sierraPath, casmPath) {
|
|
8
|
+
try {
|
|
9
|
+
this.compiledSierra = JSON.parse(fs.readFileSync(sierraPath).toString('ascii'));
|
|
10
|
+
this.compiledCasm = JSON.parse(fs.readFileSync(casmPath).toString('ascii'));
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
throw new Error(`Failed to load contract files: ${error.message}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
setAbi(abi) {
|
|
17
|
+
this.abi = abi;
|
|
18
|
+
}
|
|
19
|
+
async loadAbiFile(abiPath) {
|
|
20
|
+
try {
|
|
21
|
+
if (abiPath)
|
|
22
|
+
this.abi = JSON.parse(fs.readFileSync(abiPath).toString('ascii'));
|
|
23
|
+
else
|
|
24
|
+
this.abi = this.compiledSierra.abi;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw new Error(`Failed to load ABI file: ${error.message}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async isContractDeclared() {
|
|
31
|
+
try {
|
|
32
|
+
const contractHash = hash.computeContractClassHash(this.compiledSierra);
|
|
33
|
+
await this.account.getClassByHash(contractHash);
|
|
34
|
+
return { isDeclared: true, classHash: contractHash };
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return { isDeclared: false };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async declareContract() {
|
|
41
|
+
const { isDeclared, classHash } = await this.isContractDeclared();
|
|
42
|
+
if (isDeclared && classHash) {
|
|
43
|
+
return {
|
|
44
|
+
transaction_hash: '',
|
|
45
|
+
class_hash: classHash,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const declarePayload = {
|
|
50
|
+
contract: this.compiledSierra,
|
|
51
|
+
casm: this.compiledCasm,
|
|
52
|
+
};
|
|
53
|
+
const declareResponse = await this.account.declare(declarePayload);
|
|
54
|
+
await this.account.waitForTransaction(declareResponse.transaction_hash);
|
|
55
|
+
return {
|
|
56
|
+
transaction_hash: declareResponse.transaction_hash,
|
|
57
|
+
class_hash: declareResponse.class_hash,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new Error(`Failed to declare contract: ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async deployContract(classHash, constructorArgs = []) {
|
|
65
|
+
try {
|
|
66
|
+
const contractCallData = new CallData(this.abi);
|
|
67
|
+
const constructorCalldata = contractCallData.compile('constructor', constructorArgs);
|
|
68
|
+
const deployPayload = {
|
|
69
|
+
classHash,
|
|
70
|
+
constructorCalldata: constructorCalldata,
|
|
71
|
+
};
|
|
72
|
+
const deployResponse = await this.account.deployContract(deployPayload);
|
|
73
|
+
await this.account.waitForTransaction(deployResponse.transaction_hash);
|
|
74
|
+
return {
|
|
75
|
+
transaction_hash: deployResponse.transaction_hash,
|
|
76
|
+
contract_address: deployResponse.contract_address,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to deploy contract: ${error.message}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async declareAndDeployContract(constructorArgs = []) {
|
|
84
|
+
try {
|
|
85
|
+
const contractCallData = new CallData(this.compiledSierra.abi);
|
|
86
|
+
const constructorCalldata = contractCallData.compile('constructor', constructorArgs);
|
|
87
|
+
const declareAndDeployPayload = {
|
|
88
|
+
contract: this.compiledSierra,
|
|
89
|
+
casm: this.compiledCasm,
|
|
90
|
+
constructorCalldata: constructorCalldata,
|
|
91
|
+
};
|
|
92
|
+
const response = await this.account.declareAndDeploy(declareAndDeployPayload);
|
|
93
|
+
await this.account.waitForTransaction(response.deploy.transaction_hash);
|
|
94
|
+
return {
|
|
95
|
+
declare: {
|
|
96
|
+
transaction_hash: response.declare.transaction_hash,
|
|
97
|
+
class_hash: response.declare.class_hash.toString(),
|
|
98
|
+
},
|
|
99
|
+
deploy: {
|
|
100
|
+
transaction_hash: response.deploy.transaction_hash,
|
|
101
|
+
contract_address: response.deploy.contract_address,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
throw new Error(`Failed to declare and deploy contract: ${error.message}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
extractConstructorParams() {
|
|
110
|
+
const constructorDef = this.abi.find((item) => item.type === 'constructor');
|
|
111
|
+
if (!constructorDef ||
|
|
112
|
+
!constructorDef.inputs ||
|
|
113
|
+
!Array.isArray(constructorDef.inputs)) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
return constructorDef.inputs.map((input) => ({
|
|
117
|
+
name: input.name,
|
|
118
|
+
type: input.type,
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
convertConstructorArgs(paramDefs, argsStrings) {
|
|
122
|
+
if (!argsStrings || argsStrings.length === 0) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
if (paramDefs.length !== argsStrings.length) {
|
|
126
|
+
throw new Error(`Expected ${paramDefs.length} constructor arguments but got ${argsStrings.length}`);
|
|
127
|
+
}
|
|
128
|
+
const typedArgs = [];
|
|
129
|
+
for (let i = 0; i < paramDefs.length; i++) {
|
|
130
|
+
const param = paramDefs[i];
|
|
131
|
+
const argString = argsStrings[i];
|
|
132
|
+
typedArgs.push(this.convertStringToType(argString, param.type));
|
|
133
|
+
}
|
|
134
|
+
return typedArgs;
|
|
135
|
+
}
|
|
136
|
+
convertStringToType(value, type) {
|
|
137
|
+
if (value === undefined || value === null) {
|
|
138
|
+
throw new Error(`Missing value for type ${type}`);
|
|
139
|
+
}
|
|
140
|
+
const simpleType = type.includes('::') ? type.split('::').pop() : type;
|
|
141
|
+
switch (true) {
|
|
142
|
+
case simpleType === 'felt252' ||
|
|
143
|
+
/^u(8|16|32|64|128)$/.test(simpleType || ''):
|
|
144
|
+
return BigInt(value);
|
|
145
|
+
case simpleType === 'u256':
|
|
146
|
+
try {
|
|
147
|
+
return cairo.uint256(value);
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
try {
|
|
151
|
+
const parsed = JSON.parse(value);
|
|
152
|
+
if (parsed.low !== undefined && parsed.high !== undefined) {
|
|
153
|
+
return {
|
|
154
|
+
low: BigInt(parsed.low),
|
|
155
|
+
high: BigInt(parsed.high),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
throw new Error(`Invalid u256 format: ${value}`);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
case simpleType === 'bool':
|
|
165
|
+
return value.toLowerCase() === 'true' || value === '1';
|
|
166
|
+
case simpleType === 'ContractAddress' ||
|
|
167
|
+
simpleType === 'EthAddress' ||
|
|
168
|
+
simpleType === 'ClassHash':
|
|
169
|
+
return value.startsWith('0x') ? value : `0x${value}`;
|
|
170
|
+
case simpleType === 'ByteArray' || simpleType === 'bytearray':
|
|
171
|
+
return value;
|
|
172
|
+
case type.includes('Array'):
|
|
173
|
+
if (value.includes(',')) {
|
|
174
|
+
const elements = value.split(',').map((item) => item.trim());
|
|
175
|
+
return elements;
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
179
|
+
return JSON.parse(value);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
catch { }
|
|
183
|
+
return value;
|
|
184
|
+
default:
|
|
185
|
+
return value;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=contractManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractManager.js","sourceRoot":"","sources":["../../../src/lib/utils/contractManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,IAAI,EAIJ,KAAK,GACN,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAKzB,MAAM,OAAO,eAAe;IAK1B,YAAmB,OAAgB;QAAhB,YAAO,G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AC,CAAC;oBACnD,CAAC;oBAAC,MAAM,CAAC;wBACP,MAAM,KAAK,CAAC;oBACd,CAAC;gBACH,CAAC;YACH,KAAK,UAAU,KAAK,MAAM;gBACxB,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,CAAC;YACzD,KAAK,UAAU,KAAK,iBAAiB;gBACnC,UAAU,KAAK,YAAY;gBAC3B,UAAU,KAAK,WAAW;gBAC1B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;YACvD,KAAK,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,WAAW;gBAC3D,OAAO,KAAK,CAAC;YACf,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACzB,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC7D,OAAO,QAAQ,CAAC;gBAClB,CAAC;gBACD,IAAI,CAAC;oBACH,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;wBACjD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAC3B,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;gBAEV,OAAO,KAAK,CAAC;YACf;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ContractManager } from './contractManager.js';
|
|
2
|
+
export interface StarknetCredentials {
|
|
3
|
+
accountAddress: string;
|
|
4
|
+
accountPrivateKey: string;
|
|
5
|
+
rpcUrl: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getStarknetCredentials(): StarknetCredentials;
|
|
8
|
+
export declare function validateFilePaths(sierraPath: string, casmPath: string): Promise<void>;
|
|
9
|
+
export declare function formatContractError(error: any): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { ContractManager } from './contractManager.js';
|
|
2
|
+
export function getStarknetCredentials() {
|
|
3
|
+
const accountAddress = process.env.STARKNET_ACCOUNT_ADDRESS;
|
|
4
|
+
const accountPrivateKey = process.env.STARKNET_PRIVATE_KEY;
|
|
5
|
+
const rpcUrl = process.env.STARKNET_RPC_URL;
|
|
6
|
+
if (!accountAddress || !accountPrivateKey || !rpcUrl) {
|
|
7
|
+
throw new Error('Missing required environment variables: STARKNET_ACCOUNT_ADDRESS, STARKNET_PRIVATE_KEY, STARKNET_RPC_URL');
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
accountAddress,
|
|
11
|
+
accountPrivateKey,
|
|
12
|
+
rpcUrl,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export async function validateFilePaths(sierraPath, casmPath) {
|
|
16
|
+
const fs = await import('fs/promises');
|
|
17
|
+
try {
|
|
18
|
+
await fs.access(sierraPath, fs.constants.R_OK);
|
|
19
|
+
await fs.access(casmPath, fs.constants.R_OK);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
throw new Error(`File validation failed: ${error}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function formatContractError(error) {
|
|
26
|
+
if (typeof error === 'string') {
|
|
27
|
+
return error;
|
|
28
|
+
}
|
|
29
|
+
if (error?.message) {
|
|
30
|
+
return error.message;
|
|
31
|
+
}
|
|
32
|
+
return 'Unknown contract operation error';
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ut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@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const declareContractSchema: z.ZodObject<{
|
|
3
|
+
sierraFilePath: z.ZodString;
|
|
4
|
+
casmFilePath: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
sierraFilePath: string;
|
|
7
|
+
casmFilePath: string;
|
|
8
|
+
}, {
|
|
9
|
+
sierraFilePath: string;
|
|
10
|
+
casmFilePath: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const deployContractSchema: z.ZodObject<{
|
|
13
|
+
sierraFilePath: z.ZodString;
|
|
14
|
+
casmFilePath: z.ZodString;
|
|
15
|
+
classHash: z.ZodString;
|
|
16
|
+
constructorArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
sierraFilePath: string;
|
|
19
|
+
casmFilePath: string;
|
|
20
|
+
classHash: string;
|
|
21
|
+
constructorArgs?: string[] | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
sierraFilePath: string;
|
|
24
|
+
casmFilePath: string;
|
|
25
|
+
classHash: string;
|
|
26
|
+
constructorArgs?: string[] | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const getConstructorParamsSchema: z.ZodObject<{
|
|
29
|
+
sierraFilePath: z.ZodString;
|
|
30
|
+
casmFilePath: z.ZodString;
|
|
31
|
+
classHash: z.ZodString;
|
|
32
|
+
constructorArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
sierraFilePath: string;
|
|
35
|
+
casmFilePath: string;
|
|
36
|
+
classHash: string;
|
|
37
|
+
constructorArgs?: string[] | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
sierraFilePath: string;
|
|
40
|
+
casmFilePath: string;
|
|
41
|
+
classHash: string;
|
|
42
|
+
constructorArgs?: string[] | undefined;
|
|
43
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const declareContractSchema = z.object({
|
|
3
|
+
sierraFilePath: z.string().describe('Path to the sierra JSON file'),
|
|
4
|
+
casmFilePath: z.string().describe('Path to the casm JSON file'),
|
|
5
|
+
});
|
|
6
|
+
export const deployContractSchema = z.object({
|
|
7
|
+
sierraFilePath: z.string().describe('Path to the sierra JSON file'),
|
|
8
|
+
casmFilePath: z.string().describe('Path to the casm JSON file'),
|
|
9
|
+
classHash: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe('Class hash of the declared contract to deploy'),
|
|
12
|
+
constructorArgs: z
|
|
13
|
+
.array(z.string())
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('OPTIONAL: Arguments for the contract constructor'),
|
|
16
|
+
});
|
|
17
|
+
export const getConstructorParamsSchema = z.object({
|
|
18
|
+
sierraFilePath: z.string().describe('Path to the sierra JSON file'),
|
|
19
|
+
casmFilePath: z.string().describe('Path to the casm JSON file'),
|
|
20
|
+
classHash: z.string().describe('Class hash of the declared contract'),
|
|
21
|
+
constructorArgs: z
|
|
22
|
+
.array(z.string())
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('OPTIONAL: Arguments for the contract constructor that need to be ordered'),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACnE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAChE,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACnE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC/D,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,+CAA+C,CAAC;IAC5D,eAAe,EAAE,CAAC;SACf,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,kDAAkD,CAAC;CAChE,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACnE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC/D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACrE,eAAe,EAAE,CAAC;SACf,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,0EAA0E,CAC3E;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { declareContractSchema } from '../schemas/index.js';
|
|
3
|
+
export declare const declareContract: (params: z.infer<typeof declareContractSchema>) => Promise<{
|
|
4
|
+
status: string;
|
|
5
|
+
transactionHash: any;
|
|
6
|
+
classHash: any;
|
|
7
|
+
sierraFilePath: string;
|
|
8
|
+
casmFilePath: string;
|
|
9
|
+
message: string;
|
|
10
|
+
error?: undefined;
|
|
11
|
+
step?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
status: string;
|
|
14
|
+
error: string;
|
|
15
|
+
step: string;
|
|
16
|
+
sierraFilePath: string;
|
|
17
|
+
casmFilePath: string;
|
|
18
|
+
transactionHash?: undefined;
|
|
19
|
+
classHash?: undefined;
|
|
20
|
+
message?: undefined;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getOnchainWrite } from '@kasarlabs/ask-starknet-core';
|
|
2
|
+
import { validateFilePaths, formatContractError, ContractManager, } from '../lib/index.js';
|
|
3
|
+
export const declareContract = async (params) => {
|
|
4
|
+
try {
|
|
5
|
+
await validateFilePaths(params.sierraFilePath, params.casmFilePath);
|
|
6
|
+
const { provider, account } = getOnchainWrite();
|
|
7
|
+
const contractManager = new ContractManager(account);
|
|
8
|
+
await contractManager.loadContractCompilationFiles(params.sierraFilePath, params.casmFilePath);
|
|
9
|
+
const declareResponse = await contractManager.declareContract();
|
|
10
|
+
const contractManagerForHash = new ContractManager(account);
|
|
11
|
+
await contractManagerForHash.loadContractCompilationFiles(params.sierraFilePath, params.casmFilePath);
|
|
12
|
+
const { classHash: calculatedClassHash } = await contractManagerForHash.isContractDeclared();
|
|
13
|
+
return {
|
|
14
|
+
status: 'success',
|
|
15
|
+
transactionHash: declareResponse.transaction_hash || '',
|
|
16
|
+
classHash: declareResponse.class_hash || calculatedClassHash,
|
|
17
|
+
sierraFilePath: params.sierraFilePath,
|
|
18
|
+
casmFilePath: params.casmFilePath,
|
|
19
|
+
message: 'Contract declared successfully',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
const errorMessage = formatContractError(error);
|
|
24
|
+
return {
|
|
25
|
+
status: 'failure',
|
|
26
|
+
error: errorMessage,
|
|
27
|
+
step: 'contract declaration',
|
|
28
|
+
sierraFilePath: params.sierraFilePath,
|
|
29
|
+
casmFilePath: params.casmFilePath,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=declareContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declareCont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ChD,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,sBAAsB;YAC5B,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deployContractSchema } from '../schemas/index.js';
|
|
3
|
+
export declare const deployContract: (params: z.infer<typeof deployContractSchema>) => Promise<{
|
|
4
|
+
status: string;
|
|
5
|
+
transactionHash: any;
|
|
6
|
+
contractAddress: any;
|
|
7
|
+
classHash: string;
|
|
8
|
+
constructorArgs: string[];
|
|
9
|
+
sierraFilePath: string;
|
|
10
|
+
casmFilePath: string;
|
|
11
|
+
message: string;
|
|
12
|
+
error?: undefined;
|
|
13
|
+
step?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
status: string;
|
|
16
|
+
error: string;
|
|
17
|
+
step: string;
|
|
18
|
+
classHash: string;
|
|
19
|
+
constructorArgs: string[];
|
|
20
|
+
sierraFilePath: string;
|
|
21
|
+
casmFilePath: string;
|
|
22
|
+
transactionHash?: undefined;
|
|
23
|
+
contractAddress?: undefined;
|
|
24
|
+
message?: undefined;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getOnchainWrite } from '@kasarlabs/ask-starknet-core';
|
|
2
|
+
import { formatContractError, ContractManager, } from '../lib/index.js';
|
|
3
|
+
export const deployContract = async (params) => {
|
|
4
|
+
try {
|
|
5
|
+
const { provider, account } = getOnchainWrite();
|
|
6
|
+
const contractManager = new ContractManager(account);
|
|
7
|
+
await contractManager.loadContractCompilationFiles(params.sierraFilePath, params.casmFilePath);
|
|
8
|
+
await contractManager.loadAbiFile();
|
|
9
|
+
const deployResponse = await contractManager.deployContract(params.classHash, params.constructorArgs || []);
|
|
10
|
+
return {
|
|
11
|
+
status: 'success',
|
|
12
|
+
transactionHash: deployResponse.transaction_hash,
|
|
13
|
+
contractAddress: deployResponse.contract_address,
|
|
14
|
+
classHash: params.classHash,
|
|
15
|
+
constructorArgs: params.constructorArgs || [],
|
|
16
|
+
sierraFilePath: params.sierraFilePath,
|
|
17
|
+
casmFilePath: params.casmFilePath,
|
|
18
|
+
message: 'Contract deployed successfully',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
const errorMessage = formatContractError(error);
|
|
23
|
+
return {
|
|
24
|
+
status: 'failure',
|
|
25
|
+
error: errorMessage,
|
|
26
|
+
step: 'contract deployment',
|
|
27
|
+
classHash: params.classHash,
|
|
28
|
+
constructorArgs: params.constructorArgs || [],
|
|
29
|
+
sierraFilePath: params.sierraFilePath,
|
|
30
|
+
casmFilePath: params.casmFilePath,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=deployContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployContract.js","sourceRoot":"","sources":["../../src/tools/deployContract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAEL,mBAAmB,EACnB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,MAA4C,EAC5C,EAAE;IACF,IAAI,CAAC;QAKH,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;QAGhD,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QACrD,MAAM,eAAe,CAAC,4BAA4B,CAChD,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,YAAY,CACpB,CAAC;QACF,MAAM,eAAe,CAAC,WAAW,EAAE,CAAC;QAEpC,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC,cAAc,CACzD,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,eAAe,IAAI,EAAE,CAC7B,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,eAAe,EAAE,cAAc,CAAC,gBAAgB;YAChD,eAAe,EAAE,cAAc,CAAC,gBAAgB;YAChD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,EAAE;YAC7C,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,OAAO,EAAE,gCAAgC;SAC1C,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAChD,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,EAAE;YAC7C,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getConstructorParamsSchema } from '../schemas/index.js';
|
|
3
|
+
export declare const getConstructorParams: (params: z.infer<typeof getConstructorParamsSchema>) => Promise<{
|
|
4
|
+
status: string;
|
|
5
|
+
classHash: string;
|
|
6
|
+
sierraFilePath: string;
|
|
7
|
+
message: string;
|
|
8
|
+
parameterCount: number;
|
|
9
|
+
parameters: {
|
|
10
|
+
index: number;
|
|
11
|
+
name: any;
|
|
12
|
+
type: any;
|
|
13
|
+
}[];
|
|
14
|
+
error?: undefined;
|
|
15
|
+
step?: undefined;
|
|
16
|
+
providedArgs?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
status: string;
|
|
19
|
+
error: string;
|
|
20
|
+
step: string;
|
|
21
|
+
classHash: string;
|
|
22
|
+
sierraFilePath: string;
|
|
23
|
+
providedArgs: string[];
|
|
24
|
+
message?: undefined;
|
|
25
|
+
parameterCount?: undefined;
|
|
26
|
+
parameters?: undefined;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { validateFilePaths, formatContractError, ContractManager, } from '../lib/index.js';
|
|
2
|
+
import { Account, RpcProvider } from 'starknet';
|
|
3
|
+
export const getConstructorParams = async (params) => {
|
|
4
|
+
try {
|
|
5
|
+
await validateFilePaths(params.sierraFilePath, params.casmFilePath);
|
|
6
|
+
const provider = new RpcProvider({
|
|
7
|
+
nodeUrl: 'https://starknet-mainnet.public.blastapi.io',
|
|
8
|
+
});
|
|
9
|
+
const dummyAccount = new Account(provider, '0x1', '0x1');
|
|
10
|
+
const contractManager = new ContractManager(dummyAccount);
|
|
11
|
+
await contractManager.loadContractCompilationFiles(params.sierraFilePath, params.casmFilePath);
|
|
12
|
+
const constructorParams = contractManager.extractConstructorParams();
|
|
13
|
+
return {
|
|
14
|
+
status: 'success',
|
|
15
|
+
classHash: params.classHash,
|
|
16
|
+
sierraFilePath: params.sierraFilePath,
|
|
17
|
+
message: 'Constructor parameters retrieved successfully',
|
|
18
|
+
parameterCount: constructorParams.length,
|
|
19
|
+
parameters: constructorParams.map((param, index) => ({
|
|
20
|
+
index,
|
|
21
|
+
name: param.name,
|
|
22
|
+
type: param.type,
|
|
23
|
+
})),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
const errorMessage = formatContractError(error);
|
|
28
|
+
return {
|
|
29
|
+
status: 'failure',
|
|
30
|
+
error: errorMessage,
|
|
31
|
+
step: 'getting constructor parameters',
|
|
32
|
+
classHash: params.classHash,
|
|
33
|
+
sierraFilePath: params.sierraFilePath,
|
|
34
|
+
providedArgs: params.constructorArgs || [],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=getConstructorParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConstructorParams.js","sourceRoot":"","sources":["../../src/tools/getConstructorParams.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAOhD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,MAAkD,EAClD,EAAE;IACF,IAAI,CAAC;QAEH,MAAM,iBAAiB,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAGpE,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC;YAC/B,OAAO,EAAE,6CAA6C;SACvD,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAEzD,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;QAC1D,MAAM,eAAe,CAAC,4BAA4B,CAChD,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,YAAY,CACpB,CAAC;QAEF,MAAM,iBAAiB,GAAG,eAAe,CAAC,wBAAwB,EAAE,CAAC;QAErE,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,OAAO,EAAE,+CAA+C;YACxD,cAAc,EAAE,iBAAiB,CAAC,MAAM;YACxC,UAAU,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC;gBAChE,KAAK;gBACL,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAChD,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,gCAAgC;YACtC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,YAAY,EAAE,MAAM,CAAC,eAAe,IAAI,EAAE;SAC3C,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kasarlabs/contract-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"contract-mcp": "./bin/contract-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc && chmod 755 build/index.js",
|
|
11
|
+
"clean": "rm -rf build",
|
|
12
|
+
"clean:all": "rm -rf build node_modules",
|
|
13
|
+
"start": "node build/index.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"build"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@kasarlabs/ask-starknet-core": "0.1.0",
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.11.2",
|
|
21
|
+
"dotenv": "^16.4.7",
|
|
22
|
+
"starknet": "^7.6.4",
|
|
23
|
+
"winston": "^3.17.0",
|
|
24
|
+
"zod": "^3.24.2"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.13.10",
|
|
28
|
+
"typescript": "^5.8.2"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"starknet",
|
|
33
|
+
"contract"
|
|
34
|
+
],
|
|
35
|
+
"author": "kasarlabs",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"description": "MCP server for Starknet contract operations including declaration and deployment.",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "2239ec60f8e369abd318807cecd22fe97c0ab917"
|
|
42
|
+
}
|