Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
implementing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stat committed Jan 8, 2025
1 parent 7aa7f33 commit 73edbe2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cdp-agentkit-core/src/cdp_agentkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,17 @@ export class CdpAgentkit {
): Promise<CdpAgentkit> {
const agentkit = new CdpAgentkit(config);

const mnemonicPhrase = config.mnemonicPhrase || process.env.MNEMONIC_PHRASE;
const networkId = config.networkId || process.env.NETWORK_ID || Coinbase.networks.BaseSepolia;

// TODO: ask John if i should just remove the log statements or if this is useful for the user?
try {
if (config.cdpWalletData) {
console.log("importing wallet via wallet data");
const walletData = JSON.parse(config.cdpWalletData) as WalletData;
agentkit.wallet = await Wallet.import(walletData);
} else if (config.mnemonicPhrase) {
console.log("importing wallet via mnemonic phrase");
agentkit.wallet = await Wallet.import({ mnemonicPhrase: config.mnemonicPhrase });
} else if (mnemonicPhrase) {
agentkit.wallet = await Wallet.import({ mnemonicPhrase: mnemonicPhrase });
console.log(agentkit.wallet);
} else {
console.log("creating wallet");
agentkit.wallet = await Wallet.create({ networkId: networkId });
}
} catch (error) {
Expand Down

0 comments on commit 73edbe2

Please sign in to comment.