Skip to content

Commit

Permalink
improve listing prompt, fix mint nft action
Browse files Browse the repository at this point in the history
  • Loading branch information
phdargen committed Feb 5, 2025
1 parent 10e5a92 commit 6fab218
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 2 additions & 0 deletions typescript/agentkit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

### Added

- Added `openseaActionProvider` to list NFTs on OpenSea.
- Added `alchemyTokenPricesActionProvider` to fetch token prices from Alchemy.
- Added `token_prices_by_symbol` action to fetch token prices by symbol.
- Added `token_prices_by_address` action to fetch token prices by network and address pairs.

### Fixed

- Fixed mint function definition in ERC721_ABI.
- Added account argument in call to estimateGas in CdpWalletProvider

## [0.1.1] - 2025-02-02
Expand Down
5 changes: 1 addition & 4 deletions typescript/agentkit/src/action-providers/erc721/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export const ERC721_ABI = [
{
inputs: [
{ internalType: "address", name: "to", type: "address" },
{ internalType: "uint256", name: "tokenId", type: "uint256" },
],
inputs: [{ internalType: "address", name: "to", type: "address" }],
name: "mint",
outputs: [],
payable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("ERC721 Action Provider", () => {
data: encodeFunctionData({
abi: ERC721_ABI,
functionName: "mint",
args: [MOCK_DESTINATION, 1n],
args: [MOCK_DESTINATION],
}),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Do not use the contract address as the destination address. If you are unsure of
const data = encodeFunctionData({
abi: ERC721_ABI,
functionName: "mint",
args: [args.destination as Hex, 1n],
args: [args.destination as Hex],
});

const hash = await walletProvider.sendTransaction({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class OpenseaActionProvider extends ActionProvider {
@CreateAction({
name: "list_nft",
description: `
This tool will list an NFT for sale on OpenSea.
This tool will list an NFT for sale on the OpenSea marketplace.
Currently only base-sepolia and base-mainnet are supported.
It takes the following inputs:
Expand All @@ -106,13 +106,14 @@ It takes the following inputs:
- expirationDays: (Optional) Number of days the listing should be active for (default: 90)
Important notes:
- The wallet must own the NFT to list it
- Price is in ETH (e.g. 1.5 for 1.5 ETH) - this is what you will receive if the NFT is sold, it is not required to have this amount in your wallet
- This is a gasless action - no ETH balance is required for listing the NFT
- This will approve the whole NFT collection to be managed by OpenSea
- Only supported on the following networks:
- Base Sepolia (ie, 'base-sepolia')
- Base Mainnet (ie, 'base', 'base-mainnet')
- The wallet must own the NFT
- Price is in ETH (e.g., 1.5 for 1.5 ETH). This is the amount the seller will receive if the NFT is sold. It is not required to have this amount in the wallet.
- Listing the NFT requires approval for OpenSea to manage the entire NFT collection:
- If the collection is not already approved, an onchain transaction is required, which will incur gas fees.
- If already approved, listing is gasless and does not require any onchain transaction.
- Only the following networks are supported:
- Base Sepolia (base-sepolia)
- Base Mainnet (base, base-mainnet)
`,
schema: ListNftSchema,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class CdpWalletProvider extends EvmWalletProvider {
const feeData = await this.#publicClient!.estimateFeesPerGas();

const gas = await this.#publicClient!.estimateGas({
account: this.#publicClient.account,
account: this.#address as `0x${string}`,
to,
value,
data,
Expand Down

0 comments on commit 6fab218

Please sign in to comment.