Documentation
¶
Index ¶
- Constants
- type BaseUriWithUris
- type ChainID
- type ClaimCondition
- type ClaimConditionOutput
- type ClaimVerification
- type ContractWrapper
- type Currency
- type CurrencyValue
- type ERC721
- func (erc721 *ERC721) Balance() (*big.Int, error)
- func (erc721 *ERC721) BalanceOf(address string) (*big.Int, error)
- func (erc721 *ERC721) Burn(tokenId int) (*types.Transaction, error)
- func (erc721 *ERC721) Get(tokenId int) (*NFTMetadataOwner, error)
- func (erc721 *ERC721) GetAll() ([]*NFTMetadataOwner, error)
- func (erc721 *ERC721) GetOwned(address string) ([]*NFTMetadataOwner, error)
- func (erc721 *ERC721) GetOwnedTokenIDs(address string) ([]*big.Int, error)
- func (erc721 *ERC721) GetTotalCount() (*big.Int, error)
- func (erc721 *ERC721) IsApproved(address string, operator string) (bool, error)
- func (erc721 *ERC721) OwnerOf(tokenId int) (string, error)
- func (erc721 *ERC721) SetApprovalForAll(operator string, approved bool) (*types.Transaction, error)
- func (erc721 *ERC721) TotalSupply() (*big.Int, error)
- func (erc721 *ERC721) Transfer(to string, tokenId int) (*types.Transaction, error)
- type ERC1155
- func (erc1155 *ERC1155) Balance(tokenId int) (*big.Int, error)
- func (erc1155 *ERC1155) BalanceOf(address string, tokenId int) (*big.Int, error)
- func (erc1155 *ERC1155) Burn(tokenId int, amount int) (*types.Transaction, error)
- func (erc1155 *ERC1155) Get(tokenId int) (*EditionMetadata, error)
- func (erc1155 *ERC1155) GetAll() ([]*EditionMetadata, error)
- func (erc1155 *ERC1155) GetOwned(address string) ([]*EditionMetadataOwner, error)
- func (erc1155 *ERC1155) GetTotalCount() (*big.Int, error)
- func (erc1155 *ERC1155) GetTotalSupply(tokenId int) (*big.Int, error)
- func (erc1155 *ERC1155) IsApproved(address string, operator string) (bool, error)
- func (erc1155 *ERC1155) SetApprovalForAll(operator string, approved bool) (*types.Transaction, error)
- func (erc1155 *ERC1155) Transfer(to string, tokenId int, amount int) (*types.Transaction, error)
- type Edition
- func (edition *Edition) Mint(metadata *EditionMetadataInput) (*types.Transaction, error)
- func (edition *Edition) MintAdditionalSupply(tokenId int, additionalSupply int) (*types.Transaction, error)
- func (edition *Edition) MintAdditionalSupplyTo(to string, tokenId int, additionalSupply int) (*types.Transaction, error)
- func (edition *Edition) MintBatchTo(to string, metadatasWithSupply []*EditionMetadataInput) (*types.Transaction, error)
- func (edition *Edition) MintTo(address string, metadataWithSupply *EditionMetadataInput) (*types.Transaction, error)
- type EditionMetadata
- type EditionMetadataInput
- type EditionMetadataOwner
- type FailedToUploadError
- type IpfsStorage
- type Metadata
- type NFTCollection
- func (nft *NFTCollection) Mint(metadata *NFTMetadataInput) (*types.Transaction, error)
- func (nft *NFTCollection) MintBatch(metadatas []*NFTMetadataInput) (*types.Transaction, error)
- func (nft *NFTCollection) MintBatchTo(address string, metadatas []*NFTMetadataInput) (*types.Transaction, error)
- func (nft *NFTCollection) MintTo(address string, metadata *NFTMetadataInput) (*types.Transaction, error)
- type NFTDrop
- func (drop *NFTDrop) Claim(quantity int) (*types.Transaction, error)
- func (drop *NFTDrop) ClaimTo(destinationAddress string, quantity int) (*types.Transaction, error)
- func (drop *NFTDrop) CreateBatch(metadatas []*NFTMetadataInput) (*types.Transaction, error)
- func (drop *NFTDrop) GetAllClaimed() ([]*NFTMetadataOwner, error)
- func (drop *NFTDrop) GetAllUnclaimed() ([]*NFTMetadata, error)
- type NFTDropClaimConditions
- type NFTMetadata
- type NFTMetadataInput
- type NFTMetadataOwner
- type NFTResult
- type NativeToken
- type NoAddressError
- type NoSignerError
- type NotFoundError
- type ProviderHandler
- func (handler *ProviderHandler) GetChainID() (*big.Int, error)
- func (handler *ProviderHandler) GetProvider() *ethclient.Client
- func (handler *ProviderHandler) GetRawPrivateKey() string
- func (handler *ProviderHandler) GetSignerAddress() common.Address
- func (handler *ProviderHandler) UpdatePrivateKey(privateKey string) error
- func (handler *ProviderHandler) UpdateProvider(provider *ethclient.Client)
- type SDKOptions
- type Storage
- type ThirdwebSDK
- type UnmarshalError
- type UnsupportedFunctionError
- type WrappedToken
Constants ¶
View Source
const ( MAINNET ChainID = 1 RINKEBY = 4 GOERLI = 5 POLYGON = 137 FANTOM = 250 AVALANCHE = 43114 MUMBAI = 80001 )
View Source
const DEFAULT_IPFS_GATEWAY_URL = "https://gateway.ipfscdn.io/ipfs/"
View Source
const DEFAULT_MERKLE_ROOT = "0x0000000000000000000000000000000000000000000000000000000000000000"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseUriWithUris ¶
type BaseUriWithUris struct {
// contains filtered or unexported fields
}
type ClaimCondition ¶
type ClaimCondition struct {
// contains filtered or unexported fields
}
type ClaimConditionOutput ¶
type ClaimConditionOutput struct {
// contains filtered or unexported fields
}
type ClaimVerification ¶
type ClaimVerification struct {
// contains filtered or unexported fields
}
type ContractWrapper ¶
type ContractWrapper[TContractABI any] struct { *ProviderHandler // contains filtered or unexported fields }
func NewContractWrapper ¶
type CurrencyValue ¶
type CurrencyValue struct {
// contains filtered or unexported fields
}
type ERC721 ¶
type ERC721 struct {
// contains filtered or unexported fields
}
func (*ERC721) GetAll ¶
func (erc721 *ERC721) GetAll() ([]*NFTMetadataOwner, error)
func (*ERC721) GetOwned ¶
func (erc721 *ERC721) GetOwned(address string) ([]*NFTMetadataOwner, error)
func (*ERC721) GetOwnedTokenIDs ¶
func (*ERC721) IsApproved ¶
func (*ERC721) SetApprovalForAll ¶
type ERC1155 ¶
type ERC1155 struct {
// contains filtered or unexported fields
}
func NewERC1155 ¶
func NewERC1155(contractWrapper *ContractWrapper[*abi.TokenERC1155], storage Storage) *ERC1155
func (*ERC1155) GetAll ¶
func (erc1155 *ERC1155) GetAll() ([]*EditionMetadata, error)
func (*ERC1155) GetOwned ¶
func (erc1155 *ERC1155) GetOwned(address string) ([]*EditionMetadataOwner, error)
func (*ERC1155) GetTotalSupply ¶
func (*ERC1155) IsApproved ¶
func (*ERC1155) SetApprovalForAll ¶
type Edition ¶
type Edition struct {
*ERC1155
}
func NewEdition ¶
func (*Edition) Mint ¶
func (edition *Edition) Mint(metadata *EditionMetadataInput) (*types.Transaction, error)
func (*Edition) MintAdditionalSupply ¶
func (*Edition) MintAdditionalSupplyTo ¶
func (*Edition) MintBatchTo ¶
func (edition *Edition) MintBatchTo(to string, metadatasWithSupply []*EditionMetadataInput) (*types.Transaction, error)
func (*Edition) MintTo ¶
func (edition *Edition) MintTo(address string, metadataWithSupply *EditionMetadataInput) (*types.Transaction, error)
type EditionMetadata ¶
type EditionMetadata struct {
Metadata *NFTMetadata
Supply int
}
type EditionMetadataInput ¶
type EditionMetadataInput struct {
Metadata *NFTMetadataInput
Supply int
}
type EditionMetadataOwner ¶
type EditionMetadataOwner struct {
Metadata *NFTMetadata
Supply int
Owner string
QuantityOwned int
}
type FailedToUploadError ¶
type FailedToUploadError struct {
Payload interface{}
UnderlyingError error
// contains filtered or unexported fields
}
func (*FailedToUploadError) Error ¶
func (m *FailedToUploadError) Error() string
type IpfsStorage ¶
type IpfsStorage struct {
Url string
}
func (*IpfsStorage) Upload ¶
func (ipfs *IpfsStorage) Upload(data any, contractAddress string, signerAddress string) (string, error)
Upload method can be used to upload a generic payload to IPFS. NftLabs provides a default proxy in the SDK. You can override this with the ISdk.SetStorage
func (*IpfsStorage) UploadBatch ¶
func (ipfs *IpfsStorage) UploadBatch(data []any, contractAddress string, signerAddress string) (*BaseUriWithUris, error)
UploadBatch uploads a list of arbitrary objects and returns their URIs *in the order they were passed*
type NFTCollection ¶
type NFTCollection struct {
*ERC721
// contains filtered or unexported fields
}
func NewNFTCollection ¶
func (*NFTCollection) Mint ¶
func (nft *NFTCollection) Mint(metadata *NFTMetadataInput) (*types.Transaction, error)
func (*NFTCollection) MintBatch ¶
func (nft *NFTCollection) MintBatch(metadatas []*NFTMetadataInput) (*types.Transaction, error)
func (*NFTCollection) MintBatchTo ¶
func (nft *NFTCollection) MintBatchTo(address string, metadatas []*NFTMetadataInput) (*types.Transaction, error)
func (*NFTCollection) MintTo ¶
func (nft *NFTCollection) MintTo(address string, metadata *NFTMetadataInput) (*types.Transaction, error)
type NFTDrop ¶
type NFTDrop struct {
*ERC721
// contains filtered or unexported fields
}
func NewNFTDrop ¶
func (*NFTDrop) CreateBatch ¶
func (drop *NFTDrop) CreateBatch(metadatas []*NFTMetadataInput) (*types.Transaction, error)
func (*NFTDrop) GetAllClaimed ¶
func (drop *NFTDrop) GetAllClaimed() ([]*NFTMetadataOwner, error)
func (*NFTDrop) GetAllUnclaimed ¶
func (drop *NFTDrop) GetAllUnclaimed() ([]*NFTMetadata, error)
type NFTDropClaimConditions ¶
type NFTDropClaimConditions struct {
// contains filtered or unexported fields
}
func NewNFTDropClaimConditions ¶
func NewNFTDropClaimConditions(contractWrapper *ContractWrapper[*abi.DropERC721], storage Storage) *NFTDropClaimConditions
func (*NFTDropClaimConditions) GetActive ¶
func (claim *NFTDropClaimConditions) GetActive() (*ClaimConditionOutput, error)
type NFTMetadata ¶
type NFTMetadata struct {
Id *big.Int `json:"id"`
Uri string `json:"uri"`
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
ExternalUrl string `json:"external_url"`
AnimationUrl string `json:"animation_url"`
BackgroundColor string `json:"background_color"`
Properties interface{} `json:"properties"`
}
type NFTMetadataInput ¶
type NFTMetadataInput struct {
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
ExternalUrl string `json:"external_url"`
AnimationUrl string `json:"animation_url"`
BackgroundColor string `json:"background_color"`
Properties interface{} `json:"properties"`
}
type NFTMetadataOwner ¶
type NFTMetadataOwner struct {
Metadata *NFTMetadata
Owner string
}
type NativeToken ¶
type NativeToken struct {
// contains filtered or unexported fields
}
type NoAddressError ¶
type NoAddressError struct {
// contains filtered or unexported fields
}
func (*NoAddressError) Error ¶
func (m *NoAddressError) Error() string
type NoSignerError ¶
type NoSignerError struct {
Err error
// contains filtered or unexported fields
}
func (*NoSignerError) Error ¶
func (m *NoSignerError) Error() string
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶
func (m *NotFoundError) Error() string
type ProviderHandler ¶
type ProviderHandler struct {
// contains filtered or unexported fields
}
func NewProviderHandler ¶
func NewProviderHandler(provider *ethclient.Client, privateKey string) (*ProviderHandler, error)
func (*ProviderHandler) GetChainID ¶
func (handler *ProviderHandler) GetChainID() (*big.Int, error)
func (*ProviderHandler) GetProvider ¶
func (handler *ProviderHandler) GetProvider() *ethclient.Client
func (*ProviderHandler) GetRawPrivateKey ¶
func (handler *ProviderHandler) GetRawPrivateKey() string
func (*ProviderHandler) GetSignerAddress ¶
func (handler *ProviderHandler) GetSignerAddress() common.Address
func (*ProviderHandler) UpdatePrivateKey ¶
func (handler *ProviderHandler) UpdatePrivateKey(privateKey string) error
func (*ProviderHandler) UpdateProvider ¶
func (handler *ProviderHandler) UpdateProvider(provider *ethclient.Client)
type SDKOptions ¶
type Storage ¶
type Storage interface {
Get(uri string) ([]byte, error)
Upload(data any, contractAddress string, signerAddress string) (string, error)
UploadBatch(data []any, contractAddress string, signerAddress string) (*BaseUriWithUris, error)
}
func NewIpfsStorage ¶
type ThirdwebSDK ¶
type ThirdwebSDK struct {
*ProviderHandler
// contains filtered or unexported fields
}
func NewThirdwebSDK ¶
func NewThirdwebSDK(rpcUrl string, options *SDKOptions) (*ThirdwebSDK, error)
func (*ThirdwebSDK) GetEdition ¶
func (sdk *ThirdwebSDK) GetEdition(address string) (*Edition, error)
func (*ThirdwebSDK) GetNFTCollection ¶
func (sdk *ThirdwebSDK) GetNFTCollection(address string) (*NFTCollection, error)
func (*ThirdwebSDK) GetNFTDrop ¶
func (sdk *ThirdwebSDK) GetNFTDrop(address string) (*NFTDrop, error)
type UnmarshalError ¶
type UnmarshalError struct {
UnderlyingError error
// contains filtered or unexported fields
}
func (*UnmarshalError) Error ¶
func (m *UnmarshalError) Error() string
type UnsupportedFunctionError ¶
type UnsupportedFunctionError struct {
// contains filtered or unexported fields
}
func (*UnsupportedFunctionError) Error ¶
func (m *UnsupportedFunctionError) Error() string
type WrappedToken ¶
type WrappedToken struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.