remove crypto balance from backend

This commit is contained in:
João Geonizeli
2021-09-13 20:54:21 -03:00
parent d43939dee4
commit d6b6b997d5
33 changed files with 836 additions and 1422 deletions

View File

@@ -9,10 +9,6 @@ module Mutations
amount = BigDecimal(order[:amount])
ActiveRecord::Base.transaction do
current_user
.balance
.withdrawal!(amount)
record = SellCryptoOrder.create!(
paid_amount: amount,
user_id: current_user.id,

View File

@@ -9,10 +9,6 @@ module Mutations
amount = BigDecimal(order[:amount])
ActiveRecord::Base.transaction do
current_user
.balance
.withdrawal!(amount)
record = StakeOrder.create!(
amount: amount,
pool_name: order[:pool_name],

View File

@@ -1,12 +0,0 @@
# frozen_string_literal: true
module Types
class BalanceType < Types::BaseObject
implements GraphQL::Types::Relay::Node
global_id_field :id
graphql_name "Balance"
field :id, ID, null: false
field :amount, String, null: false
end
end

View File

@@ -11,8 +11,6 @@ module Types
field :first_name, String, null: false
field :last_name, String, null: false
field :wallet_address, String, null: true
field :balance, BalanceType, null: false
field :fiat_balance, FiatBalanceType, null: false
end
end

View File

@@ -6,8 +6,6 @@ class XStakeSchema < GraphQL::Schema
def self.resolve_type(abstract_type, obj, ctx)
case obj
when Balance
Types::BalanceType
when FiatBalance
Types::FiatBalanceType
when SellCryptoOrder