Skip to content

Commit

Permalink
chore: Release AgentKit Core Py 0.0.9 Node.js 0.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase committed Jan 17, 2025
1 parent c53a5bd commit cd489a8
Show file tree
Hide file tree
Showing 29 changed files with 3,803 additions and 33 deletions.
3 changes: 3 additions & 0 deletions cdp-agentkit-core/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

## Unreleased

## [0.0.9] - 2025-01-17

### Added

- Added `get_balance_nft` action.
- Added `transfer_nft` action.
- Added `pyth_fetch_price_feed_id` action to fetch the price feed ID for a given token symbol from Pyth.
- Added `pyth_fetch_price` action to fetch the price of a given price feed from Pyth.
- Bump `cdp-sdk` dependency to `0.14.1`.

## [0.0.8] - 2025-01-13

Expand Down
2 changes: 1 addition & 1 deletion cdp-agentkit-core/python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

project = 'CDP Agentkit - Core'
author = 'Coinbase Developer Platform'
release = '0.0.8'
release = '0.0.9'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
3,598 changes: 3,598 additions & 0 deletions cdp-agentkit-core/python/poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cdp-agentkit-core/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cdp-agentkit-core"
version = "0.0.8"
version = "0.0.9"
description = "CDP Agentkit core primitives"
authors = ["John Peterson <[email protected]>"]
readme = "../README.md"
Expand All @@ -10,7 +10,7 @@ packages = [{ include = "cdp_agentkit_core" }]

[tool.poetry.dependencies]
python = "^3.10"
cdp-sdk = "^0.13.0"
cdp-sdk = "^0.14.1"
pydantic = "^2.0"
web3 = "^7.6.0"

Expand Down
3 changes: 3 additions & 0 deletions cdp-agentkit-core/typescript/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

## Unreleased

## [0.0.12] - 2025-01-17

### Added

- Added `get_balance_nft` action.
- Added `transfer_nft` action.
- Added `pyth_fetch_price_feed_id` action to fetch the price feed ID for a given token symbol from Pyth.
- Added `pyth_fetch_price` action to fetch the price of a given price feed from Pyth.
- Bump dependency `coinbase-sdk-nodejs` to version `0.14.1`.

## [0.0.11] - 2025-01-13

Expand Down
4 changes: 2 additions & 2 deletions cdp-agentkit-core/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@coinbase/cdp-agentkit-core",
"description": "CDP Agentkit core primitives",
"repository": "https://github.com/coinbase/cdp-agentkit-nodejs",
"version": "0.0.11",
"version": "0.0.12",
"author": "Coinbase Inc.",
"license": "Apache-2.0",
"main": "dist/index.js",
Expand Down Expand Up @@ -39,7 +39,7 @@
"typescript"
],
"dependencies": {
"@coinbase/coinbase-sdk": "^0.13.0",
"@coinbase/coinbase-sdk": "^0.14.1",
"twitter-api-v2": "^1.18.2",
"viem": "^2.21.51",
"zod": "^3.23.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export async function wowBuyToken(
});

const result = await invocation.wait();
return `Purchased WoW ERC20 memecoin with transaction hash: ${result.getTransaction().getTransactionHash()}`;
return `Purchased WoW ERC20 memecoin with transaction hash: ${result
.getTransaction()
.getTransactionHash()}`;
} catch (error) {
return `Error buying Zora Wow ERC20 memecoin: ${error}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ export async function wowCreateToken(
});

const result = await invocation.wait();
return `Created WoW ERC20 memecoin ${args.name} with symbol ${args.symbol} on network ${wallet.getNetworkId()}.\nTransaction hash for the token creation: ${result.getTransaction().getTransactionHash()}`;
return `Created WoW ERC20 memecoin ${args.name} with symbol ${
args.symbol
} on network ${wallet.getNetworkId()}.\nTransaction hash for the token creation: ${result
.getTransaction()
.getTransactionHash()}`;
} catch (error) {
return `Error creating Zora Wow ERC20 memecoin: ${error}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export async function wowSellToken(
});

const result = await invocation.wait();
return `Sold WoW ERC20 memecoin with transaction hash: ${result.getTransaction().getTransactionHash()}`;
return `Sold WoW ERC20 memecoin with transaction hash: ${result
.getTransaction()
.getTransactionHash()}`;
} catch (error) {
return `Error selling Zora Wow ERC20 memecoin: ${error}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,9 @@ export function getFactoryAddress(network: string): string {
const normalizedNetwork = network.toLowerCase();
if (!(normalizedNetwork in WOW_FACTORY_CONTRACT_ADDRESSES)) {
throw new Error(
`Invalid network: ${network}. Valid networks are: ${Object.keys(WOW_FACTORY_CONTRACT_ADDRESSES).join(", ")}`,
`Invalid network: ${network}. Valid networks are: ${Object.keys(
WOW_FACTORY_CONTRACT_ADDRESSES,
).join(", ")}`,
);
}
return WOW_FACTORY_CONTRACT_ADDRESSES[normalizedNetwork];
Expand Down
8 changes: 7 additions & 1 deletion cdp-agentkit-core/typescript/src/actions/cdp/deploy_nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ export async function deployNft(

const result = await nftContract.wait();

return `Deployed NFT Collection ${args.name} to address ${result.getContractAddress()} on network ${wallet.getNetworkId()}.\nTransaction hash for the deployment: ${result.getTransaction()!.getTransactionHash()}\nTransaction link for the deployment: ${result.getTransaction()!.getTransactionLink()}`;
return `Deployed NFT Collection ${
args.name
} to address ${result.getContractAddress()} on network ${wallet.getNetworkId()}.\nTransaction hash for the deployment: ${result
.getTransaction()!
.getTransactionHash()}\nTransaction link for the deployment: ${result
.getTransaction()!
.getTransactionLink()}`;
} catch (error) {
return `Error deploying NFT: ${error}`;
}
Expand Down
6 changes: 5 additions & 1 deletion cdp-agentkit-core/typescript/src/actions/cdp/deploy_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export async function deployToken(

const result = await tokenContract.wait();

return `Deployed ERC20 token contract ${args.name} (${args.symbol}) with total supply of ${args.totalSupply} tokens at address ${result.getContractAddress()}. Transaction link: ${result.getTransaction()!.getTransactionLink()}`;
return `Deployed ERC20 token contract ${args.name} (${args.symbol}) with total supply of ${
args.totalSupply
} tokens at address ${result.getContractAddress()}. Transaction link: ${result
.getTransaction()!
.getTransactionLink()}`;
} catch (error) {
return `Error deploying token: ${error}`;
}
Expand Down
8 changes: 7 additions & 1 deletion cdp-agentkit-core/typescript/src/actions/cdp/mint_nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ export async function mintNft(wallet: Wallet, args: z.infer<typeof MintNftInput>

const result = await mintInvocation.wait();

return `Minted NFT from contract ${args.contractAddress} to address ${args.destination} on network ${wallet.getNetworkId()}.\nTransaction hash for the mint: ${result.getTransaction().getTransactionHash()}\nTransaction link for the mint: ${result.getTransaction().getTransactionLink()}`;
return `Minted NFT from contract ${args.contractAddress} to address ${
args.destination
} on network ${wallet.getNetworkId()}.\nTransaction hash for the mint: ${result
.getTransaction()
.getTransactionHash()}\nTransaction link for the mint: ${result
.getTransaction()
.getTransactionLink()}`;
} catch (error) {
return `Error minting NFT: ${error}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export async function requestFaucetFunds(
// Wait for the faucet transaction to be confirmed
const result = await faucetTx.wait();

return `Received ${args.assetId || "ETH"} from the faucet. Transaction: ${result.getTransactionLink()}`;
return `Received ${
args.assetId || "ETH"
} from the faucet. Transaction: ${result.getTransactionLink()}`;
} catch (error) {
return `Error requesting faucet funds: ${error}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export async function accountDetails(
try {
const response = await client.v2.me();
response.data.url = `https://x.com/${response.data.username}`;
return `Successfully retrieved authenticated user account details:\n${JSON.stringify(response)}`;
return `Successfully retrieved authenticated user account details:\n${JSON.stringify(
response,
)}`;
} catch (error) {
return `Error retrieving authenticated user account details: ${error}`;
}
Expand Down
8 changes: 7 additions & 1 deletion cdp-agentkit-core/typescript/src/actions/cdp/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export async function trade(wallet: Wallet, args: z.infer<typeof TradeInput>): P

const result = await tradeResult.wait();

return `Traded ${args.amount} of ${args.fromAssetId} for ${result.getToAmount()} of ${args.toAssetId}.\nTransaction hash for the trade: ${result.getTransaction().getTransactionHash()}\nTransaction link for the trade: ${result.getTransaction().getTransactionLink()}`;
return `Traded ${args.amount} of ${args.fromAssetId} for ${result.getToAmount()} of ${
args.toAssetId
}.\nTransaction hash for the trade: ${result
.getTransaction()
.getTransactionHash()}\nTransaction link for the trade: ${result
.getTransaction()
.getTransactionLink()}`;
} catch (error) {
return `Error trading assets: ${error}`;
}
Expand Down
4 changes: 3 additions & 1 deletion cdp-agentkit-core/typescript/src/actions/cdp/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export async function transfer(

const result = await transferResult.wait();

return `Transferred ${args.amount} of ${args.assetId} to ${args.destination}.\nTransaction hash for the transfer: ${result.getTransactionHash()}\nTransaction link for the transfer: ${result.getTransactionLink()}`;
return `Transferred ${args.amount} of ${args.assetId} to ${
args.destination
}.\nTransaction hash for the transfer: ${result.getTransactionHash()}\nTransaction link for the transfer: ${result.getTransactionLink()}`;
} catch (error) {
return `Error transferring the asset: ${error}`;
}
Expand Down
4 changes: 1 addition & 3 deletions cdp-agentkit-core/typescript/src/actions/cdp/transfer_nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export async function transferNft(
args.destination
}.\nTransaction hash: ${transaction.getTransactionHash()}\nTransaction link: ${transaction.getTransactionLink()}`;
} catch (error) {
return `Error transferring the NFT (contract: ${args.contractAddress}, ID: ${
args.tokenId
}) from ${from} to ${args.destination}): ${error}`;
return `Error transferring the NFT (contract: ${args.contractAddress}, ID: ${args.tokenId}) from ${from} to ${args.destination}): ${error}`;
}
}

Expand Down
2 changes: 1 addition & 1 deletion cdp-agentkit-core/typescript/src/cdp_agentkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class CdpAgentkit {
const walletData = JSON.parse(config.cdpWalletData) as WalletData;
agentkit.wallet = await Wallet.import(walletData);
} else if (mnemonicPhrase) {
agentkit.wallet = await Wallet.import({ mnemonicPhrase: mnemonicPhrase });
agentkit.wallet = await Wallet.import({ mnemonicPhrase: mnemonicPhrase }, networkId);
} else {
agentkit.wallet = await Wallet.create({ networkId: networkId });
}
Expand Down
26 changes: 25 additions & 1 deletion cdp-agentkit-core/typescript/src/tests/cdp_agentkit_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,40 @@ describe("CdpAgentkit", () => {
});

it("should successfully init with mnemonic Phrase ", async () => {
const networkId = Coinbase.networks.BaseSepolia;

const options = {
mnemonicPhrase: MOCK_MNEMONIC_PHRASE,
};

jest.spyOn(Wallet, "import").mockResolvedValue(mockWallet);

const result = await CdpAgentkit.configureWithWallet(options);

expect(result).toBeDefined();
expect(Wallet.import).toHaveBeenCalledWith(
{ mnemonicPhrase: MOCK_MNEMONIC_PHRASE },
networkId,
);
});

it("should successfully init with mnemonic Phrase ", async () => {
const networkId = Coinbase.networks.BaseMainnet;

const options = {
mnemonicPhrase: MOCK_MNEMONIC_PHRASE,
networkId,
};

jest.spyOn(Wallet, "import").mockResolvedValue(mockWallet);

const result = await CdpAgentkit.configureWithWallet(options);

expect(result).toBeDefined();
expect(Wallet.import).toHaveBeenCalledWith(options);
expect(Wallet.import).toHaveBeenCalledWith(
{ mnemonicPhrase: MOCK_MNEMONIC_PHRASE },
networkId,
);
});

it("should fail init without env", async () => {
Expand Down
10 changes: 10 additions & 0 deletions cdp-langchain/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## Unreleased

## [0.0.11] - 2025-01-17

### Added

- Bump dependency `cdp-agentkit-core` to version `0.0.9`.

### Fixed

- Allow wallet mnemonic seed import to optionally accept `network_id` input argument.

## [0.0.10] - 2025-01-13

### Added
Expand Down
2 changes: 1 addition & 1 deletion cdp-langchain/python/cdp_langchain/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.9"
__version__ = "0.0.11"
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def validate_environment(cls, values: dict) -> Any:
wallet = Wallet.import_data(wallet_data)
elif mnemonic_phrase:
phrase = MnemonicSeedPhrase(mnemonic_phrase)
wallet = Wallet.import_wallet(phrase)
wallet = Wallet.import_wallet(phrase, network_id)
else:
wallet = Wallet.create(network_id=network_id)

Expand Down
2 changes: 1 addition & 1 deletion cdp-langchain/python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

project = 'CDP Agentkit - LangChain'
author = 'Coinbase Developer Platform'
release = '0.0.10'
release = '0.0.11'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
6 changes: 3 additions & 3 deletions cdp-langchain/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cdp-langchain"
version = "0.0.10"
version = "0.0.11"
description = "CDP Agentkit Langchain Extension"
authors = ["John Peterson <[email protected]>"]
readme = "../README.md"
Expand All @@ -13,9 +13,9 @@ python = "^3.10"
langchain = "^0.3.4"
langchain-openai = "^0.2.4"
langgraph = "^0.2.39"
cdp-sdk = "^0.13.0"
cdp-sdk = "^0.14.1"
pydantic = "^2.0"
cdp-agentkit-core = "^0.0.8"
cdp-agentkit-core = "^0.0.9"

[tool.poetry.group.dev.dependencies]
ruff = "^0.7.1"
Expand Down
Loading

0 comments on commit cd489a8

Please sign in to comment.