From cbd0e2b2d3ac54f81dea32afa433909c1364dab5 Mon Sep 17 00:00:00 2001 From: James Sangalli Date: Sun, 10 Jun 2018 17:59:24 +0800 Subject: [PATCH] allow payment for free import transfers if not a stormbird contract --- .../Market/Coordinators/UniversalLinkCoordinator.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift b/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift index 1ea7a185e..73d97f106 100644 --- a/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift +++ b/AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift @@ -121,9 +121,12 @@ class UniversalLinkCoordinator: Coordinator { return false } let signedOrder = UniversalLinkHandler().parseUniversalLink(url: (url?.absoluteString)!) + let xmlAddress = XMLHandler().getAddressFromXML(server: RPCServer(chainID: Config().chainID)) + let isStormBirdContract = xmlAddress.eip55String == signedOrder.order.contractAddress getTicketDetailsAndEcRecover(signedOrder: signedOrder) { result in if let goodResult = result { - if signedOrder.order.price > 0 { + //user can pay gas for free import links if they are not covered by our server + if signedOrder.order.price > 0 || !isStormBirdContract { if let balance = self.ethBalance { balance.subscribeOnce { value in if value > signedOrder.order.price { @@ -146,7 +149,8 @@ class UniversalLinkCoordinator: Coordinator { } } } - } else { + } + else { let _ = self.usePaymentServerForFreeTransferLinks( signedOrder: signedOrder, ticketHolder: goodResult