Nethereum.StandardNonFungibleTokenERC721 7.1.0

Prefix Reserved
dotnet add package Nethereum.StandardNonFungibleTokenERC721 --version 7.1.0
                    
NuGet\Install-Package Nethereum.StandardNonFungibleTokenERC721 -Version 7.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nethereum.StandardNonFungibleTokenERC721" Version="7.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nethereum.StandardNonFungibleTokenERC721" Version="7.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nethereum.StandardNonFungibleTokenERC721" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nethereum.StandardNonFungibleTokenERC721 --version 7.1.0
                    
#r "nuget: Nethereum.StandardNonFungibleTokenERC721, 7.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nethereum.StandardNonFungibleTokenERC721@7.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nethereum.StandardNonFungibleTokenERC721&version=7.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nethereum.StandardNonFungibleTokenERC721&version=7.1.0
                    
Install as a Cake Tool

Nethereum.StandardNonFungibleTokenERC721

ERC721Service: a typed service for ERC-721 (NFT) contracts, with a deployable reference contract

NuGet

Overview

This package holds one service class, ERC721Service, a wrapper around a ContractHandler for the core ERC-721 interface, with its function, event and deployment messages. The package description is "Ethereum Service to interact with ERC721 compliant contracts".

The built-in, current way to work with any ERC-721 contract is web3.Eth.ERC721 (Nethereum.Contracts.Standards.ERC721.ERC721Service), whose GetContractService(contractAddress) returns a typed ERC721ContractService. Prefer it for new code. Use Nethereum.StandardNonFungibleTokenERC721 if you want its ERC721Deployment reference contract or existing code already uses it. The source does not mark the package obsolete.

The class has no name, symbol, tokenURI, totalSupply or enumeration members: it covers supportsInterface, getApproved, approve, transferFrom, safeTransferFrom, ownerOf, balanceOf, setApprovalForAll and isApprovedForAll. The bundled ERC721Deployment bytecode has no mint function either, so a freshly deployed contract has no tokens; it is useful for interface and approval testing, not as a token issuer.

Installation

dotnet add package Nethereum.StandardNonFungibleTokenERC721

Depends on Nethereum.Web3.

ERC721Service

Namespace Nethereum.StandardNonFungibleTokenERC721; messages are in Nethereum.StandardNonFungibleTokenERC721.ContractDefinition.

public partial class ERC721Service
{
    public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Nethereum.Web3.Web3 web3,
        ERC721Deployment eRC721Deployment, CancellationTokenSource cancellationTokenSource = null)
    public static Task<string> DeployContractAsync(Nethereum.Web3.Web3 web3, ERC721Deployment eRC721Deployment)
    public static async Task<ERC721Service> DeployContractAndGetServiceAsync(Nethereum.Web3.Web3 web3,
        ERC721Deployment eRC721Deployment, CancellationTokenSource cancellationTokenSource = null)

    public ERC721Service(Nethereum.Web3.Web3 web3, string contractAddress)
    public ContractHandler ContractHandler { get; }

    public Task<bool> SupportsInterfaceQueryAsync(SupportsInterfaceFunction supportsInterfaceFunction, BlockParameter blockParameter = null)
    public Task<bool> SupportsInterfaceQueryAsync(byte[] interfaceId, BlockParameter blockParameter = null)
    public Task<string> GetApprovedQueryAsync(GetApprovedFunction getApprovedFunction, BlockParameter blockParameter = null)
    public Task<string> GetApprovedQueryAsync(BigInteger tokenId, BlockParameter blockParameter = null)
    public Task<string> OwnerOfQueryAsync(OwnerOfFunction ownerOfFunction, BlockParameter blockParameter = null)
    public Task<string> OwnerOfQueryAsync(BigInteger tokenId, BlockParameter blockParameter = null)
    public Task<BigInteger> BalanceOfQueryAsync(BalanceOfFunction balanceOfFunction, BlockParameter blockParameter = null)
    public Task<BigInteger> BalanceOfQueryAsync(string owner, BlockParameter blockParameter = null)
    public Task<bool> IsApprovedForAllQueryAsync(IsApprovedForAllFunction isApprovedForAllFunction, BlockParameter blockParameter = null)
    public Task<bool> IsApprovedForAllQueryAsync(string owner, string operatorAddress, BlockParameter blockParameter = null)

    public Task<string> ApproveRequestAsync(ApproveFunction approveFunction)
    public Task<TransactionReceipt> ApproveRequestAndWaitForReceiptAsync(ApproveFunction approveFunction, CancellationTokenSource cancellationToken = null)
    public Task<string> ApproveRequestAsync(string to, BigInteger tokenId)
    public Task<TransactionReceipt> ApproveRequestAndWaitForReceiptAsync(string to, BigInteger tokenId, CancellationTokenSource cancellationToken = null)

    public Task<string> TransferFromRequestAsync(TransferFromFunction transferFromFunction)
    public Task<TransactionReceipt> TransferFromRequestAndWaitForReceiptAsync(TransferFromFunction transferFromFunction, CancellationTokenSource cancellationToken = null)
    public Task<string> TransferFromRequestAsync(string from, string to, BigInteger tokenId)
    public Task<TransactionReceipt> TransferFromRequestAndWaitForReceiptAsync(string from, string to, BigInteger tokenId, CancellationTokenSource cancellationToken = null)

    public Task<string> SafeTransferFromRequestAsync(SafeTransferFromFunction safeTransferFromFunction)
    public Task<TransactionReceipt> SafeTransferFromRequestAndWaitForReceiptAsync(SafeTransferFromFunction safeTransferFromFunction, CancellationTokenSource cancellationToken = null)
    public Task<string> SafeTransferFromRequestAsync(string from, string to, BigInteger tokenId)
    public Task<TransactionReceipt> SafeTransferFromRequestAndWaitForReceiptAsync(string from, string to, BigInteger tokenId, CancellationTokenSource cancellationToken = null)
    public Task<string> SafeTransferFromRequestAsync(SafeTransferFromWithDataFunction safeTransferFromWithDataFunction)
    public Task<TransactionReceipt> SafeTransferFromRequestAndWaitForReceiptAsync(SafeTransferFromWithDataFunction safeTransferFromWithDataFunction, CancellationTokenSource cancellationToken = null)
    public Task<string> SafeTransferFromRequestAsync(string from, string to, BigInteger tokenId, byte[] data)
    public Task<TransactionReceipt> SafeTransferFromRequestAndWaitForReceiptAsync(string from, string to, BigInteger tokenId, byte[] data, CancellationTokenSource cancellationToken = null)

    public Task<string> SetApprovalForAllRequestAsync(SetApprovalForAllFunction setApprovalForAllFunction)
    public Task<TransactionReceipt> SetApprovalForAllRequestAndWaitForReceiptAsync(SetApprovalForAllFunction setApprovalForAllFunction, CancellationTokenSource cancellationToken = null)
    public Task<string> SetApprovalForAllRequestAsync(string to, bool approved)
    public Task<TransactionReceipt> SetApprovalForAllRequestAndWaitForReceiptAsync(string to, bool approved, CancellationTokenSource cancellationToken = null)
}

Deploy and query

var service = await ERC721Service.DeployContractAndGetServiceAsync(web3,
    new Nethereum.StandardNonFungibleTokenERC721.ContractDefinition.ERC721Deployment());

var supportsErc721 = await service.SupportsInterfaceQueryAsync("0x80ac58cd".HexToByteArray());
var supportsUnknown = await service.SupportsInterfaceQueryAsync("0xffffffff".HexToByteArray());
var balance = await service.BalanceOfQueryAsync(OwnerAddress);
var approvedBefore = await service.IsApprovedForAllQueryAsync(OwnerAddress, OtherAddress);

await service.SetApprovalForAllRequestAndWaitForReceiptAsync(OtherAddress, true);
var approvedAfter = await service.IsApprovedForAllQueryAsync(OwnerAddress, OtherAddress);

0x80ac58cd is the ERC-721 interface id, so supportsErc721 is true and supportsUnknown (0xffffffff) is false; balance is zero because the contract mints nothing; approvedBefore is false and approvedAfter is true. Backed by StandardTokenServicesDevChainTests.ShouldDeployAnErc721ContractAndReadItsInterfaceBalancesAndApprovals (DocSection.SmartContracts, standard-token-erc721). This package has no test project of its own, so the test lives in tests/Nethereum.StandardTokenEIP20.IntegrationTests (which references this package) and runs on an in-process DevChainNode.

Messages and events

public partial class ERC721Deployment : ERC721DeploymentBase
{
    public ERC721Deployment()
    public ERC721Deployment(string byteCode)
}

public class ERC721DeploymentBase : ContractDeploymentMessage
{
    public static string BYTECODE
    public ERC721DeploymentBase()
    public ERC721DeploymentBase(string byteCode)
}

BYTECODE is the reference contract's bytecode (empty when the package is built with BYTECODELITE); the parameterless constructors use it and the byteCode constructors deploy your own bytecode with the same message.

Function messages (each a FunctionMessage): SupportsInterfaceFunction, GetApprovedFunction, ApproveFunction, TransferFromFunction, SafeTransferFromFunction, SafeTransferFromWithDataFunction, OwnerOfFunction, BalanceOfFunction, SetApprovalForAllFunction and IsApprovedForAllFunction. Output DTOs: SupportsInterfaceOutputDTO, GetApprovedOutputDTO, OwnerOfOutputDTO, BalanceOfOutputDTO, IsApprovedForAllOutputDTO.

Event DTOs (each with a partial subclass named TransferEventDTO, ApprovalEventDTO, ApprovalForAllEventDTO):

[Event("Transfer")]
public class TransferEventDTOBase : IEventDTO
{
    public virtual string From { get; set; }
    public virtual string To { get; set; }
    public virtual BigInteger TokenId { get; set; }
}

[Event("Approval")]
public class ApprovalEventDTOBase : IEventDTO
{
    public virtual string Owner { get; set; }
    public virtual string Approved { get; set; }
    public virtual BigInteger TokenId { get; set; }
}

[Event("ApprovalForAll")]
public class ApprovalForAllEventDTOBase : IEventDTO
{
    public virtual string Owner { get; set; }
    public virtual string Operator { get; set; }
    public virtual bool Approved { get; set; }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net451 is compatible.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Nethereum.StandardNonFungibleTokenERC721:

Package Downloads
DeepMeta.DeepFrozen.ETH

Package Description

MP.SimpleTokens.Common.Ethereum

Simple common abstraction layer for Etherium requests that are part of the simple tokens Devember 2021 project.

Wonka.Eth

Relying heavily on the Nethereum project, this library contains classes that interact with the Ethereum foundation and that extend the Wonka engine, particulary the base class WonkaBizRulesEngine in the Wonka.BizRulesEngine library. With the funtionality provided here, Wonka becomes a business rules engine for both the .NET platform and the Ethereum platform, one that is inherently metadata-driven and serves as a reference implementation for EIP-2746. Once the rules are written into a markup language and are parsed/deserialized by the .NET form of the engine, these rules can then be serialized onto the blockchain using Nethereum, and stored within a smart contract (i.e., the Ethereum version of the engine) built using the Solidity language. The Ethereum version of this engine can also be deployed as a contract by this library. After providing a number of rules and populating a record, a user can submit the populated record for validation by the rules engine, whether it exists in .NET or the blockchain.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.1.0 107 11/10/2026
6.1.0 1,237 3/25/2026
6.0.4 211 3/18/2026
6.0.3 160 3/18/2026
6.0.1 176 3/17/2026
6.0.0 200 3/16/2026
5.8.0 232 1/6/2026
5.0.0 386 5/28/2025
4.29.0 1,036 2/10/2025
4.28.0 349 1/7/2025
4.27.1 589 12/24/2024
4.27.0 314 12/24/2024
4.26.0 807 10/1/2024
4.25.0 846 9/19/2024
4.21.4 387 8/9/2024
4.21.3 308 7/22/2024
4.21.2 347 6/26/2024
4.21.1 312 6/26/2024
4.21.0 349 6/18/2024
4.20.0 496 3/28/2024
Loading failed