Skip to content

Commit

Permalink
chore: disable auth limit check
Browse files Browse the repository at this point in the history
  • Loading branch information
Syn-McJ committed Mar 22, 2024
1 parent 0ff4ec2 commit 35dc045
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions DashWallet/Sources/Models/Coinbase/Accounts/Account/CBAccount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ extension CBAccount {
fatalError("No wallet")
}

let fiatCurrency = Coinbase.sendLimitCurrency
if let localNumber = try? Coinbase.shared.currencyExchanger.convertDash(amount: amount.dashAmount, to: fiatCurrency),
localNumber > Coinbase.shared.sendLimit {
throw Coinbase.Error.transactionFailed(.limitExceded)
}
// TODO: disabled until Coinbase changes are clear
// let fiatCurrency = Coinbase.sendLimitCurrency
// if let localNumber = try? Coinbase.shared.currencyExchanger.convertDash(amount: amount.dashAmount, to: fiatCurrency),
// localNumber > Coinbase.shared.sendLimit {
// throw Coinbase.Error.transactionFailed(.limitExceded)
// }

guard amount >= DSTransaction.txMinOutputAmount() else {
throw Coinbase.Error.transactionFailed(.invalidAmount)
Expand Down Expand Up @@ -176,9 +177,11 @@ extension CBAccount {
let localFormatter = NumberFormatter.fiatFormatter(currencyCode: fiatCurrency)
let str = localFormatter.string(from: min) ?? "$1.99"
throw Coinbase.Error.transactionFailed(.enteredAmountTooLow(minimumAmount: str))
} else if localNumber > Coinbase.shared.sendLimit {
throw Coinbase.Error.transactionFailed(.limitExceded)
}
}
// TODO: disabled until Coinbase changes are clear
// else if localNumber > Coinbase.shared.sendLimit {
// throw Coinbase.Error.transactionFailed(.limitExceded)
// }

let formatter = NumberFormatter.decimalFormatter
formatter.maximumFractionDigits = 2
Expand Down Expand Up @@ -212,9 +215,12 @@ extension CBAccount {
let localFormatter = NumberFormatter.fiatFormatter(currencyCode: fiatCurrency)
let str = localFormatter.string(from: min) ?? "$1.99"
throw Coinbase.Error.transactionFailed(.enteredAmountTooLow(minimumAmount: str))
} else if amountInUSD > Coinbase.shared.sendLimit {
throw Coinbase.Error.transactionFailed(.limitExceded)
}
}

// TODO: disabled until Coinbase changes are clear
// else if amountInUSD > Coinbase.shared.sendLimit {
// throw Coinbase.Error.transactionFailed(.limitExceded)
// }
}

let baseIds: BaseDataCollectionResponse<CoinbaseBaseIDForCurrency> = try await CoinbaseAPI.shared.request(.getBaseIdForUSDModel("USD"))
Expand Down

0 comments on commit 35dc045

Please sign in to comment.