Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-7349 [Staking] Send input token and public key in several requests #3666

Merged
merged 6 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@ struct CommonWalletModelsFactory {
)
}

func makeStakingManager(tokenItem: TokenItem, address: String) -> StakingManager? {
func makeStakingManager(publicKey: Data, tokenItem: TokenItem, address: String) -> StakingManager? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publicKey кладется в additionalAddresses -> cosmosPubKey

guard let integrationId = StakingFeatureProvider().yieldId(for: tokenItem),
let item = tokenItem.stakingTokenItem else {
return nil
}

let wallet = StakingWallet(item: item, address: address)
let wallet = StakingWallet(
item: item,
address: address,
publicKey: publicKey
)
return StakingDependenciesFactory().makeStakingManager(integrationId: integrationId, wallet: wallet)
}
}
Expand Down Expand Up @@ -98,7 +102,11 @@ extension CommonWalletModelsFactory: WalletModelsFactory {
let shouldPerformHealthCheck = shouldPerformHealthCheck(blockchain: currentBlockchain, amountType: .coin)
let mainCoinModel = WalletModel(
walletManager: walletManager,
stakingManager: makeStakingManager(tokenItem: tokenItem, address: walletManager.wallet.address),
stakingManager: makeStakingManager(
publicKey: walletManager.wallet.publicKey.blockchainKey,
tokenItem: tokenItem,
address: walletManager.wallet.address
),
transactionHistoryService: transactionHistoryService,
amountType: .coin,
shouldPerformHealthCheck: shouldPerformHealthCheck,
Expand All @@ -119,7 +127,11 @@ extension CommonWalletModelsFactory: WalletModelsFactory {
let shouldPerformHealthCheck = shouldPerformHealthCheck(blockchain: currentBlockchain, amountType: amountType)
let tokenModel = WalletModel(
walletManager: walletManager,
stakingManager: makeStakingManager(tokenItem: tokenItem, address: walletManager.wallet.address),
stakingManager: makeStakingManager(
publicKey: walletManager.wallet.publicKey.blockchainKey,
tokenItem: tokenItem,
address: walletManager.wallet.address
),
transactionHistoryService: transactionHistoryService,
amountType: amountType,
shouldPerformHealthCheck: shouldPerformHealthCheck,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension YieldInfo {
),
],
defaultValidator: nil,
item: .init(network: .tron, contractAddress: nil),
item: .init(network: .tron, contractAddress: nil, name: "", decimals: 0, symbol: ""),
unbondingPeriod: .days(14),
warmupPeriod: .days(0),
rewardClaimingType: .manual,
Expand Down
24 changes: 20 additions & 4 deletions TangemApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
0A0DB7582C48FB0000003450 /* RewardRateValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0DB7572C48FAFF00003450 /* RewardRateValues.swift */; };
0A0E01772C64AA79009E01F2 /* StakingSendAmountValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A0E01762C64AA79009E01F2 /* StakingSendAmountValidator.swift */; };
0A1992A62B5FBDF800344312 /* CurrencyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A1992A52B5FBDF800344312 /* CurrencyTests.swift */; };
0A3BF9692C6CDAD900163492 /* AdditionalAddresses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3BF9682C6CDAD900163492 /* AdditionalAddresses.swift */; };
0A3BF96B2C6CE96B00163492 /* StakingAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3BF96A2C6CE96B00163492 /* StakingAction.swift */; };
0A3BF96D2C6DD9DA00163492 /* StakingTokenItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3BF96C2C6DD9DA00163492 /* StakingTokenItem.swift */; };
0A3BF96F2C6DDB9000163492 /* StakingActionRequestParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A3BF96E2C6DDB9000163492 /* StakingActionRequestParams.swift */; };
0A81B3732BB2D24A0008F21C /* BlockchainURLSchemesParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A81B3722BB2D24A0008F21C /* BlockchainURLSchemesParser.swift */; };
0A81B38E2BB3018E0008F21C /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 0A81B38D2BB3018E0008F21C /* ZIPFoundation */; };
0AB5A4732C5267CB00491764 /* SegmentedPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB5A4722C5267CB00491764 /* SegmentedPicker.swift */; };
Expand Down Expand Up @@ -1490,7 +1494,7 @@
EF729B722AF3E86300D80205 /* ExpressProvidersSelectorViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF729B6D2AF3E86300D80205 /* ExpressProvidersSelectorViewModel.swift */; };
EF729B732AF3E86300D80205 /* ExpressProvidersSelectorRoutable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF729B6E2AF3E86300D80205 /* ExpressProvidersSelectorRoutable.swift */; };
EF729B772AF3E95F00D80205 /* ProviderRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF729B762AF3E95F00D80205 /* ProviderRowView.swift */; };
EF72DC062C467001003DD97F /* StakingTokenItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF72DC042C467001003DD97F /* StakingTokenItem.swift */; };
EF72DC062C467001003DD97F /* StakingToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF72DC042C467001003DD97F /* StakingToken.swift */; };
EF72DC1D2C4670D9003DD97F /* TransactionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF72DC1C2C4670D9003DD97F /* TransactionType.swift */; };
EF72DC1F2C4670E6003DD97F /* TransactionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF72DC1E2C4670E6003DD97F /* TransactionStatus.swift */; };
EF74F50D289BF5AE001034D2 /* Fonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF74F50B289BF5AE001034D2 /* Fonts.swift */; };
Expand Down Expand Up @@ -1886,6 +1890,10 @@
0A0E01762C64AA79009E01F2 /* StakingSendAmountValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingSendAmountValidator.swift; sourceTree = "<group>"; };
0A1992A52B5FBDF800344312 /* CurrencyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyTests.swift; sourceTree = "<group>"; };
0A35044D2E5DF9354751E2DE /* Pods-TangemStakingTests.release(alpha).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TangemStakingTests.release(alpha).xcconfig"; path = "Target Support Files/Pods-TangemStakingTests/Pods-TangemStakingTests.release(alpha).xcconfig"; sourceTree = "<group>"; };
0A3BF9682C6CDAD900163492 /* AdditionalAddresses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalAddresses.swift; sourceTree = "<group>"; };
0A3BF96A2C6CE96B00163492 /* StakingAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingAction.swift; sourceTree = "<group>"; };
0A3BF96C2C6DD9DA00163492 /* StakingTokenItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingTokenItem.swift; sourceTree = "<group>"; };
0A3BF96E2C6DDB9000163492 /* StakingActionRequestParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StakingActionRequestParams.swift; sourceTree = "<group>"; };
0A81B3722BB2D24A0008F21C /* BlockchainURLSchemesParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockchainURLSchemesParser.swift; sourceTree = "<group>"; };
0AB5A4722C5267CB00491764 /* SegmentedPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentedPicker.swift; sourceTree = "<group>"; };
0BE949936543D22F51E09DBD /* Pods-Tangem-TangemUITests.release(alpha).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tangem-TangemUITests.release(alpha).xcconfig"; path = "Target Support Files/Pods-Tangem-TangemUITests/Pods-Tangem-TangemUITests.release(alpha).xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3466,7 +3474,7 @@
EF729B6D2AF3E86300D80205 /* ExpressProvidersSelectorViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpressProvidersSelectorViewModel.swift; sourceTree = "<group>"; };
EF729B6E2AF3E86300D80205 /* ExpressProvidersSelectorRoutable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpressProvidersSelectorRoutable.swift; sourceTree = "<group>"; };
EF729B762AF3E95F00D80205 /* ProviderRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProviderRowView.swift; sourceTree = "<group>"; };
EF72DC042C467001003DD97F /* StakingTokenItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StakingTokenItem.swift; sourceTree = "<group>"; };
EF72DC042C467001003DD97F /* StakingToken.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StakingToken.swift; sourceTree = "<group>"; };
EF72DC1C2C4670D9003DD97F /* TransactionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionType.swift; sourceTree = "<group>"; };
EF72DC1E2C4670E6003DD97F /* TransactionStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionStatus.swift; sourceTree = "<group>"; };
EF74D6A62BA8A8A0000550F3 /* Publisher+ThrowingAsyncMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Publisher+ThrowingAsyncMap.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9481,14 +9489,18 @@
EFB019442C417143009EE857 /* StakingTransactionInfo.swift */,
EFB019482C4174D1009EE857 /* EnterAction.swift */,
EF0FBB862C53FFAE0095A6BD /* ExitAction.swift */,
EF72DC042C467001003DD97F /* StakingTokenItem.swift */,
EF72DC042C467001003DD97F /* StakingToken.swift */,
0A3BF96C2C6DD9DA00163492 /* StakingTokenItem.swift */,
EFBC5C6E2C00A74100B662E0 /* StakingWallet.swift */,
EF72DC1C2C4670D9003DD97F /* TransactionType.swift */,
EF72DC1E2C4670E6003DD97F /* TransactionStatus.swift */,
DC592B8F2C41A4BA005AB9A7 /* StakingPendingHash.swift */,
0A0DB7572C48FAFF00003450 /* RewardRateValues.swift */,
EF0FBB882C53FFC10095A6BD /* ActionTransaction.swift */,
EF0FBB8A2C53FFCD0095A6BD /* ActionStatus.swift */,
0A3BF9682C6CDAD900163492 /* AdditionalAddresses.swift */,
0A3BF96A2C6CE96B00163492 /* StakingAction.swift */,
0A3BF96E2C6DDB9000163492 /* StakingActionRequestParams.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -12364,6 +12376,7 @@
EFB019472C4172D6009EE857 /* StakeKitDTO+NetworkType.swift in Sources */,
EF407E5D2C04D64B00366733 /* StakingAPIProvider.swift in Sources */,
EFBC5C732C00A74100B662E0 /* YieldInfo.swift in Sources */,
0A3BF9692C6CDAD900163492 /* AdditionalAddresses.swift in Sources */,
EFBC5C752C00A74100B662E0 /* StakingAPIService.swift in Sources */,
EFBC5C902C00B8B800B662E0 /* StakeKitDTO+Yield.swift in Sources */,
EF407E382C04B09A00366733 /* Logger.swift in Sources */,
Expand All @@ -12379,10 +12392,12 @@
DC592B8A2C419F50005AB9A7 /* StakingPendingHashesRepository.swift in Sources */,
EF0FBB872C53FFAE0095A6BD /* ExitAction.swift in Sources */,
EF407E662C04D75100366733 /* StakeKitDTO+Actions.swift in Sources */,
EF72DC062C467001003DD97F /* StakingTokenItem.swift in Sources */,
EF72DC062C467001003DD97F /* StakingToken.swift in Sources */,
EF031A282C08E65A001535C9 /* StakingCalculator.swift in Sources */,
EF8DBCDD2C060A03009072CF /* StakingManager.swift in Sources */,
0A3BF96F2C6DDB9000163492 /* StakingActionRequestParams.swift in Sources */,
EFBC5C792C00A79E00B662E0 /* StakeKitStakingAPIService.swift in Sources */,
0A3BF96B2C6CE96B00163492 /* StakingAction.swift in Sources */,
EFB019492C4174D1009EE857 /* EnterAction.swift in Sources */,
EF407E5F2C04D65B00366733 /* CommonStakingAPIProvider.swift in Sources */,
EFB019432C41710F009EE857 /* StakingBalanceInfo.swift in Sources */,
Expand All @@ -12397,6 +12412,7 @@
0A0DB7582C48FB0000003450 /* RewardRateValues.swift in Sources */,
EF72DC1D2C4670D9003DD97F /* TransactionType.swift in Sources */,
EF407E622C04D67400366733 /* StakeKitMapper.swift in Sources */,
0A3BF96D2C6DD9DA00163492 /* StakingTokenItem.swift in Sources */,
EF0FBB892C53FFC10095A6BD /* ActionTransaction.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
13 changes: 13 additions & 0 deletions TangemStaking/Models/AdditionalAddresses.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// AdditionalAddresses.swift
// TangemStaking
//
// Created by Dmitry Fedorov on 14.08.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

import Foundation

public struct AdditionalAddresses {
let cosmosPubKey: String?
tureck1y marked this conversation as resolved.
Show resolved Hide resolved
}
27 changes: 27 additions & 0 deletions TangemStaking/Models/StakingAction.swift
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вынес в отдельный файл

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// StakingAction.swift
// TangemStaking
//
// Created by Dmitry Fedorov on 14.08.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

import Foundation

public struct StakingAction {
let amount: Decimal
let validator: String
let type: ActionType

public init(amount: Decimal, validator: String, type: StakingAction.ActionType) {
self.amount = amount
self.validator = validator
self.type = type
}

public enum ActionType {
case stake
case claimRewards
case unstake
}
}
34 changes: 34 additions & 0 deletions TangemStaking/Models/StakingActionRequestParams.swift
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в интерфейсах запросов стало слишком много параметров, вынес в отдельную сущность

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// StakingActionRequestParams.swift
// TangemStaking
//
// Created by Dmitry Fedorov on 15.08.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

import Foundation

public struct StakingActionRequestParams {
let amount: Decimal
let address: String
let additionalAddresses: AdditionalAddresses?
let token: StakingToken?
let validator: String
let integrationId: String

init(
amount: Decimal,
address: String,
additionalAddresses: AdditionalAddresses? = nil,
token: StakingToken? = nil,
validator: String,
integrationId: String
) {
self.amount = amount
self.address = address
self.additionalAddresses = additionalAddresses
self.token = token
self.validator = validator
self.integrationId = integrationId
}
}
4 changes: 2 additions & 2 deletions TangemStaking/Models/StakingBalanceInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
import Foundation

public struct StakingBalanceInfo: Hashable {
public let item: StakingTokenItem
public let item: StakingToken
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

разбил сущность StakingTokenItem на StakingToken (парсится из yield модельки) и StakingTokenItem (может быть создан локально, например в TokenItem+StakingTokenItem.swift), а то была путаница

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А вот думаю надо ли? По факту мы спокойно можем создать StakingToken из TokenItem в TokenItem+StakingTokenItem.swiftда и все

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай попробую переделать, если что - отпишу

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вроде получилось

public let blocked: Decimal
public let rewards: Decimal?
public let balanceGroupType: BalanceGroupType
public let validatorAddress: String?
public let passthrough: String?

public init(
item: StakingTokenItem,
item: StakingToken,
blocked: Decimal,
rewards: Decimal?,
balanceGroupType: BalanceGroupType,
Expand Down
31 changes: 31 additions & 0 deletions TangemStaking/Models/StakingToken.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// StakingToken.swift
// TangemStaking
//
// Created by Sergey Balashov on 15.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

import Foundation

public struct StakingToken: Hashable {
public let network: StakeKitNetworkType
public let contractAddress: String?
public let name: String
public let decimals: Int
public let symbol: String

public init(
network: StakeKitNetworkType,
contractAddress: String? = nil,
name: String,
decimals: Int,
symbol: String
) {
self.network = network
self.contractAddress = contractAddress
self.name = name
self.decimals = decimals
self.symbol = symbol
}
}
4 changes: 2 additions & 2 deletions TangemStaking/Models/StakingTokenItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// StakingTokenItem.swift
// TangemStaking
//
// Created by Sergey Balashov on 15.07.2024.
// Created by Dmitry Fedorov on 15.08.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand All @@ -12,7 +12,7 @@ public struct StakingTokenItem: Hashable {
public let network: StakeKitNetworkType
public let contractAddress: String?

public init(network: StakeKitNetworkType, contractAddress: String?) {
public init(network: StakeKitNetworkType, contractAddress: String? = nil) {
self.network = network
self.contractAddress = contractAddress
}
Expand Down
4 changes: 3 additions & 1 deletion TangemStaking/Models/StakingWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import Foundation
public struct StakingWallet: Hashable {
public let item: StakingTokenItem
public let address: String
public let publicKey: Data?

public init(item: StakingTokenItem, address: String) {
public init(item: StakingTokenItem, address: String, publicKey: Data? = nil) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай может без опционала, пускай обязательным будет, мало ли забудем потом где-то

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убрал

self.item = item
self.address = address
self.publicKey = publicKey
}
}
4 changes: 2 additions & 2 deletions TangemStaking/Models/YieldInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct YieldInfo: Hashable {
public let defaultValidator: String?

// Metadata
public let item: StakingTokenItem
public let item: StakingToken
public let unbondingPeriod: Period
public let warmupPeriod: Period

Expand All @@ -43,7 +43,7 @@ public struct YieldInfo: Hashable {
exitMinimumRequirement: Decimal,
validators: [ValidatorInfo],
defaultValidator: String?,
item: StakingTokenItem,
item: StakingToken,
unbondingPeriod: Period,
warmupPeriod: Period,
rewardClaimingType: RewardClaimingType,
Expand Down
21 changes: 19 additions & 2 deletions TangemStaking/Services/StakeKitMapper/StakeKitMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,18 @@ struct StakeKitMapper {
}
}

func mapToStakingTokenItem(from token: StakeKitDTO.Token) throws -> StakingTokenItem {
func mapToStakingTokenItem(from token: StakeKitDTO.Token) throws -> StakingToken {
guard let network = StakeKitNetworkType(rawValue: token.network) else {
throw StakeKitMapperError.noData("StakeKitNetworkType not found")
}

return StakingTokenItem(network: network, contractAddress: token.address)
return StakingToken(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

парсим всю модельку чтобы отправить в estimate-gas или exit/enter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я думаю да, давай одну модельку оставим, просто добавим полей
в ней же их нет, просто потому что я их поленился добавлять

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я так сделал сначала но потом запнулся на TokenItem+StakingTokenItem.swift, там не понятно как создавать

network: network,
contractAddress: token.address,
name: token.name,
decimals: token.decimals,
symbol: token.symbol
)
}

func mapToRewardType(from rewardType: StakeKitDTO.Yield.Info.Response.RewardType) -> RewardType {
Expand Down Expand Up @@ -252,6 +258,17 @@ struct StakeKitMapper {
rewardsPendingAction(from: balance)?.passthrough
}

func mapToTokenDTO(from tokenItem: StakingToken) -> StakeKitDTO.Token {
StakeKitDTO.Token(
network: tokenItem.network.rawValue,
name: tokenItem.name,
decimals: tokenItem.decimals,
address: tokenItem.contractAddress,
symbol: tokenItem.symbol,
logoURI: nil
Comment on lines +263 to +268
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А stake kit прям все параметры нужны? Может там без name и без decimals можно?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

наверное можно, но андроид все шлет, я бы оставил пока все сети не заинтегрим.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

окей)

)
}

private func rewardsPendingAction(from balance: StakeKitDTO.Balances.Response.Balance) -> StakeKitDTO.Balances.Response.Balance.PendingAction? {
guard balance.type == .rewards else {
return nil
Expand Down
Loading
Loading