-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Soroban related improvements - Added unit tests for GetLedgerEntries of type ConfigSetting and TTL. - Added new SCInt128 constructor that accepts a numeric string. - Reordered parameters in SCInt128 constructor, from SCInt128(ulong lo, long hi) to SCInt128(long hi, ulong lo) to match with other SDKs. - Updated SorobanServer constructor SorobanServer(string uri) to SorobanServer(string uri, string? bearerToken = null), allowing direct injection of custom bearer tokens. - Added new DefaultStellarSdkHttpClient class.
- Loading branch information
Showing
10 changed files
with
451 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Net.Http; | ||
using System.Net.Http.Headers; | ||
using System.Reflection; | ||
|
||
namespace StellarDotnetSdk.Requests; | ||
|
||
public class DefaultStellarSdkHttpClient : HttpClient | ||
{ | ||
/// <summary> | ||
/// Creates an HTTP client with some default request headers and the given bearer token. | ||
/// </summary> | ||
/// <param name="bearerToken">Bearer token in case the server requires it.</param> | ||
/// <param name="clientName">Name of the client.</param> | ||
/// <param name="clientVersion">Version of the client.</param> | ||
public DefaultStellarSdkHttpClient(string? bearerToken = null, string? clientName = null, string? clientVersion = null) | ||
{ | ||
var assembly = Assembly.GetAssembly(GetType())!.GetName(); | ||
DefaultRequestHeaders.Add("X-Client-Name", clientName ?? "stellar-dotnet-sdk"); | ||
DefaultRequestHeaders.Add("X-Client-Version", clientVersion ?? assembly.Version!.ToString()); | ||
if (!string.IsNullOrEmpty(bearerToken)) | ||
{ | ||
DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
namespace StellarDotnetSdk.Requests.SorobanRpc; | ||
|
||
/// <summary> | ||
/// Pagination in RPC is similar to pagination in Horizon. | ||
/// See: <a href="https://developers.stellar.org/docs/data/rpc/api-reference/pagination">Pagination</a> | ||
/// Pagination in RPC is similar to pagination in Horizon. | ||
/// See: <a href="https://developers.stellar.org/docs/data/rpc/api-reference/pagination">Pagination</a> | ||
/// </summary> | ||
public class PaginationOptions | ||
{ | ||
/// <summary> | ||
/// A unique identifier (specifically, a TOID) that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. When a cursor is provided, RPC will not include the element whose ID matches the cursor in the response: only elements which appear after the cursor will be included. | ||
/// A unique identifier (specifically, a TOID) that points to a specific location in a collection of responses and is | ||
/// pulled from the paging_token value of a record. When a cursor is provided, RPC will not include the element whose | ||
/// ID matches the cursor in the response: only elements which appear after the cursor will be included. | ||
/// </summary> | ||
public string? Cursor { get; set; } | ||
|
||
/// <summary> | ||
/// The maximum number of records returned. For getTransactions, this ranges from 1 to 200 and defaults to 50. | ||
/// The maximum number of records returned. For getTransactions, this ranges from 1 to 200 and defaults to 50. | ||
/// </summary> | ||
public long? Limit { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters