Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions typescript/agentkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,47 @@ const agent = createReactAgent({
</table>
</details>
<details>
<summary><strong>Magic Eden</strong></summary>
<table width="100%">
<tr>
<td width="200"><code>createLaunchpad</code></td>
<td width="768">Creates a new NFT launchpad on Magic Eden with customizable parameters like name, symbol, royalties, and mint stages.</td>
</tr>
<tr>
<td width="200"><code>publishLaunchpad</code></td>
<td width="768">Publishes a previously created Solana launchpad, making it visible to the public on Magic Eden.</td>
</tr>
<tr>
<td width="200"><code>updateLaunchpad</code></td>
<td width="768">Updates an existing NFT launchpad's parameters such as name, description, royalties, or mint stages.</td>
</tr>
<tr>
<td width="200"><code>listNft</code></td>
<td width="768">Lists an NFT for sale on the Magic Eden marketplace with specified price and optional expiration.</td>
</tr>
<tr>
<td width="200"><code>cancelListing</code></td>
<td width="768">Cancels an existing NFT listing on the Magic Eden marketplace.</td>
</tr>
<tr>
<td width="200"><code>makeItemOffer</code></td>
<td width="768">Makes an offer on an NFT listed on Magic Eden with specified price and optional expiration.</td>
</tr>
<tr>
<td width="200"><code>takeItemOffer</code></td>
<td width="768">Accepts an existing offer on an NFT listed on Magic Eden.</td>
</tr>
<tr>
<td width="200"><code>cancelItemOffer</code></td>
<td width="768">Cancels an existing offer on an NFT on the Magic Eden marketplace.</td>
</tr>
<tr>
<td width="200"><code>buy</code></td>
<td width="768">Buys one or more NFTs directly from the Magic Eden marketplace at listed prices.</td>
</tr>
</table>
</details>
<details>
<summary><strong>Pyth</strong></summary>
<table width="100%">
<tr>
Expand Down
1 change: 1 addition & 0 deletions typescript/agentkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@alloralabs/allora-sdk": "^0.1.0",
"@coinbase/coinbase-sdk": "^0.20.0",
"@jup-ag/api": "^6.0.39",
"@magiceden/magiceden-sdk": "1.0.0-beta.3",
"@privy-io/public-api": "^2.18.5",
"@privy-io/server-auth": "^1.18.4",
"@solana/spl-token": "^0.4.12",
Expand Down
1 change: 1 addition & 0 deletions typescript/agentkit/src/action-providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ export * from "./wow";
export * from "./allora";
export * from "./flaunch";
export * from "./onramp";
export * from "./magiceden";
104 changes: 104 additions & 0 deletions typescript/agentkit/src/action-providers/magiceden/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Magic Eden Action Provider

This directory contains the **MagicEdenActionProvider** implementation, which provides actions to interact with the **Magic Eden NFT marketplace** across multiple blockchains (Solana and EVM chains).

## Directory Structure

```
magiceden/
├── magicEdenActionProvider.ts # Main provider implementation
├── magicEdenActionProvider.test.ts # Test file for provider
├── schemas.ts # Action parameter schemas
├── utils.ts # Utility functions and network mappings
├── index.ts # Main exports
└── README.md # This file
```

## Actions

### NFT Trading
- `buy`: Buy one or more NFTs at listed prices
- `listNft`: List an NFT for sale with specified price
- `cancelListing`: Cancel an existing NFT listing
- `makeItemOffer`: Make an offer on a listed NFT
- `takeItemOffer`: Accept an existing offer on your NFT
- `cancelItemOffer`: Cancel an existing offer you made

### Launchpad Management
- `createLaunchpad`: Create a new NFT launchpad with customizable parameters
- `publishLaunchpad`: Publish a Solana launchpad (required after creation)
- `updateLaunchpad`: Update an existing launchpad's parameters

## Network Support

The Magic Eden provider supports the following networks:

### EVM Networks
- Ethereum
- Base
- Polygon
- Sei
- Arbitrum
- ApeChain
- BeraChain
- Monad Testnet
- Abstract

### Solana Networks
- Solana Mainnet

## Configuration

The provider requires the following configuration:

```typescript
interface MagicEdenActionProviderConfig {
apiKey?: string; // Magic Eden API key
networkId?: string; // Network identifier
privateKey?: string; // Wallet private key
rpcUrl?: string; // RPC URL (required for Solana)
}
```

Configuration can be provided via:
- Environment variable: `MAGICEDEN_API_KEY`
- Provider configuration: `apiKey` parameter

## Usage Examples

### Listing an NFT
```typescript
const result = await provider.listNft({
token: "0x1234...5678:1", // EVM: contract:tokenId
price: "1000000000" // Price in wei/lamports
});
```

### Making an Offer
```typescript
const result = await provider.makeItemOffer({
token: "0x1234...5678:1",
price: "900000000"
});
```

### Creating a Launchpad
```typescript
const result = await provider.createLaunchpad({
chain: "solana",
name: "My Collection",
symbol: "MYCOL",
// ... other parameters
});
```

For complete examples, see the [magicEdenActionProvider.test.ts](magicEdenActionProvider.test.ts) file or the README file in the [Magic Eden SDK GitHub](https://github.com/magiceden/magiceden-sdk).

## Notes

- For Solana operations, a valid RPC URL must be provided
- EVM operations support batch transactions for multiple NFTs
- Launchpad creation on Solana requires a separate publish step
- All prices should be in the chain's smallest unit (wei/lamports)

For more information on the Magic Eden API, visit [Magic Eden Developer Documentation](https://docs.magiceden.io//) or visit the [Magic Eden SDK GitHub](https://github.com/magiceden/magiceden-sdk).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./magicEdenActionProvider";
Loading