Solana.Metaplex
4.8.2
See the version list below for details.
dotnet add package Solana.Metaplex --version 4.8.2
NuGet\Install-Package Solana.Metaplex -Version 4.8.2
<PackageReference Include="Solana.Metaplex" Version="4.8.2" />
paket add Solana.Metaplex --version 4.8.2
#r "nuget: Solana.Metaplex, 4.8.2"
// Install Solana.Metaplex as a Cake Addin #addin nuget:?package=Solana.Metaplex&version=4.8.2 // Install Solana.Metaplex as a Cake Tool #tool nuget:?package=Solana.Metaplex&version=4.8.2
What is Solnet.Metaplex?
Solnet is Solana's .NET integration library, a number of packages that implement features to interact with Solana from .Net applications.
Solnet.Metaplex is a package within the same Solnet.
namespace that implements a Client for Metaplex, this project is in a
separate repository so it is contained, as the goal for Solnet was to be a core SDK.
Features
Requirements
- net 6.0
Backport to .NET standard 2.0 is available on Nuget under version 4.0.0
Dependencies
- Solnet
Examples
Create & Mint a Fungible, Semi-Fungible, Non-Fungible, or Programmable metadata token
var client = ClientFactory.GetClient( Cluster.DevNet);
var exampleWallet = new Wallet.Wallet(pk);
//Get your account either by the wallet or directly from the private key
Account ownerAccount = exampleWallet.Account;
Account mintAccount = exampleWallet.GetAccount(75);
Console.WriteLine("Using account public key : {0}", ownerAccount.PublicKey );
//Create the creator list
List<Creator> creatorList = new List<Creator>
{
new Creator(ownerAccount.PublicKey, 100, true)
};
//If there is more than one then you can add more
//creatorList.Add(new Creator(new PublicKey("")))
Metadata tokenMetadata = new Metadata
{
name = "SolNET NFT",
symbol = "SOLNET",
sellerFeeBasisPoints = 500,
uri = "arweave link",
creators = creatorList,
//If your NFT has a parent collection NFT. You can specify it here
//collection = new Collection(collectionAddress),
uses = new Uses(UseMethod.Single, 5, 5),
//If your NFT is programmable and has a ruleset then specify it here
//programmableConfig = new ProgrammableConfig(rulesetAddress)
};
//Easily create any type of metadata token. Any nullable parameters can be overrided to provide the data needed to create complex metadata tokens or use legacy instructions
MetaplexClient metaplexClient = new MetaplexClient(client);
await metaplexClient.CreateNFT(ownerAccount, mintAccount, TokenStandard.NonFungible, tokenMetadata, false, true);
Get the metadata of a token
string pk = "token address here"
Console.WriteLine("### Get Metadata example ###");
Console.WriteLine("Getting account {0}", pk );
var client = ClientFactory.GetClient( Cluster.MainNet);
var account = await MetadataAccount.GetAccount( client, new PublicKey(pk ));
Console.WriteLine( $"Owner: {account.owner}");
Console.WriteLine( $"Authority key: {account.updateAuthority}");
Console.WriteLine( $"Mint key: {account.mint}");
Console.WriteLine( $"Name: {account.metadata.name}");
Console.WriteLine( $"Symbol: {account.metadata.symbol}");
Console.WriteLine( $"Uri: {account.metadata.uri}");
Console.WriteLine( $"SellerFeeBasisPoints: {account.metadata.sellerFeeBasisPoints}");
Console.WriteLine( $"---Creators---");
foreach( Creator c in account.metadata.creators)
{
Console.WriteLine( $"Creator Key: {c.key}");
Console.WriteLine( $"Creator Share: {c.share}");
Console.WriteLine( $"Creator is verified: {c.verified}");
}
Console.WriteLine( "-------Metadata-------");
Console.WriteLine($"Name: {account.offchainData.name}");
Console.WriteLine($"Description: {account.offchainData.description}");
Console.WriteLine($"Symbol: {account.offchainData.symbol}");
Console.WriteLine($"Collection: {account.offchainData.collection}");
Console.WriteLine($"Default Image: { account.offchainData.default_image }" );
Console.WriteLine($"Animation url: {account.offchainData.animation_url}");
foreach (var attribute in account.offchainData.attributes)
{
if(attribute != null)
Console.WriteLine($"Attribute: { attribute.trait_type } | { attribute.value }");
}
Console.WriteLine ( "------------------");
Contribution
We encourage everyone to contribute, submit issues, PRs, discuss. Every kind of help is welcome.
Contributors
- Mariomatic - Maintainer - mariomatic
- BifrostTitan - Contributer - bifrosttitan
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
.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 | net461 was computed. 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. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
- System.Memory (>= 4.5.5)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Solana.Metaplex:
Package | Downloads |
---|---|
SolmangoNET
A .NET library that adds some useful composite RPC calls to the Solana chain to simply NFT collections management. |
|
Siamango.SolmangoNET
A .NET library that adds some useful composite RPC calls to the Solana chain to simply NFT collection management. |
|
Solana.LinkStream
LinkStream is middleware designed to be integrated into applications or games that use Solana's solnet C# client. Utilizing TCP server & client protocols to send transaction messages from dapps to wallet based applications |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.0 | 5,073 | 5/9/2024 |
6.9.0 | 244 | 5/9/2024 |
6.8.2 | 7,530 | 8/2/2023 |
6.8.1 | 709 | 3/20/2023 |
6.8.0 | 666 | 3/2/2023 |
4.8.2 | 552 | 8/2/2023 |
4.8.1 | 638 | 3/20/2023 |
4.8.0 | 627 | 3/2/2023 |
3.0.0 | 1,034 | 11/8/2022 |
2.0.0 | 860 | 10/4/2022 |
1.3.0 | 5,216 | 3/24/2022 |
1.2.0 | 1,605 | 2/8/2022 |
1.2.0-NET5 | 481 | 2/8/2022 |
0.9.0 | 880 | 2/8/2022 |