Skip to content
Open
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: 3 additions & 1 deletion src/Blockfrost.io/Editor/Blockfrost.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"references": [
"GUID:be4fcdd22dd41994392923b08dd8863f"
],
"includePlatforms": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
Expand Down
13 changes: 11 additions & 2 deletions src/Blockfrost.io/Scripts/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class Configuration : ScriptableObject {
private int _currentNetworkIndex;
public int CurrentNetworkIndex { get => _currentNetworkIndex; protected set => _currentNetworkIndex = value; }

public Server CurrentServer { get => servers[CurrentApi][CurrentNetworkIndex]; }
public List<Server> CurrentApiServers { get => servers[CurrentApi]; }
public Server CurrentServer { get => CurrentApiServers[CurrentNetworkIndex]; }

[SerializeField]
[HideInInspector]
Expand All @@ -59,6 +60,14 @@ public class Configuration : ScriptableObject {
Network = "Testnet",
Url = "cardano-testnet.blockfrost.io/api/v0",
},
new Server{
Network = "Preprod",
Url = "cardano-preprod.blockfrost.io/api/v0",
},
new Server{
Network = "Preview",
Url = "cardano-preview.blockfrost.io/api/v0",
},
}}, {
MilkomedaApi, new List<Server>{
new Server{
Expand All @@ -80,7 +89,7 @@ public void ChangeApi(string api) {
}

public void ChangeNetwork(int index) {
if (index >= servers.Count) {
if (index >= CurrentApiServers.Count) {
Debug.LogError($"Invalid network index {index}");
return;
}
Expand Down