Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
# encoding: UTF-8
# frozen_string_literal: true
module API
module V2
module Entities
class Account < Base
expose(
:currency_id,
as: :currency,
documentation: {
desc: 'Currency code.',
type: String
}
)
expose(
:balance,
format_with: :decimal,
documentation: {
desc: 'Account balance.',
type: BigDecimal
}
)
expose(
:locked,
format_with: :decimal,
documentation: {
desc: 'Account locked funds.',
type: BigDecimal
}
)
expose(
:deposit_address,
if: ->(account, _options) { account.currency.coin? },
using: API::V2::Entities::PaymentAddress,
documentation: {
desc: 'User deposit address',
type: String
}
) do |account, options|
wallet = Wallet.deposit_wallet(account.currency_id)
::PaymentAddress.find_by(wallet: wallet, member: options[:current_user], remote: false)
end
end
end
end
end