diff --git a/packages/plugin-cosmos/src/actions/transfer.ts b/packages/plugin-cosmos/src/actions/transfer.ts index cef9766a3e..bda8cf5294 100644 --- a/packages/plugin-cosmos/src/actions/transfer.ts +++ b/packages/plugin-cosmos/src/actions/transfer.ts @@ -15,7 +15,6 @@ import { getCosmosWalletKey } from "../keypairUtils.ts"; import { connectWallet, estimateGas } from "../providers/wallet"; import { StdFee } from "@cosmjs/stargate"; -import { c } from "vitest/dist/reporters-5f784f42.js"; /** * Example interface for user-specified Cosmos transfer details. diff --git a/packages/plugin-cosmos/src/providers/wallet.ts b/packages/plugin-cosmos/src/providers/wallet.ts index 15505f5e78..b16575b571 100644 --- a/packages/plugin-cosmos/src/providers/wallet.ts +++ b/packages/plugin-cosmos/src/providers/wallet.ts @@ -5,7 +5,10 @@ import { SigningStargateClient, StdFee } from "@cosmjs/stargate"; import { getOfflineSignerProto as getOfflineSigner } from "cosmjs-utils"; import { IAgentRuntime, Memory, Provider, State } from "@elizaos/core"; import { TEEMode } from "@elizaos/plugin-cosmos-tee"; -import { DirectSecp256k1Wallet } from "@cosmjs/proto-signing"; +import { + DirectSecp256k1HdWallet, + DirectSecp256k1Wallet, +} from "@cosmjs/proto-signing"; /** Minimal CosmosChainInfo shape */ export interface CosmosChainInfo { @@ -153,17 +156,18 @@ export async function connectWallet( ); } - // Create offline signer with the mnemonic - signer = await getOfflineSigner({ - mnemonic, - chain: chainInfo, + const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, { + prefix: "osmo", }); - console.log("signer>>>>>>>>>>>>..", signer); + // Create offline signer with the mnemonic + // signer = await getOfflineSigner({ + // mnemonic, + // chain: chainInfo, + // }); + signer = wallet; } - console.log("signer>>>>>>>>.", signer); - // Connect Stargate client const stargateClient = await SigningStargateClient.connectWithSigner( rpcUrl, @@ -174,8 +178,6 @@ export async function connectWallet( const [account] = await signer.getAccounts(); signerAddress = account.address; - console.log("signerAddress>>>>>>", signerAddress); - console.log( `connectWallet: Connected to chain '${chainInfo.chain_name}', address: ${signerAddress}` );