Specifications
tensortradepy.tensor.TensorClient
Setup
__init__(api_key, private_key=None, network='devnet')
The constructor sets up the client. It allows you to set your Tensor Trade API key, your wallet private key to perform operations and the Solana network where transactions are set.
Parameters: |
|
---|
Collections
get_collection_infos(slug)
Retrieve the main information about a collection including buyNowPrice, sellNowPrice and the number of listed elements.
Parameters: |
|
---|
Returns: |
|
---|
get_collection_floor(slug)
Retrieve the lowest price of the item listed for the given collection.
Parameters: |
|
---|
Returns: |
|
---|
Listing
list_nft(mint, price, wallet_address=None)
List a NFT for sale.
Parameters: |
|
---|
list_cnft(mint, price, wallet_address=None)
List a CNFT for sale.
Parameters: |
|
---|
edit_nft_listing(mint, price, wallet_address=None)
Edit the price of a NFT listing.
Parameters: |
|
---|
edit_cnft_listing(mint, price, wallet_address=None)
Edit the price of a CNFT listing.
Parameters: |
|
---|
delist_nft(mint, wallet_address=None)
Delist a NFT.
Parameters: |
|
---|
delist_cnft(mint, wallet_address=None)
Delist a CNFT.
Parameters: |
|
---|
Bidding
set_nft_collection_bid(slug, price, quantity, wallet_address=None)
Set a bid for a NFT collection.
Parameters: |
|
---|
set_cnft_collection_bid(slug, price, quantity, wallet_address=None)
Set a bid for a CNFT collection.
Parameters: |
|
---|
edit_nft_collection_bid(bid_address, price, quantity)
Edit a bid for a NFT collection.
Parameters: |
|
---|
edit_cnft_collection_bid(bid_address, price, quantity)
Edit a bid for a CNFT collection.
Parameters: |
|
---|
cancel_nft_collection_bid(bid_address)
Cancel a bid for a NFT collection.
Parameters: |
|
---|
cancel_cnft_collection_bid(bid_address)
Cancel a bid for a CNFT collection.
Parameters: |
|
---|
Pools (AMMs, multi-listing, multi-bids)
create_pool(slug, starting_price, pool_type='TRADE', curve_type='LINEAR', delta=1.0, compound_fees=False, fee_bps=None, wallet_address=None)
pool_deposit_nft(pool, mint)
pool_withdraw_nft(pool, mint)
pool_deposit_sols(pool, amount)
pool_withdraw_sols(pool, amount)
close_pool(pool)
Buying
buy_cnft(seller, mint, price, wallet_address=None)
Buy a cNFT from the marketplace.
Parameters: |
|
---|
buy_nft(seller, mint, price, wallet_address=None)
Buy a NFT from the marketplace.
Parameters: |
|
---|
tensortradepy.exceptions
Error Handling
WrongAPIKeyException
Bases: Exception
Raised if no working API key is provided (the Tensor server returns 403 errors)
NotListedException
Bases: Exception
Raised if the related NFT is not listed on Tensor Trade. It is raised even if the NFT is listed on another marketplace like Magic Eden.
TransactionFailedException
Bases: Exception
Raised when the Solana transaction fails to execute.