diff --git a/CLAUDE.md b/CLAUDE.md index 54d2240c..61490c48 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -84,6 +84,7 @@ dotnet test tests/Workflow.Tests/Workflow.Tests.csproj - **Activity methods**: Must be `public virtual async` in implementation class (Temporal requirement) - **String truncation**: Use `StringExtensions.Truncate(maxLength)` instead of inline `[..Math.Min()]` patterns. Located in `src/Common/Extensions/StringExtensions.cs`. - **Quote expiry enforcement**: `ValidateQuoteAsync` checks `QuoteExpiry < Workflow.UtcNow` after HMAC signature validation to prevent replay of stale signed quotes +- **IsTestnet**: `Network.IsTestnet` is set at creation time only (not editable via update). `NetworkDto.IsTestnet` propagated through all projections. AdminPanel defaults to hiding testnets with a toggle. ## JS Project (`js/`) diff --git a/csharp/src/AdminAPI/Endpoints/NetworkEndpoints.cs b/csharp/src/AdminAPI/Endpoints/NetworkEndpoints.cs index d5b4b7f2..1382edf0 100644 --- a/csharp/src/AdminAPI/Endpoints/NetworkEndpoints.cs +++ b/csharp/src/AdminAPI/Endpoints/NetworkEndpoints.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; using Train.Solver.AdminAPI.Filters; +using Train.Solver.Infrastructure.Abstractions; using Train.Solver.Infrastructure.Services; using Train.Solver.Common.Extensions; using Train.Solver.Data.Abstractions.Models; @@ -34,8 +35,7 @@ public static RouteGroupBuilder MapNetworkEndpoints(this RouteGroupBuilder group .Produces() .Produces(StatusCodes.Status400BadRequest); - group.MapDelete("/networks/{networkName}/nodes/{providerName}", DeleteNodeAsync) - .Produces() + group.MapDelete("/networks/{networkName}/nodes/{id:int}", DeleteNodeAsync) .Produces(StatusCodes.Status204NoContent); group.MapPost("/networks/{networkName}/tokens", CreateTokenAsync) @@ -115,18 +115,18 @@ public static RouteGroupBuilder MapNetworkEndpoints(this RouteGroupBuilder group private static async Task GetAllAsync( ILogger logger, - INetworkRepository repository, + INetworkService networkService, [FromQuery] string[]? types) { - var networks = await repository.GetAllAsync(types.IsNullOrEmpty() ? null : types); + var networks = await networkService.GetAllAsync(types.IsNullOrEmpty() ? null : types); return Results.Ok(networks); } private static async Task GetAsync( - INetworkRepository repository, + INetworkService networkService, string networkName) { - var network = await repository.GetAsync(networkName); + var network = await networkService.GetAsync(networkName); return network is null ? Results.NotFound($"Network '{networkName}' not found.") : Results.Ok(network); @@ -188,9 +188,9 @@ private static async Task CreateNodeAsync( private static async Task DeleteNodeAsync( INetworkRepository repository, string networkName, - string providerName) + int id) { - await repository.DeleteNodeAsync(networkName, providerName); + await repository.DeleteNodeAsync(id); return Results.Ok(); } diff --git a/csharp/src/AdminAPI/Endpoints/NodeProviderEndpoints.cs b/csharp/src/AdminAPI/Endpoints/NodeProviderEndpoints.cs new file mode 100644 index 00000000..6258054d --- /dev/null +++ b/csharp/src/AdminAPI/Endpoints/NodeProviderEndpoints.cs @@ -0,0 +1,155 @@ +using Microsoft.AspNetCore.Mvc; +using Train.Solver.Data.Abstractions.Models; +using Train.Solver.Data.Abstractions.Repositories; +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.AdminAPI.Endpoints; + +public static class NodeProviderEndpoints +{ + public static RouteGroupBuilder MapNodeProviderEndpoints(this RouteGroupBuilder group) + { + group.MapGet("/node-providers", GetAllAsync) + .Produces>(StatusCodes.Status200OK); + + group.MapGet("/node-providers/{id:int}", GetAsync) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status404NotFound); + + group.MapPost("/node-providers", CreateAsync) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status400BadRequest); + + group.MapPut("/node-providers/{id:int}", UpdateAsync) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status404NotFound); + + group.MapDelete("/node-providers/{id:int}", DeleteAsync) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status404NotFound); + + group.MapPost("/node-providers/{id:int}/networks/{networkSlug}", LinkNetworkAsync) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status400BadRequest) + .Produces(StatusCodes.Status404NotFound); + + group.MapDelete("/node-providers/{id:int}/networks/{networkSlug}", UnlinkNetworkAsync) + .Produces(StatusCodes.Status200OK) + .Produces(StatusCodes.Status404NotFound); + + group.MapGet("/node-providers/supported-chains/{providerName}", GetSupportedChainsAsync) + .Produces>(StatusCodes.Status200OK) + .Produces(StatusCodes.Status404NotFound); + + return group; + } + + private static async Task GetAllAsync( + INodeProviderRepository repository) + { + var providers = await repository.GetAllAsync(); + return Results.Ok(providers); + } + + private static async Task GetAsync( + int id, + INodeProviderRepository repository) + { + var provider = await repository.GetAsync(id); + return provider is null ? Results.NotFound("Node provider not found") : Results.Ok(provider); + } + + private static async Task CreateAsync( + INodeProviderRepository repository, + IEnumerable nodeProviders, + [FromBody] CreateNodeProviderRequest request) + { + var knownProvider = nodeProviders.FirstOrDefault(p => + string.Equals(p.Name, request.Name, StringComparison.OrdinalIgnoreCase)); + + if (knownProvider is null) + { + var knownNames = nodeProviders.Select(p => p.Name); + return Results.BadRequest($"Unknown provider '{request.Name}'. Known providers: {string.Join(", ", knownNames)}"); + } + + request.Name = knownProvider.Name; + var provider = await repository.CreateAsync(request); + return Results.Ok(provider); + } + + private static async Task UpdateAsync( + int id, + INodeProviderRepository repository, + [FromBody] UpdateNodeProviderRequest request) + { + var provider = await repository.UpdateAsync(id, request); + return provider is null ? Results.NotFound("Node provider not found") : Results.Ok(provider); + } + + private static async Task DeleteAsync( + int id, + INodeProviderRepository repository) + { + var deleted = await repository.DeleteAsync(id); + return deleted ? Results.Ok() : Results.NotFound("Node provider not found"); + } + + private static async Task LinkNetworkAsync( + int id, + string networkSlug, + INodeProviderRepository providerRepository, + INetworkRepository networkRepository, + IEnumerable nodeProviders) + { + var provider = await providerRepository.GetAsync(id); + if (provider is null) + return Results.NotFound("Node provider not found"); + + var network = await networkRepository.GetAsync(networkSlug); + if (network is null) + return Results.NotFound($"Network '{networkSlug}' not found"); + + var codeProvider = nodeProviders.FirstOrDefault(p => + string.Equals(p.Name, provider.Name, StringComparison.OrdinalIgnoreCase)); + + if (codeProvider is not null && !codeProvider.SupportsChain(network.ChainId)) + return Results.BadRequest($"Provider '{provider.Name}' does not support chain ID '{network.ChainId}'"); + + var linked = await providerRepository.LinkNetworkAsync(id, networkSlug); + return linked ? Results.Ok() : Results.BadRequest("Failed to link network"); + } + + private static async Task UnlinkNetworkAsync( + int id, + string networkSlug, + INodeProviderRepository repository) + { + var unlinked = await repository.UnlinkNetworkAsync(id, networkSlug); + return unlinked ? Results.Ok() : Results.NotFound("Link not found"); + } + + private static IResult GetSupportedChainsAsync( + string providerName, + IEnumerable nodeProviders) + { + var provider = nodeProviders.FirstOrDefault(p => + string.Equals(p.Name, providerName, StringComparison.OrdinalIgnoreCase)); + + if (provider is null) + return Results.NotFound($"Unknown provider '{providerName}'"); + + // Return supported chains by testing known EVM chain IDs + var knownChainIds = new[] + { + "1", "11155111", "42161", "421614", "8453", "84532", + "10", "11155420", "137", "80002", "43114", "43113", + "56", "97", "534352", "534351", "324", "300", + "81457", "168587773", "59144", "59141", + }; + + var supported = knownChainIds.Where(provider.SupportsChain).ToList(); + return Results.Ok(supported); + } +} diff --git a/csharp/src/AdminAPI/Endpoints/RebalanceEndpoints.cs b/csharp/src/AdminAPI/Endpoints/RebalanceEndpoints.cs index 55b1eb72..1d66a8e8 100644 --- a/csharp/src/AdminAPI/Endpoints/RebalanceEndpoints.cs +++ b/csharp/src/AdminAPI/Endpoints/RebalanceEndpoints.cs @@ -138,6 +138,7 @@ private static async Task RebalanceAsync( ChainId = network.ChainId, Type = network.Type.Name, DisplayName = network.DisplayName, + IsTestnet = network.IsTestnet, NativeTokenAddress = network.Type.NativeTokenAddress, }, Token = token, diff --git a/csharp/src/AdminAPI/Program.cs b/csharp/src/AdminAPI/Program.cs index c05a71df..0a4234f2 100644 --- a/csharp/src/AdminAPI/Program.cs +++ b/csharp/src/AdminAPI/Program.cs @@ -149,6 +149,11 @@ .RequireRateLimiting("Fixed") .WithTags("Rebalance"); +app.MapGroup("/api") + .MapNodeProviderEndpoints() + .RequireRateLimiting("Fixed") + .WithTags("Node Provider"); + app.MapGroup("/api") .MapTransactionBuilderEndpoints() .RequireRateLimiting("Fixed") diff --git a/csharp/src/AdminAPI/Validators/NetworkValidators.cs b/csharp/src/AdminAPI/Validators/NetworkValidators.cs index 9393a347..5eea29fb 100644 --- a/csharp/src/AdminAPI/Validators/NetworkValidators.cs +++ b/csharp/src/AdminAPI/Validators/NetworkValidators.cs @@ -16,7 +16,6 @@ public CreateNetworkRequestValidator() RuleFor(x => x.NativeTokenPriceSymbol).NotEmpty(); RuleFor(x => x.NativeTokenDecimals).GreaterThanOrEqualTo(0); RuleFor(x => x.NodeUrl).NotEmpty(); - RuleFor(x => x.NodeProvider).NotEmpty(); RuleFor(x => x.BaseFeePercentageIncrease).GreaterThanOrEqualTo(0); RuleFor(x => x.PriorityFeePercentageIncrease).GreaterThanOrEqualTo(0); RuleFor(x => x.ReplacementFeePercentageIncrease).GreaterThanOrEqualTo(0); @@ -47,7 +46,6 @@ public class CreateNodeRequestValidator : AbstractValidator { public CreateNodeRequestValidator() { - RuleFor(x => x.ProviderName).NotEmpty(); RuleFor(x => x.Url).NotEmpty() .Must(url => Uri.TryCreate(url, UriKind.Absolute, out _)) .WithMessage("Url must be a valid absolute URI."); diff --git a/csharp/src/AdminPanel/Components/App.razor b/csharp/src/AdminPanel/Components/App.razor index 45be989a..907260a0 100644 --- a/csharp/src/AdminPanel/Components/App.razor +++ b/csharp/src/AdminPanel/Components/App.razor @@ -17,6 +17,40 @@ +
+
+
+
+ + + + + + + + + +
+
+

Reconnecting to server...

+

Connection lost. Attempting to reconnect.

+ +

Connection failed

+

Unable to reach the server. Please check your connection.

+ +

Session expired

+

The server session has ended. Reload to continue.

+
+
+ Retry + Reload +
+
+
+
+
+
+
An unhandled error has occurred. Reload diff --git a/csharp/src/AdminPanel/Layout/NavMenu.razor b/csharp/src/AdminPanel/Layout/NavMenu.razor index 15c89636..76e0de2e 100644 --- a/csharp/src/AdminPanel/Layout/NavMenu.razor +++ b/csharp/src/AdminPanel/Layout/NavMenu.razor @@ -51,6 +51,11 @@ Trusted Wallets
+ +
+
Testnet
+
@(selectedNetwork.IsTestnet ? "Yes" : "No")
+
CAIP-2
@selectedNetwork.Caip2Id
@@ -222,7 +242,7 @@ else - + @@ -230,7 +250,7 @@ else @foreach (var node in selectedNetwork.Nodes.Take(3)) { - + } @@ -250,6 +270,30 @@ else } +
+
+ Node Providers + Manage +
+ @{ var linkedProviders = nodeProviders.Where(p => p.LinkedNetworkSlugs.Contains(selectedNetwork.Slug)).ToList(); } + @if (linkedProviders.Any()) + { +
+ @foreach (var provider in linkedProviders) + { + + @provider.Name + @if (!provider.Enabled) { (disabled) } + + } +
+ } + else + { +

No providers linked to this network

+ } +
+
Contracts (@selectedNetwork.Contracts.Count()) @@ -448,6 +492,10 @@ else
+
+ + +
@@ -515,11 +563,7 @@ else
Initial Node
-
- - -
-
+
@@ -724,13 +768,10 @@ else
Add Node
-
- -
-
+
-
+
-
+
@@ -752,21 +793,34 @@ else
ProviderSource URL
@node.ProviderName@(node.IsFromProvider ? node.ProviderName : "manual") @node.Url
- + - @foreach (var node in selectedNetwork.Nodes) + @foreach (var node in selectedNetwork.Nodes.OrderBy(n => n.IsFromProvider)) { - + } @@ -1494,24 +1548,31 @@ else Nodes - @selectedNode.ProviderName + Node
-

@selectedNode.ProviderName

+

@(selectedNode.IsFromProvider ? selectedNode.ProviderName : "Manual Node")

Node Details
-
-
Provider Name
-
@selectedNode.ProviderName
-
+ @if (selectedNode.IsFromProvider) + { +
+
Provider
+
@selectedNode.ProviderName
+
+ }
URL
@selectedNode.Url
+
+
Protocol
+
@selectedNode.Protocol
+
@@ -1520,7 +1581,10 @@ else
@@ -1595,6 +1659,7 @@ else private bool isLoading = true; private bool isSaving = false; private List networks = new(); + private List nodeProviders = []; private List networkTypes = new(); private List tokenPrices = new(); private string? selectedType; @@ -1705,7 +1770,16 @@ else try { var types = string.IsNullOrEmpty(selectedType) ? null : new[] { selectedType }; - networks = await NetworkService.GetAllAsync(types); + var loaded = await NetworkService.GetAllAsync(types); + + // Sort: mainnets first (no nodes = needs attention at top), then testnets + networks = loaded + .OrderBy(n => n.IsTestnet) + .ThenByDescending(n => n.Nodes.Any()) + .ThenBy(n => n.Slug) + .ToList(); + + try { nodeProviders = await NodeProviderService.GetAllAsync(); } catch { } } catch (Exception ex) { @@ -2070,13 +2144,13 @@ else } } - private async Task DeleteNode(string providerName) + private async Task DeleteNode(int nodeId) { if (selectedNetwork == null) return; isSaving = true; try { - if (await NetworkService.DeleteNodeAsync(selectedNetwork.Slug, providerName)) + if (await NetworkService.DeleteNodeAsync(selectedNetwork.Slug, nodeId)) { CloseLevel3Panels(); selectedNetwork = await NetworkService.GetAsync(selectedNetwork.Slug); diff --git a/csharp/src/AdminPanel/Pages/NodeProviders.razor b/csharp/src/AdminPanel/Pages/NodeProviders.razor new file mode 100644 index 00000000..c4d2a2c1 --- /dev/null +++ b/csharp/src/AdminPanel/Pages/NodeProviders.razor @@ -0,0 +1,521 @@ +@page "/node-providers" +@using Train.Solver.AdminPanel.Services +@using Train.Solver.Shared.Models +@using Train.Solver.Data.Abstractions.Models +@inject NodeProviderService ProviderService +@inject NetworkService NetworkService + +Node Providers - Train Solver Admin + +
+

Node Providers

+

Manage RPC node providers and their network links

+
+ +
+ + +
+ +@if (isLoading) +{ +
+
+ Loading... +
+
+} +else +{ + @if (!providers.Any()) + { +
+

No node providers configured

+
+ } + else + { +
+
+
+
ProviderSource URL Protocol
@node.ProviderName + @if (node.IsFromProvider) + { + @node.ProviderName + auto + } + else + { + manual + } + @node.Url @node.Protocol - + @if (!node.IsFromProvider) + { + + }
+ + + + + + + + + + @foreach (var provider in providers) + { + + + + + + + } + +
NameAPI KeyNetworksStatus
@provider.Name@MaskApiKey(provider.ApiKey)@provider.LinkedNetworkSlugs.Count linked + @if (provider.Enabled) + { + Enabled + } + else + { + Disabled + } +
+
+ + + } +} + +@* View Panel *@ +@if (showViewPanel && selectedProvider != null) +{ +
+
+
+ @selectedProvider.Name +
+
+

@selectedProvider.Name

+ +
+
+
+ + + +
+ +
+
Provider Details
+
+
+
Name
+
@selectedProvider.Name
+
+
+
API Key
+
@selectedProvider.ApiKey
+
+
+
Status
+
+ @if (selectedProvider.Enabled) + { + Enabled + } + else + { + Disabled + } +
+
+
+
+ +
+
+ Linked Networks (@selectedProvider.LinkedNetworkSlugs.Count) + +
+ @if (selectedProvider.LinkedNetworkSlugs.Any()) + { +
+ @foreach (var slug in selectedProvider.LinkedNetworkSlugs) + { + + @slug + + + } +
+ } + else + { +

No networks linked

+ } +
+ +
+ Node providers automatically resolve RPC endpoints for linked networks based on chain ID mappings. + Disabled providers will not contribute nodes to any network. +
+
+
+} + +@* Create Panel *@ +@if (showCreatePanel) +{ +
+
+
+ New Provider +
+
+

Add node provider

+ +
+
+
+
Provider Configuration
+
+ + +
+
+ + + The API key for authenticating with the provider +
+
+ + +
+
+
+ +
+} + +@* Edit Panel *@ +@if (showEditPanel && selectedProvider != null) +{ +
+
+
+ @selectedProvider.Name + + Edit +
+
+

Edit @selectedProvider.Name

+ +
+
+
+
Provider Configuration
+
+ + +
+
+ + +
+
+
+ +
+} + +@* Link Networks Panel *@ +@if (showLinkPanel && selectedProvider != null) +{ +
+
+
+ @selectedProvider.Name + + Link Networks +
+
+

Link Networks

+ +
+
+
+
Available Networks
+ @if (availableNetworks.Any()) + { +
+ + + + + + + + + + @foreach (var network in availableNetworks) + { + + + + + + } + +
NetworkChain ID
+
+ + @network.DisplayName + (@network.Slug) +
+
@network.ChainId + @if (selectedProvider.LinkedNetworkSlugs.Contains(network.Slug)) + { + + } + else + { + + } +
+
+ } + else + { +

No networks available

+ } +
+
+
+} + +@code { + private bool isLoading = true; + private bool isSaving = false; + private List providers = []; + private List allNetworks = []; + + // Known provider names (matches code-based INodeProvider implementations) + private readonly string[] knownProviderNames = ["Alchemy", "Infura", "Ankr", "dRPC", "Chainlist"]; + + // Panel states + private bool showViewPanel = false; + private bool showCreatePanel = false; + private bool showEditPanel = false; + private bool showLinkPanel = false; + private NodeProviderDto? selectedProvider; + + // Request objects + private CreateNodeProviderRequest createRequest = new(); + private UpdateNodeProviderRequest updateRequest = new(); + private bool enabledToggle = true; + + // Computed + private List availableNetworks => allNetworks; + + protected override async Task OnInitializedAsync() + { + await LoadProviders(); + } + + private async Task LoadProviders() + { + isLoading = true; + try + { + providers = await ProviderService.GetAllAsync(); + allNetworks = await NetworkService.GetAllAsync(); + } + catch (Exception ex) + { + Console.WriteLine($"Error loading providers: {ex.Message}"); + } + finally + { + isLoading = false; + } + } + + private void ClosePanels() + { + showViewPanel = false; + showCreatePanel = false; + showEditPanel = false; + showLinkPanel = false; + } + + private void CloseLevel2Panels() + { + showEditPanel = false; + showLinkPanel = false; + } + + private void ShowViewPanel(NodeProviderDto provider) + { + ClosePanels(); + selectedProvider = provider; + showViewPanel = true; + } + + private void ShowCreatePanel() + { + ClosePanels(); + createRequest = new CreateNodeProviderRequest { Enabled = true }; + showCreatePanel = true; + } + + private void ShowEditPanel(NodeProviderDto provider) + { + CloseLevel2Panels(); + enabledToggle = provider.Enabled; + updateRequest = new UpdateNodeProviderRequest + { + ApiKey = provider.ApiKey, + Enabled = provider.Enabled, + }; + showEditPanel = true; + } + + private void ShowLinkPanel() + { + CloseLevel2Panels(); + showLinkPanel = true; + } + + private async Task CreateProvider() + { + isSaving = true; + try + { + var result = await ProviderService.CreateAsync(createRequest); + if (result != null) + { + ClosePanels(); + await LoadProviders(); + ShowViewPanel(result); + } + } + finally + { + isSaving = false; + } + } + + private async Task UpdateProvider() + { + if (selectedProvider == null) return; + isSaving = true; + try + { + updateRequest.Enabled = enabledToggle; + var result = await ProviderService.UpdateAsync(selectedProvider.Id, updateRequest); + if (result != null) + { + CloseLevel2Panels(); + await LoadProviders(); + selectedProvider = providers.FirstOrDefault(p => p.Id == selectedProvider.Id); + } + } + finally + { + isSaving = false; + } + } + + private async Task DeleteProvider() + { + if (selectedProvider == null) return; + isSaving = true; + try + { + if (await ProviderService.DeleteAsync(selectedProvider.Id)) + { + ClosePanels(); + await LoadProviders(); + } + } + finally + { + isSaving = false; + } + } + + private async Task LinkNetwork(string networkSlug) + { + if (selectedProvider == null) return; + isSaving = true; + try + { + if (await ProviderService.LinkNetworkAsync(selectedProvider.Id, networkSlug)) + { + await RefreshSelectedProvider(); + } + } + finally + { + isSaving = false; + } + } + + private async Task UnlinkNetwork(string networkSlug) + { + if (selectedProvider == null) return; + isSaving = true; + try + { + if (await ProviderService.UnlinkNetworkAsync(selectedProvider.Id, networkSlug)) + { + await RefreshSelectedProvider(); + } + } + finally + { + isSaving = false; + } + } + + private async Task RefreshSelectedProvider() + { + if (selectedProvider == null) return; + var refreshed = await ProviderService.GetAsync(selectedProvider.Id); + if (refreshed != null) + { + selectedProvider = refreshed; + // Also refresh the list + providers = await ProviderService.GetAllAsync(); + } + } + + private static string MaskApiKey(string apiKey) + { + if (string.IsNullOrEmpty(apiKey)) return ""; + if (apiKey.Length <= 8) return "****"; + return apiKey[..4] + "..." + apiKey[^4..]; + } +} diff --git a/csharp/src/AdminPanel/Program.cs b/csharp/src/AdminPanel/Program.cs index 72cbf706..4243b07b 100644 --- a/csharp/src/AdminPanel/Program.cs +++ b/csharp/src/AdminPanel/Program.cs @@ -8,7 +8,10 @@ builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); -var apiBaseUrl = builder.Configuration["AdminApiUrl"] ?? "https://localhost:7236"; +// Aspire injects AdminApiUrl via WithEnvironment from AppHost. +// Override in appsettings for standalone dev. +var apiBaseUrl = builder.Configuration["AdminApiUrl"] + ?? throw new InvalidOperationException("AdminApiUrl not configured. Run via Aspire AppHost or set AdminApiUrl in appsettings."); builder.Services.AddScoped(sp => { @@ -45,6 +48,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); var app = builder.Build(); diff --git a/csharp/src/AdminPanel/Services/NetworkService.cs b/csharp/src/AdminPanel/Services/NetworkService.cs index 30c7ef91..0936741d 100644 --- a/csharp/src/AdminPanel/Services/NetworkService.cs +++ b/csharp/src/AdminPanel/Services/NetworkService.cs @@ -41,9 +41,9 @@ public async Task CreateNodeAsync(string networkName, CreateNodeRequest re return response.IsSuccessStatusCode; } - public async Task DeleteNodeAsync(string networkName, string providerName) + public async Task DeleteNodeAsync(string networkName, int nodeId) { - var response = await http.DeleteAsync($"api/networks/{networkName}/nodes/{providerName}"); + var response = await http.DeleteAsync($"api/networks/{networkName}/nodes/{nodeId}"); return response.IsSuccessStatusCode; } diff --git a/csharp/src/AdminPanel/Services/NodeProviderService.cs b/csharp/src/AdminPanel/Services/NodeProviderService.cs new file mode 100644 index 00000000..9ba247ff --- /dev/null +++ b/csharp/src/AdminPanel/Services/NodeProviderService.cs @@ -0,0 +1,51 @@ +using System.Net.Http.Json; +using System.Text.Json; +using Train.Solver.Data.Abstractions.Models; +using Train.Solver.Shared.Models; + +namespace Train.Solver.AdminPanel.Services; + +public class NodeProviderService(HttpClient http, JsonSerializerOptions jsonOptions) +{ + public async Task> GetAllAsync() + { + return await http.GetFromJsonAsync>("api/node-providers", jsonOptions) ?? []; + } + + public async Task GetAsync(int id) + { + return await http.GetFromJsonAsync($"api/node-providers/{id}", jsonOptions); + } + + public async Task CreateAsync(CreateNodeProviderRequest request) + { + var response = await http.PostAsJsonAsync("api/node-providers", request, jsonOptions); + if (!response.IsSuccessStatusCode) return null; + return await response.Content.ReadFromJsonAsync(jsonOptions); + } + + public async Task UpdateAsync(int id, UpdateNodeProviderRequest request) + { + var response = await http.PutAsJsonAsync($"api/node-providers/{id}", request, jsonOptions); + if (!response.IsSuccessStatusCode) return null; + return await response.Content.ReadFromJsonAsync(jsonOptions); + } + + public async Task DeleteAsync(int id) + { + var response = await http.DeleteAsync($"api/node-providers/{id}"); + return response.IsSuccessStatusCode; + } + + public async Task LinkNetworkAsync(int providerId, string networkSlug) + { + var response = await http.PostAsync($"api/node-providers/{providerId}/networks/{networkSlug}", null); + return response.IsSuccessStatusCode; + } + + public async Task UnlinkNetworkAsync(int providerId, string networkSlug) + { + var response = await http.DeleteAsync($"api/node-providers/{providerId}/networks/{networkSlug}"); + return response.IsSuccessStatusCode; + } +} diff --git a/csharp/src/AdminPanel/wwwroot/css/app.css b/csharp/src/AdminPanel/wwwroot/css/app.css index 81100940..4af0cedd 100644 --- a/csharp/src/AdminPanel/wwwroot/css/app.css +++ b/csharp/src/AdminPanel/wwwroot/css/app.css @@ -850,7 +850,7 @@ code { letter-spacing: 0.3px; } -.network-type-evm { +.network-type-eip155 { background-color: rgba(0, 120, 212, 0.2); color: var(--azure-blue-light); } @@ -870,6 +870,10 @@ code { background-color: rgba(209, 52, 56, 0.2); color: var(--azure-red); } +.network-type-tron { + background-color: rgba(0, 178, 169, 0.2); + color: #00b2a9; +} /* Loading Spinner */ .loading-spinner { @@ -2018,3 +2022,133 @@ strong { margin-left: auto; } +/* Reconnect Modal */ +#components-reconnect-modal { + display: none; +} + +#components-reconnect-modal.components-reconnect-show, +#components-reconnect-modal.components-reconnect-failed, +#components-reconnect-modal.components-reconnect-rejected { + display: block; +} + +#components-reconnect-modal .reconnect-overlay { + position: fixed; + inset: 0; + background-color: rgba(13, 17, 23, 0.85); + backdrop-filter: blur(4px); + z-index: 10000; +} + +#components-reconnect-modal .reconnect-dialog { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10001; + background-color: var(--azure-bg-primary); + border: 1px solid var(--azure-border); + box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5); + padding: 32px 40px; + min-width: 340px; + max-width: 400px; + text-align: center; + animation: reconnect-fade-in 0.2s ease-out; +} + +@keyframes reconnect-fade-in { + from { opacity: 0; transform: translate(-50%, -48%); } + to { opacity: 1; transform: translate(-50%, -50%); } +} + +#components-reconnect-modal .reconnect-icon { + color: var(--azure-text-muted); + margin-bottom: 16px; +} + +#components-reconnect-modal.components-reconnect-show .reconnect-icon { + color: var(--azure-blue); +} + +#components-reconnect-modal.components-reconnect-failed .reconnect-icon, +#components-reconnect-modal.components-reconnect-rejected .reconnect-icon { + color: var(--azure-yellow); +} + +#components-reconnect-modal .reconnect-title { + font-size: 16px; + font-weight: 600; + color: var(--azure-text-primary); + margin: 0 0 6px 0; +} + +#components-reconnect-modal .reconnect-message { + font-size: 13px; + color: var(--azure-text-muted); + margin: 0; + line-height: 1.5; +} + +#components-reconnect-modal .reconnect-btn { + display: inline-block; + margin-top: 20px; + padding: 8px 24px; + font-size: 13px; + font-weight: 600; + color: #fff; + background-color: var(--azure-blue); + border: none; + cursor: pointer; + text-decoration: none; + transition: background-color 0.15s ease; +} + +#components-reconnect-modal .reconnect-btn:hover { + background-color: var(--azure-blue-hover); + text-decoration: none; + color: #fff; +} + +#components-reconnect-modal .reconnect-spinner { + margin-top: 20px; + display: flex; + justify-content: center; +} + +#components-reconnect-modal .spinner-ring { + width: 28px; + height: 28px; + border: 3px solid var(--azure-border-light); + border-top-color: var(--azure-blue); + border-radius: 50%; + animation: reconnect-spin 0.8s linear infinite; +} + +@keyframes reconnect-spin { + to { transform: rotate(360deg); } +} + +/* Visibility rules per state */ +#components-reconnect-modal .show-when-reconnecting, +#components-reconnect-modal .show-when-failed, +#components-reconnect-modal .show-when-rejected { + display: none; +} + +#components-reconnect-modal.components-reconnect-show .show-when-reconnecting { + display: block; +} + +#components-reconnect-modal.components-reconnect-failed .show-when-failed { + display: block; +} + +#components-reconnect-modal.components-reconnect-rejected .show-when-rejected { + display: block; +} + +#components-reconnect-modal .reconnect-actions { + display: contents; +} + diff --git a/csharp/src/AppHost/AppHost.cs b/csharp/src/AppHost/AppHost.cs index 0fd6972f..245c6dd5 100644 --- a/csharp/src/AppHost/AppHost.cs +++ b/csharp/src/AppHost/AppHost.cs @@ -143,6 +143,7 @@ 3. Access Control > Machine > Create Org Machine with admin priv > Add client se .WithEnvironment("QuoteSigning__HmacSecretKey", quoteSigningKey); builder.AddProject("admin-panel") + .WithEnvironment("AdminApiUrl", adminApiProject.GetEndpoint("https")) .WaitFor(adminApiProject); builder.AddProject("workflow-runner-swap") diff --git a/csharp/src/Data.Abstractions/Entities/Network.cs b/csharp/src/Data.Abstractions/Entities/Network.cs index 1ba999ba..94754b63 100644 --- a/csharp/src/Data.Abstractions/Entities/Network.cs +++ b/csharp/src/Data.Abstractions/Entities/Network.cs @@ -26,6 +26,8 @@ public class Network : EntityBase public string ChainId { get; set; } = null!; + public bool IsTestnet { get; set; } + /// /// CAIP-2 compatible network identifier computed on-the-fly. /// Format: {NetworkType.Name}:{ChainId} (e.g., "eip155:1", "solana:mainnet-beta") @@ -39,6 +41,8 @@ public class Network : EntityBase public virtual List Contracts { get; set; } = []; public virtual List Metadata { get; set; } = []; + + public virtual List NetworkNodeProviders { get; set; } = []; } public class Contract : EntityBase diff --git a/csharp/src/Data.Abstractions/Entities/Node.cs b/csharp/src/Data.Abstractions/Entities/Node.cs index 019436c4..0da1db27 100644 --- a/csharp/src/Data.Abstractions/Entities/Node.cs +++ b/csharp/src/Data.Abstractions/Entities/Node.cs @@ -1,12 +1,10 @@ -using Train.Solver.Data.Abstractions.Entities.Base; +using Train.Solver.Data.Abstractions.Entities.Base; using Train.Solver.Shared.Models; namespace Train.Solver.Data.Abstractions.Entities; public class Node : EntityBase { - public string ProviderName { get; set; } = null!; - public string Url { get; set; } = null!; public NodeProtocol Protocol { get; set; } = NodeProtocol.Http; diff --git a/csharp/src/Data.Abstractions/Entities/NodeProvider.cs b/csharp/src/Data.Abstractions/Entities/NodeProvider.cs new file mode 100644 index 00000000..40a36dc3 --- /dev/null +++ b/csharp/src/Data.Abstractions/Entities/NodeProvider.cs @@ -0,0 +1,25 @@ +using Train.Solver.Data.Abstractions.Entities.Base; + +namespace Train.Solver.Data.Abstractions.Entities; + +public class NodeProvider : EntityBase +{ + public string Name { get; set; } = null!; + + public string ApiKey { get; set; } = null!; + + public bool Enabled { get; set; } = true; + + public virtual List NetworkNodeProviders { get; set; } = []; +} + +public class NetworkNodeProvider : EntityBase +{ + public int NetworkId { get; set; } + + public virtual Network Network { get; set; } = null!; + + public int NodeProviderId { get; set; } + + public virtual NodeProvider NodeProvider { get; set; } = null!; +} diff --git a/csharp/src/Data.Abstractions/Models/CreateNetworkRequest.cs b/csharp/src/Data.Abstractions/Models/CreateNetworkRequest.cs index d90d71a5..b6398089 100644 --- a/csharp/src/Data.Abstractions/Models/CreateNetworkRequest.cs +++ b/csharp/src/Data.Abstractions/Models/CreateNetworkRequest.cs @@ -13,8 +13,8 @@ public class CreateNetworkRequest /// public string? NativeTokenContractAddress { get; set; } public int NativeTokenDecimals { get; set; } + public bool IsTestnet { get; set; } public string NodeUrl { get; set; } = default!; - public string NodeProvider { get; set; } = default!; // Gas Configuration public bool IsEip1559 { get; set; } = true; diff --git a/csharp/src/Data.Abstractions/Models/CreateNodeProviderRequest.cs b/csharp/src/Data.Abstractions/Models/CreateNodeProviderRequest.cs new file mode 100644 index 00000000..4e843336 --- /dev/null +++ b/csharp/src/Data.Abstractions/Models/CreateNodeProviderRequest.cs @@ -0,0 +1,14 @@ +namespace Train.Solver.Data.Abstractions.Models; + +public class CreateNodeProviderRequest +{ + public string Name { get; set; } = default!; + public string ApiKey { get; set; } = default!; + public bool Enabled { get; set; } = true; +} + +public class UpdateNodeProviderRequest +{ + public string? ApiKey { get; set; } + public bool? Enabled { get; set; } +} diff --git a/csharp/src/Data.Abstractions/Models/CreateNodeRequest.cs b/csharp/src/Data.Abstractions/Models/CreateNodeRequest.cs index 2b0af992..801f2d71 100644 --- a/csharp/src/Data.Abstractions/Models/CreateNodeRequest.cs +++ b/csharp/src/Data.Abstractions/Models/CreateNodeRequest.cs @@ -1,10 +1,9 @@ -using Train.Solver.Shared.Models; +using Train.Solver.Shared.Models; namespace Train.Solver.Data.Abstractions.Models; public class CreateNodeRequest { - public string ProviderName { get; set; } = null!; public string Url { get; set; } = null!; public NodeProtocol Protocol { get; set; } = NodeProtocol.Http; } diff --git a/csharp/src/Data.Abstractions/Repositories/INetworkRepository.cs b/csharp/src/Data.Abstractions/Repositories/INetworkRepository.cs index c49931cb..9f61f218 100644 --- a/csharp/src/Data.Abstractions/Repositories/INetworkRepository.cs +++ b/csharp/src/Data.Abstractions/Repositories/INetworkRepository.cs @@ -34,7 +34,7 @@ public interface INetworkRepository Task DeleteTokenAsync(string networkIdentifier, string contractAddress); - Task DeleteNodeAsync(string networkIdentifier, string providerName); + Task DeleteNodeAsync(int nodeId); Task UpdateAsync(string networkIdentifier, UpdateNetworkRequest request); diff --git a/csharp/src/Data.Abstractions/Repositories/INodeProviderRepository.cs b/csharp/src/Data.Abstractions/Repositories/INodeProviderRepository.cs new file mode 100644 index 00000000..04a3a324 --- /dev/null +++ b/csharp/src/Data.Abstractions/Repositories/INodeProviderRepository.cs @@ -0,0 +1,31 @@ +using Train.Solver.Data.Abstractions.Models; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Data.Abstractions.Repositories; + +public interface INodeProviderRepository +{ + Task> GetAllAsync(); + + Task GetAsync(int id); + + Task CreateAsync(CreateNodeProviderRequest request); + + Task UpdateAsync(int id, UpdateNodeProviderRequest request); + + Task DeleteAsync(int id); + + Task LinkNetworkAsync(int nodeProviderId, string networkIdentifier); + + Task UnlinkNetworkAsync(int nodeProviderId, string networkIdentifier); + + /// + /// Gets provider info (name + API key) for all enabled providers linked to a network. + /// + Task> GetProvidersForNetworkAsync(string networkIdentifier); +} + +/// +/// Lightweight record for provider resolution — no entity IDs, just what's needed to resolve URLs. +/// +public record LinkedProviderInfo(string ProviderName, string ApiKey); diff --git a/csharp/src/Data.Npgsql/Data.Npgsql.csproj b/csharp/src/Data.Npgsql/Data.Npgsql.csproj index 97d2a5f4..2c46be3f 100644 --- a/csharp/src/Data.Npgsql/Data.Npgsql.csproj +++ b/csharp/src/Data.Npgsql/Data.Npgsql.csproj @@ -25,4 +25,8 @@ + + + + diff --git a/csharp/src/Data.Npgsql/EFNetworkRepository.cs b/csharp/src/Data.Npgsql/EFNetworkRepository.cs index 3e29c304..6f8459fc 100644 --- a/csharp/src/Data.Npgsql/EFNetworkRepository.cs +++ b/csharp/src/Data.Npgsql/EFNetworkRepository.cs @@ -22,6 +22,7 @@ public class EFNetworkRepository(SolverDbContext dbContext) : INetworkRepository Slug = x.Slug, ChainId = x.ChainId, DisplayName = x.DisplayName, + IsTestnet = x.IsTestnet, NativeTokenAddress = x.Type.NativeTokenAddress, Type = new NetworkTypeDto { @@ -85,9 +86,10 @@ public class EFNetworkRepository(SolverDbContext dbContext) : INetworkRepository }), Nodes = x.Nodes.Select(n => new NodeDto { - ProviderName = n.ProviderName, + Id = n.Id, Url = n.Url, Protocol = n.Protocol, + Priority = 70, }), Contracts = x.Contracts.Select(c => new ContractDto { @@ -112,6 +114,7 @@ public Task> GetAllAsync(string[]? types) Slug = x.Slug, ChainId = x.ChainId, DisplayName = x.DisplayName, + IsTestnet = x.IsTestnet, NativeTokenAddress = x.Type.NativeTokenAddress, Type = new NetworkTypeDto { @@ -175,9 +178,10 @@ public Task> GetAllAsync(string[]? types) }), Nodes = x.Nodes.Select(n => new NodeDto { - ProviderName = n.ProviderName, + Id = n.Id, Url = n.Url, Protocol = n.Protocol, + Priority = 70, }), Contracts = x.Contracts.Select(c => new ContractDto { @@ -225,6 +229,7 @@ public Task> GetAllAsync(string[]? types) Slug = request.Slug, ChainId = request.ChainId, DisplayName = request.DisplayName, + IsTestnet = request.IsTestnet, NetworkTypeId = networkType.Id, GasConfiguration = new GasConfiguration { @@ -254,7 +259,6 @@ public Task> GetAllAsync(string[]? types) }], Nodes = [new Node { - ProviderName = request.NodeProvider, Url = request.NodeUrl, }], }; @@ -305,24 +309,23 @@ public Task> GetAllAsync(string[]? types) return null; } - var node = new Node { Url = request.Url, ProviderName = request.ProviderName, Protocol = request.Protocol, NetworkId = network.Id }; + var node = new Node { Url = request.Url, Protocol = request.Protocol, NetworkId = network.Id }; dbContext.Nodes.Add(node); await dbContext.SaveChangesAsync(); return new NodeDto { - ProviderName = node.ProviderName, + Id = node.Id, Url = node.Url, Protocol = node.Protocol, + Priority = 70, }; } - public async Task DeleteNodeAsync(string networkIdentifier, string providerName) + public async Task DeleteNodeAsync(int nodeId) { await dbContext.Nodes - .Where(x => (x.Network.Slug == networkIdentifier || - x.Network.Type.Name + ":" + x.Network.ChainId == networkIdentifier) && - x.ProviderName == providerName) + .Where(x => x.Id == nodeId) .ExecuteDeleteAsync(); } @@ -852,6 +855,7 @@ await dbContext.NetworkMetadata Slug = x.Slug, ChainId = x.ChainId, DisplayName = x.DisplayName, + IsTestnet = x.IsTestnet, NativeTokenAddress = x.Type.NativeTokenAddress, Type = new NetworkTypeDto { @@ -876,9 +880,10 @@ await dbContext.NetworkMetadata .FirstOrDefault()!, Nodes = x.Nodes.Select(n => new NodeDto { - ProviderName = n.ProviderName, + Id = n.Id, Url = n.Url, Protocol = n.Protocol, + Priority = 70, }), Contracts = x.Contracts.Select(c => new ContractDto { @@ -898,6 +903,7 @@ await dbContext.NetworkMetadata Slug = x.Slug, ChainId = x.ChainId, DisplayName = x.DisplayName, + IsTestnet = x.IsTestnet, NativeTokenAddress = x.Type.NativeTokenAddress, Type = new NetworkTypeDto { @@ -920,7 +926,7 @@ await dbContext.NetworkMetadata }, Nodes = x.Nodes.Select(n => new NodeDto { - ProviderName = n.ProviderName, + Id = n.Id, Url = n.Url, Protocol = n.Protocol, }), diff --git a/csharp/src/Data.Npgsql/EFNodeProviderRepository.cs b/csharp/src/Data.Npgsql/EFNodeProviderRepository.cs new file mode 100644 index 00000000..fab743ad --- /dev/null +++ b/csharp/src/Data.Npgsql/EFNodeProviderRepository.cs @@ -0,0 +1,142 @@ +using Microsoft.EntityFrameworkCore; +using Train.Solver.Data.Abstractions.Entities; +using Train.Solver.Data.Abstractions.Models; +using Train.Solver.Data.Abstractions.Repositories; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Data.Npgsql; + +public class EFNodeProviderRepository(SolverDbContext dbContext) : INodeProviderRepository +{ + public async Task> GetAllAsync() + { + return await dbContext.Set() + .Include(x => x.NetworkNodeProviders) + .ThenInclude(x => x.Network) + .Select(x => new NodeProviderDto + { + Id = x.Id, + Name = x.Name, + ApiKey = x.ApiKey, + Enabled = x.Enabled, + LinkedNetworkSlugs = x.NetworkNodeProviders + .Select(nnp => nnp.Network.Slug) + .ToList(), + }) + .ToListAsync(); + } + + public async Task GetAsync(int id) + { + return await dbContext.Set() + .Where(x => x.Id == id) + .Include(x => x.NetworkNodeProviders) + .ThenInclude(x => x.Network) + .Select(x => new NodeProviderDto + { + Id = x.Id, + Name = x.Name, + ApiKey = x.ApiKey, + Enabled = x.Enabled, + LinkedNetworkSlugs = x.NetworkNodeProviders + .Select(nnp => nnp.Network.Slug) + .ToList(), + }) + .FirstOrDefaultAsync(); + } + + public async Task CreateAsync(CreateNodeProviderRequest request) + { + var entity = new NodeProvider + { + Name = request.Name, + ApiKey = request.ApiKey, + Enabled = request.Enabled, + }; + + dbContext.Set().Add(entity); + await dbContext.SaveChangesAsync(); + + return await GetAsync(entity.Id); + } + + public async Task UpdateAsync(int id, UpdateNodeProviderRequest request) + { + var entity = await dbContext.Set().FindAsync(id); + if (entity is null) return null; + + if (request.ApiKey is not null) + entity.ApiKey = request.ApiKey; + if (request.Enabled.HasValue) + entity.Enabled = request.Enabled.Value; + + await dbContext.SaveChangesAsync(); + + return await GetAsync(id); + } + + public async Task DeleteAsync(int id) + { + var entity = await dbContext.Set() + .Include(x => x.NetworkNodeProviders) + .FirstOrDefaultAsync(x => x.Id == id); + + if (entity is null) return false; + + dbContext.Set().Remove(entity); + await dbContext.SaveChangesAsync(); + + return true; + } + + public async Task LinkNetworkAsync(int nodeProviderId, string networkIdentifier) + { + var provider = await dbContext.Set().FindAsync(nodeProviderId); + if (provider is null) return false; + + var network = await dbContext.Networks + .FirstOrDefaultAsync(x => x.Slug == networkIdentifier || + x.Type.Name + ":" + x.ChainId == networkIdentifier); + if (network is null) return false; + + var exists = await dbContext.Set() + .AnyAsync(x => x.NodeProviderId == nodeProviderId && x.NetworkId == network.Id); + if (exists) return true; + + dbContext.Set().Add(new NetworkNodeProvider + { + NodeProviderId = nodeProviderId, + NetworkId = network.Id, + }); + await dbContext.SaveChangesAsync(); + + return true; + } + + public async Task UnlinkNetworkAsync(int nodeProviderId, string networkIdentifier) + { + var network = await dbContext.Networks + .FirstOrDefaultAsync(x => x.Slug == networkIdentifier || + x.Type.Name + ":" + x.ChainId == networkIdentifier); + if (network is null) return false; + + var link = await dbContext.Set() + .FirstOrDefaultAsync(x => x.NodeProviderId == nodeProviderId && x.NetworkId == network.Id); + if (link is null) return false; + + dbContext.Set().Remove(link); + await dbContext.SaveChangesAsync(); + + return true; + } + + public async Task> GetProvidersForNetworkAsync(string networkIdentifier) + { + return await dbContext.Set() + .Where(x => x.Network.Slug == networkIdentifier || + x.Network.Type.Name + ":" + x.Network.ChainId == networkIdentifier) + .Where(x => x.NodeProvider.Enabled) + .Select(x => new LinkedProviderInfo(x.NodeProvider.Name, x.NodeProvider.ApiKey)) + .ToListAsync(); + } +} diff --git a/csharp/src/Data.Npgsql/EFOrderRepository.cs b/csharp/src/Data.Npgsql/EFOrderRepository.cs index bb959056..29294080 100644 --- a/csharp/src/Data.Npgsql/EFOrderRepository.cs +++ b/csharp/src/Data.Npgsql/EFOrderRepository.cs @@ -97,6 +97,7 @@ public Task> GetAllAsync(uint page = 1, uint size = 20) ChainId = x.Route.SourceToken.Network.ChainId, Type = x.Route.SourceToken.Network.Type.Name, DisplayName = x.Route.SourceToken.Network.DisplayName, + IsTestnet = x.Route.SourceToken.Network.IsTestnet, NativeTokenAddress = x.Route.SourceToken.Network.Type.NativeTokenAddress, } }, @@ -117,6 +118,7 @@ public Task> GetAllAsync(uint page = 1, uint size = 20) ChainId = x.Route.DestinationToken.Network.ChainId, Type = x.Route.DestinationToken.Network.Type.Name, DisplayName = x.Route.DestinationToken.Network.DisplayName, + IsTestnet = x.Route.DestinationToken.Network.IsTestnet, NativeTokenAddress = x.Route.DestinationToken.Network.Type.NativeTokenAddress, } }, @@ -163,6 +165,7 @@ public Task> GetAllAsync(uint page = 1, uint size = 20) ChainId = x.Route.SourceToken.Network.ChainId, Type = x.Route.SourceToken.Network.Type.Name, DisplayName = x.Route.SourceToken.Network.DisplayName, + IsTestnet = x.Route.SourceToken.Network.IsTestnet, NativeTokenAddress = x.Route.SourceToken.Network.Type.NativeTokenAddress, } }, @@ -183,6 +186,7 @@ public Task> GetAllAsync(uint page = 1, uint size = 20) ChainId = x.Route.DestinationToken.Network.ChainId, Type = x.Route.DestinationToken.Network.Type.Name, DisplayName = x.Route.DestinationToken.Network.DisplayName, + IsTestnet = x.Route.DestinationToken.Network.IsTestnet, NativeTokenAddress = x.Route.DestinationToken.Network.Type.NativeTokenAddress, } }, diff --git a/csharp/src/Data.Npgsql/EFRouteRepository.cs b/csharp/src/Data.Npgsql/EFRouteRepository.cs index 65581714..e9c7cb9b 100644 --- a/csharp/src/Data.Npgsql/EFRouteRepository.cs +++ b/csharp/src/Data.Npgsql/EFRouteRepository.cs @@ -160,6 +160,7 @@ public Task> GetAllAsync(RouteStatus[]? statuses) ChainId = r.SourceToken.Network.ChainId, Type = r.SourceToken.Network.Type.Name, DisplayName = r.SourceToken.Network.DisplayName, + IsTestnet = r.SourceToken.Network.IsTestnet, NativeTokenAddress = r.SourceToken.Network.Type.NativeTokenAddress, }, Token = new DetailedTokenDto @@ -178,6 +179,7 @@ public Task> GetAllAsync(RouteStatus[]? statuses) ChainId = r.DestinationToken.Network.ChainId, Type = r.DestinationToken.Network.Type.Name, DisplayName = r.DestinationToken.Network.DisplayName, + IsTestnet = r.DestinationToken.Network.IsTestnet, NativeTokenAddress = r.DestinationToken.Network.Type.NativeTokenAddress, }, Token = new DetailedTokenDto @@ -261,6 +263,7 @@ public Task> GetAllRateProvidersAsync() ChainId = r.SourceToken.Network.ChainId, Type = r.SourceToken.Network.Type.Name, DisplayName = r.SourceToken.Network.DisplayName, + IsTestnet = r.SourceToken.Network.IsTestnet, NativeTokenAddress = r.SourceToken.Network.Type.NativeTokenAddress, }, Token = new DetailedTokenDto @@ -279,6 +282,7 @@ public Task> GetAllRateProvidersAsync() ChainId = r.DestinationToken.Network.ChainId, Type = r.DestinationToken.Network.Type.Name, DisplayName = r.DestinationToken.Network.DisplayName, + IsTestnet = r.DestinationToken.Network.IsTestnet, NativeTokenAddress = r.DestinationToken.Network.Type.NativeTokenAddress, }, Token = new DetailedTokenDto @@ -349,6 +353,7 @@ await dbContext.Routes ChainId = r.SourceToken.Network.ChainId, Type = r.SourceToken.Network.Type.Name, DisplayName = r.SourceToken.Network.DisplayName, + IsTestnet = r.SourceToken.Network.IsTestnet, NativeTokenAddress = r.SourceToken.Network.Type.NativeTokenAddress, }, Token = new DetailedTokenDto @@ -367,6 +372,7 @@ await dbContext.Routes ChainId = r.DestinationToken.Network.ChainId, Type = r.DestinationToken.Network.Type.Name, DisplayName = r.DestinationToken.Network.DisplayName, + IsTestnet = r.DestinationToken.Network.IsTestnet, NativeTokenAddress = r.DestinationToken.Network.Type.NativeTokenAddress, }, Token = new DetailedTokenDto diff --git a/csharp/src/Data.Npgsql/Extensions/ModelBuilderSeedDataExtensions.cs b/csharp/src/Data.Npgsql/Extensions/ModelBuilderSeedDataExtensions.cs index b9f3df34..53eb5c4d 100644 --- a/csharp/src/Data.Npgsql/Extensions/ModelBuilderSeedDataExtensions.cs +++ b/csharp/src/Data.Npgsql/Extensions/ModelBuilderSeedDataExtensions.cs @@ -12,15 +12,11 @@ public static void SeedData(this ModelBuilder modelBuilder) SeedTokenPrices(modelBuilder); SeedServiceFees(modelBuilder); SeedRateProviders(modelBuilder); - SeedSignerAgents(modelBuilder); - SeedWallets(modelBuilder); SeedNetworks(modelBuilder); SeedEventListenerConfigs(modelBuilder); - SeedNodes(modelBuilder); SeedContracts(modelBuilder); SeedTokens(modelBuilder); - SeedRoutes(modelBuilder); - SeedWebhookSubscribers(modelBuilder); + SeedNodeProviders(modelBuilder); } private static void SeedNetworkTypes(ModelBuilder modelBuilder) @@ -38,10 +34,17 @@ private static void SeedNetworkTypes(ModelBuilder modelBuilder) private static void SeedTokenPrices(ModelBuilder modelBuilder) { modelBuilder.Entity().HasData( - new TokenPrice { Id = 1, Symbol = "ETH", PriceInUsd = 2000.0m, ExternalId = "ETHUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, - new TokenPrice { Id = 2, Symbol = "BNB", PriceInUsd = 600.0m, ExternalId = "BNBUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, - new TokenPrice { Id = 3, Symbol = "SOL", PriceInUsd = 140.0m, ExternalId = "SOLUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, - new TokenPrice { Id = 4, Symbol = "TRX", PriceInUsd = 0.25m, ExternalId = "TRXUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) } + new TokenPrice { Id = 1, Symbol = "ETH", PriceInUsd = 2000.0m, ExternalId = "ETHUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 2, Symbol = "BNB", PriceInUsd = 600.0m, ExternalId = "BNBUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 3, Symbol = "SOL", PriceInUsd = 140.0m, ExternalId = "SOLUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 4, Symbol = "TRX", PriceInUsd = 0.25m, ExternalId = "TRXUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 5, Symbol = "POL", PriceInUsd = 0.50m, ExternalId = "POLUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 6, Symbol = "AVAX", PriceInUsd = 35.0m, ExternalId = "AVAXUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 7, Symbol = "USDC", PriceInUsd = 1.0m, ExternalId = "USDCUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 8, Symbol = "USDT", PriceInUsd = 1.0m, ExternalId = "USDTUSD", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 9, Symbol = "STRK", PriceInUsd = 0.50m, ExternalId = "STRKUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 10, Symbol = "BTC", PriceInUsd = 60000.0m, ExternalId = "BTCUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) }, + new TokenPrice { Id = 11, Symbol = "DAI", PriceInUsd = 1.0m, ExternalId = "DAIUSDT", LastUpdated = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero) } ); } @@ -56,43 +59,55 @@ private static void SeedRateProviders(ModelBuilder modelBuilder) { modelBuilder.Entity().HasData( new RateProvider { Id = 1, Name = "SameAsset" }, - new RateProvider { Id = 2, Name = "Binance" }, - new RateProvider { Id = 3, Name = "TokenPrice" } - ); - } - - private static void SeedSignerAgents(ModelBuilder modelBuilder) - { - modelBuilder.Entity().HasData( - new SignerAgent { Id = 1, Name = "Treasury", Url = "http://localhost:3000" } - ); - } - - private static void SeedWallets(ModelBuilder modelBuilder) - { - modelBuilder.Entity().HasData( - new Wallet { Id = 1, Name = "Main", Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", NetworkTypeId = 1, SignerAgentId = 1, Status = WalletStatus.Active }, - new Wallet { Id = 2, Name = "AztecMain", Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", NetworkTypeId = 5, SignerAgentId = 1, Status = WalletStatus.Active }, - new Wallet { Id = 3, Name = "SolanaMain", Address = "9ivTbFdPJRg4bgYdUzvf2eXdb6JDhv4iKFL1wTrDwKTf", NetworkTypeId = 2, SignerAgentId = 1, Status = WalletStatus.Active } + new RateProvider { Id = 2, Name = "TokenPrice" } ); } private static void SeedNetworks(ModelBuilder modelBuilder) { - // Network base data (owned entities are seeded separately via anonymous types) + // ============================================= + // TESTNET NETWORKS (Id 1-8) + // ============================================= modelBuilder.Entity().HasData( - new { Id = 1, Slug = "eth-sepolia", DisplayName = "Ethereum Sepolia", NetworkTypeId = 1, ChainId = "11155111" }, - new { Id = 2, Slug = "arb-sepolia", DisplayName = "Arbitrum Sepolia", NetworkTypeId = 1, ChainId = "421614" }, - new { Id = 3, Slug = "base-sepolia", DisplayName = "Base Sepolia", NetworkTypeId = 1, ChainId = "84532" }, - new { Id = 4, Slug = "bsc-testnet", DisplayName = "BSC Testnet", NetworkTypeId = 1, ChainId = "97" }, - new { Id = 5, Slug = "aztec-devnet", DisplayName = "Aztec Devnet", NetworkTypeId = 5, ChainId = "aztec-devnet" }, - new { Id = 6, Slug = "starknet-sepolia", DisplayName = "Starknet Sepolia", NetworkTypeId = 3, ChainId = "SN_SEPOLIA" }, - new { Id = 7, Slug = "tron-nile", DisplayName = "Tron Nile Testnet", NetworkTypeId = 6, ChainId = "3448148188" }, - new { Id = 8, Slug = "solana-devnet", DisplayName = "Solana Devnet", NetworkTypeId = 2, ChainId = "devnet" } + new { Id = 1, Slug = "eth-sepolia", DisplayName = "Ethereum Sepolia", NetworkTypeId = 1, ChainId = "11155111", IsTestnet = true }, + new { Id = 2, Slug = "arb-sepolia", DisplayName = "Arbitrum Sepolia", NetworkTypeId = 1, ChainId = "421614", IsTestnet = true }, + new { Id = 3, Slug = "base-sepolia", DisplayName = "Base Sepolia", NetworkTypeId = 1, ChainId = "84532", IsTestnet = true }, + new { Id = 4, Slug = "bsc-testnet", DisplayName = "BSC Testnet", NetworkTypeId = 1, ChainId = "97", IsTestnet = true }, + new { Id = 5, Slug = "aztec-devnet", DisplayName = "Aztec Devnet", NetworkTypeId = 5, ChainId = "aztec-devnet", IsTestnet = true }, + new { Id = 6, Slug = "starknet-sepolia", DisplayName = "Starknet Sepolia", NetworkTypeId = 3, ChainId = "SN_SEPOLIA", IsTestnet = true }, + new { Id = 7, Slug = "tron-nile", DisplayName = "Tron Nile Testnet", NetworkTypeId = 6, ChainId = "3448148188", IsTestnet = true }, + new { Id = 8, Slug = "solana-devnet", DisplayName = "Solana Devnet", NetworkTypeId = 2, ChainId = "devnet", IsTestnet = true }, + + // ============================================= + // MAINNET NETWORKS (Id 9+) + // ============================================= + new { Id = 9, Slug = "ethereum", DisplayName = "Ethereum", NetworkTypeId = 1, ChainId = "1", IsTestnet = false }, + new { Id = 10, Slug = "arbitrum", DisplayName = "Arbitrum One", NetworkTypeId = 1, ChainId = "42161", IsTestnet = false }, + new { Id = 11, Slug = "base", DisplayName = "Base", NetworkTypeId = 1, ChainId = "8453", IsTestnet = false }, + new { Id = 12, Slug = "optimism", DisplayName = "OP Mainnet", NetworkTypeId = 1, ChainId = "10", IsTestnet = false }, + new { Id = 13, Slug = "polygon", DisplayName = "Polygon", NetworkTypeId = 1, ChainId = "137", IsTestnet = false }, + new { Id = 14, Slug = "bsc", DisplayName = "BNB Smart Chain", NetworkTypeId = 1, ChainId = "56", IsTestnet = false }, + new { Id = 15, Slug = "avalanche", DisplayName = "Avalanche C-Chain", NetworkTypeId = 1, ChainId = "43114", IsTestnet = false }, + new { Id = 16, Slug = "linea", DisplayName = "Linea", NetworkTypeId = 1, ChainId = "59144", IsTestnet = false }, + new { Id = 17, Slug = "scroll", DisplayName = "Scroll", NetworkTypeId = 1, ChainId = "534352", IsTestnet = false }, + + // ============================================= + // MAINNET NETWORKS — NON-EVM (Id 18-20) + // ============================================= + new { Id = 18, Slug = "starknet", DisplayName = "Starknet", NetworkTypeId = 3, ChainId = "SN_MAIN", IsTestnet = false }, + new { Id = 19, Slug = "solana", DisplayName = "Solana", NetworkTypeId = 2, ChainId = "mainnet-beta", IsTestnet = false }, + new { Id = 20, Slug = "tron", DisplayName = "Tron", NetworkTypeId = 6, ChainId = "728126428", IsTestnet = false }, + + // ============================================= + // MAINNET NETWORKS — ADDITIONAL EVM (Id 21-22) + // ============================================= + new { Id = 21, Slug = "zksync", DisplayName = "ZKsync Era", NetworkTypeId = 1, ChainId = "324", IsTestnet = false }, + new { Id = 22, Slug = "blast", DisplayName = "Blast", NetworkTypeId = 1, ChainId = "81457", IsTestnet = false } ); // GasConfiguration modelBuilder.Entity().OwnsOne(n => n.GasConfiguration).HasData( + // Testnets new { NetworkId = 1, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { NetworkId = 2, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 20, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { NetworkId = 3, IsEip1559 = true, HasL1Fee = true, L1FeeOracleContract = "0x420000000000000000000000000000000000000F", BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, @@ -100,11 +115,29 @@ private static void SeedNetworks(ModelBuilder modelBuilder) new { NetworkId = 5, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, new { NetworkId = 6, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, new { NetworkId = 7, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, - new { NetworkId = 8, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 } + new { NetworkId = 8, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, + // Mainnets + new { NetworkId = 9, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 10, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 20, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 11, IsEip1559 = true, HasL1Fee = true, L1FeeOracleContract = "0x420000000000000000000000000000000000000F", BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 12, IsEip1559 = true, HasL1Fee = true, L1FeeOracleContract = "0x420000000000000000000000000000000000000F", BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 13, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 14, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 15, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 16, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + new { NetworkId = 17, IsEip1559 = true, HasL1Fee = true, L1FeeOracleContract = "0x5300000000000000000000000000000000000002", BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, + // Mainnets — Non-EVM + new { NetworkId = 18, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, // Starknet + new { NetworkId = 19, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, // Solana + new { NetworkId = 20, IsEip1559 = false, HasL1Fee = false, BaseFeePercentageIncrease = 0, PriorityFeePercentageIncrease = 0, ReplacementFeePercentageIncrease = 0 }, // Tron + // Mainnets — Additional EVM + new { NetworkId = 21, IsEip1559 = true, HasL1Fee = false, BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, // ZKsync Era + new { NetworkId = 22, IsEip1559 = true, HasL1Fee = true, L1FeeOracleContract = "0x420000000000000000000000000000000000000F", BaseFeePercentageIncrease = 25, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 } // Blast ); // LiquidityConfiguration modelBuilder.Entity().OwnsOne(n => n.LiquidityConfiguration).HasData( + // Testnets new { NetworkId = 1, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, new { NetworkId = 2, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, new { NetworkId = 3, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, @@ -112,11 +145,29 @@ private static void SeedNetworks(ModelBuilder modelBuilder) new { NetworkId = 5, MinGasBalance = "0", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, new { NetworkId = 6, MinGasBalance = "0", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, new { NetworkId = 7, MinGasBalance = "10000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, - new { NetworkId = 8, MinGasBalance = "10000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false } + new { NetworkId = 8, MinGasBalance = "10000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + // Mainnets (0.01 ETH for ETH-based, 0.1 BNB for BSC, 1 POL for Polygon, 0.1 AVAX for Avalanche) + new { NetworkId = 9, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 10, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 11, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 12, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 13, MinGasBalance = "1000000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 14, MinGasBalance = "100000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 15, MinGasBalance = "100000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 16, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + new { NetworkId = 17, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, + // Mainnets — Non-EVM + new { NetworkId = 18, MinGasBalance = "0", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, // Starknet (fees in STRK) + new { NetworkId = 19, MinGasBalance = "10000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, // Solana (0.01 SOL) + new { NetworkId = 20, MinGasBalance = "10000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, // Tron (10 TRX) + // Mainnets — Additional EVM + new { NetworkId = 21, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false }, // ZKsync Era (0.01 ETH) + new { NetworkId = 22, MinGasBalance = "10000000000000000", MinBalanceThreshold = "0", MaxBalanceThreshold = "0", TargetBalance = "0", AutoRebalanceEnabled = false } // Blast (0.01 ETH) ); // TimelockConfiguration modelBuilder.Entity().OwnsOne(n => n.TimelockConfiguration).HasData( + // Testnets new { NetworkId = 1, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, new { NetworkId = 2, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, new { NetworkId = 3, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, @@ -124,11 +175,29 @@ private static void SeedNetworks(ModelBuilder modelBuilder) new { NetworkId = 5, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, new { NetworkId = 6, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, new { NetworkId = 7, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, - new { NetworkId = 8, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L } + new { NetworkId = 8, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + // Mainnets + new { NetworkId = 9, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 10, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 11, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 12, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 13, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 14, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 15, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 16, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 17, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + // Mainnets — Non-EVM + new { NetworkId = 18, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 19, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 20, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + // Mainnets — Additional EVM + new { NetworkId = 21, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L }, + new { NetworkId = 22, UserTimelockTimeSpanInSeconds = 7200L, SolverTimelockTimeSpanInSeconds = 3600L, RewardTimelockTimeSpanInSeconds = 1800L, QuoteExpiryInSeconds = 900L } ); // TransactionProcessorConfiguration modelBuilder.Entity().OwnsOne(n => n.TransactionProcessorConfiguration).HasData( + // Testnets new { NetworkId = 1, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 60, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 1, RequiredConfirmations = 0 }, new { NetworkId = 2, MaxInFlightTransactions = 1, StuckTransactionTimeoutSeconds = 60, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 1, RequiredConfirmations = 0 }, new { NetworkId = 3, MaxInFlightTransactions = 10, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 1, RequiredConfirmations = 1 }, @@ -136,11 +205,29 @@ private static void SeedNetworks(ModelBuilder modelBuilder) new { NetworkId = 5, MaxInFlightTransactions = 1, StuckTransactionTimeoutSeconds = 300, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, new { NetworkId = 6, MaxInFlightTransactions = 1, StuckTransactionTimeoutSeconds = 300, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, new { NetworkId = 7, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 90, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, - new { NetworkId = 8, MaxInFlightTransactions = 10, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 } + new { NetworkId = 8, MaxInFlightTransactions = 10, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, + // Mainnets + new { NetworkId = 9, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 }, + new { NetworkId = 10, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 60, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 1, RequiredConfirmations = 1 }, + new { NetworkId = 11, MaxInFlightTransactions = 10, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 1, RequiredConfirmations = 1 }, + new { NetworkId = 12, MaxInFlightTransactions = 10, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 1, RequiredConfirmations = 1 }, + new { NetworkId = 13, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 }, + new { NetworkId = 14, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 60, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 3, RequiredConfirmations = 1 }, + new { NetworkId = 15, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 }, + new { NetworkId = 16, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 }, + new { NetworkId = 17, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 }, + // Mainnets — Non-EVM + new { NetworkId = 18, MaxInFlightTransactions = 1, StuckTransactionTimeoutSeconds = 300, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, // Starknet + new { NetworkId = 19, MaxInFlightTransactions = 10, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, // Solana + new { NetworkId = 20, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 90, MaxGasBumpAttempts = 0, ConfirmationPollingIntervalSeconds = 5, RequiredConfirmations = 0 }, // Tron + // Mainnets — Additional EVM + new { NetworkId = 21, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 }, // ZKsync Era + new { NetworkId = 22, MaxInFlightTransactions = 5, StuckTransactionTimeoutSeconds = 120, MaxGasBumpAttempts = 3, ConfirmationPollingIntervalSeconds = 2, RequiredConfirmations = 1 } // Blast ); // RewardConfiguration modelBuilder.Entity().OwnsOne(n => n.RewardConfiguration).HasData( + // Testnets new { NetworkId = 1, DeltaPercentage = 10m }, new { NetworkId = 2, DeltaPercentage = 10m }, new { NetworkId = 3, DeltaPercentage = 10m }, @@ -148,138 +235,435 @@ private static void SeedNetworks(ModelBuilder modelBuilder) new { NetworkId = 5, DeltaPercentage = 10m }, new { NetworkId = 6, DeltaPercentage = 10m }, new { NetworkId = 7, DeltaPercentage = 10m }, - new { NetworkId = 8, DeltaPercentage = 10m } + new { NetworkId = 8, DeltaPercentage = 10m }, + // Mainnets + new { NetworkId = 9, DeltaPercentage = 10m }, + new { NetworkId = 10, DeltaPercentage = 10m }, + new { NetworkId = 11, DeltaPercentage = 10m }, + new { NetworkId = 12, DeltaPercentage = 10m }, + new { NetworkId = 13, DeltaPercentage = 10m }, + new { NetworkId = 14, DeltaPercentage = 10m }, + new { NetworkId = 15, DeltaPercentage = 10m }, + new { NetworkId = 16, DeltaPercentage = 10m }, + new { NetworkId = 17, DeltaPercentage = 10m }, + // Mainnets — Non-EVM + Additional EVM + new { NetworkId = 18, DeltaPercentage = 10m }, + new { NetworkId = 19, DeltaPercentage = 10m }, + new { NetworkId = 20, DeltaPercentage = 10m }, + new { NetworkId = 21, DeltaPercentage = 10m }, + new { NetworkId = 22, DeltaPercentage = 10m } ); } private static void SeedEventListenerConfigs(ModelBuilder modelBuilder) { modelBuilder.Entity().HasData( - // eth-sepolia: RPC Log + WebSocket - new EventListenerConfig { Id = 1, NetworkId = 1, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 100, + // ============================================= + // TESTNET EVENT LISTENERS (enabled) + // ============================================= + // eth-sepolia: RPC Log + WebSocket + Mempool + new EventListenerConfig { Id = 1, NetworkId = 1, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, Settings = new() { ["PollingIntervalSeconds"] = "1", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, - new EventListenerConfig { Id = 2, NetworkId = 1, ListenerType = "websocket-event-listener", Enabled = true, CatchUpGapThreshold = 100, + new EventListenerConfig { Id = 2, NetworkId = 1, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, - // arb-sepolia: RPC Log + WebSocket (catch-up disabled) - new EventListenerConfig { Id = 3, NetworkId = 2, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 0, + // arb-sepolia: RPC Log + WebSocket + Mempool + new EventListenerConfig { Id = 3, NetworkId = 2, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["PollingIntervalSeconds"] = "1", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, - new EventListenerConfig { Id = 4, NetworkId = 2, ListenerType = "websocket-event-listener", Enabled = true, CatchUpGapThreshold = 0, + new EventListenerConfig { Id = 4, NetworkId = 2, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "10" } }, // base-sepolia: RPC Log only - new EventListenerConfig { Id = 5, NetworkId = 3, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 0, + new EventListenerConfig { Id = 5, NetworkId = 3, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["PollingIntervalSeconds"] = "12", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "12" } }, - // eth-sepolia: Mempool (Alchemy WSS) - new EventListenerConfig { Id = 6, NetworkId = 1, ListenerType = "mempool-event-listener", Enabled = true, CatchUpGapThreshold = 0, + // eth-sepolia: Mempool + new EventListenerConfig { Id = 6, NetworkId = 1, ListenerType = "mempool-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["ReconnectDelaySeconds"] = "5", ["HeartbeatIntervalSeconds"] = "15" } }, - // arb-sepolia: Mempool (Alchemy WSS) - new EventListenerConfig { Id = 7, NetworkId = 2, ListenerType = "mempool-event-listener", Enabled = true, CatchUpGapThreshold = 0, + // arb-sepolia: Mempool + new EventListenerConfig { Id = 7, NetworkId = 2, ListenerType = "mempool-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["ReconnectDelaySeconds"] = "5", ["HeartbeatIntervalSeconds"] = "15" } }, // bsc-testnet: RPC Log + WebSocket - new EventListenerConfig { Id = 8, NetworkId = 4, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 100, + new EventListenerConfig { Id = 8, NetworkId = 4, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, Settings = new() { ["PollingIntervalSeconds"] = "3", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, - new EventListenerConfig { Id = 9, NetworkId = 4, ListenerType = "websocket-event-listener", Enabled = true, CatchUpGapThreshold = 100, + new EventListenerConfig { Id = 9, NetworkId = 4, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, // aztec-devnet: RPC Log only - new EventListenerConfig { Id = 10, NetworkId = 5, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 0, + new EventListenerConfig { Id = 10, NetworkId = 5, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["PollingIntervalSeconds"] = "5", ["BlockBatchSize"] = "10", ["BlockConfirmations"] = "0" } }, // starknet-sepolia: RPC Log only - new EventListenerConfig { Id = 11, NetworkId = 6, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 0, + new EventListenerConfig { Id = 11, NetworkId = 6, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, Settings = new() { ["PollingIntervalSeconds"] = "10", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, // solana-devnet: RPC Log only - new EventListenerConfig { Id = 12, NetworkId = 8, ListenerType = "rpc-log-event-listener", Enabled = true, CatchUpGapThreshold = 0, - Settings = new() { ["PollingIntervalSeconds"] = "5" } } - ); - } + new EventListenerConfig { Id = 12, NetworkId = 8, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["PollingIntervalSeconds"] = "5" } }, - private static void SeedNodes(ModelBuilder modelBuilder) - { - modelBuilder.Entity().HasData( - new Node { Id = 1, Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", ProviderName = "alchemy", NetworkId = 1, Protocol = NodeProtocol.Http }, - new Node { Id = 2, Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", ProviderName = "alchemy", NetworkId = 2, Protocol = NodeProtocol.Http }, - new Node { Id = 3, Url = "https://base-sepolia-rpc.publicnode.com", ProviderName = "publicnode", NetworkId = 3, Protocol = NodeProtocol.Http }, - new Node { Id = 4, Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", ProviderName = "alchemy", NetworkId = 1, Protocol = NodeProtocol.WebSocket }, - new Node { Id = 5, Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", ProviderName = "alchemy", NetworkId = 2, Protocol = NodeProtocol.WebSocket }, - new Node { Id = 6, Url = "https://bsc-testnet-rpc.publicnode.com", ProviderName = "publicnode", NetworkId = 4, Protocol = NodeProtocol.Http }, - new Node { Id = 7, Url = "wss://bsc-testnet-rpc.publicnode.com", ProviderName = "publicnode", NetworkId = 4, Protocol = NodeProtocol.WebSocket }, - new Node { Id = 8, Url = "https://v4-devnet-2.aztec-labs.com", ProviderName = "aztec", NetworkId = 5, Protocol = NodeProtocol.Http }, - new Node { Id = 9, Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", ProviderName = "alchemy", NetworkId = 6, Protocol = NodeProtocol.Http }, - new Node { Id = 10, Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", ProviderName = "alchemy", NetworkId = 7, Protocol = NodeProtocol.Http }, - new Node { Id = 11, Url = "https://api.devnet.solana.com", ProviderName = "solana", NetworkId = 8, Protocol = NodeProtocol.Http } + // ============================================= + // MAINNET EVENT LISTENERS (disabled by default) + // ============================================= + // ethereum: RPC Log + WebSocket + new EventListenerConfig { Id = 13, NetworkId = 9, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "12", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "2" } }, + new EventListenerConfig { Id = 14, NetworkId = 9, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + // arbitrum-one: RPC Log + WebSocket + new EventListenerConfig { Id = 15, NetworkId = 10, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["PollingIntervalSeconds"] = "1", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, + new EventListenerConfig { Id = 16, NetworkId = 10, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "10" } }, + // base: RPC Log + WebSocket + new EventListenerConfig { Id = 17, NetworkId = 11, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "2", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "2" } }, + new EventListenerConfig { Id = 18, NetworkId = 11, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + // optimism: RPC Log + WebSocket + new EventListenerConfig { Id = 19, NetworkId = 12, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["PollingIntervalSeconds"] = "2", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, + new EventListenerConfig { Id = 20, NetworkId = 12, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "10" } }, + // polygon: RPC Log + WebSocket + new EventListenerConfig { Id = 21, NetworkId = 13, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "2", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "2" } }, + new EventListenerConfig { Id = 22, NetworkId = 13, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + // bsc: RPC Log + WebSocket + new EventListenerConfig { Id = 23, NetworkId = 14, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "3", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "1" } }, + new EventListenerConfig { Id = 24, NetworkId = 14, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + // avalanche: RPC Log + WebSocket + new EventListenerConfig { Id = 25, NetworkId = 15, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "2", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "1" } }, + new EventListenerConfig { Id = 26, NetworkId = 15, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + // linea: RPC Log only + new EventListenerConfig { Id = 27, NetworkId = 16, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "3", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "1" } }, + // scroll: RPC Log + WebSocket + new EventListenerConfig { Id = 28, NetworkId = 17, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "3", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "1" } }, + new EventListenerConfig { Id = 29, NetworkId = 17, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + + // ============================================= + // MAINNET EVENT LISTENERS — NON-EVM (disabled) + // ============================================= + // starknet: RPC Log only + new EventListenerConfig { Id = 30, NetworkId = 18, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["PollingIntervalSeconds"] = "10", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "0" } }, + // solana: RPC Log only + new EventListenerConfig { Id = 31, NetworkId = 19, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 0, + Settings = new() { ["PollingIntervalSeconds"] = "5" } }, + // tron: no event listeners (transfer only) + + // ============================================= + // MAINNET EVENT LISTENERS — ADDITIONAL EVM (disabled) + // ============================================= + // zksync: RPC Log + WebSocket + new EventListenerConfig { Id = 32, NetworkId = 21, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "2", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "1" } }, + new EventListenerConfig { Id = 33, NetworkId = 21, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } }, + // blast: RPC Log + WebSocket + new EventListenerConfig { Id = 34, NetworkId = 22, ListenerType = "rpc-log-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["PollingIntervalSeconds"] = "2", ["BlockBatchSize"] = "100", ["BlockConfirmations"] = "1" } }, + new EventListenerConfig { Id = 35, NetworkId = 22, ListenerType = "websocket-event-listener", Enabled = false, CatchUpGapThreshold = 100, + Settings = new() { ["ReconnectDelaySeconds"] = "10", ["HeartbeatIntervalSeconds"] = "5" } } ); } private static void SeedContracts(ModelBuilder modelBuilder) { modelBuilder.Entity().HasData( - new Contract { Id = 1, Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", Type = "Train", NetworkId = 1 }, - new Contract { Id = 3, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 1 }, - new Contract { Id = 2, Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", Type = "Train", NetworkId = 2 }, - new Contract { Id = 4, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 2 }, - new Contract { Id = 5, Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", Type = "Train", NetworkId = 3 }, - new Contract { Id = 6, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 3 }, - new Contract { Id = 7, Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", Type = "Train", NetworkId = 4 }, - new Contract { Id = 8, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 4 }, - new Contract { Id = 9, Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", Type = "Train", NetworkId = 5 }, + // ============================================= + // TESTNET CONTRACTS + // ============================================= + new Contract { Id = 1, Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", Type = "Train", NetworkId = 1 }, + new Contract { Id = 3, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 1 }, + new Contract { Id = 2, Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", Type = "Train", NetworkId = 2 }, + new Contract { Id = 4, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 2 }, + new Contract { Id = 5, Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", Type = "Train", NetworkId = 3 }, + new Contract { Id = 6, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 3 }, + new Contract { Id = 7, Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", Type = "Train", NetworkId = 4 }, + new Contract { Id = 8, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 4 }, + new Contract { Id = 9, Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", Type = "Train", NetworkId = 5 }, new Contract { Id = 10, Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", Type = "Train", NetworkId = 7 }, - new Contract { Id = 11, Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", Type = "Train", NetworkId = 6 } + new Contract { Id = 11, Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", Type = "Train", NetworkId = 6 }, + + // ============================================= + // MAINNET CONTRACTS (Multicall3 — same address on all EVM chains) + // No Train contracts on mainnet yet — user deploys and adds via AdminPanel + // ============================================= + new Contract { Id = 12, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 9 }, // Ethereum + new Contract { Id = 13, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 10 }, // Arbitrum One + new Contract { Id = 14, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 11 }, // Base + new Contract { Id = 15, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 12 }, // OP Mainnet + new Contract { Id = 16, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 13 }, // Polygon + new Contract { Id = 17, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 14 }, // BNB Smart Chain + new Contract { Id = 18, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 15 }, // Avalanche + new Contract { Id = 19, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 16 }, // Linea + new Contract { Id = 20, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 17 }, // Scroll + + // ============================================= + // MAINNET CONTRACTS — ADDITIONAL EVM + // ============================================= + new Contract { Id = 21, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 21 }, // ZKsync Era + new Contract { Id = 22, Address = "0xcA11bde05977b3631167028862bE2a173976CA11", Type = "Multicall", NetworkId = 22 } // Blast ); } private static void SeedTokens(ModelBuilder modelBuilder) { + var evmNative = "0x0000000000000000000000000000000000000000"; + modelBuilder.Entity().HasData( - new Token { Id = 1, Symbol = "ETH", Decimals = 18, ContractAddress = "0x0000000000000000000000000000000000000000", TokenPriceId = 1, NetworkId = 1 }, - new Token { Id = 2, Symbol = "ETH", Decimals = 18, ContractAddress = "0x0000000000000000000000000000000000000000", TokenPriceId = 1, NetworkId = 2 }, - new Token { Id = 3, Symbol = "ETH", Decimals = 18, ContractAddress = "0x0000000000000000000000000000000000000000", TokenPriceId = 1, NetworkId = 3 }, - new Token { Id = 4, Symbol = "BNB", Decimals = 18, ContractAddress = "0x0000000000000000000000000000000000000000", TokenPriceId = 2, NetworkId = 4 }, - new Token { Id = 5, Symbol = "ETH", Decimals = 18, ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", TokenPriceId = 1, NetworkId = 5 }, - new Token { Id = 6, Symbol = "STRK", Decimals = 18, ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", TokenPriceId = 1, NetworkId = 6 }, - new Token { Id = 7, Symbol = "TRX", Decimals = 6, ContractAddress = "0x0000000000000000000000000000000000000000", TokenPriceId = 4, NetworkId = 7 }, - new Token { Id = 8, Symbol = "SOL", Decimals = 9, ContractAddress = "11111111111111111111111111111111", TokenPriceId = 3, NetworkId = 8 } + // ============================================= + // TESTNET TOKENS (Id 1-8) + // ============================================= + new Token { Id = 1, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 1 }, + new Token { Id = 2, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 2 }, + new Token { Id = 3, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 3 }, + new Token { Id = 4, Symbol = "BNB", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 2, NetworkId = 4 }, + new Token { Id = 5, Symbol = "ETH", Decimals = 18, ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", TokenPriceId = 1, NetworkId = 5 }, + new Token { Id = 6, Symbol = "STRK", Decimals = 18, ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", TokenPriceId = 9, NetworkId = 6 }, + new Token { Id = 7, Symbol = "TRX", Decimals = 6, ContractAddress = evmNative, TokenPriceId = 4, NetworkId = 7 }, + new Token { Id = 8, Symbol = "SOL", Decimals = 9, ContractAddress = "11111111111111111111111111111111", TokenPriceId = 3, NetworkId = 8 }, + + // ============================================= + // MAINNET NATIVE TOKENS (Id 9-17) + // ============================================= + new Token { Id = 9, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 9 }, // Ethereum + new Token { Id = 10, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 10 }, // Arbitrum One + new Token { Id = 11, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 11 }, // Base + new Token { Id = 12, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 12 }, // OP Mainnet + new Token { Id = 13, Symbol = "POL", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 5, NetworkId = 13 }, // Polygon + new Token { Id = 14, Symbol = "BNB", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 2, NetworkId = 14 }, // BNB Smart Chain + new Token { Id = 15, Symbol = "AVAX", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 6, NetworkId = 15 }, // Avalanche + new Token { Id = 16, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 16 }, // Linea + new Token { Id = 17, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 17 }, // Scroll + + // ============================================= + // MAINNET ERC-20 TOKENS — USDC (Id 18-25) + // ============================================= + new Token { Id = 18, Symbol = "USDC", Decimals = 6, ContractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", TokenPriceId = 7, NetworkId = 9 }, // Ethereum + new Token { Id = 19, Symbol = "USDC", Decimals = 6, ContractAddress = "0xaf88d065e77c8cc2239327c5edb3a432268e5831", TokenPriceId = 7, NetworkId = 10 }, // Arbitrum One + new Token { Id = 20, Symbol = "USDC", Decimals = 6, ContractAddress = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", TokenPriceId = 7, NetworkId = 11 }, // Base + new Token { Id = 21, Symbol = "USDC", Decimals = 6, ContractAddress = "0x0b2c639c533813f4aa9d7837caf62653d097ff85", TokenPriceId = 7, NetworkId = 12 }, // OP Mainnet + new Token { Id = 22, Symbol = "USDC", Decimals = 6, ContractAddress = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", TokenPriceId = 7, NetworkId = 13 }, // Polygon + new Token { Id = 23, Symbol = "USDC", Decimals = 6, ContractAddress = "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", TokenPriceId = 7, NetworkId = 15 }, // Avalanche + new Token { Id = 24, Symbol = "USDC", Decimals = 6, ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", TokenPriceId = 7, NetworkId = 17 }, // Scroll (zkSync-bridged) + + // ============================================= + // MAINNET ERC-20 TOKENS — USDT (Id 25-31) + // ============================================= + new Token { Id = 25, Symbol = "USDT", Decimals = 6, ContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7", TokenPriceId = 8, NetworkId = 9 }, // Ethereum + new Token { Id = 26, Symbol = "USDT", Decimals = 6, ContractAddress = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", TokenPriceId = 8, NetworkId = 10 }, // Arbitrum One + new Token { Id = 27, Symbol = "USDT", Decimals = 6, ContractAddress = "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", TokenPriceId = 8, NetworkId = 11 }, // Base + new Token { Id = 28, Symbol = "USDT", Decimals = 6, ContractAddress = "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", TokenPriceId = 8, NetworkId = 12 }, // OP Mainnet + new Token { Id = 29, Symbol = "USDT", Decimals = 6, ContractAddress = "0x55d398326f99059ff775485246999027b3197955", TokenPriceId = 8, NetworkId = 14 }, // BSC (Binance-Peg) + new Token { Id = 30, Symbol = "USDT", Decimals = 6, ContractAddress = "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", TokenPriceId = 8, NetworkId = 15 }, // Avalanche + new Token { Id = 31, Symbol = "USDT", Decimals = 6, ContractAddress = "0xa219439258ca9da29e9cc4ce5596924745e12b93", TokenPriceId = 8, NetworkId = 16 }, // Linea + new Token { Id = 32, Symbol = "USDT", Decimals = 6, ContractAddress = "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", TokenPriceId = 8, NetworkId = 17 }, // Scroll + + // ============================================= + // MAINNET ERC-20 TOKENS — WETH (Id 33-41) + // ============================================= + new Token { Id = 33, Symbol = "WETH", Decimals = 18, ContractAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", TokenPriceId = 1, NetworkId = 9 }, // Ethereum + new Token { Id = 34, Symbol = "WETH", Decimals = 18, ContractAddress = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", TokenPriceId = 1, NetworkId = 10 }, // Arbitrum One + new Token { Id = 35, Symbol = "WETH", Decimals = 18, ContractAddress = "0x4200000000000000000000000000000000000006", TokenPriceId = 1, NetworkId = 11 }, // Base + new Token { Id = 36, Symbol = "WETH", Decimals = 18, ContractAddress = "0x4200000000000000000000000000000000000006", TokenPriceId = 1, NetworkId = 12 }, // OP Mainnet + new Token { Id = 37, Symbol = "WETH", Decimals = 18, ContractAddress = "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", TokenPriceId = 1, NetworkId = 13 }, // Polygon + new Token { Id = 38, Symbol = "WETH", Decimals = 18, ContractAddress = "0x2170ed0880ac9a755fd29b2688956bd959f933f8", TokenPriceId = 1, NetworkId = 14 }, // BSC (Binance-Peg) + new Token { Id = 39, Symbol = "WETH", Decimals = 18, ContractAddress = "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", TokenPriceId = 1, NetworkId = 15 }, // Avalanche + new Token { Id = 40, Symbol = "WETH", Decimals = 18, ContractAddress = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", TokenPriceId = 1, NetworkId = 16 }, // Linea + new Token { Id = 41, Symbol = "WETH", Decimals = 18, ContractAddress = "0x5300000000000000000000000000000000000004", TokenPriceId = 1, NetworkId = 17 }, // Scroll + + // ============================================= + // MAINNET ERC-20 TOKENS — WBTC (Id 42-48) + // ============================================= + new Token { Id = 42, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", TokenPriceId = 10, NetworkId = 9 }, // Ethereum + new Token { Id = 43, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", TokenPriceId = 10, NetworkId = 10 }, // Arbitrum One + new Token { Id = 44, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x68f180fcce6836688e9084f035309e29bf0a2095", TokenPriceId = 10, NetworkId = 12 }, // OP Mainnet + new Token { Id = 45, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", TokenPriceId = 10, NetworkId = 13 }, // Polygon + new Token { Id = 46, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x50b7545627a5162f82a992c33b87adc75187b218", TokenPriceId = 10, NetworkId = 15 }, // Avalanche (WBTC.e) + new Token { Id = 47, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", TokenPriceId = 10, NetworkId = 16 }, // Linea + new Token { Id = 48, Symbol = "WBTC", Decimals = 8, ContractAddress = "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", TokenPriceId = 10, NetworkId = 17 }, // Scroll + + // ============================================= + // MAINNET ERC-20 TOKENS — DAI (Id 49-56) + // ============================================= + new Token { Id = 49, Symbol = "DAI", Decimals = 18, ContractAddress = "0x6b175474e89094c44da98b954eedeac495271d0f", TokenPriceId = 11, NetworkId = 9 }, // Ethereum + new Token { Id = 50, Symbol = "DAI", Decimals = 18, ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", TokenPriceId = 11, NetworkId = 10 }, // Arbitrum One + new Token { Id = 51, Symbol = "DAI", Decimals = 18, ContractAddress = "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", TokenPriceId = 11, NetworkId = 11 }, // Base + new Token { Id = 52, Symbol = "DAI", Decimals = 18, ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", TokenPriceId = 11, NetworkId = 12 }, // OP Mainnet + new Token { Id = 53, Symbol = "DAI", Decimals = 18, ContractAddress = "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", TokenPriceId = 11, NetworkId = 13 }, // Polygon + new Token { Id = 54, Symbol = "DAI", Decimals = 18, ContractAddress = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", TokenPriceId = 11, NetworkId = 14 }, // BSC (Binance-Peg) + new Token { Id = 55, Symbol = "DAI", Decimals = 18, ContractAddress = "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", TokenPriceId = 11, NetworkId = 15 }, // Avalanche + new Token { Id = 56, Symbol = "DAI", Decimals = 18, ContractAddress = "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", TokenPriceId = 11, NetworkId = 16 }, // Linea + + // ============================================= + // MAINNET NATIVE TOKENS — NON-EVM (Id 57-59) + // ============================================= + new Token { Id = 57, Symbol = "STRK", Decimals = 18, ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", TokenPriceId = 9, NetworkId = 18 }, // Starknet + new Token { Id = 58, Symbol = "SOL", Decimals = 9, ContractAddress = "11111111111111111111111111111111", TokenPriceId = 3, NetworkId = 19 }, // Solana + new Token { Id = 59, Symbol = "TRX", Decimals = 6, ContractAddress = evmNative, TokenPriceId = 4, NetworkId = 20 }, // Tron + + // ============================================= + // MAINNET NATIVE TOKENS — ADDITIONAL EVM (Id 60-61) + // ============================================= + new Token { Id = 60, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 21 }, // ZKsync Era + new Token { Id = 61, Symbol = "ETH", Decimals = 18, ContractAddress = evmNative, TokenPriceId = 1, NetworkId = 22 }, // Blast + + // ============================================= + // STARKNET ERC-20 TOKENS (Id 62-64) + // ============================================= + new Token { Id = 62, Symbol = "ETH", Decimals = 18, ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", TokenPriceId = 1, NetworkId = 18 }, + new Token { Id = 63, Symbol = "USDC", Decimals = 6, ContractAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", TokenPriceId = 7, NetworkId = 18 }, + new Token { Id = 64, Symbol = "USDT", Decimals = 6, ContractAddress = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", TokenPriceId = 8, NetworkId = 18 }, + + // ============================================= + // MISSING MAINNET ERC-20 TOKENS (Id 65-67) + // ============================================= + new Token { Id = 65, Symbol = "USDC", Decimals = 18, ContractAddress = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", TokenPriceId = 7, NetworkId = 14 }, // BSC (18 decimals!) + new Token { Id = 66, Symbol = "USDC", Decimals = 6, ContractAddress = "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", TokenPriceId = 7, NetworkId = 16 }, // Linea + new Token { Id = 67, Symbol = "USDT", Decimals = 6, ContractAddress = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", TokenPriceId = 8, NetworkId = 13 }, // Polygon + + // ============================================= + // ZKSYNC ERA ERC-20 TOKENS (Id 68-73) + // ============================================= + new Token { Id = 68, Symbol = "USDC", Decimals = 6, ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", TokenPriceId = 7, NetworkId = 21 }, + new Token { Id = 69, Symbol = "USDT", Decimals = 6, ContractAddress = "0x493257fd37edb34451f62edf8d2a0c418852ba4c", TokenPriceId = 8, NetworkId = 21 }, + new Token { Id = 70, Symbol = "WETH", Decimals = 18, ContractAddress = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", TokenPriceId = 1, NetworkId = 21 }, + new Token { Id = 71, Symbol = "WBTC", Decimals = 8, ContractAddress = "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", TokenPriceId = 10, NetworkId = 21 }, + new Token { Id = 72, Symbol = "DAI", Decimals = 18, ContractAddress = "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", TokenPriceId = 11, NetworkId = 21 }, + + // ============================================= + // BLAST ERC-20 TOKENS (Id 73) + // ============================================= + new Token { Id = 73, Symbol = "WETH", Decimals = 18, ContractAddress = "0x4300000000000000000000000000000000000004", TokenPriceId = 1, NetworkId = 22 } ); } - private static void SeedWebhookSubscribers(ModelBuilder modelBuilder) + private static void SeedNodeProviders(ModelBuilder modelBuilder) { - modelBuilder.Entity().HasData( - new WebhookSubscriber - { - Id = 1, - Name = "station-api", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Secret = "station-webhook-secret-1", - IsActive = true, - EventTypes = Array.Empty() - } + // Node providers — all disabled by default, add API key and enable manually + modelBuilder.Entity().HasData( + new NodeProvider { Id = 1, Name = "alchemy", ApiKey = "", Enabled = false }, + new NodeProvider { Id = 2, Name = "infura", ApiKey = "", Enabled = false }, + new NodeProvider { Id = 3, Name = "ankr", ApiKey = "", Enabled = false }, + new NodeProvider { Id = 4, Name = "drpc", ApiKey = "", Enabled = false }, + new NodeProvider { Id = 5, Name = "chainlist", ApiKey = "", Enabled = false } ); - } - private static void SeedRoutes(ModelBuilder modelBuilder) - { - modelBuilder.Entity().HasData( - new Route { Id = 1, SourceTokenId = 1, DestinationTokenId = 2, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 2, SourceTokenId = 2, DestinationTokenId = 1, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 3, SourceTokenId = 1, DestinationTokenId = 3, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 4, SourceTokenId = 3, DestinationTokenId = 1, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 5, SourceTokenId = 2, DestinationTokenId = 3, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 6, SourceTokenId = 3, DestinationTokenId = 2, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - // BNB <-> ETH routes (TokenPrice rate provider) - new Route { Id = 7, SourceTokenId = 1, DestinationTokenId = 4, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 8, SourceTokenId = 4, DestinationTokenId = 1, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 9, SourceTokenId = 2, DestinationTokenId = 4, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 10, SourceTokenId = 4, DestinationTokenId = 2, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 11, SourceTokenId = 3, DestinationTokenId = 4, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 12, SourceTokenId = 4, DestinationTokenId = 3, SourceWalletId = 1, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - // Aztec <-> EVM routes - new Route { Id = 13, SourceTokenId = 5, DestinationTokenId = 1, SourceWalletId = 2, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 14, SourceTokenId = 1, DestinationTokenId = 5, SourceWalletId = 1, DestinationWalletId = 2, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 15, SourceTokenId = 5, DestinationTokenId = 2, SourceWalletId = 2, DestinationWalletId = 1, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 16, SourceTokenId = 2, DestinationTokenId = 5, SourceWalletId = 1, DestinationWalletId = 2, RateProviderId = 1, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - // Solana <-> EVM routes (TokenPrice rate provider, SOL has 9 decimals) - new Route { Id = 17, SourceTokenId = 8, DestinationTokenId = 1, SourceWalletId = 3, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "1000000", MaxAmountInSource = "50000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 18, SourceTokenId = 1, DestinationTokenId = 8, SourceWalletId = 1, DestinationWalletId = 3, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 19, SourceTokenId = 8, DestinationTokenId = 2, SourceWalletId = 3, DestinationWalletId = 1, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "1000000", MaxAmountInSource = "50000000000", Status = RouteStatus.Active, AutoRefundUser = false }, - new Route { Id = 20, SourceTokenId = 2, DestinationTokenId = 8, SourceWalletId = 1, DestinationWalletId = 3, RateProviderId = 3, ServiceFeeId = 1, MinAmountInSource = "100000000000", MaxAmountInSource = "5000000000000000", Status = RouteStatus.Active, AutoRefundUser = false } + // Network ↔ NodeProvider links + // Network IDs: + // Testnets: 1=eth-sepolia, 2=arb-sepolia, 3=base-sepolia, 4=bsc-testnet, + // 5=aztec-devnet, 6=starknet-sepolia, 7=tron-nile, 8=solana-devnet + // Mainnets: 9=ethereum, 10=arbitrum, 11=base, 12=optimism, 13=polygon, 14=bsc, + // 15=avalanche, 16=linea, 17=scroll, 18=starknet, 19=solana, 20=tron, + // 21=zksync, 22=blast + + var id = 0; + modelBuilder.Entity().HasData( + // alchemy (Id=1): all EVM + Starknet + Solana + Tron (not aztec-devnet, tron-nile) + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 1 }, // eth-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 2 }, // arb-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 3 }, // base-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 4 }, // bsc-testnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 6 }, // starknet-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 8 }, // solana-devnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 9 }, // ethereum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 10 }, // arbitrum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 11 }, // base + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 12 }, // optimism + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 13 }, // polygon + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 14 }, // bsc + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 15 }, // avalanche + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 16 }, // linea + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 17 }, // scroll + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 18 }, // starknet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 19 }, // solana + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 20 }, // tron + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 21 }, // zksync + new NetworkNodeProvider { Id = ++id, NodeProviderId = 1, NetworkId = 22 }, // blast + + // infura (Id=2): all EVM + Starknet (not Solana, not Tron, not aztec-devnet, not tron-nile, not solana-devnet) + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 1 }, // eth-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 2 }, // arb-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 3 }, // base-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 4 }, // bsc-testnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 6 }, // starknet-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 9 }, // ethereum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 10 }, // arbitrum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 11 }, // base + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 12 }, // optimism + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 13 }, // polygon + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 14 }, // bsc + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 15 }, // avalanche + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 16 }, // linea + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 17 }, // scroll + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 18 }, // starknet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 21 }, // zksync + new NetworkNodeProvider { Id = ++id, NodeProviderId = 2, NetworkId = 22 }, // blast + + // ankr (Id=3): all EVM + Starknet + Solana + Tron, except ZKsync (not aztec-devnet, tron-nile) + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 1 }, // eth-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 2 }, // arb-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 3 }, // base-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 4 }, // bsc-testnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 6 }, // starknet-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 8 }, // solana-devnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 9 }, // ethereum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 10 }, // arbitrum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 11 }, // base + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 12 }, // optimism + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 13 }, // polygon + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 14 }, // bsc + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 15 }, // avalanche + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 16 }, // linea + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 17 }, // scroll + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 18 }, // starknet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 19 }, // solana + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 20 }, // tron + new NetworkNodeProvider { Id = ++id, NodeProviderId = 3, NetworkId = 22 }, // blast + + // drpc (Id=4): all EVM + Starknet + Solana + Tron (not aztec-devnet, tron-nile) + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 1 }, // eth-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 2 }, // arb-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 3 }, // base-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 4 }, // bsc-testnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 6 }, // starknet-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 8 }, // solana-devnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 9 }, // ethereum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 10 }, // arbitrum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 11 }, // base + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 12 }, // optimism + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 13 }, // polygon + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 14 }, // bsc + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 15 }, // avalanche + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 16 }, // linea + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 17 }, // scroll + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 18 }, // starknet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 19 }, // solana + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 20 }, // tron + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 21 }, // zksync + new NetworkNodeProvider { Id = ++id, NodeProviderId = 4, NetworkId = 22 }, // blast + + // chainlist (Id=5): EVM + Tron only (numeric chain IDs) + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 1 }, // eth-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 2 }, // arb-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 3 }, // base-sepolia + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 4 }, // bsc-testnet + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 7 }, // tron-nile + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 9 }, // ethereum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 10 }, // arbitrum + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 11 }, // base + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 12 }, // optimism + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 13 }, // polygon + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 14 }, // bsc + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 15 }, // avalanche + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 16 }, // linea + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 17 }, // scroll + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 20 }, // tron + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 21 }, // zksync + new NetworkNodeProvider { Id = ++id, NodeProviderId = 5, NetworkId = 22 } // blast ); } } diff --git a/csharp/src/Data.Npgsql/Extensions/TrainSolverBuilderExtensions.cs b/csharp/src/Data.Npgsql/Extensions/TrainSolverBuilderExtensions.cs index 3067003f..7a52ed38 100644 --- a/csharp/src/Data.Npgsql/Extensions/TrainSolverBuilderExtensions.cs +++ b/csharp/src/Data.Npgsql/Extensions/TrainSolverBuilderExtensions.cs @@ -52,6 +52,7 @@ public static TrainSolverBuilder WithNpgsqlRepositories( builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); + builder.Services.AddTransient(); using var scope = builder.Services.BuildServiceProvider().CreateScope(); var dbContext = scope.ServiceProvider.GetRequiredService(); diff --git a/csharp/src/Data.Npgsql/Migrations/20260218175421_Initial.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260218175421_Initial.Designer.cs deleted file mode 100644 index db2469ff..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260218175421_Initial.Designer.cs +++ /dev/null @@ -1,1891 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260218175421_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ethereum", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260219114310_AddMempoolListenerSeed.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260219114310_AddMempoolListenerSeed.Designer.cs deleted file mode 100644 index 62c3a585..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260219114310_AddMempoolListenerSeed.Designer.cs +++ /dev/null @@ -1,1913 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260219114310_AddMempoolListenerSeed")] - partial class AddMempoolListenerSeed - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ethereum", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260219114310_AddMempoolListenerSeed.cs b/csharp/src/Data.Npgsql/Migrations/20260219114310_AddMempoolListenerSeed.cs deleted file mode 100644 index 967cb156..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260219114310_AddMempoolListenerSeed.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddMempoolListenerSeed : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "EventListenerConfigs", - columns: new[] { "Id", "CatchUpGapThreshold", "Enabled", "ListenerType", "NetworkId", "Settings" }, - values: new object[,] - { - { 6, 0, true, "mempool-event-listener", 1, "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}" }, - { 7, 0, true, "mempool-event-listener", 2, "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}" } - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 6); - - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 7); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260219122908_AddStationWebhookSub.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260219122908_AddStationWebhookSub.Designer.cs deleted file mode 100644 index 6720e828..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260219122908_AddStationWebhookSub.Designer.cs +++ /dev/null @@ -1,1925 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260219122908_AddStationWebhookSub")] - partial class AddStationWebhookSub - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ethereum", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260219122908_AddStationWebhookSub.cs b/csharp/src/Data.Npgsql/Migrations/20260219122908_AddStationWebhookSub.cs deleted file mode 100644 index f6b6081e..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260219122908_AddStationWebhookSub.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddStationWebhookSub : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "WebhookSubscribers", - columns: new[] { "Id", "IsActive", "Name", "Secret", "Url" }, - values: new object[] { 1, true, "station-api", "station-webhook-secret-1", "http://localhost:9690/api/v1/webhooks/plorex" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "WebhookSubscribers", - keyColumn: "Id", - keyValue: 1); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220161938_UpdateEventListenerConfigs.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260220161938_UpdateEventListenerConfigs.Designer.cs deleted file mode 100644 index b56822e3..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220161938_UpdateEventListenerConfigs.Designer.cs +++ /dev/null @@ -1,1925 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260220161938_UpdateEventListenerConfigs")] - partial class UpdateEventListenerConfigs - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220161938_UpdateEventListenerConfigs.cs b/csharp/src/Data.Npgsql/Migrations/20260220161938_UpdateEventListenerConfigs.cs deleted file mode 100644 index 974c342a..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220161938_UpdateEventListenerConfigs.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateEventListenerConfigs : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "TokenPrices", - keyColumn: "Id", - keyValue: 1, - column: "ExternalId", - value: "ETHUSDT"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "TokenPrices", - keyColumn: "Id", - keyValue: 1, - column: "ExternalId", - value: "ethereum"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220164951_AddBscChainConfig.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260220164951_AddBscChainConfig.Designer.cs deleted file mode 100644 index 27e3c992..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220164951_AddBscChainConfig.Designer.cs +++ /dev/null @@ -1,2151 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260220164951_AddBscChainConfig")] - partial class AddBscChainConfig - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemywss", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220164951_AddBscChainConfig.cs b/csharp/src/Data.Npgsql/Migrations/20260220164951_AddBscChainConfig.cs deleted file mode 100644 index 2d1b6952..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220164951_AddBscChainConfig.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddBscChainConfig : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "Networks", - columns: new[] { "Id", "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", "GasConfiguration_L1FeeOracleContract", "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", "ChainId", "DisplayName", "NetworkTypeId", "Slug", "RewardConfiguration_DeltaPercentage", "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" }, - values: new object[] { 4, 25, false, true, null, 10, 15, false, "0", "0", "100000000000000000", "0", "97", "BSC Testnet", 1, "bsc-testnet", 10m, 900L, 1800L, 3600L, 7200L, 3, 3, 5, 0, 60 }); - - migrationBuilder.InsertData( - table: "RateProviders", - columns: new[] { "Id", "Name" }, - values: new object[] { 2, "Binance" }); - - migrationBuilder.InsertData( - table: "TokenPrices", - columns: new[] { "Id", "ExternalId", "LastUpdated", "PriceInUsd", "Symbol" }, - values: new object[] { 2, "BNBUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 600.0m, "BNB" }); - - migrationBuilder.InsertData( - table: "Contracts", - columns: new[] { "Id", "Address", "NetworkId", "Type" }, - values: new object[,] - { - { 7, "0x0000000000000000000000000000000000000000", 4, "Train" }, - { 8, "0xcA11bde05977b3631167028862bE2a173976CA11", 4, "Multicall" } - }); - - migrationBuilder.InsertData( - table: "EventListenerConfigs", - columns: new[] { "Id", "CatchUpGapThreshold", "Enabled", "ListenerType", "NetworkId", "Settings" }, - values: new object[,] - { - { 8, 100, true, "rpc-log-event-listener", 4, "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, - { 9, 100, true, "websocket-event-listener", 4, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" } - }); - - migrationBuilder.InsertData( - table: "Nodes", - columns: new[] { "Id", "NetworkId", "Protocol", "ProviderName", "Url" }, - values: new object[,] - { - { 6, 4, 0, "publicnode", "https://bsc-testnet-rpc.publicnode.com" }, - { 7, 4, 1, "publicnodewss", "wss://bsc-testnet-rpc.publicnode.com" } - }); - - migrationBuilder.InsertData( - table: "Tokens", - columns: new[] { "Id", "ContractAddress", "Decimals", "NetworkId", "Symbol", "TokenPriceId" }, - values: new object[] { 4, "0x0000000000000000000000000000000000000000", 18, 4, "BNB", 2 }); - - migrationBuilder.InsertData( - table: "Routes", - columns: new[] { "Id", "DestinationTokenId", "DestinationWalletId", "MaxAmountInSource", "MinAmountInSource", "RateProviderId", "ServiceFeeId", "SourceTokenId", "SourceWalletId", "Status" }, - values: new object[,] - { - { 7, 4, 1, "5000000000000000", "100000000000", 2, 1, 1, 1, 0 }, - { 8, 1, 1, "5000000000000000", "100000000000", 2, 1, 4, 1, 0 }, - { 9, 4, 1, "5000000000000000", "100000000000", 2, 1, 2, 1, 0 }, - { 10, 2, 1, "5000000000000000", "100000000000", 2, 1, 4, 1, 0 }, - { 11, 4, 1, "5000000000000000", "100000000000", 2, 1, 3, 1, 0 }, - { 12, 3, 1, "5000000000000000", "100000000000", 2, 1, 4, 1, 0 } - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Contracts", - keyColumn: "Id", - keyValue: 7); - - migrationBuilder.DeleteData( - table: "Contracts", - keyColumn: "Id", - keyValue: 8); - - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 8); - - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 9); - - migrationBuilder.DeleteData( - table: "Nodes", - keyColumn: "Id", - keyValue: 6); - - migrationBuilder.DeleteData( - table: "Nodes", - keyColumn: "Id", - keyValue: 7); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 7); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 8); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 9); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 10); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 11); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 12); - - migrationBuilder.DeleteData( - table: "RateProviders", - keyColumn: "Id", - keyValue: 2); - - migrationBuilder.DeleteData( - table: "Tokens", - keyColumn: "Id", - keyValue: 4); - - migrationBuilder.DeleteData( - table: "Networks", - keyColumn: "Id", - keyValue: 4); - - migrationBuilder.DeleteData( - table: "TokenPrices", - keyColumn: "Id", - keyValue: 2); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220165925_UpdateNodeIndex.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260220165925_UpdateNodeIndex.Designer.cs deleted file mode 100644 index 4c2ee8ac..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220165925_UpdateNodeIndex.Designer.cs +++ /dev/null @@ -1,2151 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260220165925_UpdateNodeIndex")] - partial class UpdateNodeIndex - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220165925_UpdateNodeIndex.cs b/csharp/src/Data.Npgsql/Migrations/20260220165925_UpdateNodeIndex.cs deleted file mode 100644 index 52655330..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220165925_UpdateNodeIndex.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateNodeIndex : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_Nodes_ProviderName_NetworkId", - table: "Nodes"); - - migrationBuilder.UpdateData( - table: "Nodes", - keyColumn: "Id", - keyValue: 4, - column: "ProviderName", - value: "alchemy"); - - migrationBuilder.UpdateData( - table: "Nodes", - keyColumn: "Id", - keyValue: 5, - column: "ProviderName", - value: "alchemy"); - - migrationBuilder.UpdateData( - table: "Nodes", - keyColumn: "Id", - keyValue: 7, - column: "ProviderName", - value: "publicnode"); - - migrationBuilder.CreateIndex( - name: "IX_Nodes_ProviderName_NetworkId_Protocol", - table: "Nodes", - columns: new[] { "ProviderName", "NetworkId", "Protocol" }, - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_Nodes_ProviderName_NetworkId_Protocol", - table: "Nodes"); - - migrationBuilder.UpdateData( - table: "Nodes", - keyColumn: "Id", - keyValue: 4, - column: "ProviderName", - value: "alchemywss"); - - migrationBuilder.UpdateData( - table: "Nodes", - keyColumn: "Id", - keyValue: 5, - column: "ProviderName", - value: "alchemywss"); - - migrationBuilder.UpdateData( - table: "Nodes", - keyColumn: "Id", - keyValue: 7, - column: "ProviderName", - value: "publicnodewss"); - - migrationBuilder.CreateIndex( - name: "IX_Nodes_ProviderName_NetworkId", - table: "Nodes", - columns: new[] { "ProviderName", "NetworkId" }, - unique: true); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220170359_UpdateBscTrainContract.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260220170359_UpdateBscTrainContract.Designer.cs deleted file mode 100644 index 9c6e2c71..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220170359_UpdateBscTrainContract.Designer.cs +++ /dev/null @@ -1,2151 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260220170359_UpdateBscTrainContract")] - partial class UpdateBscTrainContract - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220170359_UpdateBscTrainContract.cs b/csharp/src/Data.Npgsql/Migrations/20260220170359_UpdateBscTrainContract.cs deleted file mode 100644 index b0575aa9..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220170359_UpdateBscTrainContract.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateBscTrainContract : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 7, - column: "Address", - value: "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec"); - - migrationBuilder.UpdateData( - table: "Networks", - keyColumn: "Id", - keyValue: 4, - column: "GasConfiguration_IsEip1559", - value: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 7, - column: "Address", - value: "0x0000000000000000000000000000000000000000"); - - migrationBuilder.UpdateData( - table: "Networks", - keyColumn: "Id", - keyValue: 4, - column: "GasConfiguration_IsEip1559", - value: true); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220171607_AddAztecDevnetSeed.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260220171607_AddAztecDevnetSeed.Designer.cs deleted file mode 100644 index 03e58743..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220171607_AddAztecDevnetSeed.Designer.cs +++ /dev/null @@ -1,2310 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260220171607_AddAztecDevnetSeed")] - partial class AddAztecDevnetSeed - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x07fbdc90f60f474514ab79c99b50ef27b91ce594c168a38cb1dcadae3244f859", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 2, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x27c2fe00a408cff54626e561d4cc1b3d297ccdea700d422f7acfc25012f93cd9", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220171607_AddAztecDevnetSeed.cs b/csharp/src/Data.Npgsql/Migrations/20260220171607_AddAztecDevnetSeed.cs deleted file mode 100644 index cf0819b3..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220171607_AddAztecDevnetSeed.cs +++ /dev/null @@ -1,125 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddAztecDevnetSeed : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 5, - columns: new[] { "AddressLength", "NativeTokenAddress" }, - values: new object[] { 32, "0x0000000000000000000000000000000000000000000000000000000000000000" }); - - migrationBuilder.InsertData( - table: "Networks", - columns: new[] { "Id", "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", "GasConfiguration_L1FeeOracleContract", "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", "ChainId", "DisplayName", "NetworkTypeId", "Slug", "RewardConfiguration_DeltaPercentage", "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" }, - values: new object[] { 5, 0, false, false, null, 0, 0, false, "0", "0", "0", "0", "aztec-devnet", "Aztec Devnet", 5, "aztec-devnet", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 1, 0, 300 }); - - migrationBuilder.InsertData( - table: "Wallets", - columns: new[] { "Id", "Address", "Name", "NetworkTypeId", "SignerAgentId" }, - values: new object[] { 2, "0x27c2fe00a408cff54626e561d4cc1b3d297ccdea700d422f7acfc25012f93cd9", "AztecMain", 5, 1 }); - - migrationBuilder.InsertData( - table: "Contracts", - columns: new[] { "Id", "Address", "NetworkId", "Type" }, - values: new object[] { 9, "0x07fbdc90f60f474514ab79c99b50ef27b91ce594c168a38cb1dcadae3244f859", 5, "Train" }); - - migrationBuilder.InsertData( - table: "EventListenerConfigs", - columns: new[] { "Id", "CatchUpGapThreshold", "Enabled", "ListenerType", "NetworkId", "Settings" }, - values: new object[] { 10, 0, true, "rpc-log-event-listener", 5, "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}" }); - - migrationBuilder.InsertData( - table: "Nodes", - columns: new[] { "Id", "NetworkId", "Protocol", "ProviderName", "Url" }, - values: new object[] { 8, 5, 0, "aztec", "https://v4-devnet-2.aztec-labs.com" }); - - migrationBuilder.InsertData( - table: "Tokens", - columns: new[] { "Id", "ContractAddress", "Decimals", "NetworkId", "Symbol", "TokenPriceId" }, - values: new object[] { 5, "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b", 18, 5, "ETH", 1 }); - - migrationBuilder.InsertData( - table: "Routes", - columns: new[] { "Id", "DestinationTokenId", "DestinationWalletId", "MaxAmountInSource", "MinAmountInSource", "RateProviderId", "ServiceFeeId", "SourceTokenId", "SourceWalletId", "Status" }, - values: new object[,] - { - { 13, 1, 1, "5000000000000000", "100000000000", 1, 1, 5, 2, 0 }, - { 14, 5, 2, "5000000000000000", "100000000000", 1, 1, 1, 1, 0 }, - { 15, 2, 1, "5000000000000000", "100000000000", 1, 1, 5, 2, 0 }, - { 16, 5, 2, "5000000000000000", "100000000000", 1, 1, 2, 1, 0 } - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9); - - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 10); - - migrationBuilder.DeleteData( - table: "Nodes", - keyColumn: "Id", - keyValue: 8); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 13); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 14); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 15); - - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 16); - - migrationBuilder.DeleteData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5); - - migrationBuilder.DeleteData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2); - - migrationBuilder.DeleteData( - table: "Networks", - keyColumn: "Id", - keyValue: 5); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 5, - columns: new[] { "AddressLength", "NativeTokenAddress" }, - values: new object[] { 20, "0x0000000000000000000000000000000000000000" }); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220183102_AddTokenPriceRateProvider.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260220183102_AddTokenPriceRateProvider.Designer.cs deleted file mode 100644 index 6b751a1c..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220183102_AddTokenPriceRateProvider.Designer.cs +++ /dev/null @@ -1,2158 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260220183102_AddTokenPriceRateProvider")] - partial class AddTokenPriceRateProvider - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260220183102_AddTokenPriceRateProvider.cs b/csharp/src/Data.Npgsql/Migrations/20260220183102_AddTokenPriceRateProvider.cs deleted file mode 100644 index 5c83dac3..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260220183102_AddTokenPriceRateProvider.cs +++ /dev/null @@ -1,112 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddTokenPriceRateProvider : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "RateProviders", - columns: new[] { "Id", "Name" }, - values: new object[] { 3, "TokenPrice" }); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 7, - column: "RateProviderId", - value: 3); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 8, - column: "RateProviderId", - value: 3); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 9, - column: "RateProviderId", - value: 3); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 10, - column: "RateProviderId", - value: 3); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 11, - column: "RateProviderId", - value: 3); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 12, - column: "RateProviderId", - value: 3); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "RateProviders", - keyColumn: "Id", - keyValue: 3); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 7, - column: "RateProviderId", - value: 2); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 8, - column: "RateProviderId", - value: 2); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 9, - column: "RateProviderId", - value: 2); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 10, - column: "RateProviderId", - value: 2); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 11, - column: "RateProviderId", - value: 2); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 12, - column: "RateProviderId", - value: 2); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260221002315_UpdateTransactionTypes.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260221002315_UpdateTransactionTypes.Designer.cs deleted file mode 100644 index 729c2b6a..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260221002315_UpdateTransactionTypes.Designer.cs +++ /dev/null @@ -1,2158 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260221002315_UpdateTransactionTypes")] - partial class UpdateTransactionTypes - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260221002315_UpdateTransactionTypes.cs b/csharp/src/Data.Npgsql/Migrations/20260221002315_UpdateTransactionTypes.cs deleted file mode 100644 index 209fd275..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260221002315_UpdateTransactionTypes.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateTransactionTypes : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Type", - table: "Transactions", - type: "integer", - nullable: false, - comment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7", - oldClrType: typeof(int), - oldType: "integer", - oldComment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Type", - table: "Transactions", - type: "integer", - nullable: false, - comment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5", - oldClrType: typeof(int), - oldType: "integer", - oldComment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260223132223_UpdateAztecTrainContract.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260223132223_UpdateAztecTrainContract.Designer.cs deleted file mode 100644 index d1e4daf2..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260223132223_UpdateAztecTrainContract.Designer.cs +++ /dev/null @@ -1,2317 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260223132223_UpdateAztecTrainContract")] - partial class UpdateAztecTrainContract - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x15a34dc03eeb4befb2b24d6970d85fe8d83e422009e756cff2ab4b93a92055d1", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x27c2fe00a408cff54626e561d4cc1b3d297ccdea700d422f7acfc25012f93cd9", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260223132223_UpdateAztecTrainContract.cs b/csharp/src/Data.Npgsql/Migrations/20260223132223_UpdateAztecTrainContract.cs deleted file mode 100644 index 00cea055..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260223132223_UpdateAztecTrainContract.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateAztecTrainContract : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x15a34dc03eeb4befb2b24d6970d85fe8d83e422009e756cff2ab4b93a92055d1"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x07fbdc90f60f474514ab79c99b50ef27b91ce594c168a38cb1dcadae3244f859"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260223150052_UpdateAztecTrainContractAddress.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260223150052_UpdateAztecTrainContractAddress.Designer.cs deleted file mode 100644 index 5e30cbb4..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260223150052_UpdateAztecTrainContractAddress.Designer.cs +++ /dev/null @@ -1,2317 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260223150052_UpdateAztecTrainContractAddress")] - partial class UpdateAztecTrainContractAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x27c2fe00a408cff54626e561d4cc1b3d297ccdea700d422f7acfc25012f93cd9", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260223150052_UpdateAztecTrainContractAddress.cs b/csharp/src/Data.Npgsql/Migrations/20260223150052_UpdateAztecTrainContractAddress.cs deleted file mode 100644 index 24e26e58..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260223150052_UpdateAztecTrainContractAddress.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateAztecTrainContractAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x15a34dc03eeb4befb2b24d6970d85fe8d83e422009e756cff2ab4b93a92055d1"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260224113038_UpdateAztecWalletAddress.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260224113038_UpdateAztecWalletAddress.Designer.cs deleted file mode 100644 index bac6e339..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260224113038_UpdateAztecWalletAddress.Designer.cs +++ /dev/null @@ -1,2317 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260224113038_UpdateAztecWalletAddress")] - partial class UpdateAztecWalletAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260224113038_UpdateAztecWalletAddress.cs b/csharp/src/Data.Npgsql/Migrations/20260224113038_UpdateAztecWalletAddress.cs deleted file mode 100644 index 2b708c58..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260224113038_UpdateAztecWalletAddress.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateAztecWalletAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Address", - value: "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Address", - value: "0x27c2fe00a408cff54626e561d4cc1b3d297ccdea700d422f7acfc25012f93cd9"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260224122247_UpdateAztecTokenAddress.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260224122247_UpdateAztecTokenAddress.Designer.cs deleted file mode 100644 index 555dd57d..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260224122247_UpdateAztecTokenAddress.Designer.cs +++ /dev/null @@ -1,2317 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260224122247_UpdateAztecTokenAddress")] - partial class UpdateAztecTokenAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("EventType") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastError") - .HasColumnType("text"); - - b.Property("NextRetryAt") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProcessedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("RetryCount") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Pending=0,Delivered=1,Failed=2"); - - b.Property("SubscriberId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("SubscriberId"); - - b.HasIndex("Status", "NextRetryAt"); - - b.ToTable("WebhookOutboxMessages"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookOutboxMessage", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", "Subscriber") - .WithMany("OutboxMessages") - .HasForeignKey("SubscriberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Subscriber"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Navigation("OutboxMessages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260224122247_UpdateAztecTokenAddress.cs b/csharp/src/Data.Npgsql/Migrations/20260224122247_UpdateAztecTokenAddress.cs deleted file mode 100644 index 67846056..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260224122247_UpdateAztecTokenAddress.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateAztecTokenAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5, - column: "ContractAddress", - value: "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5, - column: "ContractAddress", - value: "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260224150421_RemoveOutbox.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260224150421_RemoveOutbox.Designer.cs deleted file mode 100644 index 38d1a151..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260224150421_RemoveOutbox.Designer.cs +++ /dev/null @@ -1,2246 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260224150421_RemoveOutbox")] - partial class RemoveOutbox - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x15a34dc03eeb4befb2b24d6970d85fe8d83e422009e756cff2ab4b93a92055d1", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x04593cd209ec9cce4c2bf3af9003c262fbda9157d75788f47e45a14db57fac3b", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x27c2fe00a408cff54626e561d4cc1b3d297ccdea700d422f7acfc25012f93cd9", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260224150421_RemoveOutbox.cs b/csharp/src/Data.Npgsql/Migrations/20260224150421_RemoveOutbox.cs deleted file mode 100644 index 0dbd6085..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260224150421_RemoveOutbox.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class RemoveOutbox : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WebhookOutboxMessages"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "WebhookOutboxMessages", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SubscriberId = table.Column(type: "integer", nullable: false), - CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - EventType = table.Column(type: "text", nullable: false), - LastError = table.Column(type: "text", nullable: true), - NextRetryAt = table.Column(type: "timestamp with time zone", nullable: true), - Payload = table.Column(type: "text", nullable: false), - ProcessedAt = table.Column(type: "timestamp with time zone", nullable: true), - RetryCount = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "integer", nullable: false, comment: "Pending=0,Delivered=1,Failed=2"), - xmin = table.Column(type: "xid", rowVersion: true, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WebhookOutboxMessages", x => x.Id); - table.ForeignKey( - name: "FK_WebhookOutboxMessages_WebhookSubscribers_SubscriberId", - column: x => x.SubscriberId, - principalTable: "WebhookSubscribers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_WebhookOutboxMessages_Status_NextRetryAt", - table: "WebhookOutboxMessages", - columns: new[] { "Status", "NextRetryAt" }); - - migrationBuilder.CreateIndex( - name: "IX_WebhookOutboxMessages_SubscriberId", - table: "WebhookOutboxMessages", - column: "SubscriberId"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260225132806_AddAutoRefundOnRoute.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260225132806_AddAutoRefundOnRoute.Designer.cs deleted file mode 100644 index 5a573f9a..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260225132806_AddAutoRefundOnRoute.Designer.cs +++ /dev/null @@ -1,2265 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260225132806_AddAutoRefundOnRoute")] - partial class AddAutoRefundOnRoute - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260225132806_AddAutoRefundOnRoute.cs b/csharp/src/Data.Npgsql/Migrations/20260225132806_AddAutoRefundOnRoute.cs deleted file mode 100644 index 77900dc7..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260225132806_AddAutoRefundOnRoute.cs +++ /dev/null @@ -1,181 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddAutoRefundOnRoute : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Type", - table: "Transactions", - type: "integer", - nullable: false, - comment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8", - oldClrType: typeof(int), - oldType: "integer", - oldComment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7"); - - migrationBuilder.AddColumn( - name: "AutoRefundUser", - table: "Routes", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AlterColumn( - name: "Status", - table: "Orders", - type: "integer", - nullable: false, - comment: "Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10", - oldClrType: typeof(int), - oldType: "integer", - oldComment: "Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 1, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 2, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 3, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 4, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 5, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 6, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 7, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 8, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 9, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 10, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 11, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 12, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 13, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 14, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 15, - column: "AutoRefundUser", - value: false); - - migrationBuilder.UpdateData( - table: "Routes", - keyColumn: "Id", - keyValue: 16, - column: "AutoRefundUser", - value: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "AutoRefundUser", - table: "Routes"); - - migrationBuilder.AlterColumn( - name: "Type", - table: "Transactions", - type: "integer", - nullable: false, - comment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7", - oldClrType: typeof(int), - oldType: "integer", - oldComment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - migrationBuilder.AlterColumn( - name: "Status", - table: "Orders", - type: "integer", - nullable: false, - comment: "Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8", - oldClrType: typeof(int), - oldType: "integer", - oldComment: "Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226102931_AddWebhookSubEventTypes.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260226102931_AddWebhookSubEventTypes.Designer.cs deleted file mode 100644 index 4f664810..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226102931_AddWebhookSubEventTypes.Designer.cs +++ /dev/null @@ -1,2271 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260226102931_AddWebhookSubEventTypes")] - partial class AddWebhookSubEventTypes - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection>("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new List(), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226102931_AddWebhookSubEventTypes.cs b/csharp/src/Data.Npgsql/Migrations/20260226102931_AddWebhookSubEventTypes.cs deleted file mode 100644 index 00327596..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226102931_AddWebhookSubEventTypes.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddWebhookSubEventTypes : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "EventTypes", - table: "WebhookSubscribers", - type: "text[]", - nullable: false, - defaultValue: Array.Empty()); - - migrationBuilder.UpdateData( - table: "WebhookSubscribers", - keyColumn: "Id", - keyValue: 1, - column: "EventTypes", - value: new List()); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EventTypes", - table: "WebhookSubscribers"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226112156_AddStarknetSeed.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260226112156_AddStarknetSeed.Designer.cs deleted file mode 100644 index b0c242be..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226112156_AddStarknetSeed.Designer.cs +++ /dev/null @@ -1,2340 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260226112156_AddStarknetSeed")] - partial class AddStarknetSeed - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection>("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new List(), - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226112156_AddStarknetSeed.cs b/csharp/src/Data.Npgsql/Migrations/20260226112156_AddStarknetSeed.cs deleted file mode 100644 index fbeea65f..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226112156_AddStarknetSeed.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddStarknetSeed : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "Networks", - columns: new[] { "Id", "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", "GasConfiguration_L1FeeOracleContract", "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", "ChainId", "DisplayName", "NetworkTypeId", "Slug", "RewardConfiguration_DeltaPercentage", "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" }, - values: new object[] { 6, 0, false, false, null, 0, 0, false, "0", "0", "0", "0", "SN_SEPOLIA", "Starknet Sepolia", 3, "starknet-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 1, 0, 300 }); - - migrationBuilder.InsertData( - table: "Nodes", - columns: new[] { "Id", "NetworkId", "Protocol", "ProviderName", "Url" }, - values: new object[] { 9, 6, 0, "alchemy", "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ" }); - - migrationBuilder.InsertData( - table: "Tokens", - columns: new[] { "Id", "ContractAddress", "Decimals", "NetworkId", "Symbol", "TokenPriceId" }, - values: new object[] { 6, "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", 18, 6, "ETH", 1 }); - - migrationBuilder.UpdateData( - table: "WebhookSubscribers", - keyColumn: "Id", - keyValue: 1, - column: "EventTypes", - value: new string[0]); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Nodes", - keyColumn: "Id", - keyValue: 9); - - migrationBuilder.DeleteData( - table: "Tokens", - keyColumn: "Id", - keyValue: 6); - - migrationBuilder.DeleteData( - table: "Networks", - keyColumn: "Id", - keyValue: 6); - - migrationBuilder.UpdateData( - table: "WebhookSubscribers", - keyColumn: "Id", - keyValue: 1, - column: "EventTypes", - value: new List()); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226122207_UpdateStarknetNativeToken.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260226122207_UpdateStarknetNativeToken.Designer.cs deleted file mode 100644 index 5c6ab3e4..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226122207_UpdateStarknetNativeToken.Designer.cs +++ /dev/null @@ -1,2339 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260226122207_UpdateStarknetNativeToken")] - partial class UpdateStarknetNativeToken - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226122207_UpdateStarknetNativeToken.cs b/csharp/src/Data.Npgsql/Migrations/20260226122207_UpdateStarknetNativeToken.cs deleted file mode 100644 index f2fd5eba..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226122207_UpdateStarknetNativeToken.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateStarknetNativeToken : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 3, - column: "NativeTokenAddress", - value: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"); - - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 6, - columns: new[] { "ContractAddress", "Symbol" }, - values: new object[] { "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "STRK" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 3, - column: "NativeTokenAddress", - value: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"); - - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 6, - columns: new[] { "ContractAddress", "Symbol" }, - values: new object[] { "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "ETH" }); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226162720_UpdateAztecContracts.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260226162720_UpdateAztecContracts.Designer.cs deleted file mode 100644 index 56710e42..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226162720_UpdateAztecContracts.Designer.cs +++ /dev/null @@ -1,2339 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260226162720_UpdateAztecContracts")] - partial class UpdateAztecContracts - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260226162720_UpdateAztecContracts.cs b/csharp/src/Data.Npgsql/Migrations/20260226162720_UpdateAztecContracts.cs deleted file mode 100644 index 1d755804..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260226162720_UpdateAztecContracts.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateAztecContracts : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260227160145_AddTronSeed.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260227160145_AddTronSeed.Designer.cs deleted file mode 100644 index b1ff51ee..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260227160145_AddTronSeed.Designer.cs +++ /dev/null @@ -1,2430 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260227160145_AddTronSeed")] - partial class AddTronSeed - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260227160145_AddTronSeed.cs b/csharp/src/Data.Npgsql/Migrations/20260227160145_AddTronSeed.cs deleted file mode 100644 index 73f770bd..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260227160145_AddTronSeed.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddTronSeed : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "NetworkTypes", - columns: new[] { "Id", "AddressFormat", "AddressLength", "Curve", "DisplayName", "Name", "NativeTokenAddress" }, - values: new object[] { 6, "hex", 20, "secp256k1", "Tron", "tron", "0x0000000000000000000000000000000000000000" }); - - migrationBuilder.InsertData( - table: "TokenPrices", - columns: new[] { "Id", "ExternalId", "LastUpdated", "PriceInUsd", "Symbol" }, - values: new object[] { 4, "TRXUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 0.25m, "TRX" }); - - migrationBuilder.InsertData( - table: "Networks", - columns: new[] { "Id", "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", "GasConfiguration_L1FeeOracleContract", "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", "ChainId", "DisplayName", "NetworkTypeId", "Slug", "RewardConfiguration_DeltaPercentage", "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" }, - values: new object[] { 7, 0, false, false, null, 0, 0, false, "0", "0", "10000000", "0", "3448148188", "Tron Nile Testnet", 6, "tron-nile", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 5, 0, 90 }); - - migrationBuilder.InsertData( - table: "Nodes", - columns: new[] { "Id", "NetworkId", "Protocol", "ProviderName", "Url" }, - values: new object[] { 10, 7, 0, "alchemy", "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ" }); - - migrationBuilder.InsertData( - table: "Tokens", - columns: new[] { "Id", "ContractAddress", "Decimals", "NetworkId", "Symbol", "TokenPriceId" }, - values: new object[] { 7, "0x0000000000000000000000000000000000000000", 6, 7, "TRX", 4 }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Nodes", - keyColumn: "Id", - keyValue: 10); - - migrationBuilder.DeleteData( - table: "Tokens", - keyColumn: "Id", - keyValue: 7); - - migrationBuilder.DeleteData( - table: "Networks", - keyColumn: "Id", - keyValue: 7); - - migrationBuilder.DeleteData( - table: "TokenPrices", - keyColumn: "Id", - keyValue: 4); - - migrationBuilder.DeleteData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 6); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260302103204_AddTronTrainContract.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260302103204_AddTronTrainContract.Designer.cs deleted file mode 100644 index d0a5c5fc..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260302103204_AddTronTrainContract.Designer.cs +++ /dev/null @@ -1,2439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260302103204_AddTronTrainContract")] - partial class AddTronTrainContract - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x232b967fa55f8d71f1c0e7223cbca3269828d1c273f66de67924e3deb0e19416", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260302103204_AddTronTrainContract.cs b/csharp/src/Data.Npgsql/Migrations/20260302103204_AddTronTrainContract.cs deleted file mode 100644 index 71d66506..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260302103204_AddTronTrainContract.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddTronTrainContract : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "Contracts", - columns: new[] { "Id", "Address", "NetworkId", "Type" }, - values: new object[] { 10, "0x1d7fd349c411467f17d293608462dc0b8529082d", 7, "Train" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Contracts", - keyColumn: "Id", - keyValue: 10); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260303094854_UpdatingTrainContractsForAztec.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260303094854_UpdatingTrainContractsForAztec.Designer.cs deleted file mode 100644 index 864081a6..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260303094854_UpdatingTrainContractsForAztec.Designer.cs +++ /dev/null @@ -1,2439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260303094854_UpdatingTrainContractsForAztec")] - partial class UpdatingTrainContractsForAztec - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x27a055c07cf0149068f3acff87a31c9cbd019a810d3f6f49d068c323bc506719", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260303094854_UpdatingTrainContractsForAztec.cs b/csharp/src/Data.Npgsql/Migrations/20260303094854_UpdatingTrainContractsForAztec.cs deleted file mode 100644 index 96cbb1ad..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260303094854_UpdatingTrainContractsForAztec.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdatingTrainContractsForAztec : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x27a055c07cf0149068f3acff87a31c9cbd019a810d3f6f49d068c323bc506719"); - - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5, - column: "ContractAddress", - value: "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8"); - - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Address", - value: "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x303637a2c303913af7faa27a93d210e987ae22ec9a27a603c6b509dad2b46e3e"); - - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5, - column: "ContractAddress", - value: "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056"); - - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Address", - value: "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260303100447_UpdateTrainContractsForAztec.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260303100447_UpdateTrainContractsForAztec.Designer.cs deleted file mode 100644 index e01083f1..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260303100447_UpdateTrainContractsForAztec.Designer.cs +++ /dev/null @@ -1,2439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260303100447_UpdateTrainContractsForAztec")] - partial class UpdateTrainContractsForAztec - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x303637a2c303913af7faa27a93d210e987ae22ec9a27a603c6b509dad2b46e3e", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260303100447_UpdateTrainContractsForAztec.cs b/csharp/src/Data.Npgsql/Migrations/20260303100447_UpdateTrainContractsForAztec.cs deleted file mode 100644 index 2fa6c568..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260303100447_UpdateTrainContractsForAztec.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateTrainContractsForAztec : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x303637a2c303913af7faa27a93d210e987ae22ec9a27a603c6b509dad2b46e3e"); - - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5, - column: "ContractAddress", - value: "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056"); - - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Address", - value: "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x27a055c07cf0149068f3acff87a31c9cbd019a810d3f6f49d068c323bc506719"); - - migrationBuilder.UpdateData( - table: "Tokens", - keyColumn: "Id", - keyValue: 5, - column: "ContractAddress", - value: "0x0eef1d0fec94130a3f183a626c05be6b50e57dac96f1a492cf83c581890530e8"); - - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Address", - value: "0x152c13a88908252313ab1e526bb9c7d14e63a8cb5fcde3b3247c7ce25c02e9ba"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260303104411_UpdateTrainAztecContract.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260303104411_UpdateTrainAztecContract.Designer.cs deleted file mode 100644 index 7a509fbf..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260303104411_UpdateTrainAztecContract.Designer.cs +++ /dev/null @@ -1,2439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260303104411_UpdateTrainAztecContract")] - partial class UpdateTrainAztecContract - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x27a055c07cf0149068f3acff87a31c9cbd019a810d3f6f49d068c323bc506719", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260303104411_UpdateTrainAztecContract.cs b/csharp/src/Data.Npgsql/Migrations/20260303104411_UpdateTrainAztecContract.cs deleted file mode 100644 index 2195886a..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260303104411_UpdateTrainAztecContract.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateTrainAztecContract : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x27a055c07cf0149068f3acff87a31c9cbd019a810d3f6f49d068c323bc506719"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x303637a2c303913af7faa27a93d210e987ae22ec9a27a603c6b509dad2b46e3e"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260304085706_UpdateAztecContract.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260304085706_UpdateAztecContract.Designer.cs deleted file mode 100644 index 183e9b00..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260304085706_UpdateAztecContract.Designer.cs +++ /dev/null @@ -1,2439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260304085706_UpdateAztecContract")] - partial class UpdateAztecContract - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260304085706_UpdateAztecContract.cs b/csharp/src/Data.Npgsql/Migrations/20260304085706_UpdateAztecContract.cs deleted file mode 100644 index 478fd92a..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260304085706_UpdateAztecContract.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class UpdateAztecContract : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Contracts", - keyColumn: "Id", - keyValue: 9, - column: "Address", - value: "0x27a055c07cf0149068f3acff87a31c9cbd019a810d3f6f49d068c323bc506719"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260304204847_AddSolanaDevnetSeed.cs b/csharp/src/Data.Npgsql/Migrations/20260304204847_AddSolanaDevnetSeed.cs deleted file mode 100644 index abc712a2..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260304204847_AddSolanaDevnetSeed.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddSolanaDevnetSeed : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - // Use ON CONFLICT DO NOTHING since some rows may already exist from manual setup - migrationBuilder.Sql(""" - INSERT INTO "TokenPrices" ("Id", "ExternalId", "LastUpdated", "PriceInUsd", "Symbol") - VALUES (3, 'SOLUSDT', '2025-01-01 00:00:00+00', 140.0, 'SOL') - ON CONFLICT ("Id") DO NOTHING; - """); - - migrationBuilder.Sql(""" - INSERT INTO "Networks" ( - "Id", "ChainId", "DisplayName", "NetworkTypeId", "Slug", - "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", - "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", - "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", - "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", - "RewardConfiguration_DeltaPercentage", - "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", - "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", - "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", - "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", - "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" - ) VALUES ( - 8, 'devnet', 'Solana Devnet', 2, 'solana-devnet', - 0, FALSE, FALSE, 0, 0, - FALSE, '0', '0', '10000000', '0', - 10.0, - 900, 1800, 3600, 7200, - 5, 0, 10, 0, 120 - ) ON CONFLICT ("Id") DO NOTHING; - """); - - migrationBuilder.Sql(""" - INSERT INTO "Wallets" ("Id", "Address", "Name", "NetworkTypeId", "SignerAgentId") - VALUES (3, '9ivTbFdPJRg4bgYdUzvf2eXdb6JDhv4iKFL1wTrDwKTf', 'SolanaMain', 2, 1) - ON CONFLICT ("Id") DO NOTHING; - """); - - migrationBuilder.Sql(""" - INSERT INTO "EventListenerConfigs" ("Id", "CatchUpGapThreshold", "Enabled", "ListenerType", "NetworkId", "Settings") - VALUES (11, 0, TRUE, 'rpc-log-event-listener', 8, '{"PollingIntervalSeconds":"5"}') - ON CONFLICT ("Id") DO NOTHING; - """); - - migrationBuilder.Sql(""" - INSERT INTO "Nodes" ("Id", "NetworkId", "Protocol", "ProviderName", "Url") - VALUES (11, 8, 0, 'solana', 'https://api.devnet.solana.com') - ON CONFLICT ("Id") DO NOTHING; - """); - - migrationBuilder.Sql(""" - INSERT INTO "Tokens" ("Id", "ContractAddress", "Decimals", "NetworkId", "Symbol", "TokenPriceId") - VALUES (8, '11111111111111111111111111111111', 9, 8, 'SOL', 3) - ON CONFLICT ("Id") DO NOTHING; - """); - - // Solana <-> EVM routes (TokenPrice rate provider) - migrationBuilder.Sql(""" - INSERT INTO "Routes" ("Id", "SourceTokenId", "DestinationTokenId", "SourceWalletId", "DestinationWalletId", "RateProviderId", "ServiceFeeId", "MinAmountInSource", "MaxAmountInSource", "Status", "AutoRefundUser") - VALUES (17, 8, 1, 3, 1, 3, 1, '1000000', '50000000000', 0, FALSE) - ON CONFLICT ("Id") DO NOTHING; - """); - migrationBuilder.Sql(""" - INSERT INTO "Routes" ("Id", "SourceTokenId", "DestinationTokenId", "SourceWalletId", "DestinationWalletId", "RateProviderId", "ServiceFeeId", "MinAmountInSource", "MaxAmountInSource", "Status", "AutoRefundUser") - VALUES (18, 1, 8, 1, 3, 3, 1, '100000000000', '5000000000000000', 0, FALSE) - ON CONFLICT ("Id") DO NOTHING; - """); - migrationBuilder.Sql(""" - INSERT INTO "Routes" ("Id", "SourceTokenId", "DestinationTokenId", "SourceWalletId", "DestinationWalletId", "RateProviderId", "ServiceFeeId", "MinAmountInSource", "MaxAmountInSource", "Status", "AutoRefundUser") - VALUES (19, 8, 2, 3, 1, 3, 1, '1000000', '50000000000', 0, FALSE) - ON CONFLICT ("Id") DO NOTHING; - """); - migrationBuilder.Sql(""" - INSERT INTO "Routes" ("Id", "SourceTokenId", "DestinationTokenId", "SourceWalletId", "DestinationWalletId", "RateProviderId", "ServiceFeeId", "MinAmountInSource", "MaxAmountInSource", "Status", "AutoRefundUser") - VALUES (20, 2, 8, 1, 3, 3, 1, '100000000000', '5000000000000000', 0, FALSE) - ON CONFLICT ("Id") DO NOTHING; - """); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 17); - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 18); - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 19); - migrationBuilder.DeleteData( - table: "Routes", - keyColumn: "Id", - keyValue: 20); - - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 11); - - migrationBuilder.DeleteData( - table: "Nodes", - keyColumn: "Id", - keyValue: 11); - - migrationBuilder.DeleteData( - table: "Tokens", - keyColumn: "Id", - keyValue: 8); - - migrationBuilder.DeleteData( - table: "Wallets", - keyColumn: "Id", - keyValue: 3); - - migrationBuilder.DeleteData( - table: "Networks", - keyColumn: "Id", - keyValue: 8); - - migrationBuilder.DeleteData( - table: "TokenPrices", - keyColumn: "Id", - keyValue: 3); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260306112331_AddStarknetTrainContract.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260306112331_AddStarknetTrainContract.Designer.cs deleted file mode 100644 index e38c8007..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260306112331_AddStarknetTrainContract.Designer.cs +++ /dev/null @@ -1,2459 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260306112331_AddStarknetTrainContract")] - partial class AddStarknetTrainContract - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }, - new - { - Id = 11, - Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 11, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 6, - Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260306112331_AddStarknetTrainContract.cs b/csharp/src/Data.Npgsql/Migrations/20260306112331_AddStarknetTrainContract.cs deleted file mode 100644 index 0adf5d7c..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260306112331_AddStarknetTrainContract.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddStarknetTrainContract : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "Contracts", - columns: new[] { "Id", "Address", "NetworkId", "Type" }, - values: new object[] { 11, "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", 6, "Train" }); - - migrationBuilder.InsertData( - table: "EventListenerConfigs", - columns: new[] { "Id", "CatchUpGapThreshold", "Enabled", "ListenerType", "NetworkId", "Settings" }, - values: new object[] { 11, 0, true, "rpc-log-event-listener", 6, "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "Contracts", - keyColumn: "Id", - keyValue: 11); - - migrationBuilder.DeleteData( - table: "EventListenerConfigs", - keyColumn: "Id", - keyValue: 11); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260306152954_AddWalletStatus.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260306152954_AddWalletStatus.Designer.cs deleted file mode 100644 index 59868065..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260306152954_AddWalletStatus.Designer.cs +++ /dev/null @@ -1,2474 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Train.Solver.Data.Npgsql; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - [DbContext(typeof(SolverDbContext))] - [Migration("20260306152954_AddWalletStatus")] - partial class AddWalletStatus - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("Type", "NetworkId") - .IsUnique(); - - b.ToTable("Contracts"); - - b.HasData( - new - { - Id = 1, - Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Train", - Version = 0u - }, - new - { - Id = 3, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 2, - Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Train", - Version = 0u - }, - new - { - Id = 4, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 5, - Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Train", - Version = 0u - }, - new - { - Id = 6, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 7, - Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Train", - Version = 0u - }, - new - { - Id = 8, - Address = "0xcA11bde05977b3631167028862bE2a173976CA11", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Type = "Multicall", - Version = 0u - }, - new - { - Id = 9, - Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Type = "Train", - Version = 0u - }, - new - { - Id = 10, - Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Type = "Train", - Version = 0u - }, - new - { - Id = 11, - Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Type = "Train", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CatchUpGapThreshold") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("ListenerType") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Settings") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("jsonb") - .HasDefaultValueSql("'{}'::jsonb"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "ListenerType"); - - b.ToTable("EventListenerConfigs"); - - b.HasData( - new - { - Id = 1, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 1, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 2, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 3, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 2, - Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 4, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", - Version = 0u - }, - new - { - Id = 5, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 3, - Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", - Version = 0u - }, - new - { - Id = 6, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 1, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 7, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "mempool-event-listener", - NetworkId = 2, - Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", - Version = 0u - }, - new - { - Id = 8, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 4, - Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 9, - CatchUpGapThreshold = 100, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "websocket-event-listener", - NetworkId = 4, - Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", - Version = 0u - }, - new - { - Id = 10, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 5, - Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }, - new - { - Id = 11, - CatchUpGapThreshold = 0, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, - ListenerType = "rpc-log-event-listener", - NetworkId = 6, - Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( - new - { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" - }, - new - { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" - }, - new - { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" - }, - new - { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" - }, - new - { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" - }, - new - { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" - }, - new - { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequiresWalletActivation") - .HasColumnType("boolean"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - RequiresWalletActivation = false, - Version = 0u - }, - new - { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - RequiresWalletActivation = false, - Version = 0u - }, - new - { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - RequiresWalletActivation = true, - Version = 0u - }, - new - { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - RequiresWalletActivation = false, - Version = 0u - }, - new - { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - RequiresWalletActivation = true, - Version = 0u - }, - new - { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - RequiresWalletActivation = false, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 5, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 6, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 7, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", - Version = 0u - }, - new - { - Id = 8, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", - Version = 0u - }, - new - { - Id = 9, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }, - new - { - Id = 10, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); - - b.Property("RouteId") - .HasColumnType("integer"); - - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("WorkflowId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") - .IsUnique(); - - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); - - b.ToTable("OrderMetrics"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("RateProviders"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", - Version = 0u - }, - new - { - Id = 3, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( - new - { - Id = 1, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 2, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 3, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 4, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 5, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 6, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 7, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 8, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 9, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 10, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 11, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 12, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 13, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 14, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, - Version = 0u - }, - new - { - Id = 15, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, - Version = 0u - }, - new - { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( - new - { - Id = 1, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 1, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 2, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 2, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 3, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, - Version = 0u - }, - new - { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 6, - Symbol = "STRK", - TokenPriceId = 1, - Version = 0u - }, - new - { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("ExternalId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LastUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("PriceInUsd") - .HasColumnType("numeric"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Symbol") - .IsUnique(); - - b.ToTable("TokenPrices"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "ETHUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 2000.0m, - Symbol = "ETH", - Version = 0u - }, - new - { - Id = 2, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "BNBUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 600.0m, - Symbol = "BNB", - Version = 0u - }, - new - { - Id = 4, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - ExternalId = "TRXUSDT", - LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - PriceInUsd = 0.25m, - Symbol = "TRX", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("OrderId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Completed=0,Initiated=1,Failed=2"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.Property("TransactionHash") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer") - .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("OrderId"); - - b.HasIndex("Status"); - - b.HasIndex("TransactionHash"); - - b.HasIndex("Type"); - - b.HasIndex("TransactionHash", "NetworkId") - .IsUnique(); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("TrustedWallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("SignerAgentId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Inactive=0,Activating=1,Active=2,Failed=3"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("SignerAgentId"); - - b.HasIndex("Address", "NetworkTypeId"); - - b.HasIndex("Name", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Status = 2, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Status = 2, - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.PrimitiveCollection("EventTypes") - .IsRequired() - .HasColumnType("text[]"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Contracts") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("EventListenerConfigs") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") - .WithMany("Networks") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("BaseFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("HasL1Fee") - .HasColumnType("boolean"); - - b1.Property("IsEip1559") - .HasColumnType("boolean"); - - b1.Property("L1FeeOracleContract") - .HasColumnType("text"); - - b1.Property("PriorityFeePercentageIncrease") - .HasColumnType("integer"); - - b1.Property("ReplacementFeePercentageIncrease") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 2, - BaseFeePercentageIncrease = 20, - HasL1Fee = false, - IsEip1559 = true, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 3, - BaseFeePercentageIncrease = 25, - HasL1Fee = true, - IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 4, - BaseFeePercentageIncrease = 25, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 10, - ReplacementFeePercentageIncrease = 15 - }, - new - { - NetworkId = 5, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 6, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }, - new - { - NetworkId = 7, - BaseFeePercentageIncrease = 0, - HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("AutoRebalanceEnabled") - .HasColumnType("boolean"); - - b1.Property("MaxBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinBalanceThreshold") - .IsRequired() - .HasColumnType("text"); - - b1.Property("MinGasBalance") - .IsRequired() - .HasColumnType("text"); - - b1.Property("TargetBalance") - .IsRequired() - .HasColumnType("text"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 2, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 3, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 4, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "100000000000000000", - TargetBalance = "0" - }, - new - { - NetworkId = 5, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 6, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "0", - TargetBalance = "0" - }, - new - { - NetworkId = 7, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - DeltaPercentage = 10m - }, - new - { - NetworkId = 2, - DeltaPercentage = 10m - }, - new - { - NetworkId = 3, - DeltaPercentage = 10m - }, - new - { - NetworkId = 4, - DeltaPercentage = 10m - }, - new - { - NetworkId = 5, - DeltaPercentage = 10m - }, - new - { - NetworkId = 6, - DeltaPercentage = 10m - }, - new - { - NetworkId = 7, - DeltaPercentage = 10m - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("QuoteExpiryInSeconds") - .HasColumnType("bigint"); - - b1.Property("RewardTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("SolverTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.Property("UserTimelockTimeSpanInSeconds") - .HasColumnType("bigint"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 2, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 3, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 4, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 5, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 6, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }, - new - { - NetworkId = 7, - QuoteExpiryInSeconds = 900L, - RewardTimelockTimeSpanInSeconds = 1800L, - SolverTimelockTimeSpanInSeconds = 3600L, - UserTimelockTimeSpanInSeconds = 7200L - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("ConfirmationPollingIntervalSeconds") - .HasColumnType("integer"); - - b1.Property("MaxGasBumpAttempts") - .HasColumnType("integer"); - - b1.Property("MaxInFlightTransactions") - .HasColumnType("integer"); - - b1.Property("RequiredConfirmations") - .HasColumnType("integer"); - - b1.Property("StuckTransactionTimeoutSeconds") - .HasColumnType("integer"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( - new - { - NetworkId = 1, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 2, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 3, - ConfirmationPollingIntervalSeconds = 1, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 10, - RequiredConfirmations = 1, - StuckTransactionTimeoutSeconds = 120 - }, - new - { - NetworkId = 4, - ConfirmationPollingIntervalSeconds = 3, - MaxGasBumpAttempts = 3, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 60 - }, - new - { - NetworkId = 5, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 6, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 1, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 300 - }, - new - { - NetworkId = 7, - ConfirmationPollingIntervalSeconds = 5, - MaxGasBumpAttempts = 0, - MaxInFlightTransactions = 5, - RequiredConfirmations = 0, - StuckTransactionTimeoutSeconds = 90 - }); - }); - - b.Navigation("GasConfiguration") - .IsRequired(); - - b.Navigation("LiquidityConfiguration") - .IsRequired(); - - b.Navigation("RewardConfiguration") - .IsRequired(); - - b.Navigation("TimelockConfiguration") - .IsRequired(); - - b.Navigation("TransactionProcessorConfiguration") - .IsRequired(); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Metadata") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Nodes") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Network"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") - .WithMany() - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany() - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") - .WithMany() - .HasForeignKey("DestinationTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") - .WithMany() - .HasForeignKey("DestinationWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") - .WithMany() - .HasForeignKey("RateProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") - .WithMany() - .HasForeignKey("ServiceFeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") - .WithMany() - .HasForeignKey("SourceTokenId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") - .WithMany() - .HasForeignKey("SourceWalletId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DestinationToken"); - - b.Navigation("DestinationWallet"); - - b.Navigation("RateProvider"); - - b.Navigation("ServiceFee"); - - b.Navigation("SourceToken"); - - b.Navigation("SourceWallet"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany("Tokens") - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") - .WithMany() - .HasForeignKey("TokenPriceId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Network"); - - b.Navigation("TokenPrice"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") - .WithMany() - .HasForeignKey("NetworkId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") - .WithMany("Transactions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Network"); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany() - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => - { - b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") - .WithMany("Wallets") - .HasForeignKey("NetworkTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") - .WithMany() - .HasForeignKey("SignerAgentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("NetworkType"); - - b.Navigation("SignerAgent"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Navigation("Contracts"); - - b.Navigation("EventListenerConfigs"); - - b.Navigation("Metadata"); - - b.Navigation("Nodes"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Navigation("Networks"); - - b.Navigation("Wallets"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => - { - b.Navigation("Transactions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260306152954_AddWalletStatus.cs b/csharp/src/Data.Npgsql/Migrations/20260306152954_AddWalletStatus.cs deleted file mode 100644 index 1573edc3..00000000 --- a/csharp/src/Data.Npgsql/Migrations/20260306152954_AddWalletStatus.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Train.Solver.Data.Npgsql.Migrations -{ - /// - public partial class AddWalletStatus : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Status", - table: "Wallets", - type: "integer", - nullable: false, - defaultValue: 0, - comment: "Inactive=0,Activating=1,Active=2,Failed=3"); - - migrationBuilder.AddColumn( - name: "RequiresWalletActivation", - table: "NetworkTypes", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 1, - column: "RequiresWalletActivation", - value: false); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 2, - column: "RequiresWalletActivation", - value: false); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 3, - column: "RequiresWalletActivation", - value: true); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 4, - column: "RequiresWalletActivation", - value: false); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 5, - column: "RequiresWalletActivation", - value: true); - - migrationBuilder.UpdateData( - table: "NetworkTypes", - keyColumn: "Id", - keyValue: 6, - column: "RequiresWalletActivation", - value: false); - - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 1, - column: "Status", - value: 2); - - migrationBuilder.UpdateData( - table: "Wallets", - keyColumn: "Id", - keyValue: 2, - column: "Status", - value: 2); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Status", - table: "Wallets"); - - migrationBuilder.DropColumn( - name: "RequiresWalletActivation", - table: "NetworkTypes"); - } - } -} diff --git a/csharp/src/Data.Npgsql/Migrations/20260304204847_AddSolanaDevnetSeed.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260311091702_Init.Designer.cs similarity index 51% rename from csharp/src/Data.Npgsql/Migrations/20260304204847_AddSolanaDevnetSeed.Designer.cs rename to csharp/src/Data.Npgsql/Migrations/20260311091702_Init.Designer.cs index 065e9836..eb5492ed 100644 --- a/csharp/src/Data.Npgsql/Migrations/20260304204847_AddSolanaDevnetSeed.Designer.cs +++ b/csharp/src/Data.Npgsql/Migrations/20260311091702_Init.Designer.cs @@ -12,15 +12,15 @@ namespace Train.Solver.Data.Npgsql.Migrations { [DbContext(typeof(SolverDbContext))] - [Migration("20260304204847_AddSolanaDevnetSeed")] - partial class AddSolanaDevnetSeed + [Migration("20260311091702_Init")] + partial class Init { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -154,6 +154,114 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NetworkId = 7, Type = "Train", Version = 0u + }, + new + { + Id = 11, + Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + Type = "Train", + Version = 0u + }, + new + { + Id = 12, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 13, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 14, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 15, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 16, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 17, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 18, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 19, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 20, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 21, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 22, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + Type = "Multicall", + Version = 0u }); }); @@ -319,443 +427,277 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Enabled = true, ListenerType = "rpc-log-event-listener", + NetworkId = 6, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 12, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", NetworkId = 8, Settings = "{\"PollingIntervalSeconds\":\"5\"}", Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( + }, new { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" + Id = 13, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 9, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u }, new { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" + Id = 14, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 9, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u }, new { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" + Id = 15, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 10, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u }, new { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" + Id = 16, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 10, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u }, new { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" + Id = 17, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 11, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u }, new { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" + Id = 18, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 11, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u }, new { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" + Id = 19, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 12, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u }, new { - Id = 8, - ChainId = "devnet", - DisplayName = "Solana Devnet", - NetworkTypeId = 2, - Slug = "solana-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, + Id = 20, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 12, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", Version = 0u }, new { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, + Id = 21, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 13, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", Version = 0u }, new { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, + Id = 22, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 13, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, + Id = 23, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 14, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, + Id = 24, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 14, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( - new - { - Id = 1, + Id = 25, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 15, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 2, + Id = 26, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 15, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 3, + Id = 27, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 16, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 4, + Id = 28, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 17, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 5, + Id = 29, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 17, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 6, + Id = 30, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 18, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", Version = 0u }, new { - Id = 7, + Id = 31, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 19, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 8, + Id = 32, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 21, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 9, + Id = 33, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 21, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 10, + Id = 34, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 22, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 11, + Id = 35, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 8, - Protocol = 0, - ProviderName = "solana", - Url = "https://api.devnet.solana.com", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 22, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }); }); - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -763,80 +705,287 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); + b.Property("ChainId") + .IsRequired() + .HasColumnType("text"); b.Property("CreatedDate") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("now()"); - b.Property("DestinationAddress") + b.Property("DisplayName") .IsRequired() .HasColumnType("text"); - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); + b.Property("IsTestnet") + .HasColumnType("boolean"); - b.Property("FailureReason") - .HasColumnType("text"); + b.Property("NetworkTypeId") + .HasColumnType("integer"); - b.Property("FeeAmount") + b.Property("Slug") .IsRequired() .HasColumnType("text"); - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); - b.Property("RouteId") - .HasColumnType("integer"); + b.HasKey("Id"); - b.Property("SolverLockIndex") - .HasColumnType("text"); + b.HasIndex("NetworkTypeId"); - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); + b.HasIndex("Slug") + .IsUnique(); - b.Property("SourceAddress") + b.HasIndex("ChainId", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Networks"); + + b.HasData( + new + { + Id = 1, + ChainId = "11155111", + DisplayName = "Ethereum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "eth-sepolia" + }, + new + { + Id = 2, + ChainId = "421614", + DisplayName = "Arbitrum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "arb-sepolia" + }, + new + { + Id = 3, + ChainId = "84532", + DisplayName = "Base Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "base-sepolia" + }, + new + { + Id = 4, + ChainId = "97", + DisplayName = "BSC Testnet", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "bsc-testnet" + }, + new + { + Id = 5, + ChainId = "aztec-devnet", + DisplayName = "Aztec Devnet", + IsTestnet = true, + NetworkTypeId = 5, + Slug = "aztec-devnet" + }, + new + { + Id = 6, + ChainId = "SN_SEPOLIA", + DisplayName = "Starknet Sepolia", + IsTestnet = true, + NetworkTypeId = 3, + Slug = "starknet-sepolia" + }, + new + { + Id = 7, + ChainId = "3448148188", + DisplayName = "Tron Nile Testnet", + IsTestnet = true, + NetworkTypeId = 6, + Slug = "tron-nile" + }, + new + { + Id = 8, + ChainId = "devnet", + DisplayName = "Solana Devnet", + IsTestnet = true, + NetworkTypeId = 2, + Slug = "solana-devnet" + }, + new + { + Id = 9, + ChainId = "1", + DisplayName = "Ethereum", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "ethereum" + }, + new + { + Id = 10, + ChainId = "42161", + DisplayName = "Arbitrum One", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "arbitrum" + }, + new + { + Id = 11, + ChainId = "8453", + DisplayName = "Base", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "base" + }, + new + { + Id = 12, + ChainId = "10", + DisplayName = "OP Mainnet", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "optimism" + }, + new + { + Id = 13, + ChainId = "137", + DisplayName = "Polygon", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "polygon" + }, + new + { + Id = 14, + ChainId = "56", + DisplayName = "BNB Smart Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "bsc" + }, + new + { + Id = 15, + ChainId = "43114", + DisplayName = "Avalanche C-Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "avalanche" + }, + new + { + Id = 16, + ChainId = "59144", + DisplayName = "Linea", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "linea" + }, + new + { + Id = 17, + ChainId = "534352", + DisplayName = "Scroll", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "scroll" + }, + new + { + Id = 18, + ChainId = "SN_MAIN", + DisplayName = "Starknet", + IsTestnet = false, + NetworkTypeId = 3, + Slug = "starknet" + }, + new + { + Id = 19, + ChainId = "mainnet-beta", + DisplayName = "Solana", + IsTestnet = false, + NetworkTypeId = 2, + Slug = "solana" + }, + new + { + Id = 20, + ChainId = "728126428", + DisplayName = "Tron", + IsTestnet = false, + NetworkTypeId = 6, + Slug = "tron" + }, + new + { + Id = 21, + ChainId = "324", + DisplayName = "ZKsync Era", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "zksync" + }, + new + { + Id = 22, + ChainId = "81457", + DisplayName = "Blast", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "blast" + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Key") .IsRequired() .HasColumnType("text"); - b.Property("SourceAmount") + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Value") .IsRequired() .HasColumnType("text"); - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - b.Property("Version") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("xid") .HasColumnName("xmin"); - b.Property("WorkflowId") - .HasColumnType("text"); - b.HasKey("Id"); - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") + b.HasIndex("NetworkId", "Key") .IsUnique(); - b.HasIndex("RouteId"); - - b.HasIndex("SourceAddress"); - - b.ToTable("Orders"); + b.ToTable("NetworkMetadata"); }); - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -844,35 +993,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - b.Property("CreatedDate") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("now()"); - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderId") + b.Property("NetworkId") .HasColumnType("integer"); - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") - .IsRequired() - .HasColumnType("text"); + b.Property("NodeProviderId") + .HasColumnType("integer"); b.Property("Version") .IsConcurrencyToken() @@ -880,23 +1010,17 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("xid") .HasColumnName("xmin"); - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - b.HasKey("Id"); - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); + b.HasIndex("NodeProviderId"); - b.HasIndex("SourceNetwork"); + b.HasIndex("NetworkId", "NodeProviderId") + .IsUnique(); - b.ToTable("OrderMetrics"); + b.ToTable("NetworkNodeProviders"); }); - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -904,15 +1028,37 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("AddressFormat") + .IsRequired() + .HasColumnType("text"); + + b.Property("AddressLength") + .HasColumnType("integer"); + b.Property("CreatedDate") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("now()"); + b.Property("Curve") + .IsRequired() + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + b.Property("Name") .IsRequired() .HasColumnType("text"); + b.Property("NativeTokenAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("RequiresWalletActivation") + .HasColumnType("boolean"); + b.Property("Version") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() @@ -924,589 +1070,1362 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("Name") .IsUnique(); - b.ToTable("RateProviders"); + b.ToTable("NetworkTypes"); b.HasData( new { Id = 1, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "EVM", + Name = "eip155", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 2, + AddressFormat = "base58", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "ed25519", + DisplayName = "Solana", + Name = "solana", + NativeTokenAddress = "11111111111111111111111111111111", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 3, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "stark", + DisplayName = "Starknet", + Name = "starknet", + NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 4, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Fuel", + Name = "fuel", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 5, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "grumpkin", + DisplayName = "Aztec", + Name = "aztec", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 6, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Tron", + Name = "tron", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Protocol") + .HasColumnType("integer"); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("ProviderName", "NetworkId", "Protocol") + .IsUnique(); + + b.ToTable("Nodes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKey") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NodeProviders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("FailureReason") + .HasColumnType("text"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hashlock") + .IsRequired() + .HasColumnType("text"); + + b.Property("RouteId") + .HasColumnType("integer"); + + b.Property("SolverLockIndex") + .HasColumnType("text"); + + b.Property("SolverLockTimelock") + .HasColumnType("bigint"); + + b.Property("SourceAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("WorkflowId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationAddress"); + + b.HasIndex("Hashlock") + .IsUnique(); + + b.HasIndex("RouteId"); + + b.HasIndex("SourceAddress"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletionTimeInSeconds") + .HasColumnType("double precision"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("ProfitInUsd") + .HasColumnType("numeric"); + + b.Property("SourceNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("VolumeInUsd") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationNetwork"); + + b.HasIndex("OrderId"); + + b.HasIndex("SourceNetwork"); + + b.ToTable("OrderMetrics"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("RateProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "SameAsset", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "TokenPrice", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoRefundUser") + .HasColumnType("boolean"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationTokenId") + .HasColumnType("integer"); + + b.Property("DestinationWalletId") + .HasColumnType("integer"); + + b.Property("MaxAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("MinAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("RateProviderId") + .HasColumnType("integer"); + + b.Property("ServiceFeeId") + .HasColumnType("integer"); + + b.Property("SourceTokenId") + .HasColumnType("integer"); + + b.Property("SourceWalletId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Active=0,Inactive=1,Archived=2"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("DestinationTokenId"); + + b.HasIndex("DestinationWalletId"); + + b.HasIndex("RateProviderId"); + + b.HasIndex("ServiceFeeId"); + + b.HasIndex("SourceWalletId"); + + b.HasIndex("SourceTokenId", "DestinationTokenId") + .IsUnique(); + + b.ToTable("Routes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeInUsd") + .HasColumnType("numeric"); + + b.Property("FeePercentage") + .HasColumnType("numeric"); + + b.Property("IncludeExpenseFee") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ServiceFees"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FeeInUsd = 0m, + FeePercentage = 0m, + IncludeExpenseFee = false, + Name = "Free", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SignerAgents"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContractAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Decimals") + .HasColumnType("integer"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenPriceId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("TokenPriceId"); + + b.HasIndex("NetworkId", "ContractAddress") + .IsUnique(); + + b.ToTable("Tokens"); + + b.HasData( + new + { + Id = 1, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 1, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 2, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 2, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 3, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 3, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 4, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 4, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 5, + ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 5, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 6, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 6, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 7, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 7, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 8, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 8, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 9, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 10, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 11, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 12, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 13, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "POL", + TokenPriceId = 5, + Version = 0u + }, + new + { + Id = 14, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 15, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "AVAX", + TokenPriceId = 6, + Version = 0u + }, + new + { + Id = 16, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 17, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 18, + ContractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 19, + ContractAddress = "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 20, + ContractAddress = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 21, + ContractAddress = "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 22, + ContractAddress = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 23, + ContractAddress = "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 24, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 25, + ContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 26, + ContractAddress = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 27, + ContractAddress = "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 28, + ContractAddress = "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 29, + ContractAddress = "0x55d398326f99059ff775485246999027b3197955", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 14, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 30, + ContractAddress = "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 31, + ContractAddress = "0xa219439258ca9da29e9cc4ce5596924745e12b93", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 32, + ContractAddress = "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 33, + ContractAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 34, + ContractAddress = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 35, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 36, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 37, + ContractAddress = "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", + Decimals = 18, + NetworkId = 13, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 2, + Id = 38, + ContractAddress = "0x2170ed0880ac9a755fd29b2688956bd959f933f8", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", + Decimals = 18, + NetworkId = 14, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 3, + Id = 39, + ContractAddress = "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", + Decimals = 18, + NetworkId = 15, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( + }, new { - Id = 1, - AutoRefundUser = false, + Id = 40, + ContractAddress = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 16, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 2, - AutoRefundUser = false, + Id = 41, + ContractAddress = "0x5300000000000000000000000000000000000004", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 17, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 3, - AutoRefundUser = false, + Id = 42, + ContractAddress = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 9, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 4, - AutoRefundUser = false, + Id = 43, + ContractAddress = "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 10, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 5, - AutoRefundUser = false, + Id = 44, + ContractAddress = "0x68f180fcce6836688e9084f035309e29bf0a2095", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 12, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 6, - AutoRefundUser = false, + Id = 45, + ContractAddress = "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 13, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 7, - AutoRefundUser = false, + Id = 46, + ContractAddress = "0x50b7545627a5162f82a992c33b87adc75187b218", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 15, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 8, - AutoRefundUser = false, + Id = 47, + ContractAddress = "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 16, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 9, - AutoRefundUser = false, + Id = 48, + ContractAddress = "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 17, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 10, - AutoRefundUser = false, + Id = 49, + ContractAddress = "0x6b175474e89094c44da98b954eedeac495271d0f", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 9, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 11, - AutoRefundUser = false, + Id = 50, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 10, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 12, - AutoRefundUser = false, + Id = 51, + ContractAddress = "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 11, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 13, - AutoRefundUser = false, + Id = 52, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, + Decimals = 18, + NetworkId = 12, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 14, - AutoRefundUser = false, + Id = 53, + ContractAddress = "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 13, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 15, - AutoRefundUser = false, + Id = 54, + ContractAddress = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, + Decimals = 18, + NetworkId = 14, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Id = 55, + ContractAddress = "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( + }, new { - Id = 1, + Id = 56, + ContractAddress = "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", + Decimals = 18, + NetworkId = 16, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( + }, new { - Id = 1, + Id = 57, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", + Decimals = 18, + NetworkId = 18, + Symbol = "STRK", + TokenPriceId = 9, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( + }, + new + { + Id = 58, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 19, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, new { - Id = 1, + Id = 59, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 20, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 60, ContractAddress = "0x0000000000000000000000000000000000000000", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 1, + NetworkId = 21, Symbol = "ETH", TokenPriceId = 1, Version = 0u }, new { - Id = 2, + Id = 61, ContractAddress = "0x0000000000000000000000000000000000000000", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 2, + NetworkId = 22, Symbol = "ETH", TokenPriceId = 1, Version = 0u }, new { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", + Id = 62, + ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 3, + NetworkId = 18, Symbol = "ETH", TokenPriceId = 1, Version = 0u }, new { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", + Id = 63, + ContractAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, + Decimals = 6, + NetworkId = 18, + Symbol = "USDC", + TokenPriceId = 7, Version = 0u }, new { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + Id = 64, + ContractAddress = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 65, + ContractAddress = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, + NetworkId = 14, + Symbol = "USDC", + TokenPriceId = 7, Version = 0u }, new { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + Id = 66, + ContractAddress = "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 67, + ContractAddress = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 68, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 69, + ContractAddress = "0x493257fd37edb34451f62edf8d2a0c418852ba4c", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 70, + ContractAddress = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 6, - Symbol = "STRK", + NetworkId = 21, + Symbol = "WETH", TokenPriceId = 1, Version = 0u }, new { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", + Id = 71, + ContractAddress = "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, + Decimals = 8, + NetworkId = 21, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 8, - ContractAddress = "11111111111111111111111111111111", + Id = 72, + ContractAddress = "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 9, - NetworkId = 8, - Symbol = "SOL", - TokenPriceId = 3, + Decimals = 18, + NetworkId = 21, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 73, + ContractAddress = "0x4300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }); }); @@ -1591,6 +2510,76 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) PriceInUsd = 0.25m, Symbol = "TRX", Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "POLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "POL", + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "AVAXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 35.0m, + Symbol = "AVAX", + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDC", + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDTUSD", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDT", + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "STRKUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "STRK", + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BTCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 60000.0m, + Symbol = "BTC", + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "DAIUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "DAI", + Version = 0u }); }); @@ -1725,6 +2714,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("SignerAgentId") .HasColumnType("integer"); + b.Property("Status") + .HasColumnType("integer") + .HasComment("Inactive=0,Activating=1,Active=2,Failed=3"); + b.Property("Version") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() @@ -1743,38 +2736,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsUnique(); b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Version = 0u - }, - new - { - Id = 3, - Address = "9ivTbFdPJRg4bgYdUzvf2eXdb6JDhv4iKFL1wTrDwKTf", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SolanaMain", - NetworkTypeId = 2, - SignerAgentId = 1, - Version = 0u - }); }); modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => @@ -1899,17 +2860,119 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b1.HasData( new { - NetworkId = 1, + NetworkId = 1, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 2, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 3, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 4, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 5, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 6, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 7, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 8, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 9, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 10, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 11, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 12, BaseFeePercentageIncrease = 25, - HasL1Fee = false, + HasL1Fee = true, IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { - NetworkId = 2, - BaseFeePercentageIncrease = 20, + NetworkId = 13, + BaseFeePercentageIncrease = 25, HasL1Fee = false, IsEip1559 = true, PriorityFeePercentageIncrease = 10, @@ -1917,26 +2980,44 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }, new { - NetworkId = 3, + NetworkId = 14, BaseFeePercentageIncrease = 25, - HasL1Fee = true, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 15, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { - NetworkId = 4, + NetworkId = 16, BaseFeePercentageIncrease = 25, HasL1Fee = false, - IsEip1559 = false, + IsEip1559 = true, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { - NetworkId = 5, + NetworkId = 17, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x5300000000000000000000000000000000000002", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 18, BaseFeePercentageIncrease = 0, HasL1Fee = false, IsEip1559 = false, @@ -1945,7 +3026,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }, new { - NetworkId = 6, + NetworkId = 19, BaseFeePercentageIncrease = 0, HasL1Fee = false, IsEip1559 = false, @@ -1954,7 +3035,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }, new { - NetworkId = 7, + NetworkId = 20, BaseFeePercentageIncrease = 0, HasL1Fee = false, IsEip1559 = false, @@ -1963,12 +3044,22 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }, new { - NetworkId = 8, - BaseFeePercentageIncrease = 0, + NetworkId = 21, + BaseFeePercentageIncrease = 25, HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 22, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 }); }); @@ -2069,69 +3160,265 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) }, new { - NetworkId = 8, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( + NetworkId = 8, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 9, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 10, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 11, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 12, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 13, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "1000000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 14, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 15, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 16, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 17, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 18, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 19, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 20, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 21, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 22, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("DeltaPercentage") + .HasColumnType("numeric"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + DeltaPercentage = 10m + }, + new + { + NetworkId = 2, + DeltaPercentage = 10m + }, + new + { + NetworkId = 3, + DeltaPercentage = 10m + }, + new + { + NetworkId = 4, + DeltaPercentage = 10m + }, + new + { + NetworkId = 5, + DeltaPercentage = 10m + }, + new + { + NetworkId = 6, + DeltaPercentage = 10m + }, + new + { + NetworkId = 7, + DeltaPercentage = 10m + }, + new + { + NetworkId = 8, + DeltaPercentage = 10m + }, + new + { + NetworkId = 9, + DeltaPercentage = 10m + }, + new + { + NetworkId = 10, + DeltaPercentage = 10m + }, + new + { + NetworkId = 11, + DeltaPercentage = 10m + }, + new + { + NetworkId = 12, + DeltaPercentage = 10m + }, + new + { + NetworkId = 13, + DeltaPercentage = 10m + }, + new + { + NetworkId = 14, + DeltaPercentage = 10m + }, new { - NetworkId = 1, + NetworkId = 15, DeltaPercentage = 10m }, new { - NetworkId = 2, + NetworkId = 16, DeltaPercentage = 10m }, new { - NetworkId = 3, + NetworkId = 17, DeltaPercentage = 10m }, new { - NetworkId = 4, + NetworkId = 18, DeltaPercentage = 10m }, new { - NetworkId = 5, + NetworkId = 19, DeltaPercentage = 10m }, new { - NetworkId = 6, + NetworkId = 20, DeltaPercentage = 10m }, new { - NetworkId = 7, + NetworkId = 21, DeltaPercentage = 10m }, new { - NetworkId = 8, + NetworkId = 22, DeltaPercentage = 10m }); }); @@ -2224,6 +3511,118 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) RewardTimelockTimeSpanInSeconds = 1800L, SolverTimelockTimeSpanInSeconds = 3600L, UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 9, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 10, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 11, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 12, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 13, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 14, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 15, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 16, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 17, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 18, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 19, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 20, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 21, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 22, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L }); }); @@ -2326,6 +3725,132 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) MaxInFlightTransactions = 10, RequiredConfirmations = 0, StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 9, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 10, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 11, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 12, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 13, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 14, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 15, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 16, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 17, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 18, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 19, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 20, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 21, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 22, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 }); }); @@ -2358,6 +3883,25 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Network"); }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.NodeProvider", "NodeProvider") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NodeProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("NodeProvider"); + }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => { b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") @@ -2517,6 +4061,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Metadata"); + b.Navigation("NetworkNodeProviders"); + b.Navigation("Nodes"); b.Navigation("Tokens"); @@ -2529,6 +4075,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Wallets"); }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Navigation("NetworkNodeProviders"); + }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => { b.Navigation("Transactions"); diff --git a/csharp/src/Data.Npgsql/Migrations/20260218175421_Initial.cs b/csharp/src/Data.Npgsql/Migrations/20260311091702_Init.cs similarity index 66% rename from csharp/src/Data.Npgsql/Migrations/20260218175421_Initial.cs rename to csharp/src/Data.Npgsql/Migrations/20260311091702_Init.cs index ec1a0815..278d59cd 100644 --- a/csharp/src/Data.Npgsql/Migrations/20260218175421_Initial.cs +++ b/csharp/src/Data.Npgsql/Migrations/20260311091702_Init.cs @@ -9,7 +9,7 @@ namespace Train.Solver.Data.Npgsql.Migrations { /// - public partial class Initial : Migration + public partial class Init : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -26,6 +26,7 @@ protected override void Up(MigrationBuilder migrationBuilder) AddressFormat = table.Column(type: "text", nullable: false), AddressLength = table.Column(type: "integer", nullable: false), Curve = table.Column(type: "text", nullable: false), + RequiresWalletActivation = table.Column(type: "boolean", nullable: false), CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), xmin = table.Column(type: "xid", rowVersion: true, nullable: false) }, @@ -34,6 +35,23 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_NetworkTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "NodeProviders", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false), + ApiKey = table.Column(type: "text", nullable: false), + Enabled = table.Column(type: "boolean", nullable: false), + CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), + xmin = table.Column(type: "xid", rowVersion: true, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_NodeProviders", x => x.Id); + }); + migrationBuilder.CreateTable( name: "RateProviders", columns: table => new @@ -111,6 +129,7 @@ protected override void Up(MigrationBuilder migrationBuilder) Url = table.Column(type: "text", nullable: false), Secret = table.Column(type: "text", nullable: false), IsActive = table.Column(type: "boolean", nullable: false), + EventTypes = table.Column(type: "text[]", nullable: false), CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), xmin = table.Column(type: "xid", rowVersion: true, nullable: false) }, @@ -150,6 +169,7 @@ protected override void Up(MigrationBuilder migrationBuilder) TransactionProcessorConfiguration_RequiredConfirmations = table.Column(type: "integer", nullable: false), RewardConfiguration_DeltaPercentage = table.Column(type: "numeric", nullable: false), ChainId = table.Column(type: "text", nullable: false), + IsTestnet = table.Column(type: "boolean", nullable: false), CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), xmin = table.Column(type: "xid", rowVersion: true, nullable: false) }, @@ -195,6 +215,7 @@ protected override void Up(MigrationBuilder migrationBuilder) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "text", nullable: false), Address = table.Column(type: "text", nullable: false), + Status = table.Column(type: "integer", nullable: false, comment: "Inactive=0,Activating=1,Active=2,Failed=3"), NetworkTypeId = table.Column(type: "integer", nullable: false), SignerAgentId = table.Column(type: "integer", nullable: false), CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), @@ -217,34 +238,6 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "WebhookOutboxMessages", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SubscriberId = table.Column(type: "integer", nullable: false), - EventType = table.Column(type: "text", nullable: false), - Payload = table.Column(type: "text", nullable: false), - Status = table.Column(type: "integer", nullable: false, comment: "Pending=0,Delivered=1,Failed=2"), - RetryCount = table.Column(type: "integer", nullable: false), - NextRetryAt = table.Column(type: "timestamp with time zone", nullable: true), - ProcessedAt = table.Column(type: "timestamp with time zone", nullable: true), - LastError = table.Column(type: "text", nullable: true), - CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - xmin = table.Column(type: "xid", rowVersion: true, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WebhookOutboxMessages", x => x.Id); - table.ForeignKey( - name: "FK_WebhookOutboxMessages_WebhookSubscribers_SubscriberId", - column: x => x.SubscriberId, - principalTable: "WebhookSubscribers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "Contracts", columns: table => new @@ -316,6 +309,34 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "NetworkNodeProviders", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + NetworkId = table.Column(type: "integer", nullable: false), + NodeProviderId = table.Column(type: "integer", nullable: false), + CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), + xmin = table.Column(type: "xid", rowVersion: true, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_NetworkNodeProviders", x => x.Id); + table.ForeignKey( + name: "FK_NetworkNodeProviders_Networks_NetworkId", + column: x => x.NetworkId, + principalTable: "Networks", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_NetworkNodeProviders_NodeProviders_NodeProviderId", + column: x => x.NodeProviderId, + principalTable: "NodeProviders", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Nodes", columns: table => new @@ -385,6 +406,7 @@ protected override void Up(MigrationBuilder migrationBuilder) RateProviderId = table.Column(type: "integer", nullable: false), ServiceFeeId = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false, comment: "Active=0,Inactive=1,Archived=2"), + AutoRefundUser = table.Column(type: "boolean", nullable: false), CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), xmin = table.Column(type: "xid", rowVersion: true, nullable: false) }, @@ -442,7 +464,7 @@ protected override void Up(MigrationBuilder migrationBuilder) SourceAmount = table.Column(type: "text", nullable: false), DestinationAmount = table.Column(type: "text", nullable: false), FeeAmount = table.Column(type: "text", nullable: false), - Status = table.Column(type: "integer", nullable: false, comment: "Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,Refunded=7,Failed=8"), + Status = table.Column(type: "integer", nullable: false, comment: "Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"), WorkflowId = table.Column(type: "text", nullable: true), FailureReason = table.Column(type: "text", nullable: true), CompletedDate = table.Column(type: "timestamp with time zone", nullable: true), @@ -500,7 +522,7 @@ protected override void Up(MigrationBuilder migrationBuilder) TransactionHash = table.Column(type: "text", nullable: false), Timestamp = table.Column(type: "timestamp with time zone", nullable: false), FeeAmount = table.Column(type: "text", nullable: false), - Type = table.Column(type: "integer", nullable: false, comment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5"), + Type = table.Column(type: "integer", nullable: false, comment: "Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"), Status = table.Column(type: "integer", nullable: false, comment: "Completed=0,Initiated=1,Failed=2"), OrderId = table.Column(type: "integer", nullable: true), CreatedDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), @@ -525,51 +547,83 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.InsertData( table: "NetworkTypes", - columns: new[] { "Id", "AddressFormat", "AddressLength", "Curve", "DisplayName", "Name", "NativeTokenAddress" }, + columns: new[] { "Id", "AddressFormat", "AddressLength", "Curve", "DisplayName", "Name", "NativeTokenAddress", "RequiresWalletActivation" }, values: new object[,] { - { 1, "hex", 20, "secp256k1", "EVM", "eip155", "0x0000000000000000000000000000000000000000" }, - { 2, "base58", 32, "ed25519", "Solana", "solana", "11111111111111111111111111111111" }, - { 3, "hex", 32, "stark", "Starknet", "starknet", "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" }, - { 4, "hex", 32, "secp256k1", "Fuel", "fuel", "0x0000000000000000000000000000000000000000000000000000000000000000" }, - { 5, "hex", 20, "grumpkin", "Aztec", "aztec", "0x0000000000000000000000000000000000000000" } + { 1, "hex", 20, "secp256k1", "EVM", "eip155", "0x0000000000000000000000000000000000000000", false }, + { 2, "base58", 32, "ed25519", "Solana", "solana", "11111111111111111111111111111111", false }, + { 3, "hex", 32, "stark", "Starknet", "starknet", "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", true }, + { 4, "hex", 32, "secp256k1", "Fuel", "fuel", "0x0000000000000000000000000000000000000000000000000000000000000000", false }, + { 5, "hex", 32, "grumpkin", "Aztec", "aztec", "0x0000000000000000000000000000000000000000000000000000000000000000", true }, + { 6, "hex", 20, "secp256k1", "Tron", "tron", "0x0000000000000000000000000000000000000000", false } }); migrationBuilder.InsertData( table: "RateProviders", columns: new[] { "Id", "Name" }, - values: new object[] { 1, "SameAsset" }); + values: new object[,] + { + { 1, "SameAsset" }, + { 2, "TokenPrice" } + }); migrationBuilder.InsertData( table: "ServiceFees", columns: new[] { "Id", "FeeInUsd", "FeePercentage", "IncludeExpenseFee", "Name" }, values: new object[] { 1, 0m, 0m, false, "Free" }); - migrationBuilder.InsertData( - table: "SignerAgents", - columns: new[] { "Id", "Name", "Url" }, - values: new object[] { 1, "Treasury", "http://localhost:3000" }); - migrationBuilder.InsertData( table: "TokenPrices", columns: new[] { "Id", "ExternalId", "LastUpdated", "PriceInUsd", "Symbol" }, - values: new object[] { 1, "ethereum", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 2000.0m, "ETH" }); + values: new object[,] + { + { 1, "ETHUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 2000.0m, "ETH" }, + { 2, "BNBUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 600.0m, "BNB" }, + { 3, "SOLUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 140.0m, "SOL" }, + { 4, "TRXUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 0.25m, "TRX" }, + { 5, "POLUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 0.50m, "POL" }, + { 6, "AVAXUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 35.0m, "AVAX" }, + { 7, "USDCUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 1.0m, "USDC" }, + { 8, "USDTUSD", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 1.0m, "USDT" }, + { 9, "STRKUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 0.50m, "STRK" }, + { 10, "BTCUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 60000.0m, "BTC" }, + { 11, "DAIUSDT", new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 1.0m, "DAI" } + }); + + migrationBuilder.InsertData( + table: "WebhookSubscribers", + columns: new[] { "Id", "EventTypes", "IsActive", "Name", "Secret", "Url" }, + values: new object[] { 1, new string[0], true, "station-api", "station-webhook-secret-1", "http://localhost:9690/api/v1/webhooks/plorex" }); migrationBuilder.InsertData( table: "Networks", - columns: new[] { "Id", "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", "GasConfiguration_L1FeeOracleContract", "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", "ChainId", "DisplayName", "NetworkTypeId", "Slug", "RewardConfiguration_DeltaPercentage", "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" }, + columns: new[] { "Id", "GasConfiguration_BaseFeePercentageIncrease", "GasConfiguration_HasL1Fee", "GasConfiguration_IsEip1559", "GasConfiguration_L1FeeOracleContract", "GasConfiguration_PriorityFeePercentageIncrease", "GasConfiguration_ReplacementFeePercentageIncrease", "LiquidityConfiguration_AutoRebalanceEnabled", "LiquidityConfiguration_MaxBalanceThreshold", "LiquidityConfiguration_MinBalanceThreshold", "LiquidityConfiguration_MinGasBalance", "LiquidityConfiguration_TargetBalance", "ChainId", "DisplayName", "IsTestnet", "NetworkTypeId", "Slug", "RewardConfiguration_DeltaPercentage", "TimelockConfiguration_QuoteExpiryInSeconds", "TimelockConfiguration_RewardTimelockTimeSpanInSeconds", "TimelockConfiguration_SolverTimelockTimeSpanInSeconds", "TimelockConfiguration_UserTimelockTimeSpanInSeconds", "TransactionProcessorConfiguration_ConfirmationPollingIntervalS~", "TransactionProcessorConfiguration_MaxGasBumpAttempts", "TransactionProcessorConfiguration_MaxInFlightTransactions", "TransactionProcessorConfiguration_RequiredConfirmations", "TransactionProcessorConfiguration_StuckTransactionTimeoutSecon~" }, values: new object[,] { - { 1, 25, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "11155111", "Ethereum Sepolia", 1, "eth-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 5, 0, 60 }, - { 2, 20, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "421614", "Arbitrum Sepolia", 1, "arb-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 1, 0, 60 }, - { 3, 25, true, true, "0x420000000000000000000000000000000000000F", 10, 15, false, "0", "0", "10000000000000000", "0", "84532", "Base Sepolia", 1, "base-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 10, 1, 120 } + { 1, 25, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "11155111", "Ethereum Sepolia", true, 1, "eth-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 5, 0, 60 }, + { 2, 20, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "421614", "Arbitrum Sepolia", true, 1, "arb-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 1, 0, 60 }, + { 3, 25, true, true, "0x420000000000000000000000000000000000000F", 10, 15, false, "0", "0", "10000000000000000", "0", "84532", "Base Sepolia", true, 1, "base-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 10, 1, 120 }, + { 4, 25, false, false, null, 10, 15, false, "0", "0", "100000000000000000", "0", "97", "BSC Testnet", true, 1, "bsc-testnet", 10m, 900L, 1800L, 3600L, 7200L, 3, 3, 5, 0, 60 }, + { 5, 0, false, false, null, 0, 0, false, "0", "0", "0", "0", "aztec-devnet", "Aztec Devnet", true, 5, "aztec-devnet", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 1, 0, 300 }, + { 6, 0, false, false, null, 0, 0, false, "0", "0", "0", "0", "SN_SEPOLIA", "Starknet Sepolia", true, 3, "starknet-sepolia", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 1, 0, 300 }, + { 7, 0, false, false, null, 0, 0, false, "0", "0", "10000000", "0", "3448148188", "Tron Nile Testnet", true, 6, "tron-nile", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 5, 0, 90 }, + { 8, 0, false, false, null, 0, 0, false, "0", "0", "10000000", "0", "devnet", "Solana Devnet", true, 2, "solana-devnet", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 10, 0, 120 }, + { 9, 25, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "1", "Ethereum", false, 1, "ethereum", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 }, + { 10, 20, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "42161", "Arbitrum One", false, 1, "arbitrum", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 5, 1, 60 }, + { 11, 25, true, true, "0x420000000000000000000000000000000000000F", 10, 15, false, "0", "0", "10000000000000000", "0", "8453", "Base", false, 1, "base", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 10, 1, 120 }, + { 12, 25, true, true, "0x420000000000000000000000000000000000000F", 10, 15, false, "0", "0", "10000000000000000", "0", "10", "OP Mainnet", false, 1, "optimism", 10m, 900L, 1800L, 3600L, 7200L, 1, 3, 10, 1, 120 }, + { 13, 25, false, true, null, 10, 15, false, "0", "0", "1000000000000000000", "0", "137", "Polygon", false, 1, "polygon", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 }, + { 14, 25, false, false, null, 10, 15, false, "0", "0", "100000000000000000", "0", "56", "BNB Smart Chain", false, 1, "bsc", 10m, 900L, 1800L, 3600L, 7200L, 3, 3, 5, 1, 60 }, + { 15, 25, false, true, null, 10, 15, false, "0", "0", "100000000000000000", "0", "43114", "Avalanche C-Chain", false, 1, "avalanche", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 }, + { 16, 25, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "59144", "Linea", false, 1, "linea", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 }, + { 17, 25, true, true, "0x5300000000000000000000000000000000000002", 10, 15, false, "0", "0", "10000000000000000", "0", "534352", "Scroll", false, 1, "scroll", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 }, + { 18, 0, false, false, null, 0, 0, false, "0", "0", "0", "0", "SN_MAIN", "Starknet", false, 3, "starknet", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 1, 0, 300 }, + { 19, 0, false, false, null, 0, 0, false, "0", "0", "10000000", "0", "mainnet-beta", "Solana", false, 2, "solana", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 10, 0, 120 }, + { 20, 0, false, false, null, 0, 0, false, "0", "0", "10000000", "0", "728126428", "Tron", false, 6, "tron", 10m, 900L, 1800L, 3600L, 7200L, 5, 0, 5, 0, 90 }, + { 21, 25, false, true, null, 10, 15, false, "0", "0", "10000000000000000", "0", "324", "ZKsync Era", false, 1, "zksync", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 }, + { 22, 25, true, true, "0x420000000000000000000000000000000000000F", 10, 15, false, "0", "0", "10000000000000000", "0", "81457", "Blast", false, 1, "blast", 10m, 900L, 1800L, 3600L, 7200L, 2, 3, 5, 1, 120 } }); - migrationBuilder.InsertData( - table: "Wallets", - columns: new[] { "Id", "Address", "Name", "NetworkTypeId", "SignerAgentId" }, - values: new object[] { 1, "0x32edfaa9157eda19a458373ddfb10464d2d39796", "Main", 1, 1 }); - migrationBuilder.InsertData( table: "Contracts", columns: new[] { "Id", "Address", "NetworkId", "Type" }, @@ -580,7 +634,23 @@ protected override void Up(MigrationBuilder migrationBuilder) { 3, "0xcA11bde05977b3631167028862bE2a173976CA11", 1, "Multicall" }, { 4, "0xcA11bde05977b3631167028862bE2a173976CA11", 2, "Multicall" }, { 5, "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", 3, "Train" }, - { 6, "0xcA11bde05977b3631167028862bE2a173976CA11", 3, "Multicall" } + { 6, "0xcA11bde05977b3631167028862bE2a173976CA11", 3, "Multicall" }, + { 7, "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", 4, "Train" }, + { 8, "0xcA11bde05977b3631167028862bE2a173976CA11", 4, "Multicall" }, + { 9, "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", 5, "Train" }, + { 10, "0x1d7fd349c411467f17d293608462dc0b8529082d", 7, "Train" }, + { 11, "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", 6, "Train" }, + { 12, "0xcA11bde05977b3631167028862bE2a173976CA11", 9, "Multicall" }, + { 13, "0xcA11bde05977b3631167028862bE2a173976CA11", 10, "Multicall" }, + { 14, "0xcA11bde05977b3631167028862bE2a173976CA11", 11, "Multicall" }, + { 15, "0xcA11bde05977b3631167028862bE2a173976CA11", 12, "Multicall" }, + { 16, "0xcA11bde05977b3631167028862bE2a173976CA11", 13, "Multicall" }, + { 17, "0xcA11bde05977b3631167028862bE2a173976CA11", 14, "Multicall" }, + { 18, "0xcA11bde05977b3631167028862bE2a173976CA11", 15, "Multicall" }, + { 19, "0xcA11bde05977b3631167028862bE2a173976CA11", 16, "Multicall" }, + { 20, "0xcA11bde05977b3631167028862bE2a173976CA11", 17, "Multicall" }, + { 21, "0xcA11bde05977b3631167028862bE2a173976CA11", 21, "Multicall" }, + { 22, "0xcA11bde05977b3631167028862bE2a173976CA11", 22, "Multicall" } }); migrationBuilder.InsertData( @@ -592,19 +662,37 @@ protected override void Up(MigrationBuilder migrationBuilder) { 2, 100, true, "websocket-event-listener", 1, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, { 3, 0, true, "rpc-log-event-listener", 2, "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, { 4, 0, true, "websocket-event-listener", 2, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}" }, - { 5, 0, true, "rpc-log-event-listener", 3, "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}" } - }); - - migrationBuilder.InsertData( - table: "Nodes", - columns: new[] { "Id", "NetworkId", "Protocol", "ProviderName", "Url" }, - values: new object[,] - { - { 1, 1, 0, "alchemy", "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ" }, - { 2, 2, 0, "alchemy", "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ" }, - { 3, 3, 0, "publicnode", "https://base-sepolia-rpc.publicnode.com" }, - { 4, 1, 1, "alchemywss", "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ" }, - { 5, 2, 1, "alchemywss", "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ" } + { 5, 0, true, "rpc-log-event-listener", 3, "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}" }, + { 6, 0, true, "mempool-event-listener", 1, "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}" }, + { 7, 0, true, "mempool-event-listener", 2, "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}" }, + { 8, 100, true, "rpc-log-event-listener", 4, "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, + { 9, 100, true, "websocket-event-listener", 4, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 10, 0, true, "rpc-log-event-listener", 5, "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}" }, + { 11, 0, true, "rpc-log-event-listener", 6, "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, + { 12, 0, true, "rpc-log-event-listener", 8, "{\"PollingIntervalSeconds\":\"5\"}" }, + { 13, 100, false, "rpc-log-event-listener", 9, "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}" }, + { 14, 100, false, "websocket-event-listener", 9, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 15, 0, false, "rpc-log-event-listener", 10, "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, + { 16, 0, false, "websocket-event-listener", 10, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}" }, + { 17, 100, false, "rpc-log-event-listener", 11, "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}" }, + { 18, 100, false, "websocket-event-listener", 11, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 19, 0, false, "rpc-log-event-listener", 12, "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, + { 20, 0, false, "websocket-event-listener", 12, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}" }, + { 21, 100, false, "rpc-log-event-listener", 13, "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}" }, + { 22, 100, false, "websocket-event-listener", 13, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 23, 100, false, "rpc-log-event-listener", 14, "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}" }, + { 24, 100, false, "websocket-event-listener", 14, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 25, 100, false, "rpc-log-event-listener", 15, "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}" }, + { 26, 100, false, "websocket-event-listener", 15, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 27, 100, false, "rpc-log-event-listener", 16, "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}" }, + { 28, 100, false, "rpc-log-event-listener", 17, "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}" }, + { 29, 100, false, "websocket-event-listener", 17, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 30, 0, false, "rpc-log-event-listener", 18, "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}" }, + { 31, 0, false, "rpc-log-event-listener", 19, "{\"PollingIntervalSeconds\":\"5\"}" }, + { 32, 100, false, "rpc-log-event-listener", 21, "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}" }, + { 33, 100, false, "websocket-event-listener", 21, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" }, + { 34, 100, false, "rpc-log-event-listener", 22, "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}" }, + { 35, 100, false, "websocket-event-listener", 22, "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}" } }); migrationBuilder.InsertData( @@ -614,20 +702,77 @@ protected override void Up(MigrationBuilder migrationBuilder) { { 1, "0x0000000000000000000000000000000000000000", 18, 1, "ETH", 1 }, { 2, "0x0000000000000000000000000000000000000000", 18, 2, "ETH", 1 }, - { 3, "0x0000000000000000000000000000000000000000", 18, 3, "ETH", 1 } - }); - - migrationBuilder.InsertData( - table: "Routes", - columns: new[] { "Id", "DestinationTokenId", "DestinationWalletId", "MaxAmountInSource", "MinAmountInSource", "RateProviderId", "ServiceFeeId", "SourceTokenId", "SourceWalletId", "Status" }, - values: new object[,] - { - { 1, 2, 1, "5000000000000000", "100000000000", 1, 1, 1, 1, 0 }, - { 2, 1, 1, "5000000000000000", "100000000000", 1, 1, 2, 1, 0 }, - { 3, 3, 1, "5000000000000000", "100000000000", 1, 1, 1, 1, 0 }, - { 4, 1, 1, "5000000000000000", "100000000000", 1, 1, 3, 1, 0 }, - { 5, 3, 1, "5000000000000000", "100000000000", 1, 1, 2, 1, 0 }, - { 6, 2, 1, "5000000000000000", "100000000000", 1, 1, 3, 1, 0 } + { 3, "0x0000000000000000000000000000000000000000", 18, 3, "ETH", 1 }, + { 4, "0x0000000000000000000000000000000000000000", 18, 4, "BNB", 2 }, + { 5, "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", 18, 5, "ETH", 1 }, + { 6, "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", 18, 6, "STRK", 9 }, + { 7, "0x0000000000000000000000000000000000000000", 6, 7, "TRX", 4 }, + { 8, "11111111111111111111111111111111", 9, 8, "SOL", 3 }, + { 9, "0x0000000000000000000000000000000000000000", 18, 9, "ETH", 1 }, + { 10, "0x0000000000000000000000000000000000000000", 18, 10, "ETH", 1 }, + { 11, "0x0000000000000000000000000000000000000000", 18, 11, "ETH", 1 }, + { 12, "0x0000000000000000000000000000000000000000", 18, 12, "ETH", 1 }, + { 13, "0x0000000000000000000000000000000000000000", 18, 13, "POL", 5 }, + { 14, "0x0000000000000000000000000000000000000000", 18, 14, "BNB", 2 }, + { 15, "0x0000000000000000000000000000000000000000", 18, 15, "AVAX", 6 }, + { 16, "0x0000000000000000000000000000000000000000", 18, 16, "ETH", 1 }, + { 17, "0x0000000000000000000000000000000000000000", 18, 17, "ETH", 1 }, + { 18, "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", 6, 9, "USDC", 7 }, + { 19, "0xaf88d065e77c8cc2239327c5edb3a432268e5831", 6, 10, "USDC", 7 }, + { 20, "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", 6, 11, "USDC", 7 }, + { 21, "0x0b2c639c533813f4aa9d7837caf62653d097ff85", 6, 12, "USDC", 7 }, + { 22, "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", 6, 13, "USDC", 7 }, + { 23, "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", 6, 15, "USDC", 7 }, + { 24, "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", 6, 17, "USDC", 7 }, + { 25, "0xdac17f958d2ee523a2206206994597c13d831ec7", 6, 9, "USDT", 8 }, + { 26, "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", 6, 10, "USDT", 8 }, + { 27, "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", 6, 11, "USDT", 8 }, + { 28, "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", 6, 12, "USDT", 8 }, + { 29, "0x55d398326f99059ff775485246999027b3197955", 6, 14, "USDT", 8 }, + { 30, "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", 6, 15, "USDT", 8 }, + { 31, "0xa219439258ca9da29e9cc4ce5596924745e12b93", 6, 16, "USDT", 8 }, + { 32, "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", 6, 17, "USDT", 8 }, + { 33, "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", 18, 9, "WETH", 1 }, + { 34, "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", 18, 10, "WETH", 1 }, + { 35, "0x4200000000000000000000000000000000000006", 18, 11, "WETH", 1 }, + { 36, "0x4200000000000000000000000000000000000006", 18, 12, "WETH", 1 }, + { 37, "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", 18, 13, "WETH", 1 }, + { 38, "0x2170ed0880ac9a755fd29b2688956bd959f933f8", 18, 14, "WETH", 1 }, + { 39, "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", 18, 15, "WETH", 1 }, + { 40, "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", 18, 16, "WETH", 1 }, + { 41, "0x5300000000000000000000000000000000000004", 18, 17, "WETH", 1 }, + { 42, "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", 8, 9, "WBTC", 10 }, + { 43, "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", 8, 10, "WBTC", 10 }, + { 44, "0x68f180fcce6836688e9084f035309e29bf0a2095", 8, 12, "WBTC", 10 }, + { 45, "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", 8, 13, "WBTC", 10 }, + { 46, "0x50b7545627a5162f82a992c33b87adc75187b218", 8, 15, "WBTC", 10 }, + { 47, "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", 8, 16, "WBTC", 10 }, + { 48, "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", 8, 17, "WBTC", 10 }, + { 49, "0x6b175474e89094c44da98b954eedeac495271d0f", 18, 9, "DAI", 11 }, + { 50, "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", 18, 10, "DAI", 11 }, + { 51, "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", 18, 11, "DAI", 11 }, + { 52, "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", 18, 12, "DAI", 11 }, + { 53, "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", 18, 13, "DAI", 11 }, + { 54, "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", 18, 14, "DAI", 11 }, + { 55, "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", 18, 15, "DAI", 11 }, + { 56, "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", 18, 16, "DAI", 11 }, + { 57, "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", 18, 18, "STRK", 9 }, + { 58, "11111111111111111111111111111111", 9, 19, "SOL", 3 }, + { 59, "0x0000000000000000000000000000000000000000", 6, 20, "TRX", 4 }, + { 60, "0x0000000000000000000000000000000000000000", 18, 21, "ETH", 1 }, + { 61, "0x0000000000000000000000000000000000000000", 18, 22, "ETH", 1 }, + { 62, "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", 18, 18, "ETH", 1 }, + { 63, "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", 6, 18, "USDC", 7 }, + { 64, "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", 6, 18, "USDT", 8 }, + { 65, "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", 18, 14, "USDC", 7 }, + { 66, "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", 6, 16, "USDC", 7 }, + { 67, "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", 6, 13, "USDT", 8 }, + { 68, "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", 6, 21, "USDC", 7 }, + { 69, "0x493257fd37edb34451f62edf8d2a0c418852ba4c", 6, 21, "USDT", 8 }, + { 70, "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", 18, 21, "WETH", 1 }, + { 71, "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", 8, 21, "WBTC", 10 }, + { 72, "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", 18, 21, "DAI", 11 }, + { 73, "0x4300000000000000000000000000000000000004", 18, 22, "WETH", 1 } }); migrationBuilder.CreateIndex( @@ -652,6 +797,17 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "NetworkId", "Key" }, unique: true); + migrationBuilder.CreateIndex( + name: "IX_NetworkNodeProviders_NetworkId_NodeProviderId", + table: "NetworkNodeProviders", + columns: new[] { "NetworkId", "NodeProviderId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_NetworkNodeProviders_NodeProviderId", + table: "NetworkNodeProviders", + column: "NodeProviderId"); + migrationBuilder.CreateIndex( name: "IX_Networks_ChainId_NetworkTypeId", table: "Networks", @@ -675,15 +831,21 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "Name", unique: true); + migrationBuilder.CreateIndex( + name: "IX_NodeProviders_Name", + table: "NodeProviders", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_Nodes_NetworkId", table: "Nodes", column: "NetworkId"); migrationBuilder.CreateIndex( - name: "IX_Nodes_ProviderName_NetworkId", + name: "IX_Nodes_ProviderName_NetworkId_Protocol", table: "Nodes", - columns: new[] { "ProviderName", "NetworkId" }, + columns: new[] { "ProviderName", "NetworkId", "Protocol" }, unique: true); migrationBuilder.CreateIndex( @@ -866,16 +1028,6 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "Wallets", column: "SignerAgentId"); - migrationBuilder.CreateIndex( - name: "IX_WebhookOutboxMessages_Status_NextRetryAt", - table: "WebhookOutboxMessages", - columns: new[] { "Status", "NextRetryAt" }); - - migrationBuilder.CreateIndex( - name: "IX_WebhookOutboxMessages_SubscriberId", - table: "WebhookOutboxMessages", - column: "SubscriberId"); - migrationBuilder.CreateIndex( name: "IX_WebhookSubscribers_Name", table: "WebhookSubscribers", @@ -895,6 +1047,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "NetworkMetadata"); + migrationBuilder.DropTable( + name: "NetworkNodeProviders"); + migrationBuilder.DropTable( name: "Nodes"); @@ -908,13 +1063,13 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "TrustedWallets"); migrationBuilder.DropTable( - name: "WebhookOutboxMessages"); + name: "WebhookSubscribers"); migrationBuilder.DropTable( - name: "Orders"); + name: "NodeProviders"); migrationBuilder.DropTable( - name: "WebhookSubscribers"); + name: "Orders"); migrationBuilder.DropTable( name: "Routes"); diff --git a/csharp/src/Data.Npgsql/Migrations/20260311095434_AddNodeProviders.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260311095434_AddNodeProviders.Designer.cs new file mode 100644 index 00000000..67808644 --- /dev/null +++ b/csharp/src/Data.Npgsql/Migrations/20260311095434_AddNodeProviders.Designer.cs @@ -0,0 +1,4883 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Train.Solver.Data.Npgsql; + +#nullable disable + +namespace Train.Solver.Data.Npgsql.Migrations +{ + [DbContext(typeof(SolverDbContext))] + [Migration("20260311095434_AddNodeProviders")] + partial class AddNodeProviders + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("Type", "NetworkId") + .IsUnique(); + + b.ToTable("Contracts"); + + b.HasData( + new + { + Id = 1, + Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + Type = "Train", + Version = 0u + }, + new + { + Id = 3, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 2, + Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + Type = "Train", + Version = 0u + }, + new + { + Id = 4, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 5, + Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + Type = "Train", + Version = 0u + }, + new + { + Id = 6, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 7, + Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + Type = "Train", + Version = 0u + }, + new + { + Id = 8, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 9, + Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 5, + Type = "Train", + Version = 0u + }, + new + { + Id = 10, + Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + Type = "Train", + Version = 0u + }, + new + { + Id = 11, + Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + Type = "Train", + Version = 0u + }, + new + { + Id = 12, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 13, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 14, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 15, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 16, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 17, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 18, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 19, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 20, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 21, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 22, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + Type = "Multicall", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CatchUpGapThreshold") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("ListenerType") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId", "ListenerType"); + + b.ToTable("EventListenerConfigs"); + + b.HasData( + new + { + Id = 1, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 1, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 2, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "websocket-event-listener", + NetworkId = 1, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 3, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 2, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 4, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "websocket-event-listener", + NetworkId = 2, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 5, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 3, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", + Version = 0u + }, + new + { + Id = 6, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "mempool-event-listener", + NetworkId = 1, + Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", + Version = 0u + }, + new + { + Id = 7, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "mempool-event-listener", + NetworkId = 2, + Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", + Version = 0u + }, + new + { + Id = 8, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 4, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 9, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "websocket-event-listener", + NetworkId = 4, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 10, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 5, + Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 11, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 6, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 12, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = true, + ListenerType = "rpc-log-event-listener", + NetworkId = 8, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 13, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 9, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 14, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 9, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 15, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 10, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 16, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 10, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 17, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 11, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 18, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 11, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 19, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 12, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 20, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 12, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 21, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 13, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 22, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 13, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 23, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 14, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 24, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 14, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 25, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 15, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 26, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 15, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 27, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 16, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 28, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 17, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 29, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 17, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 30, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 18, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 31, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 19, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 32, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 21, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 33, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 21, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 34, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 22, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 35, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 22, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChainId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsTestnet") + .HasColumnType("boolean"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("Slug") + .IsUnique(); + + b.HasIndex("ChainId", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Networks"); + + b.HasData( + new + { + Id = 1, + ChainId = "11155111", + DisplayName = "Ethereum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "eth-sepolia" + }, + new + { + Id = 2, + ChainId = "421614", + DisplayName = "Arbitrum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "arb-sepolia" + }, + new + { + Id = 3, + ChainId = "84532", + DisplayName = "Base Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "base-sepolia" + }, + new + { + Id = 4, + ChainId = "97", + DisplayName = "BSC Testnet", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "bsc-testnet" + }, + new + { + Id = 5, + ChainId = "aztec-devnet", + DisplayName = "Aztec Devnet", + IsTestnet = true, + NetworkTypeId = 5, + Slug = "aztec-devnet" + }, + new + { + Id = 6, + ChainId = "SN_SEPOLIA", + DisplayName = "Starknet Sepolia", + IsTestnet = true, + NetworkTypeId = 3, + Slug = "starknet-sepolia" + }, + new + { + Id = 7, + ChainId = "3448148188", + DisplayName = "Tron Nile Testnet", + IsTestnet = true, + NetworkTypeId = 6, + Slug = "tron-nile" + }, + new + { + Id = 8, + ChainId = "devnet", + DisplayName = "Solana Devnet", + IsTestnet = true, + NetworkTypeId = 2, + Slug = "solana-devnet" + }, + new + { + Id = 9, + ChainId = "1", + DisplayName = "Ethereum", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "ethereum" + }, + new + { + Id = 10, + ChainId = "42161", + DisplayName = "Arbitrum One", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "arbitrum" + }, + new + { + Id = 11, + ChainId = "8453", + DisplayName = "Base", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "base" + }, + new + { + Id = 12, + ChainId = "10", + DisplayName = "OP Mainnet", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "optimism" + }, + new + { + Id = 13, + ChainId = "137", + DisplayName = "Polygon", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "polygon" + }, + new + { + Id = 14, + ChainId = "56", + DisplayName = "BNB Smart Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "bsc" + }, + new + { + Id = 15, + ChainId = "43114", + DisplayName = "Avalanche C-Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "avalanche" + }, + new + { + Id = 16, + ChainId = "59144", + DisplayName = "Linea", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "linea" + }, + new + { + Id = 17, + ChainId = "534352", + DisplayName = "Scroll", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "scroll" + }, + new + { + Id = 18, + ChainId = "SN_MAIN", + DisplayName = "Starknet", + IsTestnet = false, + NetworkTypeId = 3, + Slug = "starknet" + }, + new + { + Id = 19, + ChainId = "mainnet-beta", + DisplayName = "Solana", + IsTestnet = false, + NetworkTypeId = 2, + Slug = "solana" + }, + new + { + Id = 20, + ChainId = "728126428", + DisplayName = "Tron", + IsTestnet = false, + NetworkTypeId = 6, + Slug = "tron" + }, + new + { + Id = 21, + ChainId = "324", + DisplayName = "ZKsync Era", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "zksync" + }, + new + { + Id = 22, + ChainId = "81457", + DisplayName = "Blast", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "blast" + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Key") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId", "Key") + .IsUnique(); + + b.ToTable("NetworkMetadata"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("NodeProviderId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NodeProviderId"); + + b.HasIndex("NetworkId", "NodeProviderId") + .IsUnique(); + + b.ToTable("NetworkNodeProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 12, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 13, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 14, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 15, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 16, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 17, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 18, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 19, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 21, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 22, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 23, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 24, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 25, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 26, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 27, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 28, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 29, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 30, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 31, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 33, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 34, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 35, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 36, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 37, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 38, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 39, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 40, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 41, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 42, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 43, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 44, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 45, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 46, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 47, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 48, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 49, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 50, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 51, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 52, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 53, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 54, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 55, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 56, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 57, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 58, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 59, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 60, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 61, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 62, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 63, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 64, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 65, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 66, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 67, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 68, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 69, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 70, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 71, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 72, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 73, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 74, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 75, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 76, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 77, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 78, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 79, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 80, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 81, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 82, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 83, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 84, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 85, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 86, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 87, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 88, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 89, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 90, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 91, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 92, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 93, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 5, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressFormat") + .IsRequired() + .HasColumnType("text"); + + b.Property("AddressLength") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Curve") + .IsRequired() + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NativeTokenAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("RequiresWalletActivation") + .HasColumnType("boolean"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NetworkTypes"); + + b.HasData( + new + { + Id = 1, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "EVM", + Name = "eip155", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 2, + AddressFormat = "base58", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "ed25519", + DisplayName = "Solana", + Name = "solana", + NativeTokenAddress = "11111111111111111111111111111111", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 3, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "stark", + DisplayName = "Starknet", + Name = "starknet", + NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 4, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Fuel", + Name = "fuel", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 5, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "grumpkin", + DisplayName = "Aztec", + Name = "aztec", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 6, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Tron", + Name = "tron", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Protocol") + .HasColumnType("integer"); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("ProviderName", "NetworkId", "Protocol") + .IsUnique(); + + b.ToTable("Nodes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKey") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NodeProviders"); + + b.HasData( + new + { + Id = 1, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "alchemy", + Version = 0u + }, + new + { + Id = 2, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "infura", + Version = 0u + }, + new + { + Id = 3, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "ankr", + Version = 0u + }, + new + { + Id = 4, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "drpc", + Version = 0u + }, + new + { + Id = 5, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "chainlist", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("FailureReason") + .HasColumnType("text"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hashlock") + .IsRequired() + .HasColumnType("text"); + + b.Property("RouteId") + .HasColumnType("integer"); + + b.Property("SolverLockIndex") + .HasColumnType("text"); + + b.Property("SolverLockTimelock") + .HasColumnType("bigint"); + + b.Property("SourceAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("WorkflowId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationAddress"); + + b.HasIndex("Hashlock") + .IsUnique(); + + b.HasIndex("RouteId"); + + b.HasIndex("SourceAddress"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletionTimeInSeconds") + .HasColumnType("double precision"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("ProfitInUsd") + .HasColumnType("numeric"); + + b.Property("SourceNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("VolumeInUsd") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationNetwork"); + + b.HasIndex("OrderId"); + + b.HasIndex("SourceNetwork"); + + b.ToTable("OrderMetrics"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("RateProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "SameAsset", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "TokenPrice", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoRefundUser") + .HasColumnType("boolean"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationTokenId") + .HasColumnType("integer"); + + b.Property("DestinationWalletId") + .HasColumnType("integer"); + + b.Property("MaxAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("MinAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("RateProviderId") + .HasColumnType("integer"); + + b.Property("ServiceFeeId") + .HasColumnType("integer"); + + b.Property("SourceTokenId") + .HasColumnType("integer"); + + b.Property("SourceWalletId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Active=0,Inactive=1,Archived=2"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("DestinationTokenId"); + + b.HasIndex("DestinationWalletId"); + + b.HasIndex("RateProviderId"); + + b.HasIndex("ServiceFeeId"); + + b.HasIndex("SourceWalletId"); + + b.HasIndex("SourceTokenId", "DestinationTokenId") + .IsUnique(); + + b.ToTable("Routes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeInUsd") + .HasColumnType("numeric"); + + b.Property("FeePercentage") + .HasColumnType("numeric"); + + b.Property("IncludeExpenseFee") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ServiceFees"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FeeInUsd = 0m, + FeePercentage = 0m, + IncludeExpenseFee = false, + Name = "Free", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SignerAgents"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContractAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Decimals") + .HasColumnType("integer"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenPriceId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("TokenPriceId"); + + b.HasIndex("NetworkId", "ContractAddress") + .IsUnique(); + + b.ToTable("Tokens"); + + b.HasData( + new + { + Id = 1, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 1, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 2, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 2, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 3, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 3, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 4, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 4, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 5, + ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 5, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 6, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 6, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 7, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 7, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 8, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 8, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 9, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 10, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 11, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 12, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 13, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "POL", + TokenPriceId = 5, + Version = 0u + }, + new + { + Id = 14, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 15, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "AVAX", + TokenPriceId = 6, + Version = 0u + }, + new + { + Id = 16, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 17, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 18, + ContractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 19, + ContractAddress = "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 20, + ContractAddress = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 21, + ContractAddress = "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 22, + ContractAddress = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 23, + ContractAddress = "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 24, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 25, + ContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 26, + ContractAddress = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 27, + ContractAddress = "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 28, + ContractAddress = "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 29, + ContractAddress = "0x55d398326f99059ff775485246999027b3197955", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 14, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 30, + ContractAddress = "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 31, + ContractAddress = "0xa219439258ca9da29e9cc4ce5596924745e12b93", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 32, + ContractAddress = "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 33, + ContractAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 34, + ContractAddress = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 35, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 36, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 37, + ContractAddress = "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 38, + ContractAddress = "0x2170ed0880ac9a755fd29b2688956bd959f933f8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 39, + ContractAddress = "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 40, + ContractAddress = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 41, + ContractAddress = "0x5300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 42, + ContractAddress = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 9, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 43, + ContractAddress = "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 10, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 44, + ContractAddress = "0x68f180fcce6836688e9084f035309e29bf0a2095", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 12, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 45, + ContractAddress = "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 13, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 46, + ContractAddress = "0x50b7545627a5162f82a992c33b87adc75187b218", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 15, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 47, + ContractAddress = "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 16, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 48, + ContractAddress = "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 17, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 49, + ContractAddress = "0x6b175474e89094c44da98b954eedeac495271d0f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 50, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 51, + ContractAddress = "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 52, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 53, + ContractAddress = "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 54, + ContractAddress = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 55, + ContractAddress = "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 56, + ContractAddress = "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 57, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 18, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 58, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 19, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 59, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 20, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 60, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 61, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 62, + ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 18, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 63, + ContractAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 64, + ContractAddress = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 65, + ContractAddress = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 66, + ContractAddress = "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 67, + ContractAddress = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 68, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 69, + ContractAddress = "0x493257fd37edb34451f62edf8d2a0c418852ba4c", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 70, + ContractAddress = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 71, + ContractAddress = "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 21, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 72, + ContractAddress = "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 73, + ContractAddress = "0x4300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExternalId") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("PriceInUsd") + .HasColumnType("numeric"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Symbol") + .IsUnique(); + + b.ToTable("TokenPrices"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "ETHUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 2000.0m, + Symbol = "ETH", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BNBUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 600.0m, + Symbol = "BNB", + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "SOLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 140.0m, + Symbol = "SOL", + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "TRXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.25m, + Symbol = "TRX", + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "POLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "POL", + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "AVAXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 35.0m, + Symbol = "AVAX", + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDC", + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDTUSD", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDT", + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "STRKUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "STRK", + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BTCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 60000.0m, + Symbol = "BTC", + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "DAIUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "DAI", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Completed=0,Initiated=1,Failed=2"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone"); + + b.Property("TransactionHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer") + .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("OrderId"); + + b.HasIndex("Status"); + + b.HasIndex("TransactionHash"); + + b.HasIndex("Type"); + + b.HasIndex("TransactionHash", "NetworkId") + .IsUnique(); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("Address", "NetworkTypeId"); + + b.HasIndex("Name", "NetworkTypeId") + .IsUnique(); + + b.ToTable("TrustedWallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("SignerAgentId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Inactive=0,Activating=1,Active=2,Failed=3"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("SignerAgentId"); + + b.HasIndex("Address", "NetworkTypeId"); + + b.HasIndex("Name", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Wallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.PrimitiveCollection("EventTypes") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Secret") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("WebhookSubscribers"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EventTypes = new string[0], + IsActive = true, + Name = "station-api", + Secret = "station-webhook-secret-1", + Url = "http://localhost:9690/api/v1/webhooks/plorex", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Contracts") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("EventListenerConfigs") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") + .WithMany("Networks") + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("BaseFeePercentageIncrease") + .HasColumnType("integer"); + + b1.Property("HasL1Fee") + .HasColumnType("boolean"); + + b1.Property("IsEip1559") + .HasColumnType("boolean"); + + b1.Property("L1FeeOracleContract") + .HasColumnType("text"); + + b1.Property("PriorityFeePercentageIncrease") + .HasColumnType("integer"); + + b1.Property("ReplacementFeePercentageIncrease") + .HasColumnType("integer"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 2, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 3, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 4, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 5, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 6, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 7, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 8, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 9, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 10, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 11, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 12, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 13, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 14, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 15, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 16, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 17, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x5300000000000000000000000000000000000002", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 18, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 19, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 20, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 21, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 22, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("AutoRebalanceEnabled") + .HasColumnType("boolean"); + + b1.Property("MaxBalanceThreshold") + .IsRequired() + .HasColumnType("text"); + + b1.Property("MinBalanceThreshold") + .IsRequired() + .HasColumnType("text"); + + b1.Property("MinGasBalance") + .IsRequired() + .HasColumnType("text"); + + b1.Property("TargetBalance") + .IsRequired() + .HasColumnType("text"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 2, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 3, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 4, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 5, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 6, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 7, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 8, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 9, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 10, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 11, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 12, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 13, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "1000000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 14, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 15, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 16, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 17, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 18, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 19, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 20, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 21, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 22, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("DeltaPercentage") + .HasColumnType("numeric"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + DeltaPercentage = 10m + }, + new + { + NetworkId = 2, + DeltaPercentage = 10m + }, + new + { + NetworkId = 3, + DeltaPercentage = 10m + }, + new + { + NetworkId = 4, + DeltaPercentage = 10m + }, + new + { + NetworkId = 5, + DeltaPercentage = 10m + }, + new + { + NetworkId = 6, + DeltaPercentage = 10m + }, + new + { + NetworkId = 7, + DeltaPercentage = 10m + }, + new + { + NetworkId = 8, + DeltaPercentage = 10m + }, + new + { + NetworkId = 9, + DeltaPercentage = 10m + }, + new + { + NetworkId = 10, + DeltaPercentage = 10m + }, + new + { + NetworkId = 11, + DeltaPercentage = 10m + }, + new + { + NetworkId = 12, + DeltaPercentage = 10m + }, + new + { + NetworkId = 13, + DeltaPercentage = 10m + }, + new + { + NetworkId = 14, + DeltaPercentage = 10m + }, + new + { + NetworkId = 15, + DeltaPercentage = 10m + }, + new + { + NetworkId = 16, + DeltaPercentage = 10m + }, + new + { + NetworkId = 17, + DeltaPercentage = 10m + }, + new + { + NetworkId = 18, + DeltaPercentage = 10m + }, + new + { + NetworkId = 19, + DeltaPercentage = 10m + }, + new + { + NetworkId = 20, + DeltaPercentage = 10m + }, + new + { + NetworkId = 21, + DeltaPercentage = 10m + }, + new + { + NetworkId = 22, + DeltaPercentage = 10m + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("QuoteExpiryInSeconds") + .HasColumnType("bigint"); + + b1.Property("RewardTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.Property("SolverTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.Property("UserTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 2, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 3, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 4, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 5, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 6, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 7, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 8, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 9, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 10, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 11, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 12, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 13, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 14, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 15, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 16, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 17, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 18, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 19, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 20, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 21, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 22, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("ConfirmationPollingIntervalSeconds") + .HasColumnType("integer"); + + b1.Property("MaxGasBumpAttempts") + .HasColumnType("integer"); + + b1.Property("MaxInFlightTransactions") + .HasColumnType("integer"); + + b1.Property("RequiredConfirmations") + .HasColumnType("integer"); + + b1.Property("StuckTransactionTimeoutSeconds") + .HasColumnType("integer"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 2, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 3, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 4, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 5, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 6, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 7, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 8, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 9, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 10, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 11, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 12, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 13, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 14, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 15, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 16, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 17, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 18, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 19, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 20, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 21, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 22, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }); + }); + + b.Navigation("GasConfiguration") + .IsRequired(); + + b.Navigation("LiquidityConfiguration") + .IsRequired(); + + b.Navigation("RewardConfiguration") + .IsRequired(); + + b.Navigation("TimelockConfiguration") + .IsRequired(); + + b.Navigation("TransactionProcessorConfiguration") + .IsRequired(); + + b.Navigation("Type"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Metadata") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.NodeProvider", "NodeProvider") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NodeProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("NodeProvider"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Nodes") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") + .WithMany() + .HasForeignKey("RouteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Route"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") + .WithMany() + .HasForeignKey("DestinationTokenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") + .WithMany() + .HasForeignKey("DestinationWalletId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") + .WithMany() + .HasForeignKey("RateProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") + .WithMany() + .HasForeignKey("ServiceFeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") + .WithMany() + .HasForeignKey("SourceTokenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") + .WithMany() + .HasForeignKey("SourceWalletId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DestinationToken"); + + b.Navigation("DestinationWallet"); + + b.Navigation("RateProvider"); + + b.Navigation("ServiceFee"); + + b.Navigation("SourceToken"); + + b.Navigation("SourceWallet"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Tokens") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") + .WithMany() + .HasForeignKey("TokenPriceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("TokenPrice"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany() + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") + .WithMany("Transactions") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Network"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") + .WithMany() + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NetworkType"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") + .WithMany("Wallets") + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") + .WithMany() + .HasForeignKey("SignerAgentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NetworkType"); + + b.Navigation("SignerAgent"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.Navigation("Contracts"); + + b.Navigation("EventListenerConfigs"); + + b.Navigation("Metadata"); + + b.Navigation("NetworkNodeProviders"); + + b.Navigation("Nodes"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Navigation("Networks"); + + b.Navigation("Wallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Navigation("NetworkNodeProviders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Navigation("Transactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/csharp/src/Data.Npgsql/Migrations/20260311095434_AddNodeProviders.cs b/csharp/src/Data.Npgsql/Migrations/20260311095434_AddNodeProviders.cs new file mode 100644 index 00000000..3da91a0a --- /dev/null +++ b/csharp/src/Data.Npgsql/Migrations/20260311095434_AddNodeProviders.cs @@ -0,0 +1,622 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace Train.Solver.Data.Npgsql.Migrations +{ + /// + public partial class AddNodeProviders : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "NodeProviders", + columns: new[] { "Id", "ApiKey", "Enabled", "Name" }, + values: new object[,] + { + { 1, "", false, "alchemy" }, + { 2, "", false, "infura" }, + { 3, "", false, "ankr" }, + { 4, "", false, "drpc" }, + { 5, "", false, "chainlist" } + }); + + migrationBuilder.InsertData( + table: "NetworkNodeProviders", + columns: new[] { "Id", "NetworkId", "NodeProviderId" }, + values: new object[,] + { + { 1, 1, 1 }, + { 2, 2, 1 }, + { 3, 3, 1 }, + { 4, 4, 1 }, + { 5, 6, 1 }, + { 6, 8, 1 }, + { 7, 9, 1 }, + { 8, 10, 1 }, + { 9, 11, 1 }, + { 10, 12, 1 }, + { 11, 13, 1 }, + { 12, 14, 1 }, + { 13, 15, 1 }, + { 14, 16, 1 }, + { 15, 17, 1 }, + { 16, 18, 1 }, + { 17, 19, 1 }, + { 18, 20, 1 }, + { 19, 21, 1 }, + { 20, 22, 1 }, + { 21, 1, 2 }, + { 22, 2, 2 }, + { 23, 3, 2 }, + { 24, 4, 2 }, + { 25, 6, 2 }, + { 26, 9, 2 }, + { 27, 10, 2 }, + { 28, 11, 2 }, + { 29, 12, 2 }, + { 30, 13, 2 }, + { 31, 14, 2 }, + { 32, 15, 2 }, + { 33, 16, 2 }, + { 34, 17, 2 }, + { 35, 18, 2 }, + { 36, 21, 2 }, + { 37, 22, 2 }, + { 38, 1, 3 }, + { 39, 2, 3 }, + { 40, 3, 3 }, + { 41, 4, 3 }, + { 42, 6, 3 }, + { 43, 8, 3 }, + { 44, 9, 3 }, + { 45, 10, 3 }, + { 46, 11, 3 }, + { 47, 12, 3 }, + { 48, 13, 3 }, + { 49, 14, 3 }, + { 50, 15, 3 }, + { 51, 16, 3 }, + { 52, 17, 3 }, + { 53, 18, 3 }, + { 54, 19, 3 }, + { 55, 20, 3 }, + { 56, 22, 3 }, + { 57, 1, 4 }, + { 58, 2, 4 }, + { 59, 3, 4 }, + { 60, 4, 4 }, + { 61, 6, 4 }, + { 62, 8, 4 }, + { 63, 9, 4 }, + { 64, 10, 4 }, + { 65, 11, 4 }, + { 66, 12, 4 }, + { 67, 13, 4 }, + { 68, 14, 4 }, + { 69, 15, 4 }, + { 70, 16, 4 }, + { 71, 17, 4 }, + { 72, 18, 4 }, + { 73, 19, 4 }, + { 74, 20, 4 }, + { 75, 21, 4 }, + { 76, 22, 4 }, + { 77, 1, 5 }, + { 78, 2, 5 }, + { 79, 3, 5 }, + { 80, 4, 5 }, + { 81, 7, 5 }, + { 82, 9, 5 }, + { 83, 10, 5 }, + { 84, 11, 5 }, + { 85, 12, 5 }, + { 86, 13, 5 }, + { 87, 14, 5 }, + { 88, 15, 5 }, + { 89, 16, 5 }, + { 90, 17, 5 }, + { 91, 20, 5 }, + { 92, 21, 5 }, + { 93, 22, 5 } + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 5); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 6); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 7); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 8); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 9); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 10); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 11); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 12); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 13); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 14); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 15); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 16); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 17); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 18); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 19); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 20); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 21); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 22); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 23); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 24); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 25); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 26); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 27); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 28); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 29); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 30); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 31); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 32); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 33); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 34); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 35); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 36); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 37); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 38); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 39); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 40); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 41); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 42); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 43); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 44); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 45); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 46); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 47); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 48); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 49); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 50); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 51); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 52); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 53); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 54); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 55); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 56); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 57); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 58); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 59); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 60); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 61); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 62); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 63); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 64); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 65); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 66); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 67); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 68); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 69); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 70); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 71); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 72); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 73); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 74); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 75); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 76); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 77); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 78); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 79); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 80); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 81); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 82); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 83); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 84); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 85); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 86); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 87); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 88); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 89); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 90); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 91); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 92); + + migrationBuilder.DeleteData( + table: "NetworkNodeProviders", + keyColumn: "Id", + keyValue: 93); + + migrationBuilder.DeleteData( + table: "NodeProviders", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "NodeProviders", + keyColumn: "Id", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "NodeProviders", + keyColumn: "Id", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "NodeProviders", + keyColumn: "Id", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "NodeProviders", + keyColumn: "Id", + keyValue: 5); + } + } +} diff --git a/csharp/src/Data.Npgsql/Migrations/20260311104517_UpdateEventListenerSeed.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260311104517_UpdateEventListenerSeed.Designer.cs new file mode 100644 index 00000000..1c1af1de --- /dev/null +++ b/csharp/src/Data.Npgsql/Migrations/20260311104517_UpdateEventListenerSeed.Designer.cs @@ -0,0 +1,4870 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Train.Solver.Data.Npgsql; + +#nullable disable + +namespace Train.Solver.Data.Npgsql.Migrations +{ + [DbContext(typeof(SolverDbContext))] + [Migration("20260311104517_UpdateEventListenerSeed")] + partial class UpdateEventListenerSeed + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("Type", "NetworkId") + .IsUnique(); + + b.ToTable("Contracts"); + + b.HasData( + new + { + Id = 1, + Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + Type = "Train", + Version = 0u + }, + new + { + Id = 3, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 2, + Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + Type = "Train", + Version = 0u + }, + new + { + Id = 4, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 5, + Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + Type = "Train", + Version = 0u + }, + new + { + Id = 6, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 7, + Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + Type = "Train", + Version = 0u + }, + new + { + Id = 8, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 9, + Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 5, + Type = "Train", + Version = 0u + }, + new + { + Id = 10, + Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + Type = "Train", + Version = 0u + }, + new + { + Id = 11, + Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + Type = "Train", + Version = 0u + }, + new + { + Id = 12, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 13, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 14, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 15, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 16, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 17, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 18, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 19, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 20, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 21, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 22, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + Type = "Multicall", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CatchUpGapThreshold") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("ListenerType") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId", "ListenerType"); + + b.ToTable("EventListenerConfigs"); + + b.HasData( + new + { + Id = 1, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 1, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 2, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 1, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 3, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 2, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 4, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 2, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 5, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 3, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", + Version = 0u + }, + new + { + Id = 6, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "mempool-event-listener", + NetworkId = 1, + Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", + Version = 0u + }, + new + { + Id = 7, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "mempool-event-listener", + NetworkId = 2, + Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", + Version = 0u + }, + new + { + Id = 8, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 4, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 9, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 4, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 10, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 5, + Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 11, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 6, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 12, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 8, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 13, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 9, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 14, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 9, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 15, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 10, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 16, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 10, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 17, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 11, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 18, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 11, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 19, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 12, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 20, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 12, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 21, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 13, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 22, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 13, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 23, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 14, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 24, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 14, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 25, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 15, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 26, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 15, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 27, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 16, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 28, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 17, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 29, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 17, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 30, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 18, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 31, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 19, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 32, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 21, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 33, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 21, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 34, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 22, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 35, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 22, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChainId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsTestnet") + .HasColumnType("boolean"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("Slug") + .IsUnique(); + + b.HasIndex("ChainId", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Networks"); + + b.HasData( + new + { + Id = 1, + ChainId = "11155111", + DisplayName = "Ethereum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "eth-sepolia" + }, + new + { + Id = 2, + ChainId = "421614", + DisplayName = "Arbitrum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "arb-sepolia" + }, + new + { + Id = 3, + ChainId = "84532", + DisplayName = "Base Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "base-sepolia" + }, + new + { + Id = 4, + ChainId = "97", + DisplayName = "BSC Testnet", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "bsc-testnet" + }, + new + { + Id = 5, + ChainId = "aztec-devnet", + DisplayName = "Aztec Devnet", + IsTestnet = true, + NetworkTypeId = 5, + Slug = "aztec-devnet" + }, + new + { + Id = 6, + ChainId = "SN_SEPOLIA", + DisplayName = "Starknet Sepolia", + IsTestnet = true, + NetworkTypeId = 3, + Slug = "starknet-sepolia" + }, + new + { + Id = 7, + ChainId = "3448148188", + DisplayName = "Tron Nile Testnet", + IsTestnet = true, + NetworkTypeId = 6, + Slug = "tron-nile" + }, + new + { + Id = 8, + ChainId = "devnet", + DisplayName = "Solana Devnet", + IsTestnet = true, + NetworkTypeId = 2, + Slug = "solana-devnet" + }, + new + { + Id = 9, + ChainId = "1", + DisplayName = "Ethereum", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "ethereum" + }, + new + { + Id = 10, + ChainId = "42161", + DisplayName = "Arbitrum One", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "arbitrum" + }, + new + { + Id = 11, + ChainId = "8453", + DisplayName = "Base", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "base" + }, + new + { + Id = 12, + ChainId = "10", + DisplayName = "OP Mainnet", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "optimism" + }, + new + { + Id = 13, + ChainId = "137", + DisplayName = "Polygon", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "polygon" + }, + new + { + Id = 14, + ChainId = "56", + DisplayName = "BNB Smart Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "bsc" + }, + new + { + Id = 15, + ChainId = "43114", + DisplayName = "Avalanche C-Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "avalanche" + }, + new + { + Id = 16, + ChainId = "59144", + DisplayName = "Linea", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "linea" + }, + new + { + Id = 17, + ChainId = "534352", + DisplayName = "Scroll", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "scroll" + }, + new + { + Id = 18, + ChainId = "SN_MAIN", + DisplayName = "Starknet", + IsTestnet = false, + NetworkTypeId = 3, + Slug = "starknet" + }, + new + { + Id = 19, + ChainId = "mainnet-beta", + DisplayName = "Solana", + IsTestnet = false, + NetworkTypeId = 2, + Slug = "solana" + }, + new + { + Id = 20, + ChainId = "728126428", + DisplayName = "Tron", + IsTestnet = false, + NetworkTypeId = 6, + Slug = "tron" + }, + new + { + Id = 21, + ChainId = "324", + DisplayName = "ZKsync Era", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "zksync" + }, + new + { + Id = 22, + ChainId = "81457", + DisplayName = "Blast", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "blast" + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Key") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId", "Key") + .IsUnique(); + + b.ToTable("NetworkMetadata"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("NodeProviderId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NodeProviderId"); + + b.HasIndex("NetworkId", "NodeProviderId") + .IsUnique(); + + b.ToTable("NetworkNodeProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 12, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 13, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 14, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 15, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 16, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 17, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 18, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 19, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 21, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 22, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 23, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 24, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 25, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 26, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 27, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 28, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 29, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 30, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 31, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 33, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 34, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 35, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 36, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 37, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 38, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 39, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 40, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 41, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 42, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 43, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 44, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 45, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 46, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 47, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 48, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 49, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 50, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 51, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 52, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 53, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 54, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 55, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 56, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 57, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 58, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 59, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 60, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 61, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 62, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 63, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 64, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 65, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 66, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 67, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 68, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 69, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 70, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 71, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 72, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 73, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 74, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 75, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 76, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 77, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 78, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 79, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 80, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 81, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 82, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 83, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 84, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 85, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 86, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 87, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 88, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 89, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 90, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 91, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 92, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 93, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 5, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressFormat") + .IsRequired() + .HasColumnType("text"); + + b.Property("AddressLength") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Curve") + .IsRequired() + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NativeTokenAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("RequiresWalletActivation") + .HasColumnType("boolean"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NetworkTypes"); + + b.HasData( + new + { + Id = 1, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "EVM", + Name = "eip155", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 2, + AddressFormat = "base58", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "ed25519", + DisplayName = "Solana", + Name = "solana", + NativeTokenAddress = "11111111111111111111111111111111", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 3, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "stark", + DisplayName = "Starknet", + Name = "starknet", + NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 4, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Fuel", + Name = "fuel", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 5, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "grumpkin", + DisplayName = "Aztec", + Name = "aztec", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 6, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Tron", + Name = "tron", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Protocol") + .HasColumnType("integer"); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("ProviderName", "NetworkId", "Protocol") + .IsUnique(); + + b.ToTable("Nodes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKey") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NodeProviders"); + + b.HasData( + new + { + Id = 1, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "alchemy", + Version = 0u + }, + new + { + Id = 2, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "infura", + Version = 0u + }, + new + { + Id = 3, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "ankr", + Version = 0u + }, + new + { + Id = 4, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "drpc", + Version = 0u + }, + new + { + Id = 5, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "chainlist", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("FailureReason") + .HasColumnType("text"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hashlock") + .IsRequired() + .HasColumnType("text"); + + b.Property("RouteId") + .HasColumnType("integer"); + + b.Property("SolverLockIndex") + .HasColumnType("text"); + + b.Property("SolverLockTimelock") + .HasColumnType("bigint"); + + b.Property("SourceAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("WorkflowId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationAddress"); + + b.HasIndex("Hashlock") + .IsUnique(); + + b.HasIndex("RouteId"); + + b.HasIndex("SourceAddress"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletionTimeInSeconds") + .HasColumnType("double precision"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("ProfitInUsd") + .HasColumnType("numeric"); + + b.Property("SourceNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("VolumeInUsd") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationNetwork"); + + b.HasIndex("OrderId"); + + b.HasIndex("SourceNetwork"); + + b.ToTable("OrderMetrics"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("RateProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "SameAsset", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "TokenPrice", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoRefundUser") + .HasColumnType("boolean"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationTokenId") + .HasColumnType("integer"); + + b.Property("DestinationWalletId") + .HasColumnType("integer"); + + b.Property("MaxAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("MinAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("RateProviderId") + .HasColumnType("integer"); + + b.Property("ServiceFeeId") + .HasColumnType("integer"); + + b.Property("SourceTokenId") + .HasColumnType("integer"); + + b.Property("SourceWalletId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Active=0,Inactive=1,Archived=2"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("DestinationTokenId"); + + b.HasIndex("DestinationWalletId"); + + b.HasIndex("RateProviderId"); + + b.HasIndex("ServiceFeeId"); + + b.HasIndex("SourceWalletId"); + + b.HasIndex("SourceTokenId", "DestinationTokenId") + .IsUnique(); + + b.ToTable("Routes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeInUsd") + .HasColumnType("numeric"); + + b.Property("FeePercentage") + .HasColumnType("numeric"); + + b.Property("IncludeExpenseFee") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ServiceFees"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FeeInUsd = 0m, + FeePercentage = 0m, + IncludeExpenseFee = false, + Name = "Free", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SignerAgents"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContractAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Decimals") + .HasColumnType("integer"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenPriceId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("TokenPriceId"); + + b.HasIndex("NetworkId", "ContractAddress") + .IsUnique(); + + b.ToTable("Tokens"); + + b.HasData( + new + { + Id = 1, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 1, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 2, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 2, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 3, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 3, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 4, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 4, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 5, + ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 5, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 6, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 6, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 7, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 7, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 8, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 8, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 9, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 10, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 11, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 12, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 13, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "POL", + TokenPriceId = 5, + Version = 0u + }, + new + { + Id = 14, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 15, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "AVAX", + TokenPriceId = 6, + Version = 0u + }, + new + { + Id = 16, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 17, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 18, + ContractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 19, + ContractAddress = "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 20, + ContractAddress = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 21, + ContractAddress = "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 22, + ContractAddress = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 23, + ContractAddress = "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 24, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 25, + ContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 26, + ContractAddress = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 27, + ContractAddress = "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 28, + ContractAddress = "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 29, + ContractAddress = "0x55d398326f99059ff775485246999027b3197955", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 14, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 30, + ContractAddress = "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 31, + ContractAddress = "0xa219439258ca9da29e9cc4ce5596924745e12b93", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 32, + ContractAddress = "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 33, + ContractAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 34, + ContractAddress = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 35, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 36, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 37, + ContractAddress = "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 38, + ContractAddress = "0x2170ed0880ac9a755fd29b2688956bd959f933f8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 39, + ContractAddress = "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 40, + ContractAddress = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 41, + ContractAddress = "0x5300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 42, + ContractAddress = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 9, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 43, + ContractAddress = "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 10, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 44, + ContractAddress = "0x68f180fcce6836688e9084f035309e29bf0a2095", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 12, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 45, + ContractAddress = "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 13, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 46, + ContractAddress = "0x50b7545627a5162f82a992c33b87adc75187b218", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 15, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 47, + ContractAddress = "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 16, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 48, + ContractAddress = "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 17, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 49, + ContractAddress = "0x6b175474e89094c44da98b954eedeac495271d0f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 50, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 51, + ContractAddress = "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 52, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 53, + ContractAddress = "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 54, + ContractAddress = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 55, + ContractAddress = "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 56, + ContractAddress = "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 57, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 18, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 58, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 19, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 59, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 20, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 60, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 61, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 62, + ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 18, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 63, + ContractAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 64, + ContractAddress = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 65, + ContractAddress = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 66, + ContractAddress = "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 67, + ContractAddress = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 68, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 69, + ContractAddress = "0x493257fd37edb34451f62edf8d2a0c418852ba4c", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 70, + ContractAddress = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 71, + ContractAddress = "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 21, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 72, + ContractAddress = "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 73, + ContractAddress = "0x4300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExternalId") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("PriceInUsd") + .HasColumnType("numeric"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Symbol") + .IsUnique(); + + b.ToTable("TokenPrices"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "ETHUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 2000.0m, + Symbol = "ETH", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BNBUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 600.0m, + Symbol = "BNB", + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "SOLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 140.0m, + Symbol = "SOL", + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "TRXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.25m, + Symbol = "TRX", + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "POLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "POL", + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "AVAXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 35.0m, + Symbol = "AVAX", + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDC", + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDTUSD", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDT", + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "STRKUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "STRK", + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BTCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 60000.0m, + Symbol = "BTC", + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "DAIUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "DAI", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Completed=0,Initiated=1,Failed=2"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone"); + + b.Property("TransactionHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer") + .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("OrderId"); + + b.HasIndex("Status"); + + b.HasIndex("TransactionHash"); + + b.HasIndex("Type"); + + b.HasIndex("TransactionHash", "NetworkId") + .IsUnique(); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("Address", "NetworkTypeId"); + + b.HasIndex("Name", "NetworkTypeId") + .IsUnique(); + + b.ToTable("TrustedWallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("SignerAgentId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Inactive=0,Activating=1,Active=2,Failed=3"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("SignerAgentId"); + + b.HasIndex("Address", "NetworkTypeId"); + + b.HasIndex("Name", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Wallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.PrimitiveCollection("EventTypes") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Secret") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("WebhookSubscribers"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Contracts") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("EventListenerConfigs") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") + .WithMany("Networks") + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("BaseFeePercentageIncrease") + .HasColumnType("integer"); + + b1.Property("HasL1Fee") + .HasColumnType("boolean"); + + b1.Property("IsEip1559") + .HasColumnType("boolean"); + + b1.Property("L1FeeOracleContract") + .HasColumnType("text"); + + b1.Property("PriorityFeePercentageIncrease") + .HasColumnType("integer"); + + b1.Property("ReplacementFeePercentageIncrease") + .HasColumnType("integer"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 2, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 3, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 4, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 5, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 6, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 7, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 8, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 9, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 10, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 11, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 12, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 13, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 14, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 15, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 16, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 17, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x5300000000000000000000000000000000000002", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 18, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 19, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 20, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 21, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 22, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("AutoRebalanceEnabled") + .HasColumnType("boolean"); + + b1.Property("MaxBalanceThreshold") + .IsRequired() + .HasColumnType("text"); + + b1.Property("MinBalanceThreshold") + .IsRequired() + .HasColumnType("text"); + + b1.Property("MinGasBalance") + .IsRequired() + .HasColumnType("text"); + + b1.Property("TargetBalance") + .IsRequired() + .HasColumnType("text"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 2, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 3, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 4, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 5, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 6, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 7, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 8, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 9, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 10, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 11, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 12, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 13, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "1000000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 14, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 15, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 16, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 17, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 18, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 19, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 20, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 21, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 22, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("DeltaPercentage") + .HasColumnType("numeric"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + DeltaPercentage = 10m + }, + new + { + NetworkId = 2, + DeltaPercentage = 10m + }, + new + { + NetworkId = 3, + DeltaPercentage = 10m + }, + new + { + NetworkId = 4, + DeltaPercentage = 10m + }, + new + { + NetworkId = 5, + DeltaPercentage = 10m + }, + new + { + NetworkId = 6, + DeltaPercentage = 10m + }, + new + { + NetworkId = 7, + DeltaPercentage = 10m + }, + new + { + NetworkId = 8, + DeltaPercentage = 10m + }, + new + { + NetworkId = 9, + DeltaPercentage = 10m + }, + new + { + NetworkId = 10, + DeltaPercentage = 10m + }, + new + { + NetworkId = 11, + DeltaPercentage = 10m + }, + new + { + NetworkId = 12, + DeltaPercentage = 10m + }, + new + { + NetworkId = 13, + DeltaPercentage = 10m + }, + new + { + NetworkId = 14, + DeltaPercentage = 10m + }, + new + { + NetworkId = 15, + DeltaPercentage = 10m + }, + new + { + NetworkId = 16, + DeltaPercentage = 10m + }, + new + { + NetworkId = 17, + DeltaPercentage = 10m + }, + new + { + NetworkId = 18, + DeltaPercentage = 10m + }, + new + { + NetworkId = 19, + DeltaPercentage = 10m + }, + new + { + NetworkId = 20, + DeltaPercentage = 10m + }, + new + { + NetworkId = 21, + DeltaPercentage = 10m + }, + new + { + NetworkId = 22, + DeltaPercentage = 10m + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("QuoteExpiryInSeconds") + .HasColumnType("bigint"); + + b1.Property("RewardTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.Property("SolverTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.Property("UserTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 2, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 3, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 4, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 5, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 6, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 7, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 8, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 9, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 10, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 11, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 12, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 13, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 14, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 15, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 16, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 17, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 18, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 19, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 20, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 21, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 22, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("ConfirmationPollingIntervalSeconds") + .HasColumnType("integer"); + + b1.Property("MaxGasBumpAttempts") + .HasColumnType("integer"); + + b1.Property("MaxInFlightTransactions") + .HasColumnType("integer"); + + b1.Property("RequiredConfirmations") + .HasColumnType("integer"); + + b1.Property("StuckTransactionTimeoutSeconds") + .HasColumnType("integer"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 2, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 3, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 4, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 5, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 6, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 7, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 8, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 9, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 10, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 11, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 12, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 13, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 14, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 15, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 16, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 17, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 18, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 19, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 20, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 21, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 22, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }); + }); + + b.Navigation("GasConfiguration") + .IsRequired(); + + b.Navigation("LiquidityConfiguration") + .IsRequired(); + + b.Navigation("RewardConfiguration") + .IsRequired(); + + b.Navigation("TimelockConfiguration") + .IsRequired(); + + b.Navigation("TransactionProcessorConfiguration") + .IsRequired(); + + b.Navigation("Type"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Metadata") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.NodeProvider", "NodeProvider") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NodeProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("NodeProvider"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Nodes") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") + .WithMany() + .HasForeignKey("RouteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Route"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") + .WithMany() + .HasForeignKey("DestinationTokenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") + .WithMany() + .HasForeignKey("DestinationWalletId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") + .WithMany() + .HasForeignKey("RateProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") + .WithMany() + .HasForeignKey("ServiceFeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") + .WithMany() + .HasForeignKey("SourceTokenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") + .WithMany() + .HasForeignKey("SourceWalletId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DestinationToken"); + + b.Navigation("DestinationWallet"); + + b.Navigation("RateProvider"); + + b.Navigation("ServiceFee"); + + b.Navigation("SourceToken"); + + b.Navigation("SourceWallet"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Tokens") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") + .WithMany() + .HasForeignKey("TokenPriceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("TokenPrice"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany() + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") + .WithMany("Transactions") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Network"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") + .WithMany() + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NetworkType"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") + .WithMany("Wallets") + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") + .WithMany() + .HasForeignKey("SignerAgentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NetworkType"); + + b.Navigation("SignerAgent"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.Navigation("Contracts"); + + b.Navigation("EventListenerConfigs"); + + b.Navigation("Metadata"); + + b.Navigation("NetworkNodeProviders"); + + b.Navigation("Nodes"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Navigation("Networks"); + + b.Navigation("Wallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Navigation("NetworkNodeProviders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Navigation("Transactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/csharp/src/Data.Npgsql/Migrations/20260311104517_UpdateEventListenerSeed.cs b/csharp/src/Data.Npgsql/Migrations/20260311104517_UpdateEventListenerSeed.cs new file mode 100644 index 00000000..825a6693 --- /dev/null +++ b/csharp/src/Data.Npgsql/Migrations/20260311104517_UpdateEventListenerSeed.cs @@ -0,0 +1,196 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Train.Solver.Data.Npgsql.Migrations +{ + /// + public partial class UpdateEventListenerSeed : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "WebhookSubscribers", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 1, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 2, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 3, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 4, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 5, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 6, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 7, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 8, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 9, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 10, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 11, + column: "Enabled", + value: false); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 12, + column: "Enabled", + value: false); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 1, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 2, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 3, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 4, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 5, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 6, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 7, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 8, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 9, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 10, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 11, + column: "Enabled", + value: true); + + migrationBuilder.UpdateData( + table: "EventListenerConfigs", + keyColumn: "Id", + keyValue: 12, + column: "Enabled", + value: true); + + migrationBuilder.InsertData( + table: "WebhookSubscribers", + columns: new[] { "Id", "EventTypes", "IsActive", "Name", "Secret", "Url" }, + values: new object[] { 1, new string[0], true, "station-api", "station-webhook-secret-1", "http://localhost:9690/api/v1/webhooks/plorex" }); + } + } +} diff --git a/csharp/src/Data.Npgsql/Migrations/20260311121301_RemoveNodeProviderName.Designer.cs b/csharp/src/Data.Npgsql/Migrations/20260311121301_RemoveNodeProviderName.Designer.cs new file mode 100644 index 00000000..8668fd1d --- /dev/null +++ b/csharp/src/Data.Npgsql/Migrations/20260311121301_RemoveNodeProviderName.Designer.cs @@ -0,0 +1,4866 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Train.Solver.Data.Npgsql; + +#nullable disable + +namespace Train.Solver.Data.Npgsql.Migrations +{ + [DbContext(typeof(SolverDbContext))] + [Migration("20260311121301_RemoveNodeProviderName")] + partial class RemoveNodeProviderName + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("Type", "NetworkId") + .IsUnique(); + + b.ToTable("Contracts"); + + b.HasData( + new + { + Id = 1, + Address = "0x9A0E4E619d391f6352E112cC4c452344a3EB4119", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + Type = "Train", + Version = 0u + }, + new + { + Id = 3, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 2, + Address = "0xCf6D47Cdd0cB259E78262832b4dB3F4F4F909dcB", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + Type = "Train", + Version = 0u + }, + new + { + Id = 4, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 5, + Address = "0xED6e07cAF602FEB2D535267b06b24bC6cb457975", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + Type = "Train", + Version = 0u + }, + new + { + Id = 6, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 7, + Address = "0x4e25d1f421dc2d578bc846178d5ca594e121f2ec", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + Type = "Train", + Version = 0u + }, + new + { + Id = 8, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 9, + Address = "0x2b9192d4571cceb33c689f750bcf380a7baae350846cc55616a278523cfd0dfc", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 5, + Type = "Train", + Version = 0u + }, + new + { + Id = 10, + Address = "0x1d7fd349c411467f17d293608462dc0b8529082d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + Type = "Train", + Version = 0u + }, + new + { + Id = 11, + Address = "0x056d5aab86196192bbdb571116b69de5169453eaf3f164300de2616c184fd697", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + Type = "Train", + Version = 0u + }, + new + { + Id = 12, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 13, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 14, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 15, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 16, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 17, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 18, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 19, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 20, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 21, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 22, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + Type = "Multicall", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CatchUpGapThreshold") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("ListenerType") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId", "ListenerType"); + + b.ToTable("EventListenerConfigs"); + + b.HasData( + new + { + Id = 1, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 1, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 2, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 1, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 3, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 2, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 4, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 2, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 5, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 3, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", + Version = 0u + }, + new + { + Id = 6, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "mempool-event-listener", + NetworkId = 1, + Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", + Version = 0u + }, + new + { + Id = 7, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "mempool-event-listener", + NetworkId = 2, + Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", + Version = 0u + }, + new + { + Id = 8, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 4, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 9, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 4, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 10, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 5, + Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 11, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 6, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 12, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 8, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 13, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 9, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 14, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 9, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 15, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 10, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 16, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 10, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 17, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 11, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 18, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 11, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 19, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 12, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 20, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 12, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u + }, + new + { + Id = 21, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 13, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u + }, + new + { + Id = 22, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 13, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 23, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 14, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 24, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 14, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 25, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 15, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 26, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 15, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 27, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 16, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 28, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 17, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 29, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 17, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 30, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 18, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u + }, + new + { + Id = 31, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 19, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 32, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 21, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 33, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 21, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }, + new + { + Id = 34, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 22, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", + Version = 0u + }, + new + { + Id = 35, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 22, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChainId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsTestnet") + .HasColumnType("boolean"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("Slug") + .IsUnique(); + + b.HasIndex("ChainId", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Networks"); + + b.HasData( + new + { + Id = 1, + ChainId = "11155111", + DisplayName = "Ethereum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "eth-sepolia" + }, + new + { + Id = 2, + ChainId = "421614", + DisplayName = "Arbitrum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "arb-sepolia" + }, + new + { + Id = 3, + ChainId = "84532", + DisplayName = "Base Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "base-sepolia" + }, + new + { + Id = 4, + ChainId = "97", + DisplayName = "BSC Testnet", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "bsc-testnet" + }, + new + { + Id = 5, + ChainId = "aztec-devnet", + DisplayName = "Aztec Devnet", + IsTestnet = true, + NetworkTypeId = 5, + Slug = "aztec-devnet" + }, + new + { + Id = 6, + ChainId = "SN_SEPOLIA", + DisplayName = "Starknet Sepolia", + IsTestnet = true, + NetworkTypeId = 3, + Slug = "starknet-sepolia" + }, + new + { + Id = 7, + ChainId = "3448148188", + DisplayName = "Tron Nile Testnet", + IsTestnet = true, + NetworkTypeId = 6, + Slug = "tron-nile" + }, + new + { + Id = 8, + ChainId = "devnet", + DisplayName = "Solana Devnet", + IsTestnet = true, + NetworkTypeId = 2, + Slug = "solana-devnet" + }, + new + { + Id = 9, + ChainId = "1", + DisplayName = "Ethereum", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "ethereum" + }, + new + { + Id = 10, + ChainId = "42161", + DisplayName = "Arbitrum One", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "arbitrum" + }, + new + { + Id = 11, + ChainId = "8453", + DisplayName = "Base", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "base" + }, + new + { + Id = 12, + ChainId = "10", + DisplayName = "OP Mainnet", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "optimism" + }, + new + { + Id = 13, + ChainId = "137", + DisplayName = "Polygon", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "polygon" + }, + new + { + Id = 14, + ChainId = "56", + DisplayName = "BNB Smart Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "bsc" + }, + new + { + Id = 15, + ChainId = "43114", + DisplayName = "Avalanche C-Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "avalanche" + }, + new + { + Id = 16, + ChainId = "59144", + DisplayName = "Linea", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "linea" + }, + new + { + Id = 17, + ChainId = "534352", + DisplayName = "Scroll", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "scroll" + }, + new + { + Id = 18, + ChainId = "SN_MAIN", + DisplayName = "Starknet", + IsTestnet = false, + NetworkTypeId = 3, + Slug = "starknet" + }, + new + { + Id = 19, + ChainId = "mainnet-beta", + DisplayName = "Solana", + IsTestnet = false, + NetworkTypeId = 2, + Slug = "solana" + }, + new + { + Id = 20, + ChainId = "728126428", + DisplayName = "Tron", + IsTestnet = false, + NetworkTypeId = 6, + Slug = "tron" + }, + new + { + Id = 21, + ChainId = "324", + DisplayName = "ZKsync Era", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "zksync" + }, + new + { + Id = 22, + ChainId = "81457", + DisplayName = "Blast", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "blast" + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Key") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId", "Key") + .IsUnique(); + + b.ToTable("NetworkMetadata"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("NodeProviderId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NodeProviderId"); + + b.HasIndex("NetworkId", "NodeProviderId") + .IsUnique(); + + b.ToTable("NetworkNodeProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 12, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 13, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 14, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 15, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 16, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 17, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 18, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 19, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 21, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 22, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 23, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 24, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 25, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 26, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 27, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 28, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 29, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 30, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 31, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 33, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 34, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 35, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 36, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 37, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 38, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 39, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 40, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 41, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 42, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 43, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 44, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 45, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 46, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 47, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 48, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 49, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 50, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 51, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 52, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 53, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 54, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 55, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 56, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 57, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 58, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 59, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 60, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 61, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 62, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 63, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 64, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 65, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 66, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 67, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 68, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 69, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 70, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 71, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 72, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 73, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 74, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 75, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 76, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 77, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 78, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 79, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 80, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 81, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 82, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 83, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 84, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 85, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 86, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 87, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 88, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 89, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 90, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 91, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 92, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 93, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 5, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressFormat") + .IsRequired() + .HasColumnType("text"); + + b.Property("AddressLength") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Curve") + .IsRequired() + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NativeTokenAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("RequiresWalletActivation") + .HasColumnType("boolean"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NetworkTypes"); + + b.HasData( + new + { + Id = 1, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "EVM", + Name = "eip155", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 2, + AddressFormat = "base58", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "ed25519", + DisplayName = "Solana", + Name = "solana", + NativeTokenAddress = "11111111111111111111111111111111", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 3, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "stark", + DisplayName = "Starknet", + Name = "starknet", + NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 4, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Fuel", + Name = "fuel", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 5, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "grumpkin", + DisplayName = "Aztec", + Name = "aztec", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 6, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Tron", + Name = "tron", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Protocol") + .HasColumnType("integer"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("Url", "NetworkId", "Protocol") + .IsUnique(); + + b.ToTable("Nodes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKey") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NodeProviders"); + + b.HasData( + new + { + Id = 1, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "alchemy", + Version = 0u + }, + new + { + Id = 2, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "infura", + Version = 0u + }, + new + { + Id = 3, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "ankr", + Version = 0u + }, + new + { + Id = 4, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "drpc", + Version = 0u + }, + new + { + Id = 5, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "chainlist", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("FailureReason") + .HasColumnType("text"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hashlock") + .IsRequired() + .HasColumnType("text"); + + b.Property("RouteId") + .HasColumnType("integer"); + + b.Property("SolverLockIndex") + .HasColumnType("text"); + + b.Property("SolverLockTimelock") + .HasColumnType("bigint"); + + b.Property("SourceAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("WorkflowId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationAddress"); + + b.HasIndex("Hashlock") + .IsUnique(); + + b.HasIndex("RouteId"); + + b.HasIndex("SourceAddress"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletionTimeInSeconds") + .HasColumnType("double precision"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("ProfitInUsd") + .HasColumnType("numeric"); + + b.Property("SourceNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("VolumeInUsd") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationNetwork"); + + b.HasIndex("OrderId"); + + b.HasIndex("SourceNetwork"); + + b.ToTable("OrderMetrics"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("RateProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "SameAsset", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "TokenPrice", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoRefundUser") + .HasColumnType("boolean"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationTokenId") + .HasColumnType("integer"); + + b.Property("DestinationWalletId") + .HasColumnType("integer"); + + b.Property("MaxAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("MinAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("RateProviderId") + .HasColumnType("integer"); + + b.Property("ServiceFeeId") + .HasColumnType("integer"); + + b.Property("SourceTokenId") + .HasColumnType("integer"); + + b.Property("SourceWalletId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Active=0,Inactive=1,Archived=2"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("DestinationTokenId"); + + b.HasIndex("DestinationWalletId"); + + b.HasIndex("RateProviderId"); + + b.HasIndex("ServiceFeeId"); + + b.HasIndex("SourceWalletId"); + + b.HasIndex("SourceTokenId", "DestinationTokenId") + .IsUnique(); + + b.ToTable("Routes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeInUsd") + .HasColumnType("numeric"); + + b.Property("FeePercentage") + .HasColumnType("numeric"); + + b.Property("IncludeExpenseFee") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ServiceFees"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FeeInUsd = 0m, + FeePercentage = 0m, + IncludeExpenseFee = false, + Name = "Free", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SignerAgents"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContractAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Decimals") + .HasColumnType("integer"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenPriceId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("TokenPriceId"); + + b.HasIndex("NetworkId", "ContractAddress") + .IsUnique(); + + b.ToTable("Tokens"); + + b.HasData( + new + { + Id = 1, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 1, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 2, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 2, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 3, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 3, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 4, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 4, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 5, + ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 5, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 6, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 6, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 7, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 7, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 8, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 8, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 9, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 10, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 11, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 12, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 13, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "POL", + TokenPriceId = 5, + Version = 0u + }, + new + { + Id = 14, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 15, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "AVAX", + TokenPriceId = 6, + Version = 0u + }, + new + { + Id = 16, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 17, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 18, + ContractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 19, + ContractAddress = "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 20, + ContractAddress = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 21, + ContractAddress = "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 22, + ContractAddress = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 23, + ContractAddress = "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 24, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 25, + ContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 26, + ContractAddress = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 27, + ContractAddress = "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 28, + ContractAddress = "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 29, + ContractAddress = "0x55d398326f99059ff775485246999027b3197955", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 14, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 30, + ContractAddress = "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 31, + ContractAddress = "0xa219439258ca9da29e9cc4ce5596924745e12b93", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 32, + ContractAddress = "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 33, + ContractAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 34, + ContractAddress = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 35, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 36, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 37, + ContractAddress = "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 38, + ContractAddress = "0x2170ed0880ac9a755fd29b2688956bd959f933f8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 39, + ContractAddress = "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 40, + ContractAddress = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 41, + ContractAddress = "0x5300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 42, + ContractAddress = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 9, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 43, + ContractAddress = "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 10, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 44, + ContractAddress = "0x68f180fcce6836688e9084f035309e29bf0a2095", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 12, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 45, + ContractAddress = "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 13, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 46, + ContractAddress = "0x50b7545627a5162f82a992c33b87adc75187b218", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 15, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 47, + ContractAddress = "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 16, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 48, + ContractAddress = "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 17, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 49, + ContractAddress = "0x6b175474e89094c44da98b954eedeac495271d0f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 50, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 51, + ContractAddress = "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 52, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 53, + ContractAddress = "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 54, + ContractAddress = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 55, + ContractAddress = "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 56, + ContractAddress = "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 57, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 18, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 58, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 19, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 59, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 20, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 60, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 61, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 62, + ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 18, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 63, + ContractAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 64, + ContractAddress = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 65, + ContractAddress = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 66, + ContractAddress = "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 67, + ContractAddress = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 68, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 69, + ContractAddress = "0x493257fd37edb34451f62edf8d2a0c418852ba4c", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 70, + ContractAddress = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 71, + ContractAddress = "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 8, + NetworkId = 21, + Symbol = "WBTC", + TokenPriceId = 10, + Version = 0u + }, + new + { + Id = 72, + ContractAddress = "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 21, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 73, + ContractAddress = "0x4300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TokenPrice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("ExternalId") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("PriceInUsd") + .HasColumnType("numeric"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Symbol") + .IsUnique(); + + b.ToTable("TokenPrices"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "ETHUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 2000.0m, + Symbol = "ETH", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BNBUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 600.0m, + Symbol = "BNB", + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "SOLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 140.0m, + Symbol = "SOL", + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "TRXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.25m, + Symbol = "TRX", + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "POLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "POL", + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "AVAXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 35.0m, + Symbol = "AVAX", + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDC", + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDTUSD", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDT", + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "STRKUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "STRK", + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BTCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 60000.0m, + Symbol = "BTC", + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "DAIUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "DAI", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Completed=0,Initiated=1,Failed=2"); + + b.Property("Timestamp") + .HasColumnType("timestamp with time zone"); + + b.Property("TransactionHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer") + .HasComment("Transfer=0,Approve=1,HTLCLock=2,HTLCRedeem=3,HTLCRefund=4,Custom=5,UserHTLCLock=6,UserHTLCRedeem=7,UserHTLCRefund=8"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("OrderId"); + + b.HasIndex("Status"); + + b.HasIndex("TransactionHash"); + + b.HasIndex("Type"); + + b.HasIndex("TransactionHash", "NetworkId") + .IsUnique(); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("Address", "NetworkTypeId"); + + b.HasIndex("Name", "NetworkTypeId") + .IsUnique(); + + b.ToTable("TrustedWallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NetworkTypeId") + .HasColumnType("integer"); + + b.Property("SignerAgentId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Inactive=0,Activating=1,Active=2,Failed=3"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkTypeId"); + + b.HasIndex("SignerAgentId"); + + b.HasIndex("Address", "NetworkTypeId"); + + b.HasIndex("Name", "NetworkTypeId") + .IsUnique(); + + b.ToTable("Wallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.PrimitiveCollection("EventTypes") + .IsRequired() + .HasColumnType("text[]"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Secret") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("WebhookSubscribers"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Contracts") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.EventListenerConfig", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("EventListenerConfigs") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "Type") + .WithMany("Networks") + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.GasConfiguration", "GasConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("BaseFeePercentageIncrease") + .HasColumnType("integer"); + + b1.Property("HasL1Fee") + .HasColumnType("boolean"); + + b1.Property("IsEip1559") + .HasColumnType("boolean"); + + b1.Property("L1FeeOracleContract") + .HasColumnType("text"); + + b1.Property("PriorityFeePercentageIncrease") + .HasColumnType("integer"); + + b1.Property("ReplacementFeePercentageIncrease") + .HasColumnType("integer"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 2, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 3, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 4, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 5, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 6, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 7, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 8, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 9, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 10, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 11, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 12, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 13, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 14, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 15, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 16, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 17, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x5300000000000000000000000000000000000002", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 18, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 19, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 20, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 21, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 22, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.LiquidityConfiguration", "LiquidityConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("AutoRebalanceEnabled") + .HasColumnType("boolean"); + + b1.Property("MaxBalanceThreshold") + .IsRequired() + .HasColumnType("text"); + + b1.Property("MinBalanceThreshold") + .IsRequired() + .HasColumnType("text"); + + b1.Property("MinGasBalance") + .IsRequired() + .HasColumnType("text"); + + b1.Property("TargetBalance") + .IsRequired() + .HasColumnType("text"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 2, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 3, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 4, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 5, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 6, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 7, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 8, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 9, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 10, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 11, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 12, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 13, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "1000000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 14, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 15, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 16, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 17, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 18, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 19, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 20, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 21, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 22, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("DeltaPercentage") + .HasColumnType("numeric"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + DeltaPercentage = 10m + }, + new + { + NetworkId = 2, + DeltaPercentage = 10m + }, + new + { + NetworkId = 3, + DeltaPercentage = 10m + }, + new + { + NetworkId = 4, + DeltaPercentage = 10m + }, + new + { + NetworkId = 5, + DeltaPercentage = 10m + }, + new + { + NetworkId = 6, + DeltaPercentage = 10m + }, + new + { + NetworkId = 7, + DeltaPercentage = 10m + }, + new + { + NetworkId = 8, + DeltaPercentage = 10m + }, + new + { + NetworkId = 9, + DeltaPercentage = 10m + }, + new + { + NetworkId = 10, + DeltaPercentage = 10m + }, + new + { + NetworkId = 11, + DeltaPercentage = 10m + }, + new + { + NetworkId = 12, + DeltaPercentage = 10m + }, + new + { + NetworkId = 13, + DeltaPercentage = 10m + }, + new + { + NetworkId = 14, + DeltaPercentage = 10m + }, + new + { + NetworkId = 15, + DeltaPercentage = 10m + }, + new + { + NetworkId = 16, + DeltaPercentage = 10m + }, + new + { + NetworkId = 17, + DeltaPercentage = 10m + }, + new + { + NetworkId = 18, + DeltaPercentage = 10m + }, + new + { + NetworkId = 19, + DeltaPercentage = 10m + }, + new + { + NetworkId = 20, + DeltaPercentage = 10m + }, + new + { + NetworkId = 21, + DeltaPercentage = 10m + }, + new + { + NetworkId = 22, + DeltaPercentage = 10m + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TimelockConfiguration", "TimelockConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("QuoteExpiryInSeconds") + .HasColumnType("bigint"); + + b1.Property("RewardTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.Property("SolverTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.Property("UserTimelockTimeSpanInSeconds") + .HasColumnType("bigint"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 2, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 3, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 4, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 5, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 6, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 7, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 8, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 9, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 10, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 11, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 12, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 13, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 14, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 15, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 16, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 17, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 18, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 19, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 20, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 21, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 22, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.TransactionProcessorConfiguration", "TransactionProcessorConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("ConfirmationPollingIntervalSeconds") + .HasColumnType("integer"); + + b1.Property("MaxGasBumpAttempts") + .HasColumnType("integer"); + + b1.Property("MaxInFlightTransactions") + .HasColumnType("integer"); + + b1.Property("RequiredConfirmations") + .HasColumnType("integer"); + + b1.Property("StuckTransactionTimeoutSeconds") + .HasColumnType("integer"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 2, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 3, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 4, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 5, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 6, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 7, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 8, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 9, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 10, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 11, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 12, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 13, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 14, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 15, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 16, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 17, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 18, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 19, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 20, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 21, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 22, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }); + }); + + b.Navigation("GasConfiguration") + .IsRequired(); + + b.Navigation("LiquidityConfiguration") + .IsRequired(); + + b.Navigation("RewardConfiguration") + .IsRequired(); + + b.Navigation("TimelockConfiguration") + .IsRequired(); + + b.Navigation("TransactionProcessorConfiguration") + .IsRequired(); + + b.Navigation("Type"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Metadata") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.NodeProvider", "NodeProvider") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NodeProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("NodeProvider"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Nodes") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Route", "Route") + .WithMany() + .HasForeignKey("RouteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Route"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "DestinationToken") + .WithMany() + .HasForeignKey("DestinationTokenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "DestinationWallet") + .WithMany() + .HasForeignKey("DestinationWalletId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.RateProvider", "RateProvider") + .WithMany() + .HasForeignKey("RateProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.ServiceFee", "ServiceFee") + .WithMany() + .HasForeignKey("ServiceFeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Token", "SourceToken") + .WithMany() + .HasForeignKey("SourceTokenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Wallet", "SourceWallet") + .WithMany() + .HasForeignKey("SourceWalletId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DestinationToken"); + + b.Navigation("DestinationWallet"); + + b.Navigation("RateProvider"); + + b.Navigation("ServiceFee"); + + b.Navigation("SourceToken"); + + b.Navigation("SourceWallet"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("Tokens") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.TokenPrice", "TokenPrice") + .WithMany() + .HasForeignKey("TokenPriceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("TokenPrice"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Transaction", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany() + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.Order", "Order") + .WithMany("Transactions") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Network"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.TrustedWallet", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") + .WithMany() + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NetworkType"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Wallet", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.NetworkType", "NetworkType") + .WithMany("Wallets") + .HasForeignKey("NetworkTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.SignerAgent", "SignerAgent") + .WithMany() + .HasForeignKey("SignerAgentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NetworkType"); + + b.Navigation("SignerAgent"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => + { + b.Navigation("Contracts"); + + b.Navigation("EventListenerConfigs"); + + b.Navigation("Metadata"); + + b.Navigation("NetworkNodeProviders"); + + b.Navigation("Nodes"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Navigation("Networks"); + + b.Navigation("Wallets"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Navigation("NetworkNodeProviders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Navigation("Transactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/csharp/src/Data.Npgsql/Migrations/20260311121301_RemoveNodeProviderName.cs b/csharp/src/Data.Npgsql/Migrations/20260311121301_RemoveNodeProviderName.cs new file mode 100644 index 00000000..ddf455a2 --- /dev/null +++ b/csharp/src/Data.Npgsql/Migrations/20260311121301_RemoveNodeProviderName.cs @@ -0,0 +1,49 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Train.Solver.Data.Npgsql.Migrations +{ + /// + public partial class RemoveNodeProviderName : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Nodes_ProviderName_NetworkId_Protocol", + table: "Nodes"); + + migrationBuilder.DropColumn( + name: "ProviderName", + table: "Nodes"); + + migrationBuilder.CreateIndex( + name: "IX_Nodes_Url_NetworkId_Protocol", + table: "Nodes", + columns: new[] { "Url", "NetworkId", "Protocol" }, + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Nodes_Url_NetworkId_Protocol", + table: "Nodes"); + + migrationBuilder.AddColumn( + name: "ProviderName", + table: "Nodes", + type: "text", + nullable: false, + defaultValue: ""); + + migrationBuilder.CreateIndex( + name: "IX_Nodes_ProviderName_NetworkId_Protocol", + table: "Nodes", + columns: new[] { "ProviderName", "NetworkId", "Protocol" }, + unique: true); + } + } +} diff --git a/csharp/src/Data.Npgsql/Migrations/SolverDbContextModelSnapshot.cs b/csharp/src/Data.Npgsql/Migrations/SolverDbContextModelSnapshot.cs index 55556200..ef5da24f 100644 --- a/csharp/src/Data.Npgsql/Migrations/SolverDbContextModelSnapshot.cs +++ b/csharp/src/Data.Npgsql/Migrations/SolverDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "9.0.13") + .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -160,6 +160,105 @@ protected override void BuildModel(ModelBuilder modelBuilder) NetworkId = 6, Type = "Train", Version = 0u + }, + new + { + Id = 12, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 13, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 14, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 15, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 16, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 17, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 18, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 19, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 20, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 21, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + Type = "Multicall", + Version = 0u + }, + new + { + Id = 22, + Address = "0xcA11bde05977b3631167028862bE2a173976CA11", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + Type = "Multicall", + Version = 0u }); }); @@ -213,7 +312,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 1, CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "rpc-log-event-listener", NetworkId = 1, Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", @@ -224,7 +323,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 2, CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "websocket-event-listener", NetworkId = 1, Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", @@ -235,7 +334,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 3, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "rpc-log-event-listener", NetworkId = 2, Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", @@ -246,7 +345,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 4, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "websocket-event-listener", NetworkId = 2, Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", @@ -257,7 +356,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 5, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "rpc-log-event-listener", NetworkId = 3, Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"12\"}", @@ -268,7 +367,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 6, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "mempool-event-listener", NetworkId = 1, Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", @@ -279,7 +378,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 7, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "mempool-event-listener", NetworkId = 2, Settings = "{\"ReconnectDelaySeconds\":\"5\",\"HeartbeatIntervalSeconds\":\"15\"}", @@ -290,7 +389,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 8, CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "rpc-log-event-listener", NetworkId = 4, Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", @@ -301,7 +400,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 9, CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "websocket-event-listener", NetworkId = 4, Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", @@ -312,7 +411,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 10, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "rpc-log-event-listener", NetworkId = 5, Settings = "{\"PollingIntervalSeconds\":\"5\",\"BlockBatchSize\":\"10\",\"BlockConfirmations\":\"0\"}", @@ -323,454 +422,279 @@ protected override void BuildModel(ModelBuilder modelBuilder) Id = 11, CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Enabled = true, + Enabled = false, ListenerType = "rpc-log-event-listener", NetworkId = 6, Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChainId") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkTypeId") - .HasColumnType("integer"); - - b.Property("Slug") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkTypeId"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("ChainId", "NetworkTypeId") - .IsUnique(); - - b.ToTable("Networks"); - - b.HasData( + }, new { - Id = 1, - ChainId = "11155111", - DisplayName = "Ethereum Sepolia", - NetworkTypeId = 1, - Slug = "eth-sepolia" + Id = 12, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 8, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", + Version = 0u }, new { - Id = 2, - ChainId = "421614", - DisplayName = "Arbitrum Sepolia", - NetworkTypeId = 1, - Slug = "arb-sepolia" + Id = 13, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 9, + Settings = "{\"PollingIntervalSeconds\":\"12\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u }, new { - Id = 3, - ChainId = "84532", - DisplayName = "Base Sepolia", - NetworkTypeId = 1, - Slug = "base-sepolia" + Id = 14, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 9, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u }, new { - Id = 4, - ChainId = "97", - DisplayName = "BSC Testnet", - NetworkTypeId = 1, - Slug = "bsc-testnet" + Id = 15, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 10, + Settings = "{\"PollingIntervalSeconds\":\"1\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", + Version = 0u }, new { - Id = 5, - ChainId = "aztec-devnet", - DisplayName = "Aztec Devnet", - NetworkTypeId = 5, - Slug = "aztec-devnet" + Id = 16, + CatchUpGapThreshold = 0, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 10, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", + Version = 0u }, new { - Id = 6, - ChainId = "SN_SEPOLIA", - DisplayName = "Starknet Sepolia", - NetworkTypeId = 3, - Slug = "starknet-sepolia" + Id = 17, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 11, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", + Version = 0u }, new { - Id = 7, - ChainId = "3448148188", - DisplayName = "Tron Nile Testnet", - NetworkTypeId = 6, - Slug = "tron-nile" + Id = 18, + CatchUpGapThreshold = 100, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 11, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", + Version = 0u }, new { - Id = 8, - ChainId = "devnet", - DisplayName = "Solana Devnet", - NetworkTypeId = 2, - Slug = "solana-devnet" - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Key") - .IsRequired() - .HasColumnType("text"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId", "Key") - .IsUnique(); - - b.ToTable("NetworkMetadata"); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressFormat") - .IsRequired() - .HasColumnType("text"); - - b.Property("AddressLength") - .HasColumnType("integer"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Curve") - .IsRequired() - .HasColumnType("text"); - - b.Property("DisplayName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("NativeTokenAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("RequiresWalletActivation") - .HasColumnType("boolean"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("NetworkTypes"); - - b.HasData( - new - { - Id = 1, - AddressFormat = "hex", - AddressLength = 20, + Id = 19, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "EVM", - Name = "eip155", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - RequiresWalletActivation = false, + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 12, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", Version = 0u }, new { - Id = 2, - AddressFormat = "base58", - AddressLength = 32, + Id = 20, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "ed25519", - DisplayName = "Solana", - Name = "solana", - NativeTokenAddress = "11111111111111111111111111111111", - RequiresWalletActivation = false, + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 12, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"10\"}", Version = 0u }, new { - Id = 3, - AddressFormat = "hex", - AddressLength = 32, + Id = 21, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "stark", - DisplayName = "Starknet", - Name = "starknet", - NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - RequiresWalletActivation = true, + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 13, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"2\"}", Version = 0u }, new { - Id = 4, - AddressFormat = "hex", - AddressLength = 32, + Id = 22, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Fuel", - Name = "fuel", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - RequiresWalletActivation = false, + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 13, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 5, - AddressFormat = "hex", - AddressLength = 32, + Id = 23, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "grumpkin", - DisplayName = "Aztec", - Name = "aztec", - NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", - RequiresWalletActivation = true, + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 14, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 6, - AddressFormat = "hex", - AddressLength = 20, + Id = 24, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Curve = "secp256k1", - DisplayName = "Tron", - Name = "tron", - NativeTokenAddress = "0x0000000000000000000000000000000000000000", - RequiresWalletActivation = false, + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 14, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Protocol") - .HasColumnType("integer"); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("NetworkId"); - - b.HasIndex("ProviderName", "NetworkId", "Protocol") - .IsUnique(); - - b.ToTable("Nodes"); - - b.HasData( + }, new { - Id = 1, + Id = 25, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 15, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 2, + Id = 26, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 15, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 3, + Id = 27, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 3, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://base-sepolia-rpc.publicnode.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 16, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 4, + Id = 28, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 1, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://eth-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 17, + Settings = "{\"PollingIntervalSeconds\":\"3\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 5, + Id = 29, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 2, - Protocol = 1, - ProviderName = "alchemy", - Url = "wss://arb-sepolia.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 17, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 6, + Id = 30, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 0, - ProviderName = "publicnode", - Url = "https://bsc-testnet-rpc.publicnode.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 18, + Settings = "{\"PollingIntervalSeconds\":\"10\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"0\"}", Version = 0u }, new { - Id = 7, + Id = 31, + CatchUpGapThreshold = 0, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 4, - Protocol = 1, - ProviderName = "publicnode", - Url = "wss://bsc-testnet-rpc.publicnode.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 19, + Settings = "{\"PollingIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 8, + Id = 32, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 5, - Protocol = 0, - ProviderName = "aztec", - Url = "https://v4-devnet-2.aztec-labs.com", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 21, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 9, + Id = 33, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 6, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_8/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 21, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }, new { - Id = 10, + Id = 34, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 7, - Protocol = 0, - ProviderName = "alchemy", - Url = "https://tron-testnet.g.alchemy.com/v2/KMb0Q5To2lB2gcfLSWsOJPwJmYZzSacQ", + Enabled = false, + ListenerType = "rpc-log-event-listener", + NetworkId = 22, + Settings = "{\"PollingIntervalSeconds\":\"2\",\"BlockBatchSize\":\"100\",\"BlockConfirmations\":\"1\"}", Version = 0u }, new { - Id = 11, + Id = 35, + CatchUpGapThreshold = 100, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - NetworkId = 8, - Protocol = 0, - ProviderName = "solana", - Url = "https://api.devnet.solana.com", + Enabled = false, + ListenerType = "websocket-event-listener", + NetworkId = 22, + Settings = "{\"ReconnectDelaySeconds\":\"10\",\"HeartbeatIntervalSeconds\":\"5\"}", Version = 0u }); }); - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Network", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -778,80 +702,249 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CompletedDate") - .HasColumnType("timestamp with time zone"); + b.Property("ChainId") + .IsRequired() + .HasColumnType("text"); b.Property("CreatedDate") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("now()"); - b.Property("DestinationAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationAmount") - .IsRequired() - .HasColumnType("text"); - - b.Property("FailureReason") - .HasColumnType("text"); - - b.Property("FeeAmount") + b.Property("DisplayName") .IsRequired() .HasColumnType("text"); - b.Property("Hashlock") - .IsRequired() - .HasColumnType("text"); + b.Property("IsTestnet") + .HasColumnType("boolean"); - b.Property("RouteId") + b.Property("NetworkTypeId") .HasColumnType("integer"); - b.Property("SolverLockIndex") - .HasColumnType("text"); - - b.Property("SolverLockTimelock") - .HasColumnType("bigint"); - - b.Property("SourceAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceAmount") + b.Property("Slug") .IsRequired() .HasColumnType("text"); - b.Property("Status") - .HasColumnType("integer") - .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); - b.Property("Version") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("xid") .HasColumnName("xmin"); - b.Property("WorkflowId") - .HasColumnType("text"); - b.HasKey("Id"); - b.HasIndex("CreatedDate"); + b.HasIndex("NetworkTypeId"); - b.HasIndex("DestinationAddress"); - - b.HasIndex("Hashlock") + b.HasIndex("Slug") .IsUnique(); - b.HasIndex("RouteId"); + b.HasIndex("ChainId", "NetworkTypeId") + .IsUnique(); - b.HasIndex("SourceAddress"); + b.ToTable("Networks"); - b.ToTable("Orders"); + b.HasData( + new + { + Id = 1, + ChainId = "11155111", + DisplayName = "Ethereum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "eth-sepolia" + }, + new + { + Id = 2, + ChainId = "421614", + DisplayName = "Arbitrum Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "arb-sepolia" + }, + new + { + Id = 3, + ChainId = "84532", + DisplayName = "Base Sepolia", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "base-sepolia" + }, + new + { + Id = 4, + ChainId = "97", + DisplayName = "BSC Testnet", + IsTestnet = true, + NetworkTypeId = 1, + Slug = "bsc-testnet" + }, + new + { + Id = 5, + ChainId = "aztec-devnet", + DisplayName = "Aztec Devnet", + IsTestnet = true, + NetworkTypeId = 5, + Slug = "aztec-devnet" + }, + new + { + Id = 6, + ChainId = "SN_SEPOLIA", + DisplayName = "Starknet Sepolia", + IsTestnet = true, + NetworkTypeId = 3, + Slug = "starknet-sepolia" + }, + new + { + Id = 7, + ChainId = "3448148188", + DisplayName = "Tron Nile Testnet", + IsTestnet = true, + NetworkTypeId = 6, + Slug = "tron-nile" + }, + new + { + Id = 8, + ChainId = "devnet", + DisplayName = "Solana Devnet", + IsTestnet = true, + NetworkTypeId = 2, + Slug = "solana-devnet" + }, + new + { + Id = 9, + ChainId = "1", + DisplayName = "Ethereum", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "ethereum" + }, + new + { + Id = 10, + ChainId = "42161", + DisplayName = "Arbitrum One", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "arbitrum" + }, + new + { + Id = 11, + ChainId = "8453", + DisplayName = "Base", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "base" + }, + new + { + Id = 12, + ChainId = "10", + DisplayName = "OP Mainnet", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "optimism" + }, + new + { + Id = 13, + ChainId = "137", + DisplayName = "Polygon", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "polygon" + }, + new + { + Id = 14, + ChainId = "56", + DisplayName = "BNB Smart Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "bsc" + }, + new + { + Id = 15, + ChainId = "43114", + DisplayName = "Avalanche C-Chain", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "avalanche" + }, + new + { + Id = 16, + ChainId = "59144", + DisplayName = "Linea", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "linea" + }, + new + { + Id = 17, + ChainId = "534352", + DisplayName = "Scroll", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "scroll" + }, + new + { + Id = 18, + ChainId = "SN_MAIN", + DisplayName = "Starknet", + IsTestnet = false, + NetworkTypeId = 3, + Slug = "starknet" + }, + new + { + Id = 19, + ChainId = "mainnet-beta", + DisplayName = "Solana", + IsTestnet = false, + NetworkTypeId = 2, + Slug = "solana" + }, + new + { + Id = 20, + ChainId = "728126428", + DisplayName = "Tron", + IsTestnet = false, + NetworkTypeId = 6, + Slug = "tron" + }, + new + { + Id = 21, + ChainId = "324", + DisplayName = "ZKsync Era", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "zksync" + }, + new + { + Id = 22, + ChainId = "81457", + DisplayName = "Blast", + IsTestnet = false, + NetworkTypeId = 1, + Slug = "blast" + }); }); - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkMetadata", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -859,33 +952,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CompletionTimeInSeconds") - .HasColumnType("double precision"); - b.Property("CreatedDate") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("now()"); - b.Property("DestinationNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("DestinationToken") + b.Property("Key") .IsRequired() .HasColumnType("text"); - b.Property("OrderId") + b.Property("NetworkId") .HasColumnType("integer"); - b.Property("ProfitInUsd") - .HasColumnType("numeric"); - - b.Property("SourceNetwork") - .IsRequired() - .HasColumnType("text"); - - b.Property("SourceToken") + b.Property("Value") .IsRequired() .HasColumnType("text"); @@ -895,23 +974,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("xid") .HasColumnName("xmin"); - b.Property("VolumeInUsd") - .HasColumnType("numeric"); - b.HasKey("Id"); - b.HasIndex("CreatedDate"); - - b.HasIndex("DestinationNetwork"); - - b.HasIndex("OrderId"); - - b.HasIndex("SourceNetwork"); + b.HasIndex("NetworkId", "Key") + .IsUnique(); - b.ToTable("OrderMetrics"); + b.ToTable("NetworkMetadata"); }); - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -924,9 +995,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("timestamp with time zone") .HasDefaultValueSql("now()"); - b.Property("Name") - .IsRequired() - .HasColumnType("text"); + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("NodeProviderId") + .HasColumnType("integer"); b.Property("Version") .IsConcurrencyToken() @@ -936,592 +1009,2209 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") + b.HasIndex("NodeProviderId"); + + b.HasIndex("NetworkId", "NodeProviderId") .IsUnique(); - b.ToTable("RateProviders"); + b.ToTable("NetworkNodeProviders"); b.HasData( new { Id = 1, CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SameAsset", + NetworkId = 1, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 3, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 4, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 12, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 13, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 14, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 15, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 16, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 17, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 18, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 19, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 1, + Version = 0u + }, + new + { + Id = 21, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 22, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 23, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 24, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 25, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 26, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 27, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 28, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 29, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 30, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 31, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 33, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 34, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 35, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 36, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 37, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 2, + Version = 0u + }, + new + { + Id = 38, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 39, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 40, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 41, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 42, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 43, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 44, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 45, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 46, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 47, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 48, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 49, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 50, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 51, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 52, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 53, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 54, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 55, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 56, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 3, + Version = 0u + }, + new + { + Id = 57, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 58, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 59, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 60, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 61, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 6, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 62, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 8, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 63, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 64, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 65, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 66, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 67, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 68, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 69, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 70, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 71, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 72, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 18, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 73, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 19, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 74, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 75, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 76, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 4, + Version = 0u + }, + new + { + Id = 77, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 1, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 78, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 2, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 79, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 3, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 80, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 4, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 81, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 7, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 82, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 9, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 83, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 10, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 84, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 11, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 85, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 12, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 86, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 13, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 87, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 14, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 88, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 15, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 89, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 16, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 90, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 17, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 91, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 20, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 92, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 21, + NodeProviderId = 5, + Version = 0u + }, + new + { + Id = 93, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + NetworkId = 22, + NodeProviderId = 5, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddressFormat") + .IsRequired() + .HasColumnType("text"); + + b.Property("AddressLength") + .HasColumnType("integer"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Curve") + .IsRequired() + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("NativeTokenAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("RequiresWalletActivation") + .HasColumnType("boolean"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NetworkTypes"); + + b.HasData( + new + { + Id = 1, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "EVM", + Name = "eip155", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 2, + AddressFormat = "base58", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "ed25519", + DisplayName = "Solana", + Name = "solana", + NativeTokenAddress = "11111111111111111111111111111111", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 3, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "stark", + DisplayName = "Starknet", + Name = "starknet", + NativeTokenAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 4, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Fuel", + Name = "fuel", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }, + new + { + Id = 5, + AddressFormat = "hex", + AddressLength = 32, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "grumpkin", + DisplayName = "Aztec", + Name = "aztec", + NativeTokenAddress = "0x0000000000000000000000000000000000000000000000000000000000000000", + RequiresWalletActivation = true, + Version = 0u + }, + new + { + Id = 6, + AddressFormat = "hex", + AddressLength = 20, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Curve = "secp256k1", + DisplayName = "Tron", + Name = "tron", + NativeTokenAddress = "0x0000000000000000000000000000000000000000", + RequiresWalletActivation = false, + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Protocol") + .HasColumnType("integer"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("NetworkId"); + + b.HasIndex("Url", "NetworkId", "Protocol") + .IsUnique(); + + b.ToTable("Nodes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApiKey") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("NodeProviders"); + + b.HasData( + new + { + Id = 1, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "alchemy", + Version = 0u + }, + new + { + Id = 2, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "infura", + Version = 0u + }, + new + { + Id = 3, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "ankr", + Version = 0u + }, + new + { + Id = 4, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "drpc", + Version = 0u + }, + new + { + Id = 5, + ApiKey = "", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Enabled = false, + Name = "chainlist", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("FailureReason") + .HasColumnType("text"); + + b.Property("FeeAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hashlock") + .IsRequired() + .HasColumnType("text"); + + b.Property("RouteId") + .HasColumnType("integer"); + + b.Property("SolverLockIndex") + .HasColumnType("text"); + + b.Property("SolverLockTimelock") + .HasColumnType("bigint"); + + b.Property("SourceAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceAmount") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Created=0,ReservingBalance=1,LPLocking=2,LPLocked=3,Redeeming=4,Completed=5,Refunding=6,SolverRefunded=7,UserRefunding=8,UserRefunded=9,Failed=10"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("WorkflowId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationAddress"); + + b.HasIndex("Hashlock") + .IsUnique(); + + b.HasIndex("RouteId"); + + b.HasIndex("SourceAddress"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.OrderMetric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletionTimeInSeconds") + .HasColumnType("double precision"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("DestinationToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("ProfitInUsd") + .HasColumnType("numeric"); + + b.Property("SourceNetwork") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.Property("VolumeInUsd") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDate"); + + b.HasIndex("DestinationNetwork"); + + b.HasIndex("OrderId"); + + b.HasIndex("SourceNetwork"); + + b.ToTable("OrderMetrics"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.RateProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("RateProviders"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "SameAsset", + Version = 0u + }, + new + { + Id = 2, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "TokenPrice", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoRefundUser") + .HasColumnType("boolean"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("DestinationTokenId") + .HasColumnType("integer"); + + b.Property("DestinationWalletId") + .HasColumnType("integer"); + + b.Property("MaxAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("MinAmountInSource") + .IsRequired() + .HasColumnType("text"); + + b.Property("RateProviderId") + .HasColumnType("integer"); + + b.Property("ServiceFeeId") + .HasColumnType("integer"); + + b.Property("SourceTokenId") + .HasColumnType("integer"); + + b.Property("SourceWalletId") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer") + .HasComment("Active=0,Inactive=1,Archived=2"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("DestinationTokenId"); + + b.HasIndex("DestinationWalletId"); + + b.HasIndex("RateProviderId"); + + b.HasIndex("ServiceFeeId"); + + b.HasIndex("SourceWalletId"); + + b.HasIndex("SourceTokenId", "DestinationTokenId") + .IsUnique(); + + b.ToTable("Routes"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("FeeInUsd") + .HasColumnType("numeric"); + + b.Property("FeePercentage") + .HasColumnType("numeric"); + + b.Property("IncludeExpenseFee") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ServiceFees"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + FeeInUsd = 0m, + FeePercentage = 0m, + IncludeExpenseFee = false, + Name = "Free", + Version = 0u + }); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SignerAgents"); + }); + + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContractAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Decimals") + .HasColumnType("integer"); + + b.Property("NetworkId") + .HasColumnType("integer"); + + b.Property("Symbol") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenPriceId") + .HasColumnType("integer"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("xid") + .HasColumnName("xmin"); + + b.HasKey("Id"); + + b.HasIndex("TokenPriceId"); + + b.HasIndex("NetworkId", "ContractAddress") + .IsUnique(); + + b.ToTable("Tokens"); + + b.HasData( + new + { + Id = 1, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 1, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 2, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 2, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 3, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 3, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 4, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 4, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 5, + ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 5, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 6, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 6, + Symbol = "STRK", + TokenPriceId = 9, + Version = 0u + }, + new + { + Id = 7, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 7, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 8, + ContractAddress = "11111111111111111111111111111111", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 9, + NetworkId = 8, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, + new + { + Id = 9, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 10, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 11, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 12, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 13, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "POL", + TokenPriceId = 5, + Version = 0u + }, + new + { + Id = 14, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "BNB", + TokenPriceId = 2, + Version = 0u + }, + new + { + Id = 15, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 15, + Symbol = "AVAX", + TokenPriceId = 6, + Version = 0u + }, + new + { + Id = 16, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 17, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 17, + Symbol = "ETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 18, + ContractAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 19, + ContractAddress = "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 20, + ContractAddress = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 21, + ContractAddress = "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 22, + ContractAddress = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 23, + ContractAddress = "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 24, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 25, + ContractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 9, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 26, + ContractAddress = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 10, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 27, + ContractAddress = "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 11, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 28, + ContractAddress = "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 12, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 29, + ContractAddress = "0x55d398326f99059ff775485246999027b3197955", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 14, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 30, + ContractAddress = "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 15, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 31, + ContractAddress = "0xa219439258ca9da29e9cc4ce5596924745e12b93", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 32, + ContractAddress = "0xf55bec9cafdbe8730f096aa55dad6d22d44099df", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 17, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 33, + ContractAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 9, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 34, + ContractAddress = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 10, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 35, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 11, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 36, + ContractAddress = "0x4200000000000000000000000000000000000006", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 12, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 37, + ContractAddress = "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 13, + Symbol = "WETH", + TokenPriceId = 1, + Version = 0u + }, + new + { + Id = 38, + ContractAddress = "0x2170ed0880ac9a755fd29b2688956bd959f933f8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 14, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 2, + Id = 39, + ContractAddress = "0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Binance", + Decimals = 18, + NetworkId = 15, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 3, + Id = 40, + ContractAddress = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "TokenPrice", + Decimals = 18, + NetworkId = 16, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoRefundUser") - .HasColumnType("boolean"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DestinationTokenId") - .HasColumnType("integer"); - - b.Property("DestinationWalletId") - .HasColumnType("integer"); - - b.Property("MaxAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("MinAmountInSource") - .IsRequired() - .HasColumnType("text"); - - b.Property("RateProviderId") - .HasColumnType("integer"); - - b.Property("ServiceFeeId") - .HasColumnType("integer"); - - b.Property("SourceTokenId") - .HasColumnType("integer"); - - b.Property("SourceWalletId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer") - .HasComment("Active=0,Inactive=1,Archived=2"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("DestinationTokenId"); - - b.HasIndex("DestinationWalletId"); - - b.HasIndex("RateProviderId"); - - b.HasIndex("ServiceFeeId"); - - b.HasIndex("SourceWalletId"); - - b.HasIndex("SourceTokenId", "DestinationTokenId") - .IsUnique(); - - b.ToTable("Routes"); - - b.HasData( + }, new { - Id = 1, - AutoRefundUser = false, + Id = 41, + ContractAddress = "0x5300000000000000000000000000000000000004", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 17, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }, new { - Id = 2, - AutoRefundUser = false, + Id = 42, + ContractAddress = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 9, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 3, - AutoRefundUser = false, + Id = 43, + ContractAddress = "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 10, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 4, - AutoRefundUser = false, + Id = 44, + ContractAddress = "0x68f180fcce6836688e9084f035309e29bf0a2095", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 12, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 5, - AutoRefundUser = false, + Id = 45, + ContractAddress = "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 13, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 6, - AutoRefundUser = false, + Id = 46, + ContractAddress = "0x50b7545627a5162f82a992c33b87adc75187b218", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 15, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 7, - AutoRefundUser = false, + Id = 47, + ContractAddress = "0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 16, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 8, - AutoRefundUser = false, + Id = 48, + ContractAddress = "0x3c1bca5a656e69edcd0d4e36bebb3fcdaca60cf1", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, + Decimals = 8, + NetworkId = 17, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 9, - AutoRefundUser = false, + Id = 49, + ContractAddress = "0x6b175474e89094c44da98b954eedeac495271d0f", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 9, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 10, - AutoRefundUser = false, + Id = 50, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 10, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 11, - AutoRefundUser = false, + Id = 51, + ContractAddress = "0x50c5725949a6f0c72e6c4a641f24049a917db0cb", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 4, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 3, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 11, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 12, - AutoRefundUser = false, + Id = 52, + ContractAddress = "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 3, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 3, - ServiceFeeId = 1, - SourceTokenId = 4, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 12, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 13, - AutoRefundUser = false, + Id = 53, + ContractAddress = "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 1, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, + Decimals = 18, + NetworkId = 13, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 14, - AutoRefundUser = false, + Id = 54, + ContractAddress = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 1, - SourceWalletId = 1, - Status = 0, + Decimals = 18, + NetworkId = 14, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 15, - AutoRefundUser = false, + Id = 55, + ContractAddress = "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 2, - DestinationWalletId = 1, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 5, - SourceWalletId = 2, - Status = 0, + Decimals = 18, + NetworkId = 15, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u }, new { - Id = 16, - AutoRefundUser = false, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - DestinationTokenId = 5, - DestinationWalletId = 2, - MaxAmountInSource = "5000000000000000", - MinAmountInSource = "100000000000", - RateProviderId = 1, - ServiceFeeId = 1, - SourceTokenId = 2, - SourceWalletId = 1, - Status = 0, + Id = 56, + ContractAddress = "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 16, + Symbol = "DAI", + TokenPriceId = 11, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.ServiceFee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FeeInUsd") - .HasColumnType("numeric"); - - b.Property("FeePercentage") - .HasColumnType("numeric"); - - b.Property("IncludeExpenseFee") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("ServiceFees"); - - b.HasData( + }, new { - Id = 1, + Id = 57, + ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - FeeInUsd = 0m, - FeePercentage = 0m, - IncludeExpenseFee = false, - Name = "Free", + Decimals = 18, + NetworkId = 18, + Symbol = "STRK", + TokenPriceId = 9, Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.SignerAgent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("SignerAgents"); - - b.HasData( + }, new { - Id = 1, + Id = 58, + ContractAddress = "11111111111111111111111111111111", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Treasury", - Url = "http://localhost:3000", - Version = 0u - }); - }); - - modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Token", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContractAddress") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Decimals") - .HasColumnType("integer"); - - b.Property("NetworkId") - .HasColumnType("integer"); - - b.Property("Symbol") - .IsRequired() - .HasColumnType("text"); - - b.Property("TokenPriceId") - .HasColumnType("integer"); - - b.Property("Version") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("xid") - .HasColumnName("xmin"); - - b.HasKey("Id"); - - b.HasIndex("TokenPriceId"); - - b.HasIndex("NetworkId", "ContractAddress") - .IsUnique(); - - b.ToTable("Tokens"); - - b.HasData( + Decimals = 9, + NetworkId = 19, + Symbol = "SOL", + TokenPriceId = 3, + Version = 0u + }, new { - Id = 1, + Id = 59, + ContractAddress = "0x0000000000000000000000000000000000000000", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 20, + Symbol = "TRX", + TokenPriceId = 4, + Version = 0u + }, + new + { + Id = 60, ContractAddress = "0x0000000000000000000000000000000000000000", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 1, + NetworkId = 21, Symbol = "ETH", TokenPriceId = 1, Version = 0u }, new { - Id = 2, + Id = 61, ContractAddress = "0x0000000000000000000000000000000000000000", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 2, + NetworkId = 22, Symbol = "ETH", TokenPriceId = 1, Version = 0u }, new { - Id = 3, - ContractAddress = "0x0000000000000000000000000000000000000000", + Id = 62, + ContractAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 3, + NetworkId = 18, Symbol = "ETH", TokenPriceId = 1, Version = 0u }, new { - Id = 4, - ContractAddress = "0x0000000000000000000000000000000000000000", + Id = 63, + ContractAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 18, - NetworkId = 4, - Symbol = "BNB", - TokenPriceId = 2, + Decimals = 6, + NetworkId = 18, + Symbol = "USDC", + TokenPriceId = 7, Version = 0u }, new { - Id = 5, - ContractAddress = "0x02c31306cad429e0a00d3a4ee8ba251853099f835101ee2c637e9b3b9351a056", + Id = 64, + ContractAddress = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 18, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 65, + ContractAddress = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 5, - Symbol = "ETH", - TokenPriceId = 1, + NetworkId = 14, + Symbol = "USDC", + TokenPriceId = 7, Version = 0u }, new { - Id = 6, - ContractAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", + Id = 66, + ContractAddress = "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 16, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 67, + ContractAddress = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 13, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 68, + ContractAddress = "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDC", + TokenPriceId = 7, + Version = 0u + }, + new + { + Id = 69, + ContractAddress = "0x493257fd37edb34451f62edf8d2a0c418852ba4c", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 6, + NetworkId = 21, + Symbol = "USDT", + TokenPriceId = 8, + Version = 0u + }, + new + { + Id = 70, + ContractAddress = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), Decimals = 18, - NetworkId = 6, - Symbol = "STRK", + NetworkId = 21, + Symbol = "WETH", TokenPriceId = 1, Version = 0u }, new { - Id = 7, - ContractAddress = "0x0000000000000000000000000000000000000000", + Id = 71, + ContractAddress = "0xbbeb516fb02a01611cbbe0453fe3c580d7281877", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 6, - NetworkId = 7, - Symbol = "TRX", - TokenPriceId = 4, + Decimals = 8, + NetworkId = 21, + Symbol = "WBTC", + TokenPriceId = 10, Version = 0u }, new { - Id = 8, - ContractAddress = "11111111111111111111111111111111", + Id = 72, + ContractAddress = "0x4b9eb6c0b6ea15176bbf62841c6b2a8a398cb656", CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Decimals = 9, - NetworkId = 8, - Symbol = "SOL", - TokenPriceId = 3, + Decimals = 18, + NetworkId = 21, + Symbol = "DAI", + TokenPriceId = 11, + Version = 0u + }, + new + { + Id = 73, + ContractAddress = "0x4300000000000000000000000000000000000004", + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Decimals = 18, + NetworkId = 22, + Symbol = "WETH", + TokenPriceId = 1, Version = 0u }); }); @@ -1606,6 +3296,76 @@ protected override void BuildModel(ModelBuilder modelBuilder) PriceInUsd = 0.25m, Symbol = "TRX", Version = 0u + }, + new + { + Id = 5, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "POLUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "POL", + Version = 0u + }, + new + { + Id = 6, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "AVAXUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 35.0m, + Symbol = "AVAX", + Version = 0u + }, + new + { + Id = 7, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDC", + Version = 0u + }, + new + { + Id = 8, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "USDTUSD", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "USDT", + Version = 0u + }, + new + { + Id = 9, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "STRKUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 0.50m, + Symbol = "STRK", + Version = 0u + }, + new + { + Id = 10, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "BTCUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 60000.0m, + Symbol = "BTC", + Version = 0u + }, + new + { + Id = 11, + CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + ExternalId = "DAIUSDT", + LastUpdated = new DateTimeOffset(new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + PriceInUsd = 1.0m, + Symbol = "DAI", + Version = 0u }); }); @@ -1762,40 +3522,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsUnique(); b.ToTable("Wallets"); - - b.HasData( - new - { - Id = 1, - Address = "0x32edfaa9157eda19a458373ddfb10464d2d39796", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "Main", - NetworkTypeId = 1, - SignerAgentId = 1, - Status = 2, - Version = 0u - }, - new - { - Id = 2, - Address = "0x1104fc77d3409942ce902994d181acdc1e39cf68a693375690d30a4704b1425c", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "AztecMain", - NetworkTypeId = 5, - SignerAgentId = 1, - Status = 2, - Version = 0u - }, - new - { - Id = 3, - Address = "9ivTbFdPJRg4bgYdUzvf2eXdb6JDhv4iKFL1wTrDwKTf", - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - Name = "SolanaMain", - NetworkTypeId = 2, - SignerAgentId = 1, - Version = 0u - }); }); modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.WebhookSubscriber", b => @@ -1842,19 +3568,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsUnique(); b.ToTable("WebhookSubscribers"); - - b.HasData( - new - { - Id = 1, - CreatedDate = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), - EventTypes = new string[0], - IsActive = true, - Name = "station-api", - Secret = "station-webhook-secret-1", - Url = "http://localhost:9690/api/v1/webhooks/plorex", - Version = 0u - }); }); modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Contract", b => @@ -1920,17 +3633,119 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasData( new { - NetworkId = 1, + NetworkId = 1, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 2, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 3, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 4, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 5, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 6, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 7, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 8, + BaseFeePercentageIncrease = 0, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 0, + ReplacementFeePercentageIncrease = 0 + }, + new + { + NetworkId = 9, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 10, + BaseFeePercentageIncrease = 20, + HasL1Fee = false, + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 11, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 12, BaseFeePercentageIncrease = 25, - HasL1Fee = false, + HasL1Fee = true, IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { - NetworkId = 2, - BaseFeePercentageIncrease = 20, + NetworkId = 13, + BaseFeePercentageIncrease = 25, HasL1Fee = false, IsEip1559 = true, PriorityFeePercentageIncrease = 10, @@ -1938,26 +3753,44 @@ protected override void BuildModel(ModelBuilder modelBuilder) }, new { - NetworkId = 3, + NetworkId = 14, BaseFeePercentageIncrease = 25, - HasL1Fee = true, + HasL1Fee = false, + IsEip1559 = false, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 15, + BaseFeePercentageIncrease = 25, + HasL1Fee = false, IsEip1559 = true, - L1FeeOracleContract = "0x420000000000000000000000000000000000000F", PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { - NetworkId = 4, + NetworkId = 16, BaseFeePercentageIncrease = 25, HasL1Fee = false, - IsEip1559 = false, + IsEip1559 = true, PriorityFeePercentageIncrease = 10, ReplacementFeePercentageIncrease = 15 }, new { - NetworkId = 5, + NetworkId = 17, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x5300000000000000000000000000000000000002", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 18, BaseFeePercentageIncrease = 0, HasL1Fee = false, IsEip1559 = false, @@ -1966,7 +3799,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) }, new { - NetworkId = 6, + NetworkId = 19, BaseFeePercentageIncrease = 0, HasL1Fee = false, IsEip1559 = false, @@ -1975,7 +3808,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) }, new { - NetworkId = 7, + NetworkId = 20, BaseFeePercentageIncrease = 0, HasL1Fee = false, IsEip1559 = false, @@ -1984,12 +3817,22 @@ protected override void BuildModel(ModelBuilder modelBuilder) }, new { - NetworkId = 8, - BaseFeePercentageIncrease = 0, + NetworkId = 21, + BaseFeePercentageIncrease = 25, HasL1Fee = false, - IsEip1559 = false, - PriorityFeePercentageIncrease = 0, - ReplacementFeePercentageIncrease = 0 + IsEip1559 = true, + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 + }, + new + { + NetworkId = 22, + BaseFeePercentageIncrease = 25, + HasL1Fee = true, + IsEip1559 = true, + L1FeeOracleContract = "0x420000000000000000000000000000000000000F", + PriorityFeePercentageIncrease = 10, + ReplacementFeePercentageIncrease = 15 }); }); @@ -2090,69 +3933,265 @@ protected override void BuildModel(ModelBuilder modelBuilder) }, new { - NetworkId = 8, - AutoRebalanceEnabled = false, - MaxBalanceThreshold = "0", - MinBalanceThreshold = "0", - MinGasBalance = "10000000", - TargetBalance = "0" - }); - }); - - b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => - { - b1.Property("NetworkId") - .HasColumnType("integer"); - - b1.Property("DeltaPercentage") - .HasColumnType("numeric"); - - b1.HasKey("NetworkId"); - - b1.ToTable("Networks"); - - b1.WithOwner() - .HasForeignKey("NetworkId"); - - b1.HasData( + NetworkId = 8, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 9, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 10, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 11, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 12, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 13, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "1000000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 14, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 15, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "100000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 16, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 17, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 18, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "0", + TargetBalance = "0" + }, + new + { + NetworkId = 19, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 20, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000", + TargetBalance = "0" + }, + new + { + NetworkId = 21, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }, + new + { + NetworkId = 22, + AutoRebalanceEnabled = false, + MaxBalanceThreshold = "0", + MinBalanceThreshold = "0", + MinGasBalance = "10000000000000000", + TargetBalance = "0" + }); + }); + + b.OwnsOne("Train.Solver.Data.Abstractions.Entities.RewardConfiguration", "RewardConfiguration", b1 => + { + b1.Property("NetworkId") + .HasColumnType("integer"); + + b1.Property("DeltaPercentage") + .HasColumnType("numeric"); + + b1.HasKey("NetworkId"); + + b1.ToTable("Networks"); + + b1.WithOwner() + .HasForeignKey("NetworkId"); + + b1.HasData( + new + { + NetworkId = 1, + DeltaPercentage = 10m + }, + new + { + NetworkId = 2, + DeltaPercentage = 10m + }, + new + { + NetworkId = 3, + DeltaPercentage = 10m + }, + new + { + NetworkId = 4, + DeltaPercentage = 10m + }, + new + { + NetworkId = 5, + DeltaPercentage = 10m + }, + new + { + NetworkId = 6, + DeltaPercentage = 10m + }, + new + { + NetworkId = 7, + DeltaPercentage = 10m + }, + new + { + NetworkId = 8, + DeltaPercentage = 10m + }, + new + { + NetworkId = 9, + DeltaPercentage = 10m + }, + new + { + NetworkId = 10, + DeltaPercentage = 10m + }, + new + { + NetworkId = 11, + DeltaPercentage = 10m + }, + new + { + NetworkId = 12, + DeltaPercentage = 10m + }, + new + { + NetworkId = 13, + DeltaPercentage = 10m + }, + new + { + NetworkId = 14, + DeltaPercentage = 10m + }, new { - NetworkId = 1, + NetworkId = 15, DeltaPercentage = 10m }, new { - NetworkId = 2, + NetworkId = 16, DeltaPercentage = 10m }, new { - NetworkId = 3, + NetworkId = 17, DeltaPercentage = 10m }, new { - NetworkId = 4, + NetworkId = 18, DeltaPercentage = 10m }, new { - NetworkId = 5, + NetworkId = 19, DeltaPercentage = 10m }, new { - NetworkId = 6, + NetworkId = 20, DeltaPercentage = 10m }, new { - NetworkId = 7, + NetworkId = 21, DeltaPercentage = 10m }, new { - NetworkId = 8, + NetworkId = 22, DeltaPercentage = 10m }); }); @@ -2245,6 +4284,118 @@ protected override void BuildModel(ModelBuilder modelBuilder) RewardTimelockTimeSpanInSeconds = 1800L, SolverTimelockTimeSpanInSeconds = 3600L, UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 9, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 10, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 11, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 12, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 13, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 14, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 15, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 16, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 17, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 18, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 19, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 20, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 21, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L + }, + new + { + NetworkId = 22, + QuoteExpiryInSeconds = 900L, + RewardTimelockTimeSpanInSeconds = 1800L, + SolverTimelockTimeSpanInSeconds = 3600L, + UserTimelockTimeSpanInSeconds = 7200L }); }); @@ -2347,6 +4498,132 @@ protected override void BuildModel(ModelBuilder modelBuilder) MaxInFlightTransactions = 10, RequiredConfirmations = 0, StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 9, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 10, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 11, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 12, + ConfirmationPollingIntervalSeconds = 1, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 10, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 13, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 14, + ConfirmationPollingIntervalSeconds = 3, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 60 + }, + new + { + NetworkId = 15, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 16, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 17, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 18, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 1, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 300 + }, + new + { + NetworkId = 19, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 10, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 20, + ConfirmationPollingIntervalSeconds = 5, + MaxGasBumpAttempts = 0, + MaxInFlightTransactions = 5, + RequiredConfirmations = 0, + StuckTransactionTimeoutSeconds = 90 + }, + new + { + NetworkId = 21, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 + }, + new + { + NetworkId = 22, + ConfirmationPollingIntervalSeconds = 2, + MaxGasBumpAttempts = 3, + MaxInFlightTransactions = 5, + RequiredConfirmations = 1, + StuckTransactionTimeoutSeconds = 120 }); }); @@ -2379,6 +4656,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Network"); }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NetworkNodeProvider", b => + { + b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NetworkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Train.Solver.Data.Abstractions.Entities.NodeProvider", "NodeProvider") + .WithMany("NetworkNodeProviders") + .HasForeignKey("NodeProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Network"); + + b.Navigation("NodeProvider"); + }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Node", b => { b.HasOne("Train.Solver.Data.Abstractions.Entities.Network", "Network") @@ -2538,6 +4834,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Metadata"); + b.Navigation("NetworkNodeProviders"); + b.Navigation("Nodes"); b.Navigation("Tokens"); @@ -2550,6 +4848,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Wallets"); }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.NodeProvider", b => + { + b.Navigation("NetworkNodeProviders"); + }); + modelBuilder.Entity("Train.Solver.Data.Abstractions.Entities.Order", b => { b.Navigation("Transactions"); diff --git a/csharp/src/Data.Npgsql/SolverDbContext.cs b/csharp/src/Data.Npgsql/SolverDbContext.cs index 2a53e88d..3a1126b5 100644 --- a/csharp/src/Data.Npgsql/SolverDbContext.cs +++ b/csharp/src/Data.Npgsql/SolverDbContext.cs @@ -43,6 +43,10 @@ public class SolverDbContext(DbContextOptions options) : DbCont public DbSet WebhookSubscribers { get; set; } + public DbSet NodeProviders { get; set; } + + public DbSet NetworkNodeProviders { get; set; } + public DbSet EventListenerConfigs { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) @@ -147,7 +151,7 @@ private static void SetupCustomRelations(ModelBuilder modelBuilder) .HasIndex(x => x.Name).IsUnique(); modelBuilder.Entity() - .HasIndex(x => new { x.ProviderName, x.NetworkId, x.Protocol }).IsUnique(); + .HasIndex(x => new { x.Url, x.NetworkId, x.Protocol }).IsUnique(); modelBuilder.Entity() .HasIndex(x => new { x.Type, x.NetworkId }).IsUnique(); @@ -228,6 +232,25 @@ private static void SetupCustomRelations(ModelBuilder modelBuilder) .HasIndex(x => new { x.NetworkId, x.Key }) .IsUnique(); + modelBuilder.Entity() + .HasIndex(x => x.Name) + .IsUnique(); + + modelBuilder.Entity() + .HasOne(x => x.Network) + .WithMany(x => x.NetworkNodeProviders) + .HasForeignKey(x => x.NetworkId); + + modelBuilder.Entity() + .HasOne(x => x.NodeProvider) + .WithMany(x => x.NetworkNodeProviders) + .HasForeignKey(x => x.NodeProviderId) + .OnDelete(DeleteBehavior.Cascade); + + modelBuilder.Entity() + .HasIndex(x => new { x.NetworkId, x.NodeProviderId }) + .IsUnique(); + modelBuilder.Entity() .HasIndex(x => x.Name) .IsUnique(); diff --git a/csharp/src/Infrastructure.Abstractions/INetworkService.cs b/csharp/src/Infrastructure.Abstractions/INetworkService.cs index 987b5d49..fe45671f 100644 --- a/csharp/src/Infrastructure.Abstractions/INetworkService.cs +++ b/csharp/src/Infrastructure.Abstractions/INetworkService.cs @@ -2,20 +2,29 @@ namespace Train.Solver.Infrastructure.Abstractions; -public class NetworkUpdateRequest -{ - public string DisplayName { get; set; } = null!; - - public string? GasConfigurationName { get; set; } -} - +/// +/// Higher-level network service that merges manual DB nodes with auto-discovered provider nodes. +/// Used by activities that need nodes (runtime, listeners, TP). Other consumers use INetworkRepository directly. +/// public interface INetworkService { - public Task GetAsync(string name); + /// + /// Gets a network with manual + provider-resolved nodes merged. + /// + Task GetAsync(string networkIdentifier); - public Task> GetAllAsync(); + /// + /// Gets all networks with manual + provider-resolved nodes merged. + /// + Task> GetAllAsync(string[]? types = null); - public Task CreateAsync(DetailedNetworkDto network); + /// + /// Gets a lightweight network DTO for an event listener, with provider nodes merged. + /// + Task GetForEventListenerAsync(string networkSlug, string listenerType); - public Task UpdateAsync(string name, NetworkUpdateRequest request); + /// + /// Gets a lightweight network DTO for TransactionProcessor, with provider nodes merged. + /// + Task GetForTransactionProcessorAsync(string networkSlug); } diff --git a/csharp/src/Infrastructure.Abstractions/INodeProvider.cs b/csharp/src/Infrastructure.Abstractions/INodeProvider.cs new file mode 100644 index 00000000..06ac6eac --- /dev/null +++ b/csharp/src/Infrastructure.Abstractions/INodeProvider.cs @@ -0,0 +1,27 @@ +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.Abstractions; + +/// +/// A resolved node endpoint from a provider. +/// +/// Initial score for SmartNodeInvoker (0-100). Default 40 for auto-discovered nodes. +public record ResolvedNode(string Url, NodeProtocol Protocol, int Priority = 40); + +/// +/// Code-based node provider that resolves RPC endpoint URLs from chain IDs. +/// Each implementation contains hardcoded chain mappings and URL templates. +/// +public interface INodeProvider +{ + string Name { get; } + + bool SupportsChain(string chainId); + + /// + /// Resolves RPC endpoint URLs for a chain. Returns HTTP and optionally WebSocket endpoints. + /// Most providers resolve synchronously (string interpolation). Async for providers + /// that need external data (e.g., Chainlist fetches from Redis cache). + /// + Task> ResolveAsync(string chainId, string apiKey); +} diff --git a/csharp/src/Infrastructure/Extensions/TrainSolverBuilderExtensions.cs b/csharp/src/Infrastructure/Extensions/TrainSolverBuilderExtensions.cs index 5b3e6cc2..eb193af4 100644 --- a/csharp/src/Infrastructure/Extensions/TrainSolverBuilderExtensions.cs +++ b/csharp/src/Infrastructure/Extensions/TrainSolverBuilderExtensions.cs @@ -3,8 +3,10 @@ using OpenTelemetry.Logs; using OpenTelemetry.Metrics; using OpenTelemetry.Trace; +using StackExchange.Redis; using Train.Solver.Infrastructure.Abstractions; using Train.Solver.Infrastructure.DependencyInjection; +using Train.Solver.Infrastructure.NodeProviders; using Train.Solver.Infrastructure.Quote; using Train.Solver.Infrastructure.Rate; using Train.Solver.Infrastructure.Services; @@ -26,6 +28,21 @@ public static TrainSolverBuilder WithCoreServices( builder.Services.AddKeyedTransient(RateProviderNames.TokenPrice); builder.Services.TryAddSingleton(); + // Redis (shared by balance reservation, node providers, workflow state, etc.) + // TryAdd ensures workflow modules that register Redis first aren't overwritten. + builder.Services.TryAddSingleton( + _ => ConnectionMultiplexer.Connect(builder.Options.RedisConnectionString)); + builder.Services.TryAddTransient( + sp => sp.GetRequiredService().GetDatabase(builder.Options.RedisDatabaseIndex)); + + // Node providers (code-based chain mappings + URL templates) + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddOpenTelemetry() .WithTracing(tracing => tracing .AddAspNetCoreInstrumentation() diff --git a/csharp/src/Infrastructure/NodeProviders/AlchemyNodeProvider.cs b/csharp/src/Infrastructure/NodeProviders/AlchemyNodeProvider.cs new file mode 100644 index 00000000..04caf2fc --- /dev/null +++ b/csharp/src/Infrastructure/NodeProviders/AlchemyNodeProvider.cs @@ -0,0 +1,102 @@ +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.NodeProviders; + +public class AlchemyNodeProvider : INodeProvider +{ + public string Name => "alchemy"; + + private static readonly Dictionary ChainMapping = new() + { + // Ethereum + ["1"] = new("eth-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155111"] = new("eth-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Arbitrum + ["42161"] = new("arb-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["421614"] = new("arb-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Base + ["8453"] = new("base-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["84532"] = new("base-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Optimism + ["10"] = new("opt-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155420"] = new("opt-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Polygon + ["137"] = new("polygon-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["80002"] = new("polygon-amoy", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Avalanche + ["43114"] = new("avax-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["43113"] = new("avax-fuji", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // BNB Chain + ["56"] = new("bnb-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["97"] = new("bnb-testnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Scroll + ["534352"] = new("scroll-mainnet", [NodeProtocol.Http]), + ["534351"] = new("scroll-sepolia", [NodeProtocol.Http]), + + // ZKsync + ["324"] = new("zksync-mainnet", [NodeProtocol.Http]), + ["300"] = new("zksync-sepolia", [NodeProtocol.Http]), + + // Blast + ["81457"] = new("blast-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["168587773"] = new("blast-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Linea + ["59144"] = new("linea-mainnet", [NodeProtocol.Http]), + ["59141"] = new("linea-sepolia", [NodeProtocol.Http]), + + // Starknet + ["SN_MAIN"] = new("starknet-mainnet", [NodeProtocol.Http], + HttpTemplate: "https://{slug}.g.alchemy.com/starknet/version/rpc/v0_7/{apiKey}"), + ["SN_SEPOLIA"] = new("starknet-sepolia", [NodeProtocol.Http], + HttpTemplate: "https://{slug}.g.alchemy.com/starknet/version/rpc/v0_7/{apiKey}"), + + // Tron + ["728126428"] = new("tron-mainnet", [NodeProtocol.Http]), + + // Solana + ["mainnet-beta"] = new("solana-mainnet", [NodeProtocol.Http], + HttpTemplate: "https://{slug}.g.alchemy.com/v2/{apiKey}"), + ["devnet"] = new("solana-devnet", [NodeProtocol.Http], + HttpTemplate: "https://{slug}.g.alchemy.com/v2/{apiKey}"), + }; + + public bool SupportsChain(string chainId) => ChainMapping.ContainsKey(chainId); + + public Task> ResolveAsync(string chainId, string apiKey) + { + if (!ChainMapping.TryGetValue(chainId, out var config)) + return Task.FromResult>([]); + + var nodes = new List(); + + foreach (var protocol in config.Protocols) + { + var url = protocol switch + { + NodeProtocol.Http => config.HttpTemplate is not null + ? config.HttpTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", apiKey) + : $"https://{config.Slug}.g.alchemy.com/v2/{apiKey}", + NodeProtocol.WebSocket => config.WsTemplate is not null + ? config.WsTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", apiKey) + : $"wss://{config.Slug}.g.alchemy.com/v2/{apiKey}", + _ => null, + }; + + if (url is not null) + nodes.Add(new ResolvedNode(url, protocol)); + } + + return Task.FromResult(nodes); + } + + private record ChainConfig(string Slug, NodeProtocol[] Protocols, string? HttpTemplate = null, string? WsTemplate = null); +} diff --git a/csharp/src/Infrastructure/NodeProviders/AnkrNodeProvider.cs b/csharp/src/Infrastructure/NodeProviders/AnkrNodeProvider.cs new file mode 100644 index 00000000..1292f571 --- /dev/null +++ b/csharp/src/Infrastructure/NodeProviders/AnkrNodeProvider.cs @@ -0,0 +1,97 @@ +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.NodeProviders; + +public class AnkrNodeProvider : INodeProvider +{ + public string Name => "ankr"; + + private static readonly Dictionary ChainMapping = new() + { + // Ethereum + ["1"] = new("eth", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155111"] = new("eth_sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Arbitrum + ["42161"] = new("arbitrum", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["421614"] = new("arbitrum_sepolia", [NodeProtocol.Http]), + + // Base + ["8453"] = new("base", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["84532"] = new("base_sepolia", [NodeProtocol.Http]), + + // Optimism + ["10"] = new("optimism", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155420"] = new("optimism_sepolia", [NodeProtocol.Http]), + + // Polygon + ["137"] = new("polygon", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["80002"] = new("polygon_amoy", [NodeProtocol.Http]), + + // Avalanche + ["43114"] = new("avalanche", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["43113"] = new("avalanche_fuji", [NodeProtocol.Http]), + + // BNB Chain + ["56"] = new("bsc", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["97"] = new("bsc_testnet_chapel", [NodeProtocol.Http]), + + // Scroll + ["534352"] = new("scroll", [NodeProtocol.Http]), + ["534351"] = new("scroll_sepolia", [NodeProtocol.Http]), + + // Blast + ["81457"] = new("blast", [NodeProtocol.Http]), + + // Linea + ["59144"] = new("linea", [NodeProtocol.Http]), + + // Tron + ["728126428"] = new("tron", [NodeProtocol.Http]), + + // Starknet + ["SN_MAIN"] = new("starknet_mainnet", [NodeProtocol.Http]), + ["SN_SEPOLIA"] = new("starknet_sepolia", [NodeProtocol.Http]), + + // Solana + ["mainnet-beta"] = new("solana", [NodeProtocol.Http]), + ["devnet"] = new("solana_devnet", [NodeProtocol.Http]), + }; + + public bool SupportsChain(string chainId) => ChainMapping.ContainsKey(chainId); + + public Task> ResolveAsync(string chainId, string apiKey) + { + if (!ChainMapping.TryGetValue(chainId, out var config)) + return Task.FromResult>([]); + + var nodes = new List(); + var hasApiKey = !string.IsNullOrWhiteSpace(apiKey); + + foreach (var protocol in config.Protocols) + { + var url = protocol switch + { + NodeProtocol.Http => config.HttpTemplate is not null + ? config.HttpTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", hasApiKey ? apiKey : "") + : hasApiKey + ? $"https://rpc.ankr.com/{config.Slug}/{apiKey}" + : $"https://rpc.ankr.com/{config.Slug}", + NodeProtocol.WebSocket => config.WsTemplate is not null + ? config.WsTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", hasApiKey ? apiKey : "") + : hasApiKey + ? $"wss://rpc.ankr.com/{config.Slug}/ws/{apiKey}" + : $"wss://rpc.ankr.com/{config.Slug}/ws", + _ => null, + }; + + if (url is not null) + nodes.Add(new ResolvedNode(url, protocol)); + } + + return Task.FromResult(nodes); + } + + private record ChainConfig(string Slug, NodeProtocol[] Protocols, string? HttpTemplate = null, string? WsTemplate = null); +} diff --git a/csharp/src/Infrastructure/NodeProviders/ChainlistNodeProvider.cs b/csharp/src/Infrastructure/NodeProviders/ChainlistNodeProvider.cs new file mode 100644 index 00000000..86b42707 --- /dev/null +++ b/csharp/src/Infrastructure/NodeProviders/ChainlistNodeProvider.cs @@ -0,0 +1,61 @@ +using System.Text.Json; +using Microsoft.Extensions.Logging; +using StackExchange.Redis; +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.NodeProviders; + +/// +/// Resolves public RPC endpoints from Chainlist data cached in Redis. +/// Data is populated by a scheduled job that fetches the full Chainlist JSON periodically. +/// HTTP-only — public Chainlist RPCs don't support WebSocket. +/// +public class ChainlistNodeProvider(IDatabase redis, ILogger logger) : INodeProvider +{ + public const string RedisKeyPrefix = "chainlist:nodes:"; + private static readonly TimeSpan CacheTtl = TimeSpan.FromHours(24); + + public string Name => "chainlist"; + + /// + /// Chainlist supports any EVM chain — but data must be pre-fetched by the scheduled job. + /// Always returns true for EVM chain IDs; resolve will return empty if no cached data. + /// + public bool SupportsChain(string chainId) + { + return int.TryParse(chainId, out _); + } + + public async Task> ResolveAsync(string chainId, string apiKey) + { + try + { + var cached = await redis.StringGetAsync($"{RedisKeyPrefix}{chainId}"); + if (cached.IsNullOrEmpty) + return []; + + var urls = JsonSerializer.Deserialize>(cached!); + if (urls is null || urls.Count == 0) + return []; + + return urls + .Select(url => new ResolvedNode(url, NodeProtocol.Http)) + .ToList(); + } + catch (Exception ex) + { + logger.LogWarning(ex, "Failed to read Chainlist cache for chain {ChainId}", chainId); + return []; + } + } + + /// + /// Called by the scheduled job to cache resolved nodes for a chain. + /// + public static async Task CacheNodesForChainAsync(IDatabase redis, string chainId, List rpcUrls) + { + var json = JsonSerializer.Serialize(rpcUrls); + await redis.StringSetAsync($"{RedisKeyPrefix}{chainId}", json, CacheTtl); + } +} diff --git a/csharp/src/Infrastructure/NodeProviders/DrpcNodeProvider.cs b/csharp/src/Infrastructure/NodeProviders/DrpcNodeProvider.cs new file mode 100644 index 00000000..870ebaef --- /dev/null +++ b/csharp/src/Infrastructure/NodeProviders/DrpcNodeProvider.cs @@ -0,0 +1,97 @@ +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.NodeProviders; + +public class DrpcNodeProvider : INodeProvider +{ + public string Name => "drpc"; + + private static readonly Dictionary ChainMapping = new() + { + // Ethereum + ["1"] = new("ethereum", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155111"] = new("sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Arbitrum + ["42161"] = new("arbitrum", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["421614"] = new("arbitrum-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Base + ["8453"] = new("base", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["84532"] = new("base-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Optimism + ["10"] = new("optimism", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155420"] = new("optimism-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Polygon + ["137"] = new("polygon", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["80002"] = new("polygon-amoy", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Avalanche + ["43114"] = new("avalanche", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["43113"] = new("avalanche-fuji", [NodeProtocol.Http]), + + // BNB Chain + ["56"] = new("bsc", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["97"] = new("bsc-testnet", [NodeProtocol.Http]), + + // Scroll + ["534352"] = new("scroll", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["534351"] = new("scroll-sepolia", [NodeProtocol.Http]), + + // Blast + ["81457"] = new("blast", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Linea + ["59144"] = new("linea", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["59141"] = new("linea-sepolia", [NodeProtocol.Http]), + + // ZKsync + ["324"] = new("zksync", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["300"] = new("zksync-sepolia", [NodeProtocol.Http]), + + // Tron + ["728126428"] = new("tron", [NodeProtocol.Http]), + + // Starknet + ["SN_MAIN"] = new("starknet", [NodeProtocol.Http]), + ["SN_SEPOLIA"] = new("starknet-sepolia", [NodeProtocol.Http]), + + // Solana + ["mainnet-beta"] = new("solana", [NodeProtocol.Http]), + ["devnet"] = new("solana-devnet", [NodeProtocol.Http]), + }; + + public bool SupportsChain(string chainId) => ChainMapping.ContainsKey(chainId); + + public Task> ResolveAsync(string chainId, string apiKey) + { + if (!ChainMapping.TryGetValue(chainId, out var config)) + return Task.FromResult>([]); + + var nodes = new List(); + + foreach (var protocol in config.Protocols) + { + var url = protocol switch + { + NodeProtocol.Http => config.HttpTemplate is not null + ? config.HttpTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", apiKey) + : $"https://lb.drpc.org/ogrpc?network={config.Slug}&dkey={apiKey}", + NodeProtocol.WebSocket => config.WsTemplate is not null + ? config.WsTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", apiKey) + : $"wss://lb.drpc.org/ogws?network={config.Slug}&dkey={apiKey}", + _ => null, + }; + + if (url is not null) + nodes.Add(new ResolvedNode(url, protocol)); + } + + return Task.FromResult(nodes); + } + + private record ChainConfig(string Slug, NodeProtocol[] Protocols, string? HttpTemplate = null, string? WsTemplate = null); +} diff --git a/csharp/src/Infrastructure/NodeProviders/InfuraNodeProvider.cs b/csharp/src/Infrastructure/NodeProviders/InfuraNodeProvider.cs new file mode 100644 index 00000000..6f1f9b4c --- /dev/null +++ b/csharp/src/Infrastructure/NodeProviders/InfuraNodeProvider.cs @@ -0,0 +1,93 @@ +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.NodeProviders; + +public class InfuraNodeProvider : INodeProvider +{ + public string Name => "infura"; + + private static readonly Dictionary ChainMapping = new() + { + // Ethereum + ["1"] = new("mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155111"] = new("sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Arbitrum + ["42161"] = new("arbitrum-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["421614"] = new("arbitrum-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Base + ["8453"] = new("base-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["84532"] = new("base-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Optimism + ["10"] = new("optimism-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["11155420"] = new("optimism-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Polygon + ["137"] = new("polygon-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["80002"] = new("polygon-amoy", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Avalanche + ["43114"] = new("avalanche-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["43113"] = new("avalanche-fuji", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // BNB Chain + ["56"] = new("bsc-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["97"] = new("bsc-testnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // Linea + ["59144"] = new("linea-mainnet", [NodeProtocol.Http, NodeProtocol.WebSocket]), + ["59141"] = new("linea-sepolia", [NodeProtocol.Http, NodeProtocol.WebSocket]), + + // ZKsync + ["324"] = new("zksync-mainnet", [NodeProtocol.Http]), + ["300"] = new("zksync-sepolia", [NodeProtocol.Http]), + + // Scroll + ["534352"] = new("scroll-mainnet", [NodeProtocol.Http]), + ["534351"] = new("scroll-sepolia", [NodeProtocol.Http]), + + // Blast + ["81457"] = new("blast-mainnet", [NodeProtocol.Http]), + ["168587773"] = new("blast-sepolia", [NodeProtocol.Http]), + + // Starknet + ["SN_MAIN"] = new("starknet-mainnet", [NodeProtocol.Http], + HttpTemplate: "https://{slug}.infura.io/rpc/v0_7/{apiKey}"), + ["SN_SEPOLIA"] = new("starknet-sepolia", [NodeProtocol.Http], + HttpTemplate: "https://{slug}.infura.io/rpc/v0_7/{apiKey}"), + }; + + public bool SupportsChain(string chainId) => ChainMapping.ContainsKey(chainId); + + public Task> ResolveAsync(string chainId, string apiKey) + { + if (!ChainMapping.TryGetValue(chainId, out var config)) + return Task.FromResult>([]); + + var nodes = new List(); + + foreach (var protocol in config.Protocols) + { + var url = protocol switch + { + NodeProtocol.Http => config.HttpTemplate is not null + ? config.HttpTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", apiKey) + : $"https://{config.Slug}.infura.io/v3/{apiKey}", + NodeProtocol.WebSocket => config.WsTemplate is not null + ? config.WsTemplate.Replace("{slug}", config.Slug).Replace("{apiKey}", apiKey) + : $"wss://{config.Slug}.infura.io/ws/v3/{apiKey}", + _ => null, + }; + + if (url is not null) + nodes.Add(new ResolvedNode(url, protocol)); + } + + return Task.FromResult(nodes); + } + + private record ChainConfig(string Slug, NodeProtocol[] Protocols, string? HttpTemplate = null, string? WsTemplate = null); +} diff --git a/csharp/src/Infrastructure/NodeProviders/NetworkService.cs b/csharp/src/Infrastructure/NodeProviders/NetworkService.cs new file mode 100644 index 00000000..35dadf42 --- /dev/null +++ b/csharp/src/Infrastructure/NodeProviders/NetworkService.cs @@ -0,0 +1,103 @@ +using Microsoft.Extensions.Logging; +using Train.Solver.Data.Abstractions.Repositories; +using Train.Solver.Infrastructure.Abstractions; +using Train.Solver.Shared.Models; + +namespace Train.Solver.Infrastructure.NodeProviders; + +public class NetworkService( + INetworkRepository networkRepository, + INodeProviderRepository nodeProviderRepository, + IEnumerable nodeProviders, + ILogger logger) : INetworkService +{ + private readonly Dictionary _providersByName = + nodeProviders.ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase); + + public async Task GetAsync(string networkIdentifier) + { + var network = await networkRepository.GetAsync(networkIdentifier); + if (network is null) return null; + + await EnrichWithProviderNodesAsync(network); + return network; + } + + public async Task> GetAllAsync(string[]? types = null) + { + var networks = await networkRepository.GetAllAsync(types); + + foreach (var network in networks) + { + await EnrichWithProviderNodesAsync(network); + } + + return networks; + } + + public async Task GetForEventListenerAsync(string networkSlug, string listenerType) + { + var network = await networkRepository.GetForEventListenerAsync(networkSlug, listenerType); + if (network is null) return null; + + var providerNodes = await ResolveProviderNodesAsync(networkSlug, network.ChainId); + network.Nodes = network.Nodes.Concat(providerNodes); + return network; + } + + public async Task GetForTransactionProcessorAsync(string networkSlug) + { + var network = await networkRepository.GetForTransactionProcessorAsync(networkSlug); + if (network is null) return null; + + var providerNodes = await ResolveProviderNodesAsync(networkSlug, network.ChainId); + network.Nodes = network.Nodes.Concat(providerNodes); + return network; + } + + private async Task EnrichWithProviderNodesAsync(NetworkCoreDto network) + { + var providerNodes = await ResolveProviderNodesAsync(network.Slug, network.ChainId); + network.Nodes = network.Nodes.Concat(providerNodes); + } + + private async Task> ResolveProviderNodesAsync(string networkIdentifier, string chainId) + { + try + { + var linkedProviders = await nodeProviderRepository.GetProvidersForNetworkAsync(networkIdentifier); + if (linkedProviders.Count == 0) return []; + + var resolvedNodes = new List(); + + foreach (var linked in linkedProviders) + { + if (!_providersByName.TryGetValue(linked.ProviderName, out var provider)) + { + logger.LogWarning("No code implementation found for provider '{ProviderName}'", linked.ProviderName); + continue; + } + + var nodes = await provider.ResolveAsync(chainId, linked.ApiKey); + + foreach (var node in nodes) + { + resolvedNodes.Add(new NodeDto + { + ProviderName = linked.ProviderName, + Url = node.Url, + Protocol = node.Protocol, + Priority = node.Priority, + }); + } + } + + return resolvedNodes; + } + catch (Exception ex) + { + logger.LogWarning(ex, "Failed to resolve provider nodes for network '{Network}'", networkIdentifier); + return []; + } + } +} diff --git a/csharp/src/Shared.Models/Models/NetworkDto.cs b/csharp/src/Shared.Models/Models/NetworkDto.cs index 42c1d7bc..47fe9e96 100644 --- a/csharp/src/Shared.Models/Models/NetworkDto.cs +++ b/csharp/src/Shared.Models/Models/NetworkDto.cs @@ -16,6 +16,8 @@ public class NetworkDto /// public string NativeTokenAddress { get; set; } = null!; + public bool IsTestnet { get; set; } + /// /// CAIP-2 compatible network identifier. /// Format: {Type}:{ChainId} (e.g., "eip155:1", "solana:mainnet-beta") diff --git a/csharp/src/Shared.Models/Models/NodeDto.cs b/csharp/src/Shared.Models/Models/NodeDto.cs index a3ff3431..f9a6b0e3 100644 --- a/csharp/src/Shared.Models/Models/NodeDto.cs +++ b/csharp/src/Shared.Models/Models/NodeDto.cs @@ -1,10 +1,29 @@ -namespace Train.Solver.Shared.Models; +namespace Train.Solver.Shared.Models; public class NodeDto { - public required string ProviderName { get; set; } = null!; + public int Id { get; set; } + + /// + /// Provider name for provider-resolved nodes (e.g., "alchemy", "infura"). + /// Null for manually configured DB nodes. + /// + public string? ProviderName { get; set; } public required string Url { get; set; } = null!; public NodeProtocol Protocol { get; set; } = NodeProtocol.Http; + + /// + /// Initial priority score for SmartNodeInvoker (0-100). + /// Higher = preferred. Manual DB nodes default to 70, provider nodes to 40. + /// SmartNodeInvoker uses this as the starting score when no Redis score exists. + /// + public int Priority { get; set; } = 50; + + /// + /// True if this node was resolved from a linked node provider (not stored in DB). + /// Provider nodes are read-only — they cannot be edited or deleted via the admin API. + /// + public bool IsFromProvider => ProviderName is not null; } diff --git a/csharp/src/Shared.Models/Models/NodeProviderDto.cs b/csharp/src/Shared.Models/Models/NodeProviderDto.cs new file mode 100644 index 00000000..befcb735 --- /dev/null +++ b/csharp/src/Shared.Models/Models/NodeProviderDto.cs @@ -0,0 +1,10 @@ +namespace Train.Solver.Shared.Models; + +public class NodeProviderDto +{ + public int Id { get; set; } + public string Name { get; set; } = null!; + public string ApiKey { get; set; } = null!; + public bool Enabled { get; set; } + public List LinkedNetworkSlugs { get; set; } = []; +} diff --git a/csharp/src/SmartNodeInvoker/ISmartNodeInvoker.cs b/csharp/src/SmartNodeInvoker/ISmartNodeInvoker.cs index dfcad8e2..d174dbf0 100644 --- a/csharp/src/SmartNodeInvoker/ISmartNodeInvoker.cs +++ b/csharp/src/SmartNodeInvoker/ISmartNodeInvoker.cs @@ -1,4 +1,6 @@ -namespace Train.Solver.SmartNodeInvoker; +using Train.Solver.Shared.Models; + +namespace Train.Solver.SmartNodeInvoker; public interface ISmartNodeInvoker { @@ -6,4 +8,9 @@ Task> ExecuteAsync( string networkName, IEnumerable nodes, Func> dataRetrievalTask); + + Task> ExecuteAsync( + string networkName, + IEnumerable nodes, + Func> dataRetrievalTask); } diff --git a/csharp/src/SmartNodeInvoker/SmartNodeInvoker.cs b/csharp/src/SmartNodeInvoker/SmartNodeInvoker.cs index 75845bd9..209e73bc 100644 --- a/csharp/src/SmartNodeInvoker/SmartNodeInvoker.cs +++ b/csharp/src/SmartNodeInvoker/SmartNodeInvoker.cs @@ -2,6 +2,7 @@ using StackExchange.Redis; using System.Diagnostics; using Train.Solver.Common.Helpers; +using Train.Solver.Shared.Models; namespace Train.Solver.SmartNodeInvoker; @@ -9,22 +10,39 @@ public class SmartNodeInvoker(IDatabase cache) : ISmartNodeInvoker { private const int MaxScore = 100; private const int MinScore = 0; + private const int DefaultInitialScore = 50; private const int SuccessReward = 5; private const int FailurePenalty = 5; private static readonly TimeSpan ScoreCacheTtl = TimeSpan.FromSeconds(5); private readonly ConcurrentDictionary Scores, DateTime FetchedAt)> _scoreCache = new(); - public async Task> ExecuteAsync( + public Task> ExecuteAsync( string networkName, IEnumerable nodes, Func> dataRetrievalTask) + { + var nodeDtos = nodes.Select(n => new NodeDto + { + ProviderName = "unknown", + Url = n, + Priority = DefaultInitialScore, + }); + + return ExecuteAsync(networkName, nodeDtos, dataRetrievalTask); + } + + public async Task> ExecuteAsync( + string networkName, + IEnumerable nodes, + Func> dataRetrievalTask) { var stopwatch = Stopwatch.StartNew(); var redisKey = RedisHelper.BuildNodeScoreKey(networkName); var failed = new Dictionary(); - var orderedNodes = await OrderNodesByScoreAsync(redisKey, nodes); + var nodeList = nodes.ToList(); + var orderedNodes = await OrderNodesByScoreAsync(redisKey, nodeList); foreach (var node in orderedNodes) { @@ -58,7 +76,7 @@ public async Task> ExecuteAsync( }; } - private async Task> OrderNodesByScoreAsync(string redisKey, IEnumerable nodes) + private async Task> OrderNodesByScoreAsync(string redisKey, List nodes) { var scoreDict = GetCachedScores(redisKey); @@ -74,8 +92,17 @@ private async Task> OrderNodesByScoreAsync(string redisKey, IEnumer _scoreCache[redisKey] = (scoreDict, DateTime.UtcNow); } + // Build a lookup for initial priority per URL (used when no Redis score exists) + var priorityByUrl = nodes.ToDictionary(n => n.Url, n => n.Priority); + return nodes - .Select(n => new { Node = n, Score = scoreDict.GetValueOrDefault(n, MaxScore / 2) }) + .Select(n => new + { + Node = n.Url, + Score = scoreDict.TryGetValue(n.Url, out var existingScore) + ? existingScore + : priorityByUrl.GetValueOrDefault(n.Url, DefaultInitialScore) + }) .OrderByDescending(s => s.Score) .Select(s => s.Node) .ToList(); diff --git a/csharp/src/SmartNodeInvoker/SmartNodeInvoker.csproj b/csharp/src/SmartNodeInvoker/SmartNodeInvoker.csproj index dba9def1..6d277431 100644 --- a/csharp/src/SmartNodeInvoker/SmartNodeInvoker.csproj +++ b/csharp/src/SmartNodeInvoker/SmartNodeInvoker.csproj @@ -12,6 +12,7 @@ + diff --git a/csharp/src/Workflow.Abstractions/Activities/IChainlistActivities.cs b/csharp/src/Workflow.Abstractions/Activities/IChainlistActivities.cs new file mode 100644 index 00000000..85fece10 --- /dev/null +++ b/csharp/src/Workflow.Abstractions/Activities/IChainlistActivities.cs @@ -0,0 +1,13 @@ +using Temporalio.Activities; + +namespace Train.Solver.Workflow.Abstractions.Activities; + +public interface IChainlistActivities +{ + /// + /// Fetches the full Chainlist JSON, extracts HTTP RPC URLs for all networks + /// that have a Chainlist provider linked, and caches them in Redis. + /// + [Activity] + Task SyncChainlistNodesAsync(); +} diff --git a/csharp/src/Workflow.Abstractions/Activities/INetworkActivities.cs b/csharp/src/Workflow.Abstractions/Activities/INetworkActivities.cs index c0e8cdcb..bd8f86f9 100644 --- a/csharp/src/Workflow.Abstractions/Activities/INetworkActivities.cs +++ b/csharp/src/Workflow.Abstractions/Activities/INetworkActivities.cs @@ -11,9 +11,6 @@ public interface INetworkActivities [Activity] Task> GetNetworksAsync(); - [Activity] - Task> GetNetworkTokensAsync(); - [Activity] Task GetNetworkForEventListenerAsync(string networkSlug, string listenerType); diff --git a/csharp/src/Workflow.Abstractions/Constants.cs b/csharp/src/Workflow.Abstractions/Constants.cs index 48e052a1..946ef407 100644 --- a/csharp/src/Workflow.Abstractions/Constants.cs +++ b/csharp/src/Workflow.Abstractions/Constants.cs @@ -40,4 +40,5 @@ public static class CoreWorkflowNames public const string WebhookDelivery = "webhook-delivery"; public const string RebalanceWorkflow = "rebalance-workflow"; public const string WalletActivation = "wallet-activation"; + public const string ChainlistSync = "chainlist-sync"; } diff --git a/csharp/src/Workflow.Abstractions/Workflows/IChainlistSync.cs b/csharp/src/Workflow.Abstractions/Workflows/IChainlistSync.cs new file mode 100644 index 00000000..d736cd9f --- /dev/null +++ b/csharp/src/Workflow.Abstractions/Workflows/IChainlistSync.cs @@ -0,0 +1,6 @@ +using Temporalio.Workflows; + +namespace Train.Solver.Workflow.Abstractions.Workflows; + +[Workflow(name: CoreWorkflowNames.ChainlistSync)] +public interface IChainlistSync : IScheduledWorkflow { } diff --git a/csharp/src/Workflow.Swap/Activities/ChainlistActivities.cs b/csharp/src/Workflow.Swap/Activities/ChainlistActivities.cs new file mode 100644 index 00000000..2d022809 --- /dev/null +++ b/csharp/src/Workflow.Swap/Activities/ChainlistActivities.cs @@ -0,0 +1,98 @@ +using System.Text.Json; +using Microsoft.Extensions.Logging; +using StackExchange.Redis; +using Temporalio.Activities; +using Train.Solver.Data.Abstractions.Repositories; +using Train.Solver.Infrastructure.NodeProviders; +using Train.Solver.Workflow.Abstractions.Activities; + +namespace Train.Solver.Workflow.Swap.Activities; + +public class ChainlistActivities( + INodeProviderRepository nodeProviderRepository, + IDatabase redis, + IHttpClientFactory httpClientFactory, + ILogger logger) : IChainlistActivities +{ + private const string ChainlistUrl = "https://chainid.network/chains.json"; + private const string ProviderName = "chainlist"; + + [Activity] + public virtual async Task SyncChainlistNodesAsync() + { + // Find all networks linked to the chainlist provider + var providers = await nodeProviderRepository.GetAllAsync(); + var chainlistProvider = providers.FirstOrDefault(p => + string.Equals(p.Name, ProviderName, StringComparison.OrdinalIgnoreCase)); + + if (chainlistProvider is null || !chainlistProvider.Enabled) + { + logger.LogDebug("Chainlist provider not found or disabled, skipping sync"); + return; + } + + if (chainlistProvider.LinkedNetworkSlugs.Count == 0) + { + logger.LogDebug("No networks linked to Chainlist provider, skipping sync"); + return; + } + + // Fetch the full Chainlist JSON (~5MB) + var httpClient = httpClientFactory.CreateClient("Chainlist"); + var response = await httpClient.GetAsync(ChainlistUrl); + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsStringAsync(); + var chains = JsonSerializer.Deserialize>(json, new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + }); + + if (chains is null || chains.Count == 0) + { + logger.LogWarning("Chainlist returned empty or invalid data"); + return; + } + + // Build chainId → RPC URLs lookup + var rpcsByChainId = chains + .Where(c => c.Rpc is not null && c.Rpc.Count > 0) + .ToDictionary( + c => c.ChainId.ToString(), + c => c.Rpc! + .Where(r => r.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) + .Where(r => !r.Contains("${")) // Exclude template URLs like ${ALCHEMY_KEY} + .Take(5) // Limit to 5 public RPCs per chain + .ToList()); + + // Get chain IDs for all linked networks + // We need to look up network chain IDs — fetch from provider's linked networks + var allProviders = await nodeProviderRepository.GetAllAsync(); + var chainlist = allProviders.FirstOrDefault(p => + string.Equals(p.Name, ProviderName, StringComparison.OrdinalIgnoreCase)); + + if (chainlist is null) return; + + // For each linked network, we need to resolve its chain ID + // Since we only have slugs, we'll need the network repo + // But activities shouldn't depend on too many repos. + // Instead, cache for ALL chain IDs that have RPCs — the resolve step filters by linked networks + var cachedCount = 0; + foreach (var (chainId, rpcUrls) in rpcsByChainId) + { + if (rpcUrls.Count == 0) continue; + + await ChainlistNodeProvider.CacheNodesForChainAsync(redis, chainId, rpcUrls); + cachedCount++; + } + + logger.LogInformation("Chainlist sync complete: cached RPCs for {Count} chains", cachedCount); + } + + private class ChainlistEntry + { + public int ChainId { get; set; } + public string Name { get; set; } = ""; + public List? Rpc { get; set; } + } +} diff --git a/csharp/src/Workflow.Swap/Activities/NetworkActivities.cs b/csharp/src/Workflow.Swap/Activities/NetworkActivities.cs index 167e5138..29c201f8 100644 --- a/csharp/src/Workflow.Swap/Activities/NetworkActivities.cs +++ b/csharp/src/Workflow.Swap/Activities/NetworkActivities.cs @@ -1,16 +1,16 @@ -using Temporalio.Activities; -using Train.Solver.Data.Abstractions.Repositories; +using Temporalio.Activities; +using Train.Solver.Infrastructure.Abstractions; using Train.Solver.Shared.Models; using Train.Solver.Workflow.Abstractions.Activities; namespace Train.Solver.Workflow.Swap.Activities; -public class NetworkActivities(INetworkRepository networkRepository) : INetworkActivities +public class NetworkActivities(INetworkService networkService) : INetworkActivities { [Activity] public async Task GetNetworkAsync(string networkName) { - var network = await networkRepository.GetAsync(networkName); + var network = await networkService.GetAsync(networkName); if (network == null) { @@ -23,23 +23,15 @@ public async Task GetNetworkAsync(string networkName) [Activity] public async Task> GetNetworksAsync() { - var networks = await networkRepository.GetAllAsync(null); + var networks = await networkService.GetAllAsync(); return networks; } - [Activity] - public async Task> GetNetworkTokensAsync() - { - var tokens = await networkRepository.GetAllTokensAsync(); - - return tokens; - } - [Activity] public async Task GetNetworkForEventListenerAsync(string networkSlug, string listenerType) { - var network = await networkRepository.GetForEventListenerAsync(networkSlug, listenerType); + var network = await networkService.GetForEventListenerAsync(networkSlug, listenerType); if (network == null) { @@ -52,7 +44,7 @@ public async Task GetNetworkForEventListenerAs [Activity] public async Task GetNetworkForTransactionProcessorAsync(string networkSlug) { - var network = await networkRepository.GetForTransactionProcessorAsync(networkSlug); + var network = await networkService.GetForTransactionProcessorAsync(networkSlug); if (network == null) { diff --git a/csharp/src/Workflow.Swap/Extensions/TrainSolverBuilderExtensions.cs b/csharp/src/Workflow.Swap/Extensions/TrainSolverBuilderExtensions.cs index ccd41477..f637bff4 100644 --- a/csharp/src/Workflow.Swap/Extensions/TrainSolverBuilderExtensions.cs +++ b/csharp/src/Workflow.Swap/Extensions/TrainSolverBuilderExtensions.cs @@ -40,6 +40,7 @@ public static TrainSolverBuilder WithCoreWorkflows( .AddTransientActivities() .AddTransientActivities() .AddTransientActivities() + .AddTransientActivities() .AddWorkflow() .AddWorkflow() .AddWorkflow() @@ -49,11 +50,13 @@ public static TrainSolverBuilder WithCoreWorkflows( .AddWorkflow() .AddWorkflow() .AddWorkflow() - .AddWorkflow(); + .AddWorkflow() + .AddWorkflow(); // Register webhook delivery scheduler builder.Services.AddTransient(); builder.Services.AddHttpClient("WebhookDelivery", c => c.Timeout = TimeSpan.FromSeconds(10)); + builder.Services.AddHttpClient("Chainlist", c => c.Timeout = TimeSpan.FromSeconds(30)); // Register balance reservation service and Redis dependencies builder.Services.TryAddTransient(); diff --git a/csharp/src/Workflow.Swap/Workflows/ChainlistSync.cs b/csharp/src/Workflow.Swap/Workflows/ChainlistSync.cs new file mode 100644 index 00000000..6fc99a3c --- /dev/null +++ b/csharp/src/Workflow.Swap/Workflows/ChainlistSync.cs @@ -0,0 +1,25 @@ +using Temporalio.Workflows; +using Train.Solver.Workflow.Abstractions; +using Train.Solver.Workflow.Abstractions.Activities; +using Train.Solver.Workflow.Abstractions.Workflows; +using Train.Solver.Workflow.Common; +using Train.Solver.Workflow.Common.Helpers; + +namespace Train.Solver.Workflow.Swap.Workflows; + +/// +/// Scheduled workflow that syncs Chainlist public RPC endpoints to Redis. +/// Runs daily — fetches the full Chainlist JSON and caches nodes for all linked networks. +/// +[Workflow(name: CoreWorkflowNames.ChainlistSync)] +[TemporalJobSchedule(Chron = "0 0 * * *")] +public class ChainlistSync : IChainlistSync +{ + [WorkflowRun] + public async Task RunAsync() + { + await Temporalio.Workflows.Workflow.ExecuteActivityAsync( + (IChainlistActivities a) => a.SyncChainlistNodesAsync(), + TemporalHelper.DefaultActivityOptions(Constants.CoreTaskQueue)); + } +} diff --git a/csharp/src/Workflow.Swap/Workflows/NetworkRuntimeMonitor.cs b/csharp/src/Workflow.Swap/Workflows/NetworkRuntimeMonitor.cs index f09652ba..f6e3c270 100644 --- a/csharp/src/Workflow.Swap/Workflows/NetworkRuntimeMonitor.cs +++ b/csharp/src/Workflow.Swap/Workflows/NetworkRuntimeMonitor.cs @@ -36,10 +36,20 @@ public async Task RunAsync() return; } + // Only start runtimes for networks that have at least one node (static or provider-resolved) + var runnableNetworks = networks.Where(n => n.Nodes.Any()).ToList(); + var skippedCount = networks.Count - runnableNetworks.Count; + + if (skippedCount > 0) + { + Temporalio.Workflows.Workflow.Logger.LogInformation( + "Skipping {SkippedCount} networks with no nodes configured", skippedCount); + } + Temporalio.Workflows.Workflow.Logger.LogInformation( - "Ensuring {Count} NetworkRuntimes are running", networks.Count); + "Ensuring {Count} NetworkRuntimes are running", runnableNetworks.Count); - foreach (var network in networks) + foreach (var network in runnableNetworks) { try { diff --git a/csharp/tests/Workflow.Tests/Mocks/MockNetworkActivities.cs b/csharp/tests/Workflow.Tests/Mocks/MockNetworkActivities.cs index b9773f02..4ddc8be0 100644 --- a/csharp/tests/Workflow.Tests/Mocks/MockNetworkActivities.cs +++ b/csharp/tests/Workflow.Tests/Mocks/MockNetworkActivities.cs @@ -44,9 +44,4 @@ public virtual Task> GetNetworksAsync() }); } - [Activity] - public virtual Task> GetNetworkTokensAsync() - { - return Task.FromResult(new List()); - } } diff --git a/js/src/TrainSolver/Models/Shared/DetailedNetworkDto.ts b/js/src/TrainSolver/Models/Shared/DetailedNetworkDto.ts index 6e02943e..f823c4b0 100644 --- a/js/src/TrainSolver/Models/Shared/DetailedNetworkDto.ts +++ b/js/src/TrainSolver/Models/Shared/DetailedNetworkDto.ts @@ -5,7 +5,8 @@ export interface TokenDto { } export interface NodeDto { - providerName: string; + id: number; + providerName: string | null; url: string; protocol: 'Http' | 'WebSocket' | number; // C# enum: 0=Http, 1=WebSocket }