Skip to content

Commit

Permalink
feat: network properties made public
Browse files Browse the repository at this point in the history
so they can be changed from external scripts
  • Loading branch information
talha-trili committed Oct 16, 2024
1 parent e452f85 commit 7fd60a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 37 deletions.
18 changes: 3 additions & 15 deletions Runtime/Scripts/Configs/DataProviderConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Tezos.Configs
public class DataProviderConfig: ScriptableObject
{
[Tooltip("Select the network to use for querying data.")]
[SerializeField] private NetworkType network = NetworkType.ghostnet;
[SerializeField] public NetworkType Network = NetworkType.ghostnet;

// The URL format string for the base API endpoint. Use {network} as a placeholder for the network type.
// Example format: "https://api.{network}.tzkt.io/v1/"
Expand All @@ -21,20 +21,8 @@ public class DataProviderConfig: ScriptableObject
[Tooltip("URL to the documentation of the data provider. (Optional)")]
[SerializeField] private string documentationUrl = "https://api.tzkt.io/";

public string BaseUrl
{
get => baseUrlFormat.Replace("{network}", network.ToString());
}

public string DocumentationUrl
{
get => documentationUrl;
}

public NetworkType Network
{
get => network;
}
public string BaseUrl => baseUrlFormat.Replace("{network}", Network.ToString());
public string DocumentationUrl => documentationUrl;

public int RequestTimeoutSeconds
{
Expand Down
27 changes: 5 additions & 22 deletions Runtime/Scripts/Configs/TezosConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Tezos.Configs
public class TezosConfig: ScriptableObject
{
[Tooltip("Select the network to use for chain interactions.")]
[SerializeField] private NetworkType network = NetworkType.ghostnet;
[SerializeField] public NetworkType Network = NetworkType.ghostnet;

[Tooltip("Web client address for Kukai Connector.")]
[SerializeField] private string kukaiWebClientAddress;
Expand All @@ -33,29 +33,12 @@ public DataProviderConfig DataProvider
set => dataProviderConfig = value;
}

public string KukaiWebClientAddress
{
get => kukaiWebClientAddress;
}
public string KukaiWebClientAddress => kukaiWebClientAddress;

public NetworkType Network
{
get => network;
}
public string PinataApiKey => pinataApiKey;

public string PinataApiKey
{
get => pinataApiKey;
}
public int RequestTimeoutSeconds => requestTimeoutSeconds;

public int RequestTimeoutSeconds
{
get => requestTimeoutSeconds;
}

public string Rpc
{
get => rpcUrlFormat.Replace("{network}", network.ToString());
}
public string Rpc => rpcUrlFormat.Replace("{network}", Network.ToString());
}
}

0 comments on commit 7fd60a8

Please sign in to comment.