diff --git a/AlphaWallet.xcodeproj/project.pbxproj b/AlphaWallet.xcodeproj/project.pbxproj index a24a45f1e..9821b21db 100644 --- a/AlphaWallet.xcodeproj/project.pbxproj +++ b/AlphaWallet.xcodeproj/project.pbxproj @@ -443,7 +443,7 @@ 76F1D51EFA6255E0D0381E06 /* GetERC721BalanceEncode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1DC947821847220DE2B97 /* GetERC721BalanceEncode.swift */; }; 76F1D5AF727A83205BBCF0EC /* OrderHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1DADFD07E2941897FD2E1 /* OrderHandler.swift */; }; 76F1D74912F5D8CDA72363BD /* GetContractInteractions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1DF5CF4A922E6FFCB7B2A /* GetContractInteractions.swift */; }; - 76F1D76BF700FCC461B11CC0 /* ClaimStormBirdOrder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1D1417613174D447DEE56 /* ClaimStormBirdOrder.swift */; }; + 76F1D76BF700FCC461B11CC0 /* ClaimERC875Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1D1417613174D447DEE56 /* ClaimERC875Order.swift */; }; 76F1D7F08263A663C3A67926 /* GetIsERC721ContractCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1D4F77311FBF3A442E4B5 /* GetIsERC721ContractCoordinator.swift */; }; 76F1D850F4F2E968CF8D9C86 /* MonkeyTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B138ABCF208C2C93000FC28A /* MonkeyTest.swift */; }; 76F1D91659771C9EEA7B48DC /* CreateRedeem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F1DF80932454E9F58B7830 /* CreateRedeem.swift */; }; @@ -978,7 +978,7 @@ 73ED85A420349BE400593BF3 /* StringFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringFormatter.swift; sourceTree = ""; }; 73ED85A62034BFEF00593BF3 /* UITextFieldAdditions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextFieldAdditions.swift; sourceTree = ""; }; 73ED85A82034C42D00593BF3 /* StringFormatterTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringFormatterTest.swift; sourceTree = ""; }; - 76F1D1417613174D447DEE56 /* ClaimStormBirdOrder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClaimStormBirdOrder.swift; sourceTree = ""; }; + 76F1D1417613174D447DEE56 /* ClaimERC875Order.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClaimERC875Order.swift; sourceTree = ""; }; 76F1D419EE36261E50ABAFAE /* ClaimOrderCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClaimOrderCoordinator.swift; sourceTree = ""; }; 76F1D473FF303828D93C95EB /* GetERC721BalanceCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetERC721BalanceCoordinator.swift; sourceTree = ""; }; 76F1D4F77311FBF3A442E4B5 /* GetIsERC721ContractCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetIsERC721ContractCoordinator.swift; sourceTree = ""; }; @@ -1311,7 +1311,7 @@ 442FC8B1D5B4317DE7D68325 /* GetERC875Balance.swift */, 442FCA1F19B6293FE5FAD494 /* GetIsERC875Encode.swift */, 442FC72F9D22CC36AC015274 /* GetERC20Decimals.swift */, - 76F1D1417613174D447DEE56 /* ClaimStormBirdOrder.swift */, + 76F1D1417613174D447DEE56 /* ClaimERC875Order.swift */, 76F1DC947821847220DE2B97 /* GetERC721BalanceEncode.swift */, 76F1DC1E229431AA75EF94C3 /* GetIsERC721Encode.swift */, 76F1D6838F0069D06414009D /* ContractERC721Transfer.swift */, @@ -3534,7 +3534,7 @@ 442FC81F38F80EEF54C69C5B /* TokenAdaptor.swift in Sources */, 442FC258BAEFDE2D64E48D0D /* TicketsCoordinator.swift in Sources */, 76F1DB9E1443DCFC36228B08 /* ClaimOrderCoordinator.swift in Sources */, - 76F1D76BF700FCC461B11CC0 /* ClaimStormBirdOrder.swift in Sources */, + 76F1D76BF700FCC461B11CC0 /* ClaimERC875Order.swift in Sources */, 76F1D91659771C9EEA7B48DC /* CreateRedeem.swift in Sources */, 442FCA2F6C6A21C27B628AA4 /* TicketTableViewCellWithCheckbox.swift in Sources */, 442FC7777D495D3095836CA6 /* RedeemTicketsViewModel.swift in Sources */, diff --git a/AlphaWallet/Tokens/Coordinators/GetERC875BalanceCoordinator.swift b/AlphaWallet/Tokens/Coordinators/GetERC875BalanceCoordinator.swift index 8dcfe11ca..138d69b30 100644 --- a/AlphaWallet/Tokens/Coordinators/GetERC875BalanceCoordinator.swift +++ b/AlphaWallet/Tokens/Coordinators/GetERC875BalanceCoordinator.swift @@ -20,7 +20,7 @@ class GetERC875BalanceCoordinator { contract: Address, completion: @escaping (Result<[String], AnyError>) -> Void ) { - let request = GetStormBirdBalanceEncode(address: address) + let request = GetERC875BalanceEncode(address: address) web3.request(request: request) { result in switch result { case .success(let res): @@ -30,7 +30,7 @@ class GetERC875BalanceCoordinator { Session.send(request2) { [weak self] result2 in switch result2 { case .success(let balance): - let request = GetStormBirdBalanceDecode(data: balance) + let request = GetERC875BalanceDecode(data: balance) self?.web3.request(request: request) { result in switch result { case .success(let res): diff --git a/AlphaWallet/Tokens/Types/TokensDataStore.swift b/AlphaWallet/Tokens/Types/TokensDataStore.swift index e9d19cd7d..8a7eef49f 100644 --- a/AlphaWallet/Tokens/Types/TokensDataStore.swift +++ b/AlphaWallet/Tokens/Types/TokensDataStore.swift @@ -288,7 +288,7 @@ class TokensDataStore { getERC875Balance(for: tokenObject.contract, completion: { result in switch result { case .success(let balance): - self.update(token: tokenObject, action: .stormBirdBalance(balance)) + self.update(token: tokenObject, action: .nonFungibleBalance(balance)) case .failure: break } @@ -297,7 +297,7 @@ class TokensDataStore { getERC721Balance(for: tokenObject.contract, completion: { result in switch result { case .success(let balance): - self.update(token: tokenObject, action: .stormBirdBalance(balance)) + self.update(token: tokenObject, action: .nonFungibleBalance(balance)) case .failure: break } @@ -413,7 +413,7 @@ class TokensDataStore { enum TokenUpdate { case value(BigInt) case isDisabled(Bool) - case stormBirdBalance([String]) + case nonFungibleBalance([String]) } func update(token: TokenObject, action: TokenUpdate) { @@ -424,7 +424,7 @@ class TokensDataStore { token.value = value.description case .isDisabled(let value): token.isDisabled = value - case .stormBirdBalance(let balance): + case .nonFungibleBalance(let balance): token.balance.removeAll() if !balance.isEmpty { for i in 0...balance.count - 1 { diff --git a/AlphaWallet/Vendors/New Group/Commands/ClaimStormBirdOrder.swift b/AlphaWallet/Vendors/New Group/Commands/ClaimERC875Order.swift similarity index 100% rename from AlphaWallet/Vendors/New Group/Commands/ClaimStormBirdOrder.swift rename to AlphaWallet/Vendors/New Group/Commands/ClaimERC875Order.swift diff --git a/AlphaWallet/Vendors/New Group/Commands/GetERC875Balance.swift b/AlphaWallet/Vendors/New Group/Commands/GetERC875Balance.swift index 9ba388b62..65dceaa69 100644 --- a/AlphaWallet/Vendors/New Group/Commands/GetERC875Balance.swift +++ b/AlphaWallet/Vendors/New Group/Commands/GetERC875Balance.swift @@ -3,7 +3,7 @@ import Foundation import TrustKeystore -struct GetStormBirdBalanceEncode: Web3Request { +struct GetERC875BalanceEncode: Web3Request { typealias Response = String static let abi = "{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}" @@ -11,12 +11,12 @@ struct GetStormBirdBalanceEncode: Web3Request { let address: Address var type: Web3RequestType { - let run = "web3.eth.abi.encodeFunctionCall(\(GetStormBirdBalanceEncode.abi), [\"\(address.description)\"])" + let run = "web3.eth.abi.encodeFunctionCall(\(GetERC875BalanceEncode.abi), [\"\(address.description)\"])" return .script(command: run) } } -struct GetStormBirdBalanceDecode: Web3Request { +struct GetERC875BalanceDecode: Web3Request { typealias Response = String let data: String