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

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implementing feedback
Browse files Browse the repository at this point in the history
stat committed Jan 8, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent faf48be commit 87da8bc
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
@@ -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) {

0 comments on commit 87da8bc

Please sign in to comment.