Skip to main content

core.sdk

ThirdwebSDK Objects

class ThirdwebSDK(ProviderHandler)

The main entry point for the Thirdweb SDK.

__init__

def __init__(network: str,
signer: Optional[LocalAccount] = None,
options: SDKOptions = SDKOptions(),
storage: IpfsStorage = IpfsStorage())

Initialize the thirdweb SDK.

Arguments:

  • provider: web3 provider instance to use for getting on-chain data
  • signer: signer to use for sending transactions
  • options: optional SDK configuration options
  • storage: optional IPFS storage instance to use for storing data

get_nft_collection

def get_nft_collection(address: str) -> NFTCollection

Returns an NFT Collection contract SDK instance

Arguments:

  • address: address of the NFT Collection contract

Returns:

NFT Collection contract SDK instance

get_edition

def get_edition(address: str) -> Edition

Returns an Edition contract SDK instance

Arguments:

  • address: address of the Edition contract

Returns:

Edition contract SDK instance

get_token

def get_token(address: str) -> Token

Returns a Token contract SDK instance

Arguments:

  • address: address of the Token contract

Returns:

Token contract SDK instance

get_marketplace

def get_marketplace(address: str) -> Marketplace

Returns a Marketplace contract SDK instance

Arguments:

  • address: address of the Marketplace contract

Returns:

Marketplace contract SDK instance

get_nft_drop

def get_nft_drop(address: str) -> NFTDrop

Returns an NFT Drop contract SDK instance

Arguments:

  • address: address of the NFT Drop contract

Returns:

NFT Drop contract SDK instance

get_edition_drop

def get_edition_drop(address: str) -> EditionDrop

Returns an Edition Drop contract SDK instance

Arguments:

  • address: address of the Edition Drop contract

Returns:

Edition Drop contract SDK instance

get_multiwrap

def get_multiwrap(address: str) -> Multiwrap

Returns a multiwrap contract SDK instance

Arguments:

  • address: address of the multiwrap contract

Returns:

multiwrap contract SDK instance

get_contract

def get_contract(address: str) -> CustomContract

Returns a custom contract SDK instance

Arguments:

  • address: address of the custom contract

Returns:

custom contract SDK instance

get_contract_from_abi

def get_contract_from_abi(address: str, abi: str) -> CustomContract

Returns a custom contract SDK instance given the contract ABI

Arguments:

  • address: address of the custom contract
  • abi: abi of the custom contract

Returns:

custom contract SDK instance

update_provider

def update_provider(provider: Web3)

Update the provider instance used by the SDK.

Arguments:

  • provider: web3 provider instance to use for getting on-chain data

update_signer

def update_signer(signer: Optional[LocalAccount] = None)

Update the signer instance used by the SDK.

Arguments:

  • signer: signer to use for sending transactions