Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: NBA TopShot Plugin - list, buy, and manage NBA TopShot NFTs using Flow blockchain #11

Merged
merged 7 commits into from
Mar 3, 2025

Conversation

kamalbuilds
Copy link

Fixes #1

NBA TopShot Plugin for Eliza

Background

EthDenver 2025

What does this PR do?

This plugin enables trading NBA TopShot moments through Eliza. It provides functionality to list, buy, and manage NBA TopShot NFTs using Flow blockchain.

Features

  • View owned TopShot moments
  • List moments for sale
  • Purchase moments from the marketplace
  • Cancel sale listings
  • View market prices and metadata

Installation

pnpm install @eliza/plugin-nba-topshot

Configuration

The plugin requires Flow network configuration:

import { TopShotPlugin } from '@eliza/plugin-nba-topshot';

const plugin = new TopShotPlugin({
  network: 'mainnet', // or 'testnet'
  accessNode: 'https://rest-mainnet.onflow.org',
  walletDiscovery: 'https://fcl-discovery.onflow.org/authn'
});

Usage

Initialize the Plugin

await plugin.initialize();

View Owned Moments

const moments = await plugin.getMoments('0x1234...'); // Flow address

List a Moment for Sale

await plugin.listMomentForSale(momentId, price);

Purchase a Moment

await plugin.purchaseMoment(momentId);

Cancel a Sale

await plugin.cancelSale(momentId);

Get Market Prices

// Get all listings
const listings = await plugin.getMarketPrices();

// Filter by set or play
const filteredListings = await plugin.getMarketPrices(setId, playId);

Dependencies

  • Flow Client Library (FCL)
  • NBA TopShot Smart Contracts
  • Dapper Utility Coin (DUC) for transactions

Contract Addresses

The plugin uses the following Flow contract addresses:

  • TopShot: 0x0b2a3299cc857e29
  • TopShotMarketV3: 0xc1e4f4f4c4257510
  • DapperUtilityCoin: 0x82ec283f88a62e65

What kind of change is this?

Testing

Where should a reviewer start?

Detailed testing steps

@btspoony
Copy link
Collaborator

btspoony commented Feb 25, 2025

  1. The Plugin is not the standard plugin for Eliza.
  2. Please check some sample code at https://github.com/fixes-world/plugin-flow-advanced/tree/main/src.

@kamalbuilds
Copy link
Author

@SeanRobb

@btspoony btspoony changed the title NBA TopShot Plugin - list, buy, and manage NBA TopShot NFTs using Flow blockchain feat: NBA TopShot Plugin - list, buy, and manage NBA TopShot NFTs using Flow blockchain Mar 2, 2025
@btspoony
Copy link
Collaborator

btspoony commented Mar 2, 2025

Good job

@btspoony btspoony merged commit f9754ac into onflow:develop Mar 3, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Agentic Idea] Build a plugin for Topshot Memont Trading
2 participants