@iqai/mcp-fraxlend
Version:
Mcp server for Fraxlend access
29 lines • 911 B
JavaScript
import { http, createPublicClient, createWalletClient, } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { fraxtal } from "viem/chains";
export class WalletService {
publicClient;
walletClient;
constructor(privateKey, chain = fraxtal) {
console.log("[WALLET_SERVICE] Initializing wallet service with private key: ", privateKey);
this.publicClient = createPublicClient({
chain,
transport: http(),
});
if (privateKey) {
const account = privateKeyToAccount(`0x${privateKey}`);
this.walletClient = createWalletClient({
account,
chain,
transport: http(),
});
}
}
getPublicClient() {
return this.publicClient;
}
getWalletClient() {
return this.walletClient;
}
}
//# sourceMappingURL=wallet.js.map