mirror of
https://github.com/we-promise/sure.git
synced 2026-05-25 13:34:58 +00:00
* feat(providers): add Kraken exchange sync Adds family-scoped Kraken API-key connections, read-only balance and trade import, account setup/linking flows, provider status wiring, and focused test coverage. Closes #1758 * test(providers): avoid Kraken sample secret false positive * fix(providers): address Kraken review findings * fix(providers): address Kraken review cleanup * test(imports): stabilize transaction import ordering
43 lines
2.0 KiB
Plaintext
43 lines
2.0 KiB
Plaintext
<%# Modal: Link an existing manual crypto exchange account to a Kraken account %>
|
|
<%= turbo_frame_tag "modal" do %>
|
|
<%= render DS::Dialog.new do |dialog| %>
|
|
<% dialog.with_header(title: t(".title")) %>
|
|
|
|
<% dialog.with_body do %>
|
|
<% if @available_kraken_accounts.blank? %>
|
|
<div class="p-4 text-sm text-secondary">
|
|
<p class="mb-2"><%= t(".no_accounts_found") %></p>
|
|
<ul class="list-disc list-inside space-y-1">
|
|
<li><%= t(".wait_for_sync") %></li>
|
|
<li><%= t(".check_provider_health") %></li>
|
|
</ul>
|
|
</div>
|
|
<% else %>
|
|
<%= form_with url: link_existing_account_kraken_items_path, method: :post, class: "space-y-4" do %>
|
|
<%= hidden_field_tag :account_id, @account.id %>
|
|
<%= hidden_field_tag :kraken_item_id, @kraken_item.id %>
|
|
|
|
<div class="space-y-2 max-h-64 overflow-auto">
|
|
<% @available_kraken_accounts.each do |kraken_account| %>
|
|
<label class="flex items-center gap-3 p-2 rounded border border-secondary hover:border-primary cursor-pointer">
|
|
<%= radio_button_tag :kraken_account_id, kraken_account.id, false, required: true %>
|
|
<div class="flex flex-col">
|
|
<span class="text-sm text-primary font-medium"><%= kraken_account.name.presence || kraken_account.id %></span>
|
|
<span class="text-xs text-secondary">
|
|
<%= kraken_account.currency %> • <%= number_with_delimiter(kraken_account.current_balance || 0, delimiter: ",") %>
|
|
</span>
|
|
</div>
|
|
</label>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex items-center justify-end gap-2">
|
|
<%= render DS::Button.new(text: t(".link"), variant: :primary, icon: "link-2", type: :submit) %>
|
|
<%= render DS::Link.new(text: t(".cancel"), variant: :secondary, href: accounts_path, data: { turbo_frame: "_top" }) %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|