Zora.Coins
0.1.1
dotnet add package Zora.Coins --version 0.1.1
NuGet\Install-Package Zora.Coins -Version 0.1.1
<PackageReference Include="Zora.Coins" Version="0.1.1" />
<PackageVersion Include="Zora.Coins" Version="0.1.1" />
<PackageReference Include="Zora.Coins" />
paket add Zora.Coins --version 0.1.1
#r "nuget: Zora.Coins, 0.1.1"
#:package Zora.Coins@0.1.1
#addin nuget:?package=Zora.Coins&version=0.1.1
#tool nuget:?package=Zora.Coins&version=0.1.1
Zora.Coins for .NET and Unity
Typed async client for the Zora Coins API: all 30 endpoints, IAsyncEnumerable pagination, retries, a GraphQL client, and an onchain indexer for the creator and referral rewards Zora pays on Base. Targets .NET Standard 2.1 (Unity 2021+) and .NET 8+.
Unofficial and community-maintained. Not affiliated with Zora.
dotnet add package Zora.Coins
Quick start
using Zora.Coins;
using var zora = new ZoraCoinsClient(); // reads ZORA_API_KEY; or new ZoraCoinsClient(new() { ApiKey = "…" })
var coin = await zora.GetCoinAsync("0x0b8590d3c0b1ee6c797e184a4afbb15f8f58a46b"); // null if there's no such coin
Console.WriteLine($"{coin?.Name} {coin?.MarketCap} {coin?.CreatorProfile?.Handle}");
Every response property is nullable, because the API leaves fields out. Enums are extensible (string-backed structs, as in the Azure SDKs), so a value Zora adds later doesn't break deserialization.
Pagination
var page = await zora.GetCoinHoldersAsync(addr, new CoinHoldersParams { PageSize = 50 });
foreach (var h in page.Nodes()) { /* … */ }
var next = page.NextCursor(); // null on the last page
await foreach (var holder in zora.EnumerateCoinHoldersAsync(addr))
Console.WriteLine($"{holder.OwnerAddress} {holder.Balance}"); // Balance: 18-decimal integer string
Every method takes a CancellationToken.
Errors, trading, GraphQL
try
{
var q = await zora.QuoteTradeAsync(ZoraCoinsClient.Eth(), ZoraCoinsClient.Erc20(coin), "1000000000000000", wallet, referrer: myApp);
// q.Call.Target / Data / Value: sign with your wallet (Nethereum, a Unity wallet SDK…)
}
catch (ZoraApiException e) when (e.IsInsufficientLiquidity) { /* the pool can't fill that size */ }
var gql = new ZoraGraphQLClient(new Uri("http://localhost:8080/graphql"));
var data = await gql.QueryAsync<MyData>("query($a: String!) { coin(address: $a) { name marketCap } }", new { a = addr });
Rate limits and server errors are retried with backoff, honouring Retry-After. This package never holds keys or sends transactions.
Rewards
using Zora.Coins.Rewards;
var idx = new RewardsIndexer(new MemoryStore()); // Base's public RPC by default
await idx.ScanAsync(new[] { addr }, days: 7);
var report = await RewardsReport.BuildAsync(idx.Store.EventsFor(new[] { addr }), new[] { addr }, zora);
Console.Write(report.ToText());
Amounts are exact BigIntegers.
Reference
Every endpoint and its method, including the units of the numeric fields. XML docs on every public member.
dotnet test tests/Zora.Coins.Tests # offline
LIVE=1 dotnet test tests/Zora.Coins.Tests --filter LiveTests # every endpoint against production
MIT © Rebel Studios Software
| 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 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 was computed. 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 was computed. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | 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.1
- System.Text.Json (>= 8.0.5)
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.