Skip to content

Commit 93551d3

Browse files
committed
fix: fixed tools, using human readable format for amounts instead of wei
1 parent 562e71e commit 93551d3

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ This server implements the following MCP tools:
422422
- `get_starknet_nft_balance`: Get the number of NFTs owned by an address
423423

424424
#### Transfer Tools
425-
- `transfer_starknet_eth`: Transfer ETH from one account to another
426-
- `transfer_starknet_strk`: Transfer STRK from one account to another
427-
- `transfer_starknet_token`: Transfer ERC20 tokens from one account to another
425+
- `transfer_starknet_eth`: Transfer ETH from one account to another (amounts in human-readable format)
426+
- `transfer_starknet_strk`: Transfer STRK from one account to another (amounts in human-readable format)
427+
- `transfer_starknet_token`: Transfer ERC20 tokens from one account to another (amounts in human-readable format)
428428

429429
### Available MCP Resources
430430

@@ -475,6 +475,7 @@ When using this server with AI assistants like Claude or GPT:
475475
## 🔒 Security Considerations
476476

477477
- **Private keys** are used only for transaction signing and are never stored by the server
478+
- **All token amounts** are specified in human-readable format (e.g., ETH, STRK, token units) rather than in wei or smallest units
478479
- Always validate and sanitize input parameters before executing operations
479480
- Consider implementing additional authentication mechanisms for production use
480481
- Use HTTPS for the HTTP server in production environments

src/core/tools.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -725,10 +725,10 @@ export function registerTools(server: McpServer) {
725725
"transfer_starknet_eth",
726726
"Transfer ETH from one account to another",
727727
{
728-
privateKey: z.string().describe("Private key of the sender account"),
728+
privateKey: z.string().describe("Private key of the sender account (not stored, only used to sign the transaction)"),
729729
from: z.string().describe("Sender's Starknet address"),
730730
to: z.string().describe("Recipient's Starknet address or Starknet ID"),
731-
amount: z.string().describe("Amount to transfer in wei"),
731+
amount: z.string().describe("Amount to transfer in ETH (human readable format, not wei)"),
732732
maxFee: z.string().optional().describe("Maximum fee to pay (optional)"),
733733
network: z.string().optional().describe("Network name (e.g., 'mainnet', 'sepolia'). Defaults to Mainnet.")
734734
},
@@ -738,7 +738,7 @@ export function registerTools(server: McpServer) {
738738
privateKey,
739739
from,
740740
to,
741-
amount,
741+
amount, // Will be converted from human-readable ETH to wei internally
742742
maxFee
743743
}, network);
744744

@@ -768,10 +768,10 @@ export function registerTools(server: McpServer) {
768768
"transfer_starknet_strk",
769769
"Transfer STRK from one account to another",
770770
{
771-
privateKey: z.string().describe("Private key of the sender account"),
771+
privateKey: z.string().describe("Private key of the sender account (not stored, only used to sign the transaction)"),
772772
from: z.string().describe("Sender's Starknet address"),
773773
to: z.string().describe("Recipient's Starknet address or Starknet ID"),
774-
amount: z.string().describe("Amount to transfer in wei"),
774+
amount: z.string().describe("Amount to transfer in STRK (human readable format, not wei)"),
775775
maxFee: z.string().optional().describe("Maximum fee to pay (optional)"),
776776
network: z.string().optional().describe("Network name (e.g., 'mainnet', 'sepolia'). Defaults to Mainnet.")
777777
},
@@ -781,7 +781,7 @@ export function registerTools(server: McpServer) {
781781
privateKey,
782782
from,
783783
to,
784-
amount,
784+
amount, // Will be converted from human-readable STRK to wei internally
785785
maxFee
786786
}, network);
787787

@@ -811,11 +811,11 @@ export function registerTools(server: McpServer) {
811811
"transfer_starknet_token",
812812
"Transfer ERC20 tokens from one account to another",
813813
{
814-
privateKey: z.string().describe("Private key of the sender account"),
814+
privateKey: z.string().describe("Private key of the sender account (not stored, only used to sign the transaction)"),
815815
from: z.string().describe("Sender's Starknet address"),
816816
to: z.string().describe("Recipient's Starknet address or Starknet ID"),
817817
tokenAddress: z.string().describe("Token contract address or Starknet ID"),
818-
amount: z.string().describe("Amount to transfer (in token's smallest unit)"),
818+
amount: z.string().describe("Amount to transfer in token's standard units (human readable format, not in smallest unit)"),
819819
maxFee: z.string().optional().describe("Maximum fee to pay (optional)"),
820820
network: z.string().optional().describe("Network name (e.g., 'mainnet', 'sepolia'). Defaults to Mainnet.")
821821
},
@@ -826,7 +826,7 @@ export function registerTools(server: McpServer) {
826826
from,
827827
to,
828828
tokenAddress,
829-
amount,
829+
amount, // Will be converted from human-readable token units to smallest units internally
830830
maxFee
831831
}, network);
832832

@@ -856,7 +856,7 @@ export function registerTools(server: McpServer) {
856856
"execute_starknet_contract",
857857
"Execute a contract call (write operation)",
858858
{
859-
privateKey: z.string().describe("Private key of the sender account"),
859+
privateKey: z.string().describe("Private key of the sender account (not stored, only used to sign the transaction)"),
860860
accountAddress: z.string().describe("Sender's Starknet address"),
861861
contractAddress: z.string().describe("Contract address or Starknet ID"),
862862
entrypoint: z.string().describe("Function name to call"),

0 commit comments

Comments
 (0)