Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add maxSupportedTransactionVersion #46

Merged
merged 1 commit into from
Nov 6, 2023
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
5 changes: 3 additions & 2 deletions src/Solana.Unity.Rpc/IRpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ Task<RequestResult<ResponseValue<List<LargeTokenAccount>>>> GetTokenLargestAccou
/// <returns>Returns a task that holds the asynchronous operation result and state.</returns>
Task<RequestResult<ResponseValue<TokenBalance>>> GetTokenSupplyAsync(string tokenMintPubKey,
Commitment commitment = default);

/// <summary>
/// Returns transaction details for a confirmed transaction.
/// <remarks>
Expand All @@ -558,9 +558,10 @@ Task<RequestResult<ResponseValue<TokenBalance>>> GetTokenSupplyAsync(string toke
/// </summary>
/// <param name="signature">Transaction signature as base-58 encoded string.</param>
/// <param name="commitment">The state commitment to consider when querying the ledger state.</param>
/// <param name="maxSupportedTransactionVersion">The max supported transaction version (1 for versioned)</param>
/// <returns>Returns a task that holds the asynchronous operation result and state.</returns>
Task<RequestResult<TransactionMetaSlotInfo>> GetTransactionAsync(string signature,
Commitment commitment = default);
Commitment commitment = default, int maxSupportedTransactionVersion = 0);

/// <summary>
/// Returns transaction details for a confirmed transaction.
Expand Down
6 changes: 4 additions & 2 deletions src/Solana.Unity.Rpc/SolanaRpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,13 @@ public async Task<RequestResult<Dictionary<string, List<ulong>>>> GetLeaderSched

/// <inheritdoc cref="IRpcClient.GetTransactionAsync"/>
public async Task<RequestResult<TransactionMetaSlotInfo>> GetTransactionAsync(string signature,
Commitment commitment = default)
Commitment commitment = default, int maxSupportedTransactionVersion = 0)
{
return await SendRequestAsync<TransactionMetaSlotInfo>("getTransaction",
Parameters.Create(signature,
ConfigObject.Create(KeyValue.Create("encoding", "json"), HandleCommitment(commitment))));
ConfigObject.Create(KeyValue.Create("encoding", "json"), HandleCommitment(commitment),
KeyValue.Create("maxSupportedTransactionVersion", maxSupportedTransactionVersion)))
);
}

/// <inheritdoc cref="IRpcClient.GetConfirmedTransactionAsync(string, Commitment)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"method":"getTransaction","params":["5as3w4KMpY23MP5T1nkPVksjXjN7hnjHKqiDxRMxUNcw5XsCGtStayZib1kQdyR2D9w8dR11Ha9Xk38KP3kbAwM1",{"encoding":"json","commitment":"processed"}],"jsonrpc":"2.0","id":0}
{"method":"getTransaction","params":["5as3w4KMpY23MP5T1nkPVksjXjN7hnjHKqiDxRMxUNcw5XsCGtStayZib1kQdyR2D9w8dR11Ha9Xk38KP3kbAwM1",{"encoding":"json","commitment":"processed","maxSupportedTransactionVersion":0}],"jsonrpc":"2.0","id":0}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"method":"getTransaction","params":["5as3w4KMpY23MP5T1nkPVksjXjN7hnjHKqiDxRMxUNcw5XsCGtStayZib1kQdyR2D9w8dR11Ha9Xk38KP3kbAwM1",{"encoding":"json"}],"jsonrpc":"2.0","id":0}
{"method":"getTransaction","params":["5as3w4KMpY23MP5T1nkPVksjXjN7hnjHKqiDxRMxUNcw5XsCGtStayZib1kQdyR2D9w8dR11Ha9Xk38KP3kbAwM1",{"encoding":"json","maxSupportedTransactionVersion":0}],"jsonrpc":"2.0","id":0}