Git Product home page Git Product logo

tensor-trade-py's Introduction

(unofficial) Python Client for Tensor Trade

This library is a simple Python client for the Tensor Trade API. It's aimed is to make your bot trading simpler.

Disclaimer

Be aware that this client directly communicates with Tensor. Be sure of your script before doing any financial operations. Moreover, there is no guarantee about the reliability of this client. I encourage you to tests your scripts with cheap cNFT collections first.

The developer of this client is not responsible for any errors or issues that may occur when using this SDK. Use at your own risk.

Tips

If you like this client, you can tip me at: thewisetrade.sol or buy the logo NFT.

Install

Install the library with:

pip install tensortradepy

Development version:

pip install git+https://github.com/defilogist/tensor-trade-py

Usage example

import os
from tensortradepy import TensorClient

client = TensorClient(
    os.getenv("TENSOR_API_KEY"),
    os.getenv("WALLET_PRIVATE_KEY"),
    "mainnet-beta"
)

floor = client.get_collection_floor("theheist")
price = floor * 0.99
nft_mint = "nft-mint"
client.list_nft(nft_mint, price) # we assume your keypair owns the NFT.

Documenation

A full documentation is available.

Functions available

  • get_collection_infos(slug)
  • get_collection_floor(slug)
  • list_nft(mint, price) // Price in $SOL
  • list_cnft(mint, price) // Price in $SOL
  • delist_cnft(mint)
  • edit_cnft_listing(mint, price) // Price in $SOL
  • set_cnft_collection_bid(slug, price, quantity)
  • edit_cnft_collection_bid(slug, price, quantity)
  • cancel_cnft_collection_bid(slug, price, quantity)
  • buy_nft_(seller, mint_address, price)
  • buy_cnft_(seller, mint_address, price)

Contributions

Any contribution is welcome, please open your PR for additions and report bug through Github issues.

About

This client is developed by thewise.trade.

tensor-trade-py's People

Contributors

defilogist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tensor-trade-py's Issues

tensortradepy.exceptions.WrongAPIKeyException: Invalid API Key

Hi, I follow your setup to do a simple script.
`import os
from tensortradepy import TensorClient
import pdb

client = TensorClient(
os.getenv("f6af71fb-91a2-46eb-a140-********"),
os.getenv("xxxxxxx"),
"mainnet-beta"
)
floor = client.get_collection_floor("theheist")
pdb.set_trace()`

some errors show up, such as Traceback (most recent call last): File "/root/tensortrade/tensortrade.py", line 10, in <module> floor = client.get_collection_floor("theheist") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/lib/python3.11/site-packages/tensortradepy/tensor.py", line 192, in get_collection_floor data = self.get_collection_infos(slug) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/lib/python3.11/site-packages/tensortradepy/tensor.py", line 179, in get_collection_infos data = self.send_query(query, variables) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/lib/python3.11/site-packages/tensortradepy/tensor.py", line 99, in send_query raise WrongAPIKeyException("Invalid API Key") tensortradepy.exceptions.WrongAPIKeyException: Invalid API Key

the tensor.trade API email is
image

do you have some suggestion? thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.