Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Solnet.Examples/TokenSwapExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ public void Run()
.AddInstruction(SystemProgram.CreateAccount(
wallet.Account,
swap,
RpcClient.GetMinimumBalanceForRentExemption((long)TokenSwapProgram.TokenSwapAccountDataSize).Result,
TokenSwapProgram.TokenSwapAccountDataSize,
RpcClient.GetMinimumBalanceForRentExemption((long)TokenSwapProgram.TokenSwapDataLength).Result,
TokenSwapProgram.TokenSwapDataLength,
program.ProgramIdKey
))
.AddInstruction(program.Initialize(
Expand Down
7 changes: 6 additions & 1 deletion src/Solnet.Programs/TokenSwap/TokenSwapProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public class TokenSwapProgram : BaseProgram
/// Token Swap account layout size.
/// </summary>
public static readonly ulong TokenSwapAccountDataSize = 323;


/// <summary>
/// Token Swap data length. // 1 (for the SwapVersion enum) + 323 (TokenSwapAccountDataSize)
/// </summary>
public static readonly ulong TokenSwapDataLength = 1 + TokenSwapAccountDataSize;

/// <summary>
/// Create a token swap program instance with the standard programid and program name
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Solnet.Programs/TokenSwap/TokenSwapProgramData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ internal static void DecodeInitializeData(DecodedInstruction decodedInstruction,
decodedInstruction.Values.Add("Owner Withraw Fee Denominator", data.GetU64(42));
decodedInstruction.Values.Add("Host Fee Numerator", data.GetU64(50));
decodedInstruction.Values.Add("Host Fee Denominator", data.GetU64(58));
decodedInstruction.Values.Add("Curve Type", data.GetU64(59));
decodedInstruction.Values.Add("Curve Type", data.GetU8(66));
//nothing to show for calculator unless hardcoding the switch stmt
}

Expand Down