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
17 lines
576 B
Ruby
17 lines
576 B
Ruby
# frozen_string_literal: true
|
|
|
|
class KrakenAccount::SecurityResolver
|
|
EXCHANGE_MIC = "XKRA"
|
|
|
|
def self.resolve(ticker, symbol)
|
|
Security::Resolver.new(ticker).resolve
|
|
rescue StandardError => e
|
|
Rails.logger.warn "KrakenAccount::SecurityResolver - resolver failed for #{ticker}: #{e.message}"
|
|
Security.find_or_initialize_by(ticker: ticker, exchange_operating_mic: EXCHANGE_MIC).tap do |security|
|
|
security.name = symbol if security.name.blank?
|
|
security.offline = true unless security.offline
|
|
security.save! if security.changed?
|
|
end
|
|
end
|
|
end
|