Skip to content

Instantly share code, notes, and snippets.

@hoakbuilds
hoakbuilds / TransferWithDurableNonce.cs
Created July 21, 2021 00:34
Solana - GetAccountInfo, Decode NonceAccount to use Nonce instead of RecentBlockhash
public class TransactionBuilderTransferWithDurableNonceExample : IExample
{
private static readonly IRpcClient rpcClient = ClientFactory.GetClient(Cluster.TestNet);
private const string MnemonicWords =
"route clerk disease box emerge airport loud waste attitude film army tray " +
"forward deal onion eight catalog surface unit card window walnut wealth medal";
public void Run()
{
var wallet = new Wallet.Wallet(MnemonicWords);
@hoakbuilds
hoakbuilds / FreezeAuthorityExample.cs
Created August 7, 2021 00:36
Example on how to use multi signature accounts to control a token's mint and freeze authorities.
/// <summary>
/// An example on how to control the freeze authority of a token using multi signatures
/// </summary>
public class FreezeAuthorityExample : IExample
{
private static readonly IRpcClient rpcClient = ClientFactory.GetClient(Cluster.TestNet);
private const string MnemonicWords =
"route clerk disease box emerge airport loud waste attitude film army tray " +
"forward deal onion eight catalog surface unit card window walnut wealth medal";
Block Slot: 89661259 Transactions: 1182 Consensus: 981 Percentage: 82.99%
Block Slot: 89661261 Transactions: 1626 Consensus: 1614 Percentage: 99.26%
Block Slot: 89661262 Transactions: 2722 Consensus: 2682 Percentage: 98.53%
Block Slot: 89661263 Transactions: 905 Consensus: 860 Percentage: 95.03%
Block Slot: 89661264 Transactions: 3273 Consensus: 3180 Percentage: 97.16%
Block Slot: 89661265 Transactions: 1217 Consensus: 1165 Percentage: 95.73%
Block Slot: 89661266 Transactions: 2349 Consensus: 2228 Percentage: 94.85%
Block Slot: 89661267 Transactions: 1956 Consensus: 1833 Percentage: 93.71%
Block Slot: 89661270 Transactions: 5612 Consensus: 4911 Percentage: 87.51%
Block Slot: 89661271 Transactions: 2224 Consensus: 20 Percentage: 0.90%
using Solnet.KeyStore;
using Solnet.Programs;
using Solnet.Rpc;
using Solnet.Rpc.Builders;
using Solnet.Rpc.Core.Http;
using Solnet.Rpc.Messages;
using Solnet.Rpc.Models;
using Solnet.Wallet;
using System;
using System.Collections.Generic;
@hoakbuilds
hoakbuilds / Solana
Created September 28, 2021 12:12
Solana dev resources
Guides / Walkthroughs
Intro to Programming on Solana
https://paulx.dev/blog/2021/01/14/programming-on-solana-an-introduction/
Development Tutorial by Solong
https://solongwallet.medium.com/solana-development-tutorial-things-you-should-know-before-structuring-your-code-807f0e2ee43
Intro to Anchor Framework
https://project-serum.github.io/anchor/getting-started/introduction.html