Use Tensor

The Use Tensor tool, part of AgentiPy, allows users to interact with the Tensor NFT marketplace on Solana. It provides functionalities to list NFTs for sale and cancel existing listings. These operations are routed through an Agentipy proxy service.

Functionality

This tool is implemented in the TensorManager class. All its methods interact with an Agentipy proxy service (agent.base_proxy_url), sending encrypted private keys and an OpenAI API key with each request. These proxy calls likely translate to on-chain interactions with Tensor's smart contracts.

Key Methods:

  • list_nft_for_sale(agent: SolanaAgentKit, price: float, nft_mint: str) -> Optional[Dict[str, Any]]:

    • Lists an NFT for sale on the Tensor marketplace.

    • Parameters:

      • agent: The SolanaAgentKit instance.

      • price: The desired listing price for the NFT (likely in SOL).

      • nft_mint: The mint address (string) of the NFT to be listed.

    • Sends a request to the Agentipy proxy endpoint (/tensor/list-nft-for-sale).

    • Returns a dictionary with the transaction details from the proxy or an error.

  • cancel_listing(agent: SolanaAgentKit, nft_mint: str) -> Optional[Dict[str, Any]]:

    • Cancels an active listing for an NFT on Tensor.

    • Parameters:

      • agent: The SolanaAgentKit instance.

      • nft_mint: The mint address (string) of the NFT whose listing is to be canceled.

    • Sends a request to the Agentipy proxy endpoint (/tensor/cancel-listing).

    • Returns a dictionary with the transaction details from the proxy or an error.

Important Considerations:

  • Proxy Service: This tool relies on an Agentipy proxy service. The functionality is dependent on this proxy's correct implementation of Tensor interactions.

  • On-Chain NFT Operations: Listing an NFT for sale and canceling a listing are on-chain actions that will interact with your NFT and require SOL for transaction fees.

  • Tensor Platform: Familiarity with how Tensor listings work, including their fee structure and marketplace rules, is recommended.

  • API Keys: An openai_api_key is passed to the proxy; its role in Tensor operations should be understood from the proxy's documentation. The agent's Solana private key is also encrypted and sent.

Source Code

You can find the source code for this tool on GitHub: https://github.com/niceberginc/agentipy/blob/main/agentipy/tools/use_tensor.py

Last updated