index.ts•2.19 kB
/**
* MCP Resources for MIST.cash
*/
import { CHAMBER_ABI } from '@mistcash/config';
import { txHash } from '@mistcash/crypto';
import type { StarknetNetwork } from '../types.js';
import { getContractAddress } from '../utils/provider.js';
/**
* Resource 1: Chamber Contract Information
*/
export function getChamberContractInfo(network: StarknetNetwork = 'mainnet') {
const contractAddress = getContractAddress(network);
return {
uri: 'chamber://contract-info',
mimeType: 'application/json',
text: JSON.stringify({
contract_address: contractAddress,
network,
abi: CHAMBER_ABI,
description: 'MIST.cash Chamber contract for private payments on Starknet',
features: [
'Private transactions with claiming keys',
'Multi-token support (ETH, USDC, USDT, DAI)',
'Zero-knowledge proof verification',
'Non-custodial privacy layer'
]
}, null, 2)
};
}
/**
* Resource 2: Transaction Details by Hash
*/
export function getTransactionDetails(txHashValue: string) {
return {
uri: `chamber://tx/${txHashValue}`,
mimeType: 'application/json',
text: JSON.stringify({
hash: txHashValue,
note: 'Transaction details can be retrieved using the obtener_assets_transaccion or verificar_existencia_transaccion tools',
privacy_notice: 'MIST.cash transactions are private. Full details may not be publicly available.'
}, null, 2)
};
}
/**
* List all available resources
*/
export function listResources() {
return [
{
uri: 'chamber://contract-info',
name: 'Chamber Contract Information',
description: 'Static information about the MIST.cash Chamber contract',
mimeType: 'application/json'
},
{
uri: 'chamber://tx/{txHash}',
name: 'Transaction Details',
description: 'Details for a specific transaction by hash',
mimeType: 'application/json'
}
];
}