VOOZH about

URL: https://www.nuget.org/packages/Solana.Pumpfun/

⇱ NuGet Gallery | Solana.Pumpfun 8.0.0.1




👁 Image
Solana.Pumpfun 8.0.0.1

dotnet add package Solana.Pumpfun --version 8.0.0.1
 
 
NuGet\Install-Package Solana.Pumpfun -Version 8.0.0.1
 
 
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="Solana.Pumpfun" Version="8.0.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Solana.Pumpfun" Version="8.0.0.1" />
 
Directory.Packages.props
<PackageReference Include="Solana.Pumpfun" />
 
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 Solana.Pumpfun --version 8.0.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Solana.Pumpfun, 8.0.0.1"
 
 
#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 Solana.Pumpfun@8.0.0.1
 
 
#: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=Solana.Pumpfun&version=8.0.0.1
 
Install as a Cake Addin
#tool nuget:?package=Solana.Pumpfun&version=8.0.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Solnet.Pumpfun

C# SDK & Client for Pump.fun on Solana

Dependencies - Use NET8 tag on nuget to find latest versions of solnet
  • NET8.0
  • Solnet.RPC
  • Solnet.Wallet
  • Solnet.Programs

How to use the library to perform a 10 second buy/sell

using Solnet.Programs;
using Solnet.Pumpfun;
using Solnet.Rpc;
using Solnet.Wallet;


Account _trader = Account.FromSecretKey("ENTER SECRET KEY HERE");
IRpcClient connection = ClientFactory.GetClient("RPC LINK HERE");
PumpfunClient pumpFun = new PumpfunClient(connection, _trader);

//Buy the token. Token Address - Sol Amount - Slippage Percent 
await pumpFun.Buy("CA/MINT ADDRESS HERE", 0.001m, 10);

await Task.Delay(10000);

PublicKey associatedUser = AssociatedTokenAccountProgram.DeriveAssociatedTokenAccount(_trader, new PublicKey("CA/MINT ADDRESS HERE"));
var tokenbalance = await connection.GetTokenAccountBalanceAsync(associatedUser);

await Task.Delay(1000);

await pumpFun.Sell("CA/MINT ADDRESS HERE", tokenbalance.Result.Value.AmountDecimal);

Quickstart AI logic template

using Solnet.Programs;
using Solnet.Pumpfun;
using Solnet.Rpc;
using Solnet.Wallet;


Account _trader = Account.FromSecretKey("ENTER SECRET KEY HERE");
IRpcClient connection = ClientFactory.GetClient("RPC LINK HERE");
PumpfunClient pumpFun = new PumpfunClient(connection, _trader);

bool living = true;
while (living)
{

 //THINK 
 //Add logic here to determine what you should buy next then execute the code below to have your bot trade the tokens
 //if (foundGoodToken)
 //{

 //DO
 try
 {
 //Swap the token. Token Address - Sol Amount 
 await PerformTenSecondTrade("TOKEN ADDRESS", 0.001m, pumpFun, _trader);

 }
 catch(Exception ex)
 {
 Console.WriteLine(ex.ToString());
 }
 //Freeze the loop in the example. you can remove this once you add logic to determine when to buy/sell
 await Task.Delay(1000000000);
 //}
}

static async Task PerformTenSecondTrade(string tokenAddress, decimal sol_amount, PumpfunClient pumpFun, Account _trader)
{
 try
 {
 //Buy the token. Token Address - Sol Amount - Slippage Percent 
 await pumpFun.Buy(tokenAddress, 0.001m, 10);

 await Task.Delay(10000);

 PublicKey associatedUser = AssociatedTokenAccountProgram.DeriveAssociatedTokenAccount(_trader, new PublicKey(tokenAddress));
 var tokenbalance = await pumpFun.RpcClient.GetTokenAccountBalanceAsync(associatedUser);

 await Task.Delay(1000);

 await pumpFun.Sell(tokenAddress, tokenbalance.Result.Value.AmountDecimal);

 }
 catch (Exception ex)
 {
 Console.WriteLine(ex.ToString());
 }
}
Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0.1 1,639 10/21/2024
8.0.0 215 10/21/2024