From 84570a8406cef0f2101f1fdd00d29e02d23c5cb8 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 19 Feb 2025 18:06:50 +0300 Subject: [PATCH] Updated on 2026-08-14 --- app/build.gradle.kts | 7 +- .../data/visa/utils/VisaCurrencyFactory.kt | 1 - .../tangem/domain/visa/model/VisaCurrency.kt | 1 - .../BalancesAndLimitsBottomSheetConfig.kt | 1 - .../BalancesAndLimitsBottomSheetConverter.kt | 1 - .../visa/BalancesAndLimitsBottomSheet.kt | 5 - gradle/dependencies.toml | 2 +- libs/visa/build.gradle.kts | 6 + .../main/java/com/tangem/lib/visa/ERC20.java | 183 +- .../lib/visa/TangemBridgeProcessor.java | 1807 +++++++------ .../tangem/lib/visa/TangemPaymentAccount.java | 2392 ++++++++++------- .../visa/TangemPaymentAccountRegistry.java | 506 ++-- .../visa/DefaultVisaContractInfoProvider.kt | 43 +- .../tangem/lib/visa/model/VisaContractInfo.kt | 1 - settings.gradle.kts | 11 + 15 files changed, 2860 insertions(+), 2107 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f3177619a4..8fa9c93920 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,9 +22,14 @@ android { jniLibs { useLegacyPackaging = true } - resources.excludes.add("META-INF/DEPENDENCIES") resources.excludes.add("META-INF/LICENSE.md") resources.excludes.add("META-INF/NOTICE.md") + resources.excludes.add("META-INF/DISCLAIMER") + resources.excludes.add("META-INF/DEPENDENCIES") + resources.excludes.add("META-INF/FastDoubleParser-NOTICE") + resources.excludes.add("META-INF/FastDoubleParser-LICENSE") + resources.excludes.add("META-INF/io.netty.versions.properties") + resources.excludes.add("META-INF/INDEX.LIST") } androidResources { generateLocaleConfig = true diff --git a/data/visa/src/debug/kotlin/com/tangem/data/visa/utils/VisaCurrencyFactory.kt b/data/visa/src/debug/kotlin/com/tangem/data/visa/utils/VisaCurrencyFactory.kt index 6398dcec84..989a2d504c 100644 --- a/data/visa/src/debug/kotlin/com/tangem/data/visa/utils/VisaCurrencyFactory.kt +++ b/data/visa/src/debug/kotlin/com/tangem/data/visa/utils/VisaCurrencyFactory.kt @@ -32,7 +32,6 @@ internal class VisaCurrencyFactory { available = balances.available.forPayment, blocked = balances.blocked, debt = balances.debt, - pendingRefund = balances.pendingRefund, ) }, limits = VisaCurrency.Limits( diff --git a/domain/visa/src/main/kotlin/com/tangem/domain/visa/model/VisaCurrency.kt b/domain/visa/src/main/kotlin/com/tangem/domain/visa/model/VisaCurrency.kt index 1e6a0c55a1..b21df662c3 100644 --- a/domain/visa/src/main/kotlin/com/tangem/domain/visa/model/VisaCurrency.kt +++ b/domain/visa/src/main/kotlin/com/tangem/domain/visa/model/VisaCurrency.kt @@ -20,7 +20,6 @@ data class VisaCurrency( val available: BigDecimal, val blocked: BigDecimal, val debt: BigDecimal, - val pendingRefund: BigDecimal, ) data class Limits( diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/BalancesAndLimitsBottomSheetConfig.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/BalancesAndLimitsBottomSheetConfig.kt index 1dd961ab14..cedb03bee2 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/BalancesAndLimitsBottomSheetConfig.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/BalancesAndLimitsBottomSheetConfig.kt @@ -12,7 +12,6 @@ internal data class BalancesAndLimitsBottomSheetConfig( val availableBalance: String, val blockedBalance: String, val debit: String, - val pending: String, val amlVerified: String, val onInfoClick: () -> Unit, ) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/BalancesAndLimitsBottomSheetConverter.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/BalancesAndLimitsBottomSheetConverter.kt index dc965b29e2..ffb4722637 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/BalancesAndLimitsBottomSheetConverter.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/BalancesAndLimitsBottomSheetConverter.kt @@ -27,7 +27,6 @@ internal class BalancesAndLimitsBottomSheetConverter( availableBalance = value.balances.available.let(::formatAmount), blockedBalance = value.balances.blocked.let(::formatAmount), debit = value.balances.debt.let(::formatAmount), - pending = value.balances.pendingRefund.let(::formatAmount), amlVerified = value.balances.verified.let(::formatAmount), onInfoClick = this::showBalanceInfo, ), diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/visa/BalancesAndLimitsBottomSheet.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/visa/BalancesAndLimitsBottomSheet.kt index 97dd93b282..d9296dab81 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/visa/BalancesAndLimitsBottomSheet.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/visa/BalancesAndLimitsBottomSheet.kt @@ -78,10 +78,6 @@ private fun BalancesBlock(balances: BalancesAndLimitsBottomSheetConfig.Balance, title = stringReference("Debit"), value = balances.debit, ) - BlockItem( - title = stringReference("Pending refund"), - value = balances.pending, - ) }, description = { InfoButton(onClick = balances.onInfoClick) @@ -180,7 +176,6 @@ private class BalancesAndLimitsBottomSheetParameterProvider : availableBalance = "392.45 USDT", blockedBalance = "36.00 USDT", debit = "00.00 USDT", - pending = "20.99 USDT", amlVerified = "356.45 USDT", onInfoClick = {}, ), diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index 060b0ba823..7f200fada5 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -80,7 +80,7 @@ mlKit-barcodeScanning = "17.2.0" androidXCamera = "1.3.0" listenableFuture = "1.0" swipeRefreshLayout = "1.1.0" -web3j = "4.10.1" +web3j = "4.12.3-SNAPSHOT" leakcanary = "2.13" decompose = "2.2.2" room = "2.6.1" diff --git a/libs/visa/build.gradle.kts b/libs/visa/build.gradle.kts index eb6f922306..d73b1485ff 100644 --- a/libs/visa/build.gradle.kts +++ b/libs/visa/build.gradle.kts @@ -9,6 +9,12 @@ plugins { android { namespace = "com.tangem.libs.visa" + + packaging { + resources { + excludes += "/META-INF/*" + } + } } dependencies { diff --git a/libs/visa/src/main/java/com/tangem/lib/visa/ERC20.java b/libs/visa/src/main/java/com/tangem/lib/visa/ERC20.java index fb6048f082..5ea4655792 100644 --- a/libs/visa/src/main/java/com/tangem/lib/visa/ERC20.java +++ b/libs/visa/src/main/java/com/tangem/lib/visa/ERC20.java @@ -1,8 +1,18 @@ package com.tangem.lib.visa; +import io.reactivex.Flowable; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import org.web3j.abi.EventEncoder; import org.web3j.abi.TypeReference; -import org.web3j.abi.datatypes.*; +import org.web3j.abi.datatypes.Address; +import org.web3j.abi.datatypes.Event; +import org.web3j.abi.datatypes.Function; +import org.web3j.abi.datatypes.Type; +import org.web3j.abi.datatypes.Utf8String; import org.web3j.abi.datatypes.generated.Uint256; import org.web3j.abi.datatypes.generated.Uint8; import org.web3j.crypto.Credentials; @@ -17,25 +27,17 @@ import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; import org.web3j.tx.gas.ContractGasProvider; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import io.reactivex.Flowable; - /** *

Auto generated code. *

Do not modify! *

Please use the web3j command line tools, - * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the + * codegen module to update. * - *

Generated with web3j version 1.5.2. + *

Generated with web3j version 1.6.1. */ @SuppressWarnings("rawtypes") -class ERC20 extends Contract { +public class ERC20 extends Contract { public static final String BINARY = "Bin file was not provided"; public static final String FUNC_ALLOWANCE = "allowance"; @@ -57,39 +59,40 @@ class ERC20 extends Contract { public static final String FUNC_TRANSFERFROM = "transferFrom"; public static final Event APPROVAL_EVENT = new Event("Approval", - Arrays.asList(new TypeReference

(true) { - }, new TypeReference
(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event TRANSFER_EVENT = new Event("Transfer", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference
(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; @Deprecated - protected ERC20(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + protected ERC20(String contractAddress, Web3j web3j, Credentials credentials, + BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } - protected ERC20(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + protected ERC20(String contractAddress, Web3j web3j, Credentials credentials, + ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, credentials, contractGasProvider); } @Deprecated - protected ERC20(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + protected ERC20(String contractAddress, Web3j web3j, TransactionManager transactionManager, + BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } - protected ERC20(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + protected ERC20(String contractAddress, Web3j web3j, TransactionManager transactionManager, + ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); } - public static List getApprovalEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(APPROVAL_EVENT, transactionReceipt); + public static List getApprovalEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(APPROVAL_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { ApprovalEventResponse typedResponse = new ApprovalEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -101,7 +104,7 @@ class ERC20 extends Contract { } public static ApprovalEventResponse getApprovalEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(APPROVAL_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(APPROVAL_EVENT, log); ApprovalEventResponse typedResponse = new ApprovalEventResponse(); typedResponse.log = log; typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -110,20 +113,22 @@ class ERC20 extends Contract { return typedResponse; } - @Deprecated - public static ERC20 load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { - return new ERC20(contractAddress, web3j, credentials, gasPrice, gasLimit); + public Flowable approvalEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getApprovalEventFromLog(log)); } - @Deprecated - public static ERC20 load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { - return new ERC20(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + public Flowable approvalEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT)); + return approvalEventFlowable(filter); } - public static List getTransferEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt); + public static List getTransferEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { TransferEventResponse typedResponse = new TransferEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -135,7 +140,7 @@ class ERC20 extends Contract { } public static TransferEventResponse getTransferEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSFER_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSFER_EVENT, log); TransferEventResponse typedResponse = new TransferEventResponse(); typedResponse.log = log; typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -148,107 +153,107 @@ class ERC20 extends Contract { return web3j.ethLogFlowable(filter).map(log -> getTransferEventFromLog(log)); } - public Flowable transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable transferEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); return transferEventFlowable(filter); } - public static ERC20 load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { - return new ERC20(contractAddress, web3j, credentials, contractGasProvider); - } - - public static ERC20 load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { - return new ERC20(contractAddress, web3j, transactionManager, contractGasProvider); - } - - public Flowable approvalEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getApprovalEventFromLog(log)); - } - - public Flowable approvalEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT)); - return approvalEventFlowable(filter); - } - public RemoteFunctionCall allowance(String owner, String spender) { final Function function = new Function(FUNC_ALLOWANCE, - Arrays.asList(new Address(160, owner), - new Address(160, spender)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner), + new org.web3j.abi.datatypes.Address(160, spender)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall approve(String spender, BigInteger value) { final Function function = new Function( FUNC_APPROVE, - Arrays.asList(new Address(160, spender), - new Uint256(value)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, spender), + new org.web3j.abi.datatypes.generated.Uint256(value)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall balanceOf(String account) { final Function function = new Function(FUNC_BALANCEOF, - List.of(new Address(160, account)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, account)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall decimals() { final Function function = new Function(FUNC_DECIMALS, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall name() { final Function function = new Function(FUNC_NAME, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall symbol() { final Function function = new Function(FUNC_SYMBOL, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall totalSupply() { final Function function = new Function(FUNC_TOTALSUPPLY, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall transfer(String to, BigInteger value) { final Function function = new Function( FUNC_TRANSFER, - Arrays.asList(new Address(160, to), - new Uint256(value)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, to), + new org.web3j.abi.datatypes.generated.Uint256(value)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall transferFrom(String from, String to, BigInteger value) { + public RemoteFunctionCall transferFrom(String from, String to, + BigInteger value) { final Function function = new Function( FUNC_TRANSFERFROM, - Arrays.asList(new Address(160, from), - new Address(160, to), - new Uint256(value)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, from), + new org.web3j.abi.datatypes.Address(160, to), + new org.web3j.abi.datatypes.generated.Uint256(value)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } + @Deprecated + public static ERC20 load(String contractAddress, Web3j web3j, Credentials credentials, + BigInteger gasPrice, BigInteger gasLimit) { + return new ERC20(contractAddress, web3j, credentials, gasPrice, gasLimit); + } + + @Deprecated + public static ERC20 load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + return new ERC20(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + } + + public static ERC20 load(String contractAddress, Web3j web3j, Credentials credentials, + ContractGasProvider contractGasProvider) { + return new ERC20(contractAddress, web3j, credentials, contractGasProvider); + } + + public static ERC20 load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + return new ERC20(contractAddress, web3j, transactionManager, contractGasProvider); + } + public static class ApprovalEventResponse extends BaseEventResponse { public String owner; @@ -264,4 +269,4 @@ class ERC20 extends Contract { public BigInteger value; } -} +} \ No newline at end of file diff --git a/libs/visa/src/main/java/com/tangem/lib/visa/TangemBridgeProcessor.java b/libs/visa/src/main/java/com/tangem/lib/visa/TangemBridgeProcessor.java index b612de84bc..3352f39d85 100644 --- a/libs/visa/src/main/java/com/tangem/lib/visa/TangemBridgeProcessor.java +++ b/libs/visa/src/main/java/com/tangem/lib/visa/TangemBridgeProcessor.java @@ -1,11 +1,23 @@ package com.tangem.lib.visa; +import io.reactivex.Flowable; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import org.web3j.abi.EventEncoder; import org.web3j.abi.FunctionEncoder; import org.web3j.abi.TypeReference; -import org.web3j.abi.datatypes.*; +import org.web3j.abi.datatypes.Address; +import org.web3j.abi.datatypes.Bool; +import org.web3j.abi.datatypes.Event; +import org.web3j.abi.datatypes.Function; +import org.web3j.abi.datatypes.StaticStruct; +import org.web3j.abi.datatypes.Type; +import org.web3j.abi.datatypes.generated.Bytes16; import org.web3j.abi.datatypes.generated.Bytes32; -import org.web3j.abi.datatypes.generated.Bytes4; +import org.web3j.abi.datatypes.generated.Uint16; import org.web3j.abi.datatypes.generated.Uint256; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; @@ -20,40 +32,36 @@ import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; import org.web3j.tx.gas.ContractGasProvider; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import io.reactivex.Flowable; - /** *

Auto generated code. *

Do not modify! *

Please use the web3j command line tools, - * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the + * codegen module to update. * - *

Generated with web3j version 1.5.2. + *

Generated with web3j version 1.6.1. */ @SuppressWarnings("rawtypes") -class TangemBridgeProcessor extends Contract { - public static final String BINARY = "608060405262278d006008553480156200001857600080fd5b506040516200272f3803806200272f8339810160408190526200003b9162000214565b60028054600580546001600160a01b03199081166001600160a01b038a8116919091179092556006805482168984161790556001600160a81b03199092166101008783160217909255600380549091169184169190911790556009819055620000a6600033620000b2565b5050505050506200027b565b600080620000c18484620000ef565b90508015620000e6576000848152600160205260409020620000e490846200019d565b505b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000194576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556200014b3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620000e9565b506000620000e9565b6000620000e6836001600160a01b03841660008181526001830160205260408120546200019457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620000e9565b80516001600160a01b03811681146200020f57600080fd5b919050565b600080600080600060a086880312156200022d57600080fd5b6200023886620001f7565b94506200024860208701620001f7565b93506200025860408701620001f7565b92506200026860608701620001f7565b9150608086015190509295509295909350565b6124a4806200028b6000396000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c806383af133d1161015c578063c904ea39116100ce578063da90f3a011610087578063da90f3a0146105f1578063e24fd1f114610604578063e452f20d14610617578063e63ab1e91461062a578063e96ede8e14610651578063fe2208aa1461066457600080fd5b8063c904ea3914610589578063ca15c8731461059c578063cb37f3b2146105af578063d47ae89c146105c2578063d547741f146105cb578063d6d32b2a146105de57600080fd5b80639353ce4c116101205780639353ce4c146104f357806396bc563d1461051a578063978975591461052f578063a217fddf14610556578063b77c6d351461055e578063be4d18511461057657600080fd5b806383af133d146104a95780638456cb59146104bc5780639010d07c146104c457806391792d5b146104d757806391d14854146104e057600080fd5b80633f4ba83a11610200578063601c6065116101b9578063601c60651461042357806365ebf99a1461043657806370e4306e1461044957806373d3467c146104705780637f2fadb0146104835780638072a0221461049657600080fd5b80633f4ba83a146103ae5780634413e098146103b65780634b9bb0b4146103c95780634e6d8a73146103f057806356737951146104035780635c975abb1461041857600080fd5b80632f2ff15d116102525780632f2ff15d1461030e5780633013ce291461032157806336568abe1461034c57806337de81061461035f5780633d409a86146103725780633e1dbe1f1461038757600080fd5b806301ffc9a71461028f5780630f1071be146102b757806311dce771146102ce578063248a9ca3146102e35780632cc3264114610306575b600080fd5b6102a261029d366004611f47565b610677565b60405190151581526020015b60405180910390f35b6102c060085481565b6040519081526020016102ae565b6102e16102dc366004611f86565b6106a2565b005b6102c06102f1366004611fa3565b60009081526020819052604090206001015490565b6102e1610710565b6102e161031c366004611fbc565b61078a565b600354610334906001600160a01b031681565b6040516001600160a01b0390911681526020016102ae565b6102e161035a366004611fbc565b6107b5565b6102e161036d366004611fa3565b6107ed565b6102c060008051602061242683398151915281565b6102c07f80578ee961742bd59ed4d7f52c856d4014970acf79709a07f09c8c279d66cbb481565b6102e161084c565b6102e16103c4366004611fec565b610881565b6102c07fc62d23620f0c241b20cdec293f57ff9c0cc09ac7c55352efe3363184cd93032281565b6102e16103fe366004612018565b61094d565b6102c06000805160206123b183398151915281565b60025460ff166102a2565b6102e1610431366004612018565b610a57565b6102e1610444366004611f86565b610c7f565b6102c07f6ac2c8b5322a929d300af17766189693ff6db6939ffe690430ad4720baf47d1c81565b6102e161047e36600461205b565b610ce5565b6102e1610491366004611fec565b610e02565b6102e16104a4366004611fa3565b610ee5565b6102e16104b7366004611fec565b610f70565b6102e161102f565b6103346104d23660046120df565b611061565b6102c060075481565b6102a26104ee366004611fbc565b611080565b6102c07f79af5a85184b45263c1b3721b9c8eb1becd98e55ade5a61da0fed18b90b8325681565b6102c060008051602061230183398151915281565b6102c07f581be84b4822abe392a3bcac0d4d656e4cd57faf2e321a32108215cdd4a8365681565b6102c0600081565b6002546103349061010090046001600160a01b031681565b600654610334906001600160a01b031681565b6102e1610597366004612101565b6110a9565b6102c06105aa366004611fa3565b6111aa565b600554610334906001600160a01b031681565b6102c060095481565b6102e16105d9366004611fbc565b6111c1565b6102e16105ec366004611fa3565b6111e6565b6102e16105ff366004611fec565b611270565b6102e161061236600461214b565b6114ed565b610334610625366004611f86565b61162e565b6102c07f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6102e161065f366004612018565b61168d565b6102e1610672366004612018565b611782565b60006001600160e01b03198216635a05180f60e01b148061069c575061069c8261185c565b92915050565b6000805160206123018339815191526106ba81611891565b600680546001600160a01b0319166001600160a01b0384169081179091556040519081527f68c7b435e0ad7bfb2140fab0735300efbda206f62906049e0b35763cef67cc5e906020015b60405180910390a15050565b600a54339061071e8261189b565b6000811160405180606001604052806029815260200161244660299139906107625760405162461bcd60e51b8152600401610759919061219d565b60405180910390fd5b506000600a55600654600354610786916001600160a01b0391821691168484611946565b5050565b6000828152602081905260409020600101546107a581611891565b6107af83836119a0565b50505050565b6001600160a01b03811633146107de5760405163334bd91960e11b815260040160405180910390fd5b6107e882826119d5565b505050565b7f80578ee961742bd59ed4d7f52c856d4014970acf79709a07f09c8c279d66cbb461081781611891565b60078290556040518281527fb5aa183eb20407e22587bcd13d5c82a85835a4bd60e2a13d7c7efee3c2e9ed4890602001610704565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61087681611891565b61087e611a02565b50565b7f581be84b4822abe392a3bcac0d4d656e4cd57faf2e321a32108215cdd4a836566108ab81611891565b60405163b9603bdf60e01b8152600481018390526001600160a01b0384169063b9603bdf90602401600060405180830381600087803b1580156108ed57600080fd5b505af1158015610901573d6000803e3d6000fd5b50505050826001600160a01b03167fc8818db5b3e4e986e2f21e002090b1513e17c05a7a326c3737af624bf6ef78c48360405161094091815260200190565b60405180910390a2505050565b610955611a54565b7f6ac2c8b5322a929d300af17766189693ff6db6939ffe690430ad4720baf47d1c61097f81611891565b600061098a8561162e565b905060006007548461099c91906121e6565b604051630381b4dd60e01b815260048101879052602481018290529091506001600160a01b03831690630381b4dd90604401600060405180830381600087803b1580156109e857600080fd5b505af11580156109fc573d6000803e3d6000fd5b5050505084866001600160a01b03167fa77a4ae2cfa0139350d70cd52434d01ae72e9ec897ae89be03580f1ff00dd3d086600754604051610a47929190918252602082015260400190565b60405180910390a3505050505050565b610a5f611a54565b6000805160206123b1833981519152610a7781611891565b60408051808201909152601b81527f353130307c436f6d6d6f6e3a20616d6f756e74206973207a65726f0000000000602082015282610ac95760405162461bcd60e51b8152600401610759919061219d565b506000610ad58561162e565b6003546006546040516370a0823160e01b81526001600160a01b0391821660048201529293506000929116906370a0823190602401602060405180830381865afa158015610b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4b91906121f9565b9050838110156040518060400160405280601f81526020017f353130317c436f6d6d6f6e3a20696e73756666696369656e742066756e64730081525090610ba55760405162461bcd60e51b8152600401610759919061219d565b50600a84905560405163f89db45760e01b8152600481018690526001600160a01b0383169063f89db45790602401600060405180830381600087803b158015610bed57600080fd5b505af1158015610c01573d6000803e3d6000fd5b50505050600a546000146040518060600160405280602e81526020016123d1602e913990610c425760405162461bcd60e51b8152600401610759919061219d565b5084866001600160a01b03167fa5411d116afcb8415f0019792cccf595f94852ba82886dacbf756d9c3ce85f3f86604051610a4791815260200190565b600080516020612301833981519152610c9781611891565b600580546001600160a01b0319166001600160a01b0384169081179091556040519081527fccbdeb71dc680b2f0fd85f93e7ef0f70eda32a12b918c9715be07bb646360e5990602001610704565b610ced611a54565b600080516020612426833981519152610d0581611891565b6000610d108861162e565b9050600060075487610d2291906121e6565b6040516334284dfb60e01b8152600481018a9052602481018290526001600160801b03198816604482015261ffff8716606482015285151560848201529091506001600160a01b038316906334284dfb9060a401600060405180830381600087803b158015610d9057600080fd5b505af1158015610da4573d6000803e3d6000fd5b5050505087896001600160a01b03167f92c1dbadbb7b791052341ce7c185ca37861e432438355dc3e1642b7c1287609a89600754604051610def929190918252602082015260400190565b60405180910390a3505050505050505050565b610e0a611a54565b7f79af5a85184b45263c1b3721b9c8eb1becd98e55ade5a61da0fed18b90b83256610e3481611891565b6000610e3f8461162e565b604051636df6c7d560e11b8152600481018590529091506001600160a01b0382169063dbed8faa90602401600060405180830381600087803b158015610e8457600080fd5b505af1158015610e98573d6000803e3d6000fd5b50505050836001600160a01b03167f466723bb873015d5baf515fce6b0c8df2cb154adfd8badb6bc77a620a6ef676184604051610ed791815260200190565b60405180910390a250505050565b600080516020612301833981519152610efd81611891565b6283d60082106040518060600160405280602a81526020016122d7602a913990610f3a5760405162461bcd60e51b8152600401610759919061219d565b5060088290556040518281527fdc10143650bb79cd7a92cdf792545dcc2c3b0a719bebb3d83a8a21bb8fbfc3d690602001610704565b7f581be84b4822abe392a3bcac0d4d656e4cd57faf2e321a32108215cdd4a83656610f9a81611891565b6040516306b2a38360e41b8152600481018390526001600160a01b03841690636b2a383090602401600060405180830381600087803b158015610fdc57600080fd5b505af1158015610ff0573d6000803e3d6000fd5b50505050826001600160a01b03167fcc1685e553848099cad0e11271e780371c44b5ed92a54552fbedf9f1b6b9f2478360405161094091815260200190565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61105981611891565b61087e611a7a565b60008281526001602052604081206110799083611ab7565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6110b1611a54565b6000805160206124268339815191526110c981611891565b60006110d48661162e565b90506000600754856110e691906121e6565b6040516320199e7960e21b8152600481018890526024810182905285151560448201529091506001600160a01b0383169063806679e490606401600060405180830381600087803b15801561113a57600080fd5b505af115801561114e573d6000803e3d6000fd5b5050505085876001600160a01b03167f92c1dbadbb7b791052341ce7c185ca37861e432438355dc3e1642b7c1287609a87600754604051611199929190918252602082015260400190565b60405180910390a350505050505050565b600081815260016020526040812061069c90611ac3565b6000828152602081905260409020600101546111dc81611891565b6107af83836119d5565b6000805160206123018339815191526111fe81611891565b610e1082106040518060600160405280602781526020016123ff602791399061123a5760405162461bcd60e51b8152600401610759919061219d565b5060098290556040518281527f7f63f876249f25f7856e620802edd09af38a83c9c6040fcdb37179154030831190602001610704565b611278611a54565b6000805160206123b183398151915261129081611891565b600061129b8461162e565b604051631902cad960e31b8152600481018590529091506000906001600160a01b0383169063c81656c890602401602060405180830381865afa1580156112e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130a91906121f9565b6003546006546040516370a0823160e01b81526001600160a01b0391821660048201529293506000929116906370a0823190602401602060405180830381865afa15801561135c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138091906121f9565b90506000821160405180606001604052806027815260200161238a60279139906113bd5760405162461bcd60e51b8152600401610759919061219d565b5060408051808201909152601f81527f353130317c436f6d6d6f6e3a20696e73756666696369656e742066756e6473006020820152828210156114135760405162461bcd60e51b8152600401610759919061219d565b50600a82905560405163e3dbffd560e01b8152600481018690526001600160a01b0384169063e3dbffd590602401600060405180830381600087803b15801561145b57600080fd5b505af115801561146f573d6000803e3d6000fd5b50505050600a546000146040518060600160405280602e81526020016123d1602e9139906114b05760405162461bcd60e51b8152600401610759919061219d565b5084866001600160a01b03167fdfab01fc691e8b69fca482c65142d1bcfeafeb9eb6e9fd5220867d7196d9476e84604051610a4791815260200190565b7fc62d23620f0c241b20cdec293f57ff9c0cc09ac7c55352efe3363184cd93032261151781611891565b6115208261189b565b306001600160a01b0316826001600160a01b031663ce1b1d436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158c9190612212565b6001600160a01b03161460405180606001604052806032815260200161235860329139906115cd5760405162461bcd60e51b8152600401610759919061219d565b506001600160a01b0383811660008181526004602090815260409182902080546001600160a01b0319169487169485179055905192835290917f0c1464e8c817204497a2076f3b466fe64093e83033c83303b0cb44001cd9b6b59101610940565b6001600160a01b03808216600090815260046020908152604080832054815160608101909252602f80835293941692831515926122a890830139906116865760405162461bcd60e51b8152600401610759919061219d565b5092915050565b611695611a54565b6000805160206124268339815191526116ad81611891565b60006116b88561162e565b9050600083156116ca576007546116cd565b60005b905060006116db82866121e6565b60405163e4d7ddb960e01b815260048101889052602481018290529091506001600160a01b0384169063e4d7ddb990604401600060405180830381600087803b15801561172757600080fd5b505af115801561173b573d6000803e3d6000fd5b505060408051888152602081018690528993506001600160a01b038b1692507f8ba3ad1bd4ff5c3d75861d56df66b7942244d700f4d4cb67df693bac78e805a29101611199565b61178a611a54565b6000805160206123b18339815191526117a281611891565b60006117ad8561162e565b60405163456575e560e01b815260048101869052602481018590529091506001600160a01b0382169063456575e590604401600060405180830381600087803b1580156117f957600080fd5b505af115801561180d573d6000803e3d6000fd5b5050505083856001600160a01b03167f6f60b80b8dcecc3741c03485554a9a35ced96ebba66405fd324caf12a16261da8560405161184d91815260200190565b60405180910390a35050505050565b60006001600160e01b03198216637965db0b60e01b148061069c57506301ffc9a760e01b6001600160e01b031983161461069c565b61087e8133611acd565b6002546040516385bb392360e01b81526001600160a01b038381166004830152610100909204909116906385bb392390602401602060405180830381865afa1580156118eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190f919061222f565b60405180606001604052806037815260200161232160379139906107865760405162461bcd60e51b8152600401610759919061219d565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526107af908590611b06565b6000806119ad8484611b69565b905080156110795760008481526001602052604090206119cd9084611bfb565b509392505050565b6000806119e28484611c10565b905080156110795760008481526001602052604090206119cd9084611c7b565b611a0a611c90565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff1615611a785760405163d93c066560e01b815260040160405180910390fd5b565b611a82611a54565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611a373390565b60006110798383611cb3565b600061069c825490565b611ad78282611080565b6107865760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610759565b6000611b1b6001600160a01b03841683611cdd565b90508051600014158015611b40575080806020019051810190611b3e919061222f565b155b156107e857604051635274afe760e01b81526001600160a01b0384166004820152602401610759565b6000611b758383611080565b611bf3576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611bab3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161069c565b50600061069c565b6000611079836001600160a01b038416611ceb565b6000611c1c8383611080565b15611bf3576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161069c565b6000611079836001600160a01b038416611d32565b60025460ff16611a7857604051638dfc202b60e01b815260040160405180910390fd5b6000826000018281548110611cca57611cca61224c565b9060005260206000200154905092915050565b606061107983836000611e25565b6000818152600183016020526040812054611bf35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561069c565b60008181526001830160205260408120548015611e1b576000611d56600183612262565b8554909150600090611d6a90600190612262565b9050808214611dcf576000866000018281548110611d8a57611d8a61224c565b9060005260206000200154905080876000018481548110611dad57611dad61224c565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611de057611de0612275565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061069c565b600091505061069c565b606081471015611e4a5760405163cd78605960e01b8152306004820152602401610759565b600080856001600160a01b03168486604051611e66919061228b565b60006040518083038185875af1925050503d8060008114611ea3576040519150601f19603f3d011682016040523d82523d6000602084013e611ea8565b606091505b5091509150611eb8868383611ec2565b9695505050505050565b606082611ed757611ed282611f1e565b611079565b8151158015611eee57506001600160a01b0384163b155b15611f1757604051639996b31560e01b81526001600160a01b0385166004820152602401610759565b5080611079565b805115611f2e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b600060208284031215611f5957600080fd5b81356001600160e01b03198116811461107957600080fd5b6001600160a01b038116811461087e57600080fd5b600060208284031215611f9857600080fd5b813561107981611f71565b600060208284031215611fb557600080fd5b5035919050565b60008060408385031215611fcf57600080fd5b823591506020830135611fe181611f71565b809150509250929050565b60008060408385031215611fff57600080fd5b823561200a81611f71565b946020939093013593505050565b60008060006060848603121561202d57600080fd5b833561203881611f71565b95602085013595506040909401359392505050565b801515811461087e57600080fd5b60008060008060008060c0878903121561207457600080fd5b863561207f81611f71565b9550602087013594506040870135935060608701356001600160801b0319811681146120aa57600080fd5b9250608087013561ffff811681146120c157600080fd5b915060a08701356120d18161204d565b809150509295509295509295565b600080604083850312156120f257600080fd5b50508035926020909101359150565b6000806000806080858703121561211757600080fd5b843561212281611f71565b9350602085013592506040850135915060608501356121408161204d565b939692955090935050565b6000806040838503121561215e57600080fd5b823561216981611f71565b91506020830135611fe181611f71565b60005b8381101561219457818101518382015260200161217c565b50506000910152565b60208152600082518060208401526121bc816040850160208701612179565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561069c5761069c6121d0565b60006020828403121561220b57600080fd5b5051919050565b60006020828403121561222457600080fd5b815161107981611f71565b60006020828403121561224157600080fd5b81516110798161204d565b634e487b7160e01b600052603260045260246000fd5b8181038181111561069c5761069c6121d0565b634e487b7160e01b600052603160045260246000fd5b6000825161229d818460208701612179565b919091019291505056fe353230327c50726f636573736f723a206e6f207061796d656e74206163636f756e7420666f72207468652063617264353231307c50726f636573736f723a20736574746c656d656e7420706572696f6420746f6f206c6f6e67fa658e47c75a6eb0e27156b2f72e1b295c98b53e8a1d238d7ca6ea6345b34880353230307c50726f636573736f723a207061796d656e74206163636f756e74206e6f74206465706c6f79656420627920666163746f7279353230317c50726f636573736f723a207061796d656e74206163636f756e742070726f636573736f72206d69736d61746368353235307c50726f636573736f723a20726566756e64207265636f7264206e6f7420666f756e64d77cc12a543481a2b3ef8fd055979569715a10db9879cd9e664395eca3a54dff353235327c50726f636573736f723a20726566756e6420746f2070726f63657373207761736e2774207265736574353231317c50726f636573736f723a2073656375726974792064656c617920746f6f206c6f6e67a567244cad934c87b7f7e15b15dd0e75f95a76afd1916f8eab4a391410d6f278353235317c50726f636573736f723a20726566756e6420746f2070726f63657373206973207a65726fa2646970667358221220098c0e97a9ad9d3bb5cd4459c44925a6fb83295823a48d337beb3c254c7b728b64736f6c63430008160033"; +public class TangemBridgeProcessor extends Contract { + public static final String BINARY = "608060405234620000345762000022620000186200012e565b939290926200022c565b604051612dc86200057b8239612dc890f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176200007157604052565b62000039565b906200008e6200008660405190565b92836200004f565b565b6001600160a01b031690565b90565b6001600160a01b0381165b036200003457565b905051906200008e826200009f565b80620000aa565b905051906200008e82620000c1565b919060a0838203126200003457620000f08184620000b2565b92620001008260208301620000b2565b926200009c620001148460408501620000b2565b936080620001268260608701620000b2565b9401620000c8565b620001516200334380380380620001458162000077565b928339810190620000d7565b9091929394565b906001600160a01b03905b9181191691161790565b6200009c9062000090906001600160a01b031682565b6200009c906200016d565b6200009c9062000183565b90620001ad6200009c620001b5926200018e565b825462000158565b9055565b90610100600160a81b039060081b62000163565b90620001e16200009c620001b5926200018e565b8254620001b9565b906000199062000163565b6200009c6200009c6200009c9290565b90620002186200009c620001b592620001f4565b8254620001e9565b6200009c6000620001f4565b92620002676200026d6200027d946200026762000275956200025f620002859a9962000257620002c3565b600462000199565b600562000199565b6200018e565b6002620001cd565b600362000199565b600662000204565b6200029b6200029362000220565b3390620002e1565b50565b9060ff9062000163565b90620002bb6200009c620001b592151590565b82546200029e565b6200008e60006002620002a8565b905b600052602052604060002090565b620002ed828262000324565b9182620002f957505090565b6200030e6200009c62000314936001620002d1565b620003d2565b5090565b90620002d3906200018e565b6200033862000334838362000419565b1590565b15620003b8576200036460016200035e846000620003578682620002d1565b0162000318565b620002a8565b620003836200037c62000375339390565b936200018e565b916200018e565b917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d620003af60405190565b600090a4600190565b5050600090565b6200009c9081906001600160a01b031681565b906200040c6200040862000402620003fc60006200009c96620003f3600090565b50019462000183565b620003bf565b620001f4565b9190565b620004e4565b5460ff1690565b6200009c916000620003576200043a9362000432600090565b5082620002d1565b62000412565b634e487b7160e01b600052603260045260246000fd5b80548210156200047b5762000472600191600052602060002090565b91020190600090565b62000440565b9160001960089290920291821b911b62000163565b9190620004a86200009c620001b59390565b90835462000481565b9081549168010000000000000000831015620000715782620004dd9160016200008e9501815562000456565b9062000496565b620004f462000334838362000542565b15620003b8576200052991620005239060016200051b84620005178482620004b1565b5490565b9301620002d1565b62000204565b600190565b6200009c9081565b6200009c90546200052e565b620005659160016200055f9262000557600090565b5001620002d1565b62000536565b62000575620004086000620001f4565b14159056fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461030257806311dce771146102fd578063248a9ca3146102f857806328e14f24146102f35780632cc32641146102ee5780632e44b939146102e95780632f2ff15d146102e45780633013ce29146102df57806336568abe146102da5780633c1a5012146102d55780633d409a86146102d05780633f4ba83a146102cb57806341d2ac20146102c65780634413e098146102c157806356737951146102bc5780635c975abb146102b757806365ebf99a146102b257806368b40573146102ad5780636a7554c0146102a857806370e4306e146102a35780637123925e1461029e57806383af133d146102995780638456cb59146102945780639010d07c1461028f57806391d148541461028a5780639353ce4c1461028557806396bc563d14610280578063978975591461027b57806399fef6bb146102765780639e4da86214610271578063a217fddf1461026c578063a9eb7b5a14610267578063aca821f714610262578063b77c6d351461025d578063be4d185114610258578063c0e678f814610253578063c8de6d171461024e578063ca15c87314610249578063cb37f3b214610244578063d47ae89c1461023f578063d547741f1461023a578063d595130814610235578063d6d32b2a14610230578063e0a86ef71461022b578063e63ab1e914610226578063eb465bca146102215763f0cb94980361031a57610d95565b610d76565b610cce565b610caf565b610c04565b610be8565b610bcf565b610bb4565b610b77565b610b50565b610b37565b610b1b565b610a9f565b610a78565b610a50565b610a37565b610a1c565b6109c4565b6109a9565b610970565b610949565b610910565b6108f4565b6108be565b61088a565b610871565b610838565b6107ff565b6107e6565b6107ca565b61077d565b61075e565b610725565b61070c565b6106d7565b61068f565b610668565b610650565b610637565b610610565b61058d565b610548565b61046a565b610431565b6103fa565b6103b6565b610349565b6001600160e01b031981165b0361031a57565b600080fd5b9050359061032c82610307565b565b9060208282031261031a576103429161031f565b90565b9052565b3461031a5761037661036461035f36600461032e565b610dce565b60405191829182901515815260200190565b0390f35b6001600160a01b031690565b6001600160a01b038116610313565b9050359061032c82610386565b9060208282031261031a5761034291610395565b3461031a576103ce6103c93660046103a2565b610e81565b604051005b80610313565b9050359061032c826103d3565b9060208282031261031a57610342916103d9565b3461031a576103766104156104103660046103e6565b610eab565b6040515b9182918290815260200190565b600091031261031a57565b3461031a57610441366004610426565b6103767f350e76a198c654a14c1f5ccac917c5f939f08970b53375e57483f9623a24399c610415565b3461031a5761047a366004610426565b6103ce611072565b908160e091031261031a5790565b909182601f8301121561031a5781359167ffffffffffffffff831161031a57602001926001830284011161031a57565b6101808183031261031a576104d58282610395565b926104e38360208401610395565b926104f18160408501610482565b926105008261012083016103d9565b9261014082013567ffffffffffffffff811161031a5783610522918401610490565b92909361016082013567ffffffffffffffff811161031a576105449201610490565b9091565b3461031a576103ce61055b3660046104c0565b969590959491949392936113fd565b919060408382031261031a5761034290602061058682866103d9565b9401610395565b3461031a576103ce6105a036600461056a565b9061142b565b610342916008021c6001600160a01b031690565b9061034291546105a6565b610342600060036105ba565b6103429061037a906001600160a01b031682565b610342906105d1565b610342906105e5565b610345906105ee565b60208101929161032c91906105f7565b3461031a57610620366004610426565b61037661062b6105c5565b60405191829182610600565b3461031a576103ce61064a36600461056a565b90611435565b3461031a576103ce6106633660046103a2565b611530565b3461031a57610678366004610426565b610376600080516020612d73833981519152610415565b3461031a5761069f366004610426565b6103ce61156d565b909160608284031261031a576103426106c08484610395565b9360406106d08260208701610395565b94016103d9565b3461031a576103ce6106ea3660046106a7565b916116eb565b919060408382031261031a576103429060206106d08286610395565b3461031a576103ce61071f3660046106f0565b906117a3565b3461031a57610735366004610426565b6103767fd77cc12a543481a2b3ef8fd055979569715a10db9879cd9e664395eca3a54dff610415565b3461031a5761076e366004610426565b61037661036460025460ff1690565b3461031a576103ce6107903660046103a2565b6117f8565b60808183031261031a576107a98282610395565b926103426107ba8460208501610395565b9360606106d082604087016103d9565b3461031a576103ce6107dd366004610795565b92919091611a60565b3461031a576103ce6107f93660046106f0565b90611b0f565b3461031a5761080f366004610426565b6103767f6ac2c8b5322a929d300af17766189693ff6db6939ffe690430ad4720baf47d1c610415565b3461031a57610848366004610426565b6103767fca900a2e3cfbbbb78b9095304e53ddb6de902bbef4638bd3c79fe9cf3a441202610415565b3461031a576103ce6108843660046106f0565b90611bbc565b3461031a5761089a366004610426565b6103ce611bfa565b919060408382031261031a576103429060206106d082866103d9565b3461031a576103766108da6108d43660046108a2565b90611c02565b604051918291826001600160a01b03909116815260200190565b3461031a5761037661036461090a36600461056a565b90611c2c565b3461031a57610920366004610426565b6103767f79af5a85184b45263c1b3721b9c8eb1becd98e55ade5a61da0fed18b90b83256610415565b3461031a57610959366004610426565b610376600080516020612d53833981519152610415565b3461031a57610980366004610426565b6103767f581be84b4822abe392a3bcac0d4d656e4cd57faf2e321a32108215cdd4a83656610415565b3461031a576103766103646109bf3660046103a2565b611c55565b3461031a576109d4366004610426565b6103767f863747851594ece3a3681369cf3710069c605efc30fccffb517283afa5efce91610415565b6103426103426103429290565b61034260006109fd565b610342610a0a565b3461031a57610a2c366004610426565b610376610415610a14565b3461031a576103ce610a4a3660046106a7565b91611d3b565b3461031a576103ce610a63366004610795565b92919091611e22565b610342600160026105ba565b3461031a57610a88366004610426565b61037661062b610a6c565b610342600060056105ba565b3461031a57610aaf366004610426565b6103766108da610a93565b801515610313565b9050359061032c82610aba565b919060a08382031261031a57610ae58184610395565b92610af38260208301610395565b92610342610b0484604085016103d9565b936080610b1482606087016103d9565b9401610ac2565b3461031a576103ce610b2e366004610acf565b93929092611f2f565b3461031a576103ce610b4a3660046106a7565b91611ff3565b3461031a57610376610415610b663660046103e6565b611ffe565b610342600060046105ba565b3461031a57610b87366004610426565b6103766108da610b6b565b610342916008021c81565b906103429154610b92565b61034260006006610b9d565b3461031a57610bc4366004610426565b610376610415610ba8565b3461031a576103ce610be236600461056a565b90612030565b3461031a576103ce610bfb366004610795565b929190916120fc565b3461031a576103ce610c173660046103e6565b6121ce565b6001600160801b03198116610313565b9050359061032c82610c1c565b61ffff8116610313565b9050359061032c82610c39565b60e08183031261031a57610c648282610395565b92610c728360208401610395565b92610c8081604085016103d9565b92610c8e82606083016103d9565b92610342610c9f8460808501610c2c565b9360c0610b148260a08701610c43565b3461031a576103ce610cc2366004610c50565b959490949391936122b4565b3461031a57610cde366004610426565b6103767f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610415565b9060c08282031261031a57610d1c8183610395565b92610d2a8260208501610395565b92610d3883604083016103d9565b92610d4681606084016103d9565b92608083013567ffffffffffffffff811161031a5782610d6d60a094610342938701610490565b94909501610ac2565b3461031a576103ce610d89366004610d07565b95949094939193612397565b3461031a57610da5366004610426565b6103767f7245419aa9f77e6e9f023dc59852153b8258661dd13b3e1a61fe9e8a5977aa74610415565b635a05180f60e01b6001600160e01b0319821614908115610ded575090565b61034291506123a6565b61032c90610e17600080516020612d538339815191526123e0565b6123e0565b610e4c565b906001600160a01b03905b9181191691161790565b90610e41610342610e48926105ee565b8254610e1c565b9055565b610e7c7f68c7b435e0ad7bfb2140fab0735300efbda206f62906049e0b35763cef67cc5e916108da816005610e31565b0390a1565b61032c90610df7565b905b600052602052604060002090565b6103429081565b6103429054610e9a565b6001610ec461034292610ebc600090565b506000610e8a565b01610ea1565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff821117610f0257604052565b610eca565b9061032c610f1460405190565b9283610ee0565b67ffffffffffffffff8111610f0257602090601f01601f19160190565b0190565b90610f4e610f4983610f1b565b610f07565b918252565b610f5d6029610f3c565b7f353235317c50726f636573736f723a20726566756e6420746f2070726f63657360208201526873206973207a65726f60b81b604082015290565b610342610f53565b610342610f98565b60005b838110610fbb5750506000910152565b8181015183820152602001610fab565b610fec610ff5602093610f3893610fe0815190565b80835293849260200190565b95869101610fa8565b601f01601f191690565b602080825261034292910190610fcb565b156110185750565b61103a9061102560405190565b62461bcd60e51b815291829160048301610fff565b0390fd5b9060001990610e27565b90611058610342610e48926109fd565b825461103e565b6103429061037a565b610342905461105f565b61032c336110806007610ea1565b9061108a81612475565b6110a761109760006109fd565b83116110a1610fa0565b90611010565b6110bb6110b460006109fd565b6007611048565b6110c56003611068565b6110cf6005611068565b90612537565b9061032c979695949392916110e8612581565b61032c979695949392919061111c7f863747851594ece3a3681369cf3710069c605efc30fccffb517283afa5efce916123e0565b61130e565b6103429060081c61037a565b6103429054611121565b9050519061032c82610386565b9060208282031261031a5761034291611137565b50610342906020810190610ac2565b50610342906020810190610c2c565b50610342906020810190610c43565b9060206111b661032c936111ad61119f6000830183611167565b6001600160801b0319168552565b82810190611176565b61ffff16910152565b506103429060208101906103d9565b90606061122361032c936111ec6111e860008301836111bf565b8552565b6112036111fc60208301836111bf565b6020860152565b61121a61121360408301836111bf565b6040860152565b828101906111bf565b910152565b90606061125e61032c936112486112426000830183611158565b15158552565b611259602082016020860190611185565b820190565b9101906111ce565b90826000939282370152565b9190610ff58161128981610f389560209181520190565b8095611266565b9694906112f3946112dd89956112d36103429c9a966112c36112e59660006101808c019b01906001600160a01b03169052565b6001600160a01b031660208d0152565b60408b0190611228565b610120890152565b868303610140880152611272565b92610160818503910152611272565b6040513d6000823e3d90fd5b9485611354839960209795969960009461133061132b600261112d565b6105ee565b9761133a60405190565b9c8d9a8b998a98632e44b93960e01b8a5260048a01611290565b03925af19081156113f8577f49f84c15b9f052fd24e68e7760c0bc11d05c5a058721d4dfc2c5c02866f84cd6926000926113c3575b50611393906105ee565b926113be6113a060405190565b928392836001600160a01b0391821681529116602082015260400190565b0390a2565b6113939192506113ea9060203d6020116113f1575b6113e28183610ee0565b810190611144565b9190611389565b503d6113d8565b611302565b9061032c979695949392916110d5565b9061032c9161141e610e1282610eab565b906114289161259f565b50565b9061032c9161140d565b9061143f3361037a565b6001600160a01b0382160361145757611428916125ce565b60405163334bd91960e11b8152600490fd5b61032c906114967fca900a2e3cfbbbb78b9095304e53ddb6de902bbef4638bd3c79fe9cf3a4412026123e0565b6114a261132b826105ee565b90813b1561031a5760006114b560405190565b6337a1d41560e01b8152928390600490829084905af19182156113f8576114e192611512575b506105ee565b7feb17a79f3df37ac5b011bba24abb3d48db9d0dd39110551346f1c30bfa0fe70161150b60405190565b80806113be565b61152a9060006115228183610ee0565b810190610426565b386114db565b61032c90611469565b6115627f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6123e0565b61032c61032c61265f565b61032c611539565b9061032c9291611583612581565b61032c9291906115b27f79af5a85184b45263c1b3721b9c8eb1becd98e55ade5a61da0fed18b90b832566123e0565b6115f9565b9050519061032c826103d3565b9060208282031261031a57610342916115b7565b6001600160a01b03909116815260408101929161032c9160200152565b0152565b602061163360009461160d61132b856105ee565b9061161760405190565b968793849283919063f93184c160e01b835289600484016115d8565b03925af19283156113f85760009361168c575b5061168761167d6116777f8c7f40acbbdddd09014432da06798dda241de8adb409a62f3611f9a0d63d6b5b936105ee565b936105ee565b9361041960405190565b0390a3565b7f8c7f40acbbdddd09014432da06798dda241de8adb409a62f3611f9a0d63d6b5b91935061167d6116776116da6116879360203d6020116116e4575b6116d28183610ee0565b8101906115c4565b9593505050611646565b503d6116c8565b9061032c9291611575565b61032c91906117247f581be84b4822abe392a3bcac0d4d656e4cd57faf2e321a32108215cdd4a836566123e0565b61173061132b826105ee565b803b1561031a57600061174260405190565b63b9603bdf60e01b815260048101859052918290602490829084905af180156113f8577fc8818db5b3e4e986e2f21e002090b1513e17c05a7a326c3737af624bf6ef78c4926113be926117999261151257506105ee565b9261041960405190565b9061032c916116f6565b61032c906117c8600080516020612d538339815191526123e0565b610e7c7fccbdeb71dc680b2f0fd85f93e7ef0f70eda32a12b918c9715be07bb646360e59916108da816004610e31565b61032c906117ad565b9061032c939291611810612581565b61032c939291906118407fd77cc12a543481a2b3ef8fd055979569715a10db9879cd9e664395eca3a54dff6123e0565b6118e2565b61184f601f610f3c565b7f353130317c436f6d6d6f6e3a20696e73756666696369656e742066756e647300602082015290565b610342611845565b610342611878565b611892602e610f3c565b7f353235327c50726f636573736f723a20726566756e6420746f2070726f63657360208201526d1cc81dd85cdb89dd081c995cd95d60921b604082015290565b610342611888565b6103426118d2565b6118eb846126aa565b61193860206118fd61132b6003611068565b6119076005611068565b9061191160405190565b938492839182916370a0823160e01b5b83526001600160a01b031660048301526024820190565b03915afa80156113f85761196491600091611a41575b50859061195a565b9190565b10156110a1611880565b61196f846007611048565b61197b61132b826105ee565b90813b1561031a57600061198e60405190565b92839063bc77d49560e01b82528183816119ac8a8a600484016115d8565b03925af19081156113f857611a16611a10611a1c927f6de2d5fa0b9cac9e48f300a350314e447648d158a5067a56513a46396f1b638a95611a2695611a2b575b5061132b6119fa6007610ea1565b611a0761195660006109fd565b146110a16118da565b946105ee565b946109fd565b9461041960405190565b0390a4565b611a3b9060006115228183610ee0565b386119ec565b611a5a915060203d6020116116e4576116d28183610ee0565b3861194e565b9061032c939291611801565b61032c9190611a9a7f7245419aa9f77e6e9f023dc59852153b8258661dd13b3e1a61fe9e8a5977aa746123e0565b611aa661132b826105ee565b803b1561031a576000611ab860405190565b6377627c0960e11b815260048101859052918290602490829084905af180156113f8577faeb30c8dda75512b9946228f4034031bd3f99d91f2c4ed3806be677f3429cd80926113be926117999261151257506105ee565b9061032c91611a6c565b61032c9190611b477f581be84b4822abe392a3bcac0d4d656e4cd57faf2e321a32108215cdd4a836566123e0565b611b5361132b826105ee565b803b1561031a576000611b6560405190565b6306b2a38360e41b815260048101859052918290602490829084905af180156113f8577fcc1685e553848099cad0e11271e780371c44b5ed92a54552fbedf9f1b6b9f247926113be926117999261151257506105ee565b9061032c91611b19565b611bef7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6123e0565b61032c61032c612705565b61032c611bc6565b90611c1d61034261034293611c15600090565b506001610e8a565b612723565b90610e8c906105ee565b610342916000611c48611c4e93611c41600090565b5082610e8a565b01611c22565b5460ff1690565b610342907f350e76a198c654a14c1f5ccac917c5f939f08970b53375e57483f9623a24399c611c2c565b9061032c9291611c8d612581565b61032c929190611cbc7f6ac2c8b5322a929d300af17766189693ff6db6939ffe690430ad4720baf47d1c6123e0565b611cc861132b826105ee565b90813b1561031a576000611cdb60405190565b928390633e0fc2ff60e01b8252818381611cf98a8a600484016115d8565b03925af19182156113f8576116776116879261167d927f7ea7d3b21868f19f237e4e91d95cc953f5a73d5b2c1862712635f3ef384887fd9561151257506105ee565b9061032c9291611c7f565b9061032c939291611d55612581565b61032c93929190611d73600080516020612d738339815191526123e0565b611d9f565b6001600160a01b03909116815260608101939261032c9290916040916115f5906020830152565b611dab61132b826105ee565b90813b1561031a576000611dbe60405190565b9283906374b76f4760e11b8252818381611ddd8b8b8b60048501611d78565b03925af19081156113f857611a16611a10611a1c927f0ee23c67813e7ee061931ccc27dd2be79deb9f90738c9649947a27243cd6d81f95611a269561151257506105ee565b9061032c939291611d46565b9061032c94939291611e3e612581565b61032c9493929190611e5d600080516020612d738339815191526123e0565b611ea2565b611e9a61032c94611e93606094989795611e8c608086019a60008701906001600160a01b03169052565b6020850152565b6040830152565b019015159052565b9390919293611eb361132b826105ee565b803b1561031a57611eea600093918492611ecc60405190565b95869384928391906303ad5cef60e31b83528c8c8c60048601611e62565b03925af19081156113f857611a16611a10611a1c927f3cd37480027e3583365f7acfb552d017416b316c9bec58d3c722169ebcfbed8d95611a269561151257506105ee565b9061032c94939291611e2e565b9061032c9291611f4a612581565b61032c929190611f797f79af5a85184b45263c1b3721b9c8eb1becd98e55ade5a61da0fed18b90b832566123e0565b611f8561132b826105ee565b90813b1561031a576000611f9860405190565b636df6c7d560e11b815260048101869052928390602490829084905af19182156113f8576116776116879261167d927f4ec4ca1f307e20478f96cb1c545fe5430572a8db4931456f3828b649f641b1ef9561151257506105ee565b9061032c9291611f3c565b61201061034261034292611c15600090565b612757565b9061032c91612026610e1282610eab565b90611428916125ce565b9061032c91612015565b9061032c939291612049612581565b61032c939291906120797f6ac2c8b5322a929d300af17766189693ff6db6939ffe690430ad4720baf47d1c6123e0565b61208561132b826105ee565b90813b1561031a57600061209860405190565b928390634e6d8a7360e01b82528183816120b78b8b8b60048501611d78565b03925af19081156113f857611a16611a10611a1c927f1dd3b030dd7573079a398f70654588c91f23b82a2434fc5351cef1cbeda903e195611a269561151257506105ee565b9061032c93929161203a565b61032c90612123600080516020612d538339815191526123e0565b612186565b610342610e106109fd565b61213d6027610f3c565b7f353231317c50726f636573736f723a2073656375726974792064656c617920746020820152666f6f206c6f6e6760c81b604082015290565b610342612133565b610342612176565b610e7c7f7f63f876249f25f7856e620802edd09af38a83c9c6040fcdb371791540308311916121c36121b9610342612128565b82106110a161217e565b610415816006611048565b61032c90612108565b9061032c9695949392916121e9612581565b61032c9695949392919061220a600080516020612d738339815191526123e0565b61226c565b9194612261611e9a9298979561225060a09661224961032c9a61224260c08a019e60008b01906001600160a01b03169052565b6020890152565b6040870152565b6001600160801b0319166060850152565b61ffff166080830152565b9194959093929561227f61132b846105ee565b803b1561031a5786600087611eea82968c9661229a60405190565b9a8b9889978896636fb7e9c160e01b88526004880161220f565b9061032c9695949392916121d7565b9061032c9695949392916122d5612581565b61032c969594939291906122f6600080516020612d738339815191526123e0565b61234f565b9695939461032c956123396080956123326123469661232b8d97600060a08a019901906001600160a01b03169052565b60208d0152565b60408b0152565b88830360608a0152611272565b94019015159052565b9194959093929561236261132b846105ee565b803b1561031a5786600087611eea82968c9661237d60405190565b9a8b98899788966311de011760e31b8852600488016122fb565b9061032c9695949392916122c3565b637965db0b60e01b6001600160e01b03198216149081156123c5575090565b61034291506001600160e01b0319166301ffc9a760e01b1490565b61032c90339061276d565b9050519061032c82610aba565b9060208282031261031a57610342916123eb565b6124166037610f3c565b7f353230307c50726f636573736f723a207061796d656e74206163636f756e742060208201527f6e6f74206465706c6f79656420627920666163746f7279000000000000000000604082015290565b61034261240c565b610342612465565b602061249f9161248861132b600261112d565b604051938492839182916385bb392360e01b611921565b03915afa80156113f85761032c916000916124be575b506110a161246d565b6124e0915060203d6020116124e6575b6124d88183610ee0565b8101906123f8565b386124b5565b503d6124ce565b6125066125006103429263ffffffff1690565b60e01b90565b6001600160e01b03191690565b6001600160a01b0391821681529116602082015260608101929161032c9160400152565b9061257c9061256d61032c956004956125536323b872dd6124ed565b9361255d60405190565b9788956020870190815201612513565b60208201810382520383610ee0565b6127a9565b60025460ff1661258d57565b60405163d93c066560e01b8152600490fd5b6125a98282612831565b91826125b457505090565b6125c56103426125ca936001610e8a565b6128be565b5090565b6125d882826128f0565b91826125e357505090565b6125f46103426125ca936001610e8a565b61294c565b61260161296c565b61032c612629565b9060ff90610e27565b90612622610342610e4892151590565b8254612609565b61263560006002612612565b7f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610e7c336108da565b61032c6125f9565b612671601b610f3c565b7f353130307c436f6d6d6f6e3a20616d6f756e74206973207a65726f0000000000602082015290565b610342612667565b61034261269a565b61032c906126bb61195660006109fd565b116110a16126a2565b6126cc612581565b61032c6126db60016002612612565b7f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e7c336108da565b61032c6126c4565b610342906109fd565b61037a6103426103429290565b61274d6127486103429361274360006127529561273e600090565b500190565b6129d1565b61270d565b612716565b6105e5565b61276860006103429261273e600090565b6129f0565b9061277f61277b8284611c2c565b1590565b612787575050565b61103a61279360405190565b63e2517d3f60e01b8152928392600484016115d8565b6127b56127bc916105ee565b9182612a04565b80516127cb61195660006109fd565b1415908161280d575b506127dc5750565b61103a906127e960405190565b635274afe760e01b8152918291600483016001600160a01b03909116815260200190565b61282b915080602061282061277b935190565b8183010191016123f8565b386127d4565b61283e61277b8383611c2c565b156128a55761285d6001612858846000611c488682610e8a565b612612565b61287161286b611677339390565b916105ee565b917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d61289c60405190565b600090a4600190565b5050600090565b6103429081906001600160a01b031681565b906128eb6119566128e66128e16000610342966128d9600090565b5001946105e5565b6128ac565b6109fd565b612a71565b6128fa8282611c2c565b156128a55761291360006128588482611c488682610e8a565b61292161286b611677339390565b917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b61289c60405190565b906129676119566128e66128e16000610342966128d9600090565b612b3f565b61297b61277b60025460ff1690565b61298157565b604051638dfc202b60e01b8152600490fd5b634e487b7160e01b600052603260045260246000fd5b80548210156129cc576129c3600191600052602060002090565b91020190600090565b612993565b6103429160006129ea926129e3600090565b50016129a9565b90610b9d565b6000610342916129fe600090565b50015490565b61034291612a1260006109fd565b91612c23565b9160001960089290920291821b911b610e27565b9190612a3b610342610e489390565b908354612a18565b9081549168010000000000000000831015610f025782612a6b91600161032c950181556129a9565b90612a2c565b612a7e61277b8383612c88565b156128a557612aab91612aa6906001612a9f84612a9b8482612a43565b5490565b9301610e8a565b611048565b600190565b634e487b7160e01b600052601160045260246000fd5b91908203918211612ad357565b612ab0565b634e487b7160e01b600052603160045260246000fd5b61032c91600091612a2c565b80548015612b1d576000190190612b1a612b1483836129a9565b90612aee565b55565b612ad8565b9190612a3b610342610e48936109fd565b61032c91600091612b22565b90612b55612b508260018501610e8a565b610ea1565b612b5f60006109fd565b8114612bfc57612bc461034292600092612bb995612bbe6001978893612b8d612b87866109fd565b82612ac6565b88850191612bab612b9c845490565b612ba5896109fd565b90612ac6565b808303612bc9575b50505090565b612afa565b01610e8a565b612b33565b612a6b612bec612bf494612be36129ea612aa695896129a9565b928391886129a9565b888801610e8a565b388080612bb3565b505050600090565b3d15612c1e57612c133d610f3c565b903d6000602084013e565b606090565b91612c2d306105ee565b81813110612c57575060008281926020610342969551920190855af1612c51612c04565b91612cb3565b61103a90612c6460405190565b63cd78605960e01b8152918291600483016001600160a01b03909116815260200190565b612ca1916001612b5092612c9a600090565b5001610e8a565b612cae61195660006109fd565b141590565b90612cbe5750612d23565b8151612ccd61195660006109fd565b1480612d0d575b612cdc575090565b61103a90612ce960405190565b639996b31560e01b8152918291600483016001600160a01b03909116815260200190565b50803b612d1d61195660006109fd565b14612cd4565b8051612d3261195660006109fd565b1115612d4057805190602001fd5b604051630a12f52160e11b8152600490fdfefa658e47c75a6eb0e27156b2f72e1b295c98b53e8a1d238d7ca6ea6345b34880a567244cad934c87b7f7e15b15dd0e75f95a76afd1916f8eab4a391410d6f278a26469706673582212202e2530549c24438ec28dea3d0ac5bc4a94ae7752c7cb46a83d147d6cd4df5ffd64736f6c63430008160033"; + + private static String librariesLinkedBinary; public static final String FUNC_AUTHORIZATION_PROCESSOR_ROLE = "AUTHORIZATION_PROCESSOR_ROLE"; public static final String FUNC_BALANCE_VERIFIER_ROLE = "BALANCE_VERIFIER_ROLE"; + public static final String FUNC_CARD_CONFIRMER_ROLE = "CARD_CONFIRMER_ROLE"; + public static final String FUNC_DEBT_PROCESSOR_ROLE = "DEBT_PROCESSOR_ROLE"; public static final String FUNC_DEFAULT_ADMIN_ROLE = "DEFAULT_ADMIN_ROLE"; - public static final String FUNC_FIXED_FEE_SETTER_ROLE = "FIXED_FEE_SETTER_ROLE"; - public static final String FUNC_PAUSER_ROLE = "PAUSER_ROLE"; - public static final String FUNC_PAYMENT_ACCOUNT_SETTER_ROLE = "PAYMENT_ACCOUNT_SETTER_ROLE"; + public static final String FUNC_PAYMENT_ACCOUNT_DEPLOYER_ROLE = "PAYMENT_ACCOUNT_DEPLOYER_ROLE"; + + public static final String FUNC_PAYMENT_ACCOUNT_PROPERTY_SETTER_ROLE = "PAYMENT_ACCOUNT_PROPERTY_SETTER_ROLE"; public static final String FUNC_PROPERTY_SETTER_ROLE = "PROPERTY_SETTER_ROLE"; @@ -61,9 +69,9 @@ class TangemBridgeProcessor extends Contract { public static final String FUNC_SETTLEMENT_PROCESSOR_ROLE = "SETTLEMENT_PROCESSOR_ROLE"; - public static final String FUNC_FIXEDFEE = "fixedFee"; + public static final String FUNC_WITHDRAWAL_PROCESSOR_ROLE = "WITHDRAWAL_PROCESSOR_ROLE"; - public static final String FUNC_GETPAYMENTACCOUNT = "getPaymentAccount"; + public static final String FUNC_DEPLOYPAYMENTACCOUNT = "deployPaymentAccount"; public static final String FUNC_GETROLEADMIN = "getRoleAdmin"; @@ -77,6 +85,8 @@ class TangemBridgeProcessor extends Contract { public static final String FUNC_INCREASEVERIFIEDBALANCEFOR = "increaseVerifiedBalanceFor"; + public static final String FUNC_ISCARDCONFIRMER = "isCardConfirmer"; + public static final String FUNC_PAUSE = "pause"; public static final String FUNC_PAUSED = "paused"; @@ -87,13 +97,13 @@ class TangemBridgeProcessor extends Contract { public static final String FUNC_PAYMENTTOKEN = "paymentToken"; - public static final String FUNC_PROCESSAUTHORIZATION = "processAuthorization"; - public static final String FUNC_PROCESSAUTHORIZATIONCHANGE = "processAuthorizationChange"; - public static final String FUNC_PROCESSAUTHORIZATIONNOOTP = "processAuthorizationNoOtp"; + public static final String FUNC_PROCESSDEBT = "processDebt"; - public static final String FUNC_PROCESSPENDINGREFUND = "processPendingRefund"; + public static final String FUNC_PROCESSNOCONFIRMATIONAUTHORIZATION = "processNoConfirmationAuthorization"; + + public static final String FUNC_PROCESSOTPAUTHORIZATION = "processOtpAuthorization"; public static final String FUNC_PROCESSREFUND = "processRefund"; @@ -101,19 +111,21 @@ class TangemBridgeProcessor extends Contract { public static final String FUNC_PROCESSSETTLEMENT = "processSettlement"; + public static final String FUNC_PROCESSSIGNATUREAUTHORIZATION = "processSignatureAuthorization"; + + public static final String FUNC_PROCESSUNSETTLEDTRANSACTION = "processUnsettledTransaction"; + + public static final String FUNC_PROCESSWITHDRAWAL = "processWithdrawal"; + public static final String FUNC_REFUNDACCOUNT = "refundAccount"; public static final String FUNC_RENOUNCEROLE = "renounceRole"; public static final String FUNC_REVOKEROLE = "revokeRole"; - public static final String FUNC_SAVEPENDINGREFUND = "savePendingRefund"; - public static final String FUNC_SECURITYDELAY = "securityDelay"; - public static final String FUNC_SETFIXEDFEE = "setFixedFee"; - - public static final String FUNC_SETPAYMENTACCOUNT = "setPaymentAccount"; + public static final String FUNC_SETAUTHLIMITMARGINFOR = "setAuthLimitMarginFor"; public static final String FUNC_SETPAYMENTRECEIVER = "setPaymentReceiver"; @@ -121,214 +133,312 @@ class TangemBridgeProcessor extends Contract { public static final String FUNC_SETSECURITYDELAY = "setSecurityDelay"; - public static final String FUNC_SETSETTLEMENTPERIOD = "setSettlementPeriod"; - public static final String FUNC_SETVERIFIEDBALANCEFOR = "setVerifiedBalanceFor"; - public static final String FUNC_SETTLEMENTPERIOD = "settlementPeriod"; - public static final String FUNC_SUPPORTSINTERFACE = "supportsInterface"; public static final String FUNC_UNPAUSE = "unpause"; public static final String FUNC_WRITEOFFDEBT = "writeOffDebt"; + public static final Event AUTHLIMITMARGINSETFOR_EVENT = new Event("AuthLimitMarginSetFor", + Arrays.>asList(new TypeReference

(true) {}, new TypeReference() {})); + ; + public static final Event AUTHORIZATIONCHANGEPROCESSED_EVENT = new Event("AuthorizationChangeProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference(true) { - }, new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference(true) {}, new TypeReference() {})); + ; public static final Event AUTHORIZATIONPROCESSED_EVENT = new Event("AuthorizationProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference(true) { - }, new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference(true) {}, new TypeReference() {})); + ; + + public static final Event DEBTPROCESSED_EVENT = new Event("DebtProcessed", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event DEBTWRITEOFFPROCESSED_EVENT = new Event("DebtWriteOffProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference() { - })); - - public static final Event FIXEDFEESET_EVENT = new Event("FixedFeeSet", - List.of(new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event PAUSED_EVENT = new Event("Paused", - List.of(new TypeReference
() { - })); + Arrays.>asList(new TypeReference
() {})); + ; - public static final Event PAYMENTACCOUNTSET_EVENT = new Event("PaymentAccountSet", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference
() { - })); + public static final Event PAYMENTACCOUNTDEPLOYED_EVENT = new Event("PaymentAccountDeployed", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
() {}, new TypeReference
() {})); + ; public static final Event PAYMENTRECEIVERSET_EVENT = new Event("PaymentReceiverSet", - List.of(new TypeReference
() { - })); - - public static final Event PENDINGREFUNDPROCESSED_EVENT = new Event("PendingRefundProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
() {})); + ; public static final Event REFUNDACCOUNTSET_EVENT = new Event("RefundAccountSet", - List.of(new TypeReference
() { - })); + Arrays.>asList(new TypeReference
() {})); + ; public static final Event REFUNDPROCESSED_EVENT = new Event("RefundProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference(true) {}, new TypeReference() {})); + ; public static final Event ROLEADMINCHANGED_EVENT = new Event("RoleAdminChanged", - Arrays.asList(new TypeReference(true) { - }, new TypeReference(true) { - }, new TypeReference(true) { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference(true) {}, new TypeReference(true) {})); + ; public static final Event ROLEGRANTED_EVENT = new Event("RoleGranted", - Arrays.asList(new TypeReference(true) { - }, new TypeReference
(true) { - }, new TypeReference
(true) { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference
(true) {})); + ; public static final Event ROLEREVOKED_EVENT = new Event("RoleRevoked", - Arrays.asList(new TypeReference(true) { - }, new TypeReference
(true) { - }, new TypeReference
(true) { - })); - - public static final Event SAVEREFUNDPROCESSED_EVENT = new Event("SaveRefundProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference
(true) {})); + ; public static final Event SECURITYDELAYSET_EVENT = new Event("SecurityDelaySet", - List.of(new TypeReference() { - })); + Arrays.>asList(new TypeReference() {})); + ; public static final Event SETTLEMENTPERIODSET_EVENT = new Event("SettlementPeriodSet", - List.of(new TypeReference() { - })); + Arrays.>asList(new TypeReference() {})); + ; public static final Event SETTLEMENTPROCESSED_EVENT = new Event("SettlementProcessed", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference(true) { - }, new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference(true) {}, new TypeReference() {})); + ; public static final Event UNPAUSED_EVENT = new Event("Unpaused", - List.of(new TypeReference
() { - })); + Arrays.>asList(new TypeReference
() {})); + ; + + public static final Event UNSETTLEDTRANSACTIONPROCESSED_EVENT = new Event("UnsettledTransactionProcessed", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event VERIFIEDBALANCEINCREASEDFOR_EVENT = new Event("VerifiedBalanceIncreasedFor", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event VERIFIEDBALANCESETFOR_EVENT = new Event("VerifiedBalanceSetFor", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference() {})); + ; + + public static final Event WITHDRAWALPROCESSED_EVENT = new Event("WithdrawalProcessed", + Arrays.>asList(new TypeReference
(true) {})); + ; @Deprecated - protected TangemBridgeProcessor(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + protected TangemBridgeProcessor(String contractAddress, Web3j web3j, Credentials credentials, + BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } - protected TangemBridgeProcessor(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + protected TangemBridgeProcessor(String contractAddress, Web3j web3j, Credentials credentials, + ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, credentials, contractGasProvider); } @Deprecated - protected TangemBridgeProcessor(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + protected TangemBridgeProcessor(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } - protected TangemBridgeProcessor(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + protected TangemBridgeProcessor(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); } - public static List getAuthorizationChangeProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(AUTHORIZATIONCHANGEPROCESSED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - AuthorizationChangeProcessedEventResponse typedResponse = new AuthorizationChangeProcessedEventResponse(); + public static List getAuthLimitMarginSetForEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(AUTHLIMITMARGINSETFOR_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + AuthLimitMarginSetForEventResponse typedResponse = new AuthLimitMarginSetForEventResponse(); typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.fee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.authLimitMargin = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } - public static AuthorizationChangeProcessedEventResponse getAuthorizationChangeProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(AUTHORIZATIONCHANGEPROCESSED_EVENT, log); - AuthorizationChangeProcessedEventResponse typedResponse = new AuthorizationChangeProcessedEventResponse(); + public static AuthLimitMarginSetForEventResponse getAuthLimitMarginSetForEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(AUTHLIMITMARGINSETFOR_EVENT, log); + AuthLimitMarginSetForEventResponse typedResponse = new AuthLimitMarginSetForEventResponse(); typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.fee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.authLimitMargin = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - public static AuthorizationProcessedEventResponse getAuthorizationProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(AUTHORIZATIONPROCESSED_EVENT, log); + public Flowable authLimitMarginSetForEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getAuthLimitMarginSetForEventFromLog(log)); + } + + public Flowable authLimitMarginSetForEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(AUTHLIMITMARGINSETFOR_EVENT)); + return authLimitMarginSetForEventFlowable(filter); + } + + public static List getAuthorizationChangeProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(AUTHORIZATIONCHANGEPROCESSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + AuthorizationChangeProcessedEventResponse typedResponse = new AuthorizationChangeProcessedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static AuthorizationChangeProcessedEventResponse getAuthorizationChangeProcessedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(AUTHORIZATIONCHANGEPROCESSED_EVENT, log); + AuthorizationChangeProcessedEventResponse typedResponse = new AuthorizationChangeProcessedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable authorizationChangeProcessedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getAuthorizationChangeProcessedEventFromLog(log)); + } + + public Flowable authorizationChangeProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(AUTHORIZATIONCHANGEPROCESSED_EVENT)); + return authorizationChangeProcessedEventFlowable(filter); + } + + public static List getAuthorizationProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(AUTHORIZATIONPROCESSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + AuthorizationProcessedEventResponse typedResponse = new AuthorizationProcessedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static AuthorizationProcessedEventResponse getAuthorizationProcessedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(AUTHORIZATIONPROCESSED_EVENT, log); AuthorizationProcessedEventResponse typedResponse = new AuthorizationProcessedEventResponse(); typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.fee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); return typedResponse; } + public Flowable authorizationProcessedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getAuthorizationProcessedEventFromLog(log)); + } + + public Flowable authorizationProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(AUTHORIZATIONPROCESSED_EVENT)); + return authorizationProcessedEventFlowable(filter); + } + + public static List getDebtProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(DEBTPROCESSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + DebtProcessedEventResponse typedResponse = new DebtProcessedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static DebtProcessedEventResponse getDebtProcessedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTPROCESSED_EVENT, log); + DebtProcessedEventResponse typedResponse = new DebtProcessedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable debtProcessedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getDebtProcessedEventFromLog(log)); + } + + public Flowable debtProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(DEBTPROCESSED_EVENT)); + return debtProcessedEventFlowable(filter); + } + + public static List getDebtWriteOffProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(DEBTWRITEOFFPROCESSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + DebtWriteOffProcessedEventResponse typedResponse = new DebtWriteOffProcessedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + public static DebtWriteOffProcessedEventResponse getDebtWriteOffProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTWRITEOFFPROCESSED_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTWRITEOFFPROCESSED_EVENT, log); DebtWriteOffProcessedEventResponse typedResponse = new DebtWriteOffProcessedEventResponse(); typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - public static List getAuthorizationProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(AUTHORIZATIONPROCESSED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - AuthorizationProcessedEventResponse typedResponse = new AuthorizationProcessedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.fee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - responses.add(typedResponse); - } - return responses; + public Flowable debtWriteOffProcessedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getDebtWriteOffProcessedEventFromLog(log)); } - public static FixedFeeSetEventResponse getFixedFeeSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FIXEDFEESET_EVENT, log); - FixedFeeSetEventResponse typedResponse = new FixedFeeSetEventResponse(); - typedResponse.log = log; - typedResponse.fixedFee = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable debtWriteOffProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(DEBTWRITEOFFPROCESSED_EVENT)); + return debtWriteOffProcessedEventFlowable(filter); } public static List getPausedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAUSED_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(PAUSED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { PausedEventResponse typedResponse = new PausedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -338,177 +448,67 @@ class TangemBridgeProcessor extends Contract { } public static PausedEventResponse getPausedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAUSED_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAUSED_EVENT, log); PausedEventResponse typedResponse = new PausedEventResponse(); typedResponse.log = log; typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - public static List getDebtWriteOffProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(DEBTWRITEOFFPROCESSED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - DebtWriteOffProcessedEventResponse typedResponse = new DebtWriteOffProcessedEventResponse(); + public Flowable pausedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getPausedEventFromLog(log)); + } + + public Flowable pausedEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(PAUSED_EVENT)); + return pausedEventFlowable(filter); + } + + public static List getPaymentAccountDeployedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(PAYMENTACCOUNTDEPLOYED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + PaymentAccountDeployedEventResponse typedResponse = new PaymentAccountDeployedEventResponse(); typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.cardAddress = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(1).getValue(); responses.add(typedResponse); } return responses; } - public static PaymentAccountSetEventResponse getPaymentAccountSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTACCOUNTSET_EVENT, log); - PaymentAccountSetEventResponse typedResponse = new PaymentAccountSetEventResponse(); + public static PaymentAccountDeployedEventResponse getPaymentAccountDeployedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTACCOUNTDEPLOYED_EVENT, log); + PaymentAccountDeployedEventResponse typedResponse = new PaymentAccountDeployedEventResponse(); typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.owner = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.cardAddress = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(1).getValue(); return typedResponse; } - public static PaymentReceiverSetEventResponse getPaymentReceiverSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTRECEIVERSET_EVENT, log); - PaymentReceiverSetEventResponse typedResponse = new PaymentReceiverSetEventResponse(); - typedResponse.log = log; - typedResponse.paymentReceiver = (String) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable paymentAccountDeployedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getPaymentAccountDeployedEventFromLog(log)); } - public static RefundAccountSetEventResponse getRefundAccountSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REFUNDACCOUNTSET_EVENT, log); - RefundAccountSetEventResponse typedResponse = new RefundAccountSetEventResponse(); - typedResponse.log = log; - typedResponse.refundAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable paymentAccountDeployedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(PAYMENTACCOUNTDEPLOYED_EVENT)); + return paymentAccountDeployedEventFlowable(filter); } - public static List getFixedFeeSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(FIXEDFEESET_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - FixedFeeSetEventResponse typedResponse = new FixedFeeSetEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.fixedFee = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static RefundProcessedEventResponse getRefundProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REFUNDPROCESSED_EVENT, log); - RefundProcessedEventResponse typedResponse = new RefundProcessedEventResponse(); - typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static RoleAdminChangedEventResponse getRoleAdminChangedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, log); - RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse(); - typedResponse.log = log; - typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.previousAdminRole = (byte[]) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.newAdminRole = (byte[]) eventValues.getIndexedValues().get(2).getValue(); - return typedResponse; - } - - public static RoleGrantedEventResponse getRoleGrantedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, log); - RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse(); - typedResponse.log = log; - typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue(); - return typedResponse; - } - - public static RoleRevokedEventResponse getRoleRevokedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, log); - RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse(); - typedResponse.log = log; - typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue(); - return typedResponse; - } - - public static SaveRefundProcessedEventResponse getSaveRefundProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SAVEREFUNDPROCESSED_EVENT, log); - SaveRefundProcessedEventResponse typedResponse = new SaveRefundProcessedEventResponse(); - typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static SecurityDelaySetEventResponse getSecurityDelaySetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SECURITYDELAYSET_EVENT, log); - SecurityDelaySetEventResponse typedResponse = new SecurityDelaySetEventResponse(); - typedResponse.log = log; - typedResponse.securityDelay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static SettlementPeriodSetEventResponse getSettlementPeriodSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SETTLEMENTPERIODSET_EVENT, log); - SettlementPeriodSetEventResponse typedResponse = new SettlementPeriodSetEventResponse(); - typedResponse.log = log; - typedResponse.settlementPeriod = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static List getPaymentAccountSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAYMENTACCOUNTSET_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PaymentAccountSetEventResponse typedResponse = new PaymentAccountSetEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static SettlementProcessedEventResponse getSettlementProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SETTLEMENTPROCESSED_EVENT, log); - SettlementProcessedEventResponse typedResponse = new SettlementProcessedEventResponse(); - typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.fee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - return typedResponse; - } - - public static List getUnpausedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(UNPAUSED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - UnpausedEventResponse typedResponse = new UnpausedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static UnpausedEventResponse getUnpausedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNPAUSED_EVENT, log); - UnpausedEventResponse typedResponse = new UnpausedEventResponse(); - typedResponse.log = log; - typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static List getPaymentReceiverSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAYMENTRECEIVERSET_EVENT, transactionReceipt); + public static List getPaymentReceiverSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(PAYMENTRECEIVERSET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { PaymentReceiverSetEventResponse typedResponse = new PaymentReceiverSetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.paymentReceiver = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -517,61 +517,31 @@ class TangemBridgeProcessor extends Contract { return responses; } - public static VerifiedBalanceIncreasedForEventResponse getVerifiedBalanceIncreasedForEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASEDFOR_EVENT, log); - VerifiedBalanceIncreasedForEventResponse typedResponse = new VerifiedBalanceIncreasedForEventResponse(); + public static PaymentReceiverSetEventResponse getPaymentReceiverSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTRECEIVERSET_EVENT, log); + PaymentReceiverSetEventResponse typedResponse = new PaymentReceiverSetEventResponse(); typedResponse.log = log; - typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.paymentReceiver = (String) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - @Deprecated - public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { - return new TangemBridgeProcessor(contractAddress, web3j, credentials, gasPrice, gasLimit); + public Flowable paymentReceiverSetEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getPaymentReceiverSetEventFromLog(log)); } - @Deprecated - public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { - return new TangemBridgeProcessor(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + public Flowable paymentReceiverSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(PAYMENTRECEIVERSET_EVENT)); + return paymentReceiverSetEventFlowable(filter); } - public static List getPendingRefundProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PENDINGREFUNDPROCESSED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PendingRefundProcessedEventResponse typedResponse = new PendingRefundProcessedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static PendingRefundProcessedEventResponse getPendingRefundProcessedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PENDINGREFUNDPROCESSED_EVENT, log); - PendingRefundProcessedEventResponse typedResponse = new PendingRefundProcessedEventResponse(); - typedResponse.log = log; - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { - return new TangemBridgeProcessor(contractAddress, web3j, credentials, contractGasProvider); - } - - public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { - return new TangemBridgeProcessor(contractAddress, web3j, transactionManager, contractGasProvider); - } - - public static List getRefundAccountSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(REFUNDACCOUNTSET_EVENT, transactionReceipt); + public static List getRefundAccountSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(REFUNDACCOUNTSET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { RefundAccountSetEventResponse typedResponse = new RefundAccountSetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.refundAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -580,72 +550,68 @@ class TangemBridgeProcessor extends Contract { return responses; } - public static RemoteCall deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String paymentReceiver_, String refundAccount_, String paymentAccountFactory_, String paymentToken_, BigInteger securityDelay_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new Address(160, paymentReceiver_), - new Address(160, refundAccount_), - new Address(160, paymentAccountFactory_), - new Address(160, paymentToken_), - new Uint256(securityDelay_))); - return deployRemoteCall(TangemBridgeProcessor.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor); + public static RefundAccountSetEventResponse getRefundAccountSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REFUNDACCOUNTSET_EVENT, log); + RefundAccountSetEventResponse typedResponse = new RefundAccountSetEventResponse(); + typedResponse.log = log; + typedResponse.refundAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String paymentReceiver_, String refundAccount_, String paymentAccountFactory_, String paymentToken_, BigInteger securityDelay_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new Address(160, paymentReceiver_), - new Address(160, refundAccount_), - new Address(160, paymentAccountFactory_), - new Address(160, paymentToken_), - new Uint256(securityDelay_))); - return deployRemoteCall(TangemBridgeProcessor.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor); + public Flowable refundAccountSetEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getRefundAccountSetEventFromLog(log)); } - @Deprecated - public static RemoteCall deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String paymentReceiver_, String refundAccount_, String paymentAccountFactory_, String paymentToken_, BigInteger securityDelay_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new Address(160, paymentReceiver_), - new Address(160, refundAccount_), - new Address(160, paymentAccountFactory_), - new Address(160, paymentToken_), - new Uint256(securityDelay_))); - return deployRemoteCall(TangemBridgeProcessor.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor); + public Flowable refundAccountSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(REFUNDACCOUNTSET_EVENT)); + return refundAccountSetEventFlowable(filter); } - public static List getRefundProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(REFUNDPROCESSED_EVENT, transactionReceipt); + public static List getRefundProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(REFUNDPROCESSED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { RefundProcessedEventResponse typedResponse = new RefundProcessedEventResponse(); typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } - @Deprecated - public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String paymentReceiver_, String refundAccount_, String paymentAccountFactory_, String paymentToken_, BigInteger securityDelay_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new Address(160, paymentReceiver_), - new Address(160, refundAccount_), - new Address(160, paymentAccountFactory_), - new Address(160, paymentToken_), - new Uint256(securityDelay_))); - return deployRemoteCall(TangemBridgeProcessor.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor); + public static RefundProcessedEventResponse getRefundProcessedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REFUNDPROCESSED_EVENT, log); + RefundProcessedEventResponse typedResponse = new RefundProcessedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public Flowable authorizationChangeProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getAuthorizationChangeProcessedEventFromLog(log)); + public Flowable refundProcessedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getRefundProcessedEventFromLog(log)); } - public Flowable authorizationChangeProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable refundProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(AUTHORIZATIONCHANGEPROCESSED_EVENT)); - return authorizationChangeProcessedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(REFUNDPROCESSED_EVENT)); + return refundProcessedEventFlowable(filter); } - public static List getRoleAdminChangedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, transactionReceipt); + public static List getRoleAdminChangedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); @@ -656,24 +622,32 @@ class TangemBridgeProcessor extends Contract { return responses; } - public Flowable authorizationProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getAuthorizationProcessedEventFromLog(log)); + public static RoleAdminChangedEventResponse getRoleAdminChangedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, log); + RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse(); + typedResponse.log = log; + typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.previousAdminRole = (byte[]) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.newAdminRole = (byte[]) eventValues.getIndexedValues().get(2).getValue(); + return typedResponse; } - public Flowable authorizationProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable roleAdminChangedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getRoleAdminChangedEventFromLog(log)); + } + + public Flowable roleAdminChangedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(AUTHORIZATIONPROCESSED_EVENT)); - return authorizationProcessedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(ROLEADMINCHANGED_EVENT)); + return roleAdminChangedEventFlowable(filter); } - public Flowable debtWriteOffProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getDebtWriteOffProcessedEventFromLog(log)); - } - - public static List getRoleGrantedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, transactionReceipt); + public static List getRoleGrantedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); @@ -684,26 +658,32 @@ class TangemBridgeProcessor extends Contract { return responses; } - public Flowable debtWriteOffProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static RoleGrantedEventResponse getRoleGrantedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, log); + RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse(); + typedResponse.log = log; + typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue(); + return typedResponse; + } + + public Flowable roleGrantedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getRoleGrantedEventFromLog(log)); + } + + public Flowable roleGrantedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(DEBTWRITEOFFPROCESSED_EVENT)); - return debtWriteOffProcessedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(ROLEGRANTED_EVENT)); + return roleGrantedEventFlowable(filter); } - public Flowable fixedFeeSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getFixedFeeSetEventFromLog(log)); - } - - public Flowable fixedFeeSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(FIXEDFEESET_EVENT)); - return fixedFeeSetEventFlowable(filter); - } - - public static List getRoleRevokedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, transactionReceipt); + public static List getRoleRevokedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); @@ -714,54 +694,32 @@ class TangemBridgeProcessor extends Contract { return responses; } - public Flowable pausedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPausedEventFromLog(log)); + public static RoleRevokedEventResponse getRoleRevokedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, log); + RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse(); + typedResponse.log = log; + typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue(); + return typedResponse; } - public Flowable pausedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable roleRevokedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getRoleRevokedEventFromLog(log)); + } + + public Flowable roleRevokedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAUSED_EVENT)); - return pausedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(ROLEREVOKED_EVENT)); + return roleRevokedEventFlowable(filter); } - public Flowable paymentAccountSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPaymentAccountSetEventFromLog(log)); - } - - public static List getSaveRefundProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(SAVEREFUNDPROCESSED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - SaveRefundProcessedEventResponse typedResponse = new SaveRefundProcessedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public Flowable paymentAccountSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAYMENTACCOUNTSET_EVENT)); - return paymentAccountSetEventFlowable(filter); - } - - public Flowable paymentReceiverSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPaymentReceiverSetEventFromLog(log)); - } - - public Flowable paymentReceiverSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAYMENTRECEIVERSET_EVENT)); - return paymentReceiverSetEventFlowable(filter); - } - - public static List getSecurityDelaySetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(SECURITYDELAYSET_EVENT, transactionReceipt); + public static List getSecurityDelaySetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(SECURITYDELAYSET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { SecurityDelaySetEventResponse typedResponse = new SecurityDelaySetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.securityDelay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -770,24 +728,30 @@ class TangemBridgeProcessor extends Contract { return responses; } - public Flowable pendingRefundProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPendingRefundProcessedEventFromLog(log)); + public static SecurityDelaySetEventResponse getSecurityDelaySetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SECURITYDELAYSET_EVENT, log); + SecurityDelaySetEventResponse typedResponse = new SecurityDelaySetEventResponse(); + typedResponse.log = log; + typedResponse.securityDelay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public Flowable pendingRefundProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable securityDelaySetEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getSecurityDelaySetEventFromLog(log)); + } + + public Flowable securityDelaySetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PENDINGREFUNDPROCESSED_EVENT)); - return pendingRefundProcessedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(SECURITYDELAYSET_EVENT)); + return securityDelaySetEventFlowable(filter); } - public Flowable refundAccountSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getRefundAccountSetEventFromLog(log)); - } - - public static List getSettlementPeriodSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(SETTLEMENTPERIODSET_EVENT, transactionReceipt); + public static List getSettlementPeriodSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(SETTLEMENTPERIODSET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { SettlementPeriodSetEventResponse typedResponse = new SettlementPeriodSetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.settlementPeriod = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -796,75 +760,140 @@ class TangemBridgeProcessor extends Contract { return responses; } - public Flowable refundAccountSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static SettlementPeriodSetEventResponse getSettlementPeriodSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SETTLEMENTPERIODSET_EVENT, log); + SettlementPeriodSetEventResponse typedResponse = new SettlementPeriodSetEventResponse(); + typedResponse.log = log; + typedResponse.settlementPeriod = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable settlementPeriodSetEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getSettlementPeriodSetEventFromLog(log)); + } + + public Flowable settlementPeriodSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(REFUNDACCOUNTSET_EVENT)); - return refundAccountSetEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(SETTLEMENTPERIODSET_EVENT)); + return settlementPeriodSetEventFlowable(filter); } - public Flowable refundProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getRefundProcessedEventFromLog(log)); - } - - public Flowable refundProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(REFUNDPROCESSED_EVENT)); - return refundProcessedEventFlowable(filter); - } - - public static List getSettlementProcessedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(SETTLEMENTPROCESSED_EVENT, transactionReceipt); + public static List getSettlementProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(SETTLEMENTPROCESSED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { SettlementProcessedEventResponse typedResponse = new SettlementProcessedEventResponse(); typedResponse.log = eventValues.getLog(); - typedResponse.card = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.fee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); responses.add(typedResponse); } return responses; } - public Flowable roleAdminChangedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getRoleAdminChangedEventFromLog(log)); + public static SettlementProcessedEventResponse getSettlementProcessedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SETTLEMENTPROCESSED_EVENT, log); + SettlementProcessedEventResponse typedResponse = new SettlementProcessedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public Flowable roleAdminChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable settlementProcessedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getSettlementProcessedEventFromLog(log)); + } + + public Flowable settlementProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(ROLEADMINCHANGED_EVENT)); - return roleAdminChangedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(SETTLEMENTPROCESSED_EVENT)); + return settlementProcessedEventFlowable(filter); } - public Flowable roleGrantedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getRoleGrantedEventFromLog(log)); + public static List getUnpausedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(UNPAUSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + UnpausedEventResponse typedResponse = new UnpausedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; } - public Flowable roleGrantedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static UnpausedEventResponse getUnpausedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNPAUSED_EVENT, log); + UnpausedEventResponse typedResponse = new UnpausedEventResponse(); + typedResponse.log = log; + typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable unpausedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getUnpausedEventFromLog(log)); + } + + public Flowable unpausedEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(ROLEGRANTED_EVENT)); - return roleGrantedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(UNPAUSED_EVENT)); + return unpausedEventFlowable(filter); } - public Flowable roleRevokedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getRoleRevokedEventFromLog(log)); + public static List getUnsettledTransactionProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(UNSETTLEDTRANSACTIONPROCESSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + UnsettledTransactionProcessedEventResponse typedResponse = new UnsettledTransactionProcessedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; } - public Flowable roleRevokedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static UnsettledTransactionProcessedEventResponse getUnsettledTransactionProcessedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNSETTLEDTRANSACTIONPROCESSED_EVENT, log); + UnsettledTransactionProcessedEventResponse typedResponse = new UnsettledTransactionProcessedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.transactionId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable unsettledTransactionProcessedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getUnsettledTransactionProcessedEventFromLog(log)); + } + + public Flowable unsettledTransactionProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(ROLEREVOKED_EVENT)); - return roleRevokedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(UNSETTLEDTRANSACTIONPROCESSED_EVENT)); + return unsettledTransactionProcessedEventFlowable(filter); } - public Flowable saveRefundProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getSaveRefundProcessedEventFromLog(log)); - } - - public static List getVerifiedBalanceIncreasedForEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASEDFOR_EVENT, transactionReceipt); + public static List getVerifiedBalanceIncreasedForEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASEDFOR_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { VerifiedBalanceIncreasedForEventResponse typedResponse = new VerifiedBalanceIncreasedForEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -874,26 +903,33 @@ class TangemBridgeProcessor extends Contract { return responses; } - public Flowable saveRefundProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static VerifiedBalanceIncreasedForEventResponse getVerifiedBalanceIncreasedForEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASEDFOR_EVENT, log); + VerifiedBalanceIncreasedForEventResponse typedResponse = new VerifiedBalanceIncreasedForEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable verifiedBalanceIncreasedForEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceIncreasedForEventFromLog(log)); + } + + public Flowable verifiedBalanceIncreasedForEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(SAVEREFUNDPROCESSED_EVENT)); - return saveRefundProcessedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCEINCREASEDFOR_EVENT)); + return verifiedBalanceIncreasedForEventFlowable(filter); } - public Flowable securityDelaySetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getSecurityDelaySetEventFromLog(log)); - } - - public Flowable securityDelaySetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(SECURITYDELAYSET_EVENT)); - return securityDelaySetEventFlowable(filter); - } - - public static List getVerifiedBalanceSetForEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCESETFOR_EVENT, transactionReceipt); + public static List getVerifiedBalanceSetForEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCESETFOR_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { VerifiedBalanceSetForEventResponse typedResponse = new VerifiedBalanceSetForEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -904,7 +940,7 @@ class TangemBridgeProcessor extends Contract { } public static VerifiedBalanceSetForEventResponse getVerifiedBalanceSetForEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCESETFOR_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCESETFOR_EVENT, log); VerifiedBalanceSetForEventResponse typedResponse = new VerifiedBalanceSetForEventResponse(); typedResponse.log = log; typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -912,486 +948,671 @@ class TangemBridgeProcessor extends Contract { return typedResponse; } - public Flowable verifiedBalanceSetForEventFlowable(EthFilter filter) { + public Flowable verifiedBalanceSetForEventFlowable( + EthFilter filter) { return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceSetForEventFromLog(log)); } - public Flowable verifiedBalanceSetForEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable verifiedBalanceSetForEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCESETFOR_EVENT)); return verifiedBalanceSetForEventFlowable(filter); } - public Flowable settlementPeriodSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getSettlementPeriodSetEventFromLog(log)); + public static List getWithdrawalProcessedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(WITHDRAWALPROCESSED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + WithdrawalProcessedEventResponse typedResponse = new WithdrawalProcessedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; } - public Flowable settlementPeriodSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static WithdrawalProcessedEventResponse getWithdrawalProcessedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALPROCESSED_EVENT, log); + WithdrawalProcessedEventResponse typedResponse = new WithdrawalProcessedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable withdrawalProcessedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getWithdrawalProcessedEventFromLog(log)); + } + + public Flowable withdrawalProcessedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(SETTLEMENTPERIODSET_EVENT)); - return settlementPeriodSetEventFlowable(filter); - } - - public Flowable settlementProcessedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getSettlementProcessedEventFromLog(log)); - } - - public Flowable settlementProcessedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(SETTLEMENTPROCESSED_EVENT)); - return settlementProcessedEventFlowable(filter); - } - - public Flowable unpausedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getUnpausedEventFromLog(log)); - } - - public Flowable unpausedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(UNPAUSED_EVENT)); - return unpausedEventFlowable(filter); - } - - public Flowable verifiedBalanceIncreasedForEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceIncreasedForEventFromLog(log)); - } - - public Flowable verifiedBalanceIncreasedForEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCEINCREASEDFOR_EVENT)); - return verifiedBalanceIncreasedForEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(WITHDRAWALPROCESSED_EVENT)); + return withdrawalProcessedEventFlowable(filter); } public RemoteFunctionCall AUTHORIZATION_PROCESSOR_ROLE() { final Function function = new Function(FUNC_AUTHORIZATION_PROCESSOR_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall BALANCE_VERIFIER_ROLE() { final Function function = new Function(FUNC_BALANCE_VERIFIER_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, byte[].class); + } + + public RemoteFunctionCall CARD_CONFIRMER_ROLE() { + final Function function = new Function(FUNC_CARD_CONFIRMER_ROLE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall DEBT_PROCESSOR_ROLE() { final Function function = new Function(FUNC_DEBT_PROCESSOR_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall DEFAULT_ADMIN_ROLE() { final Function function = new Function(FUNC_DEFAULT_ADMIN_ROLE, - List.of(), - List.of(new TypeReference() { - })); - return executeRemoteCallSingleValueReturn(function, byte[].class); - } - - public RemoteFunctionCall FIXED_FEE_SETTER_ROLE() { - final Function function = new Function(FUNC_FIXED_FEE_SETTER_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall PAUSER_ROLE() { final Function function = new Function(FUNC_PAUSER_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } - public RemoteFunctionCall PAYMENT_ACCOUNT_SETTER_ROLE() { - final Function function = new Function(FUNC_PAYMENT_ACCOUNT_SETTER_ROLE, - List.of(), - List.of(new TypeReference() { - })); + public RemoteFunctionCall PAYMENT_ACCOUNT_DEPLOYER_ROLE() { + final Function function = new Function(FUNC_PAYMENT_ACCOUNT_DEPLOYER_ROLE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, byte[].class); + } + + public RemoteFunctionCall PAYMENT_ACCOUNT_PROPERTY_SETTER_ROLE() { + final Function function = new Function(FUNC_PAYMENT_ACCOUNT_PROPERTY_SETTER_ROLE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall PROPERTY_SETTER_ROLE() { final Function function = new Function(FUNC_PROPERTY_SETTER_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall REFUND_PROCESSOR_ROLE() { final Function function = new Function(FUNC_REFUND_PROCESSOR_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall SETTLEMENT_PROCESSOR_ROLE() { final Function function = new Function(FUNC_SETTLEMENT_PROCESSOR_ROLE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } - public RemoteFunctionCall fixedFee() { - final Function function = new Function(FUNC_FIXEDFEE, - List.of(), - List.of(new TypeReference() { - })); - return executeRemoteCallSingleValueReturn(function, BigInteger.class); + public RemoteFunctionCall WITHDRAWAL_PROCESSOR_ROLE() { + final Function function = new Function(FUNC_WITHDRAWAL_PROCESSOR_ROLE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, byte[].class); } - public RemoteFunctionCall getPaymentAccount(String card) { - final Function function = new Function(FUNC_GETPAYMENTACCOUNT, - List.of(new Address(160, card)), - List.of(new TypeReference
() { - })); - return executeRemoteCallSingleValueReturn(function, String.class); + public RemoteFunctionCall deployPaymentAccount(String owner, + String cardAddress, CardParams cardParams, BigInteger authLimitMargin_, + byte[] ownerDeployAcceptanceSignature, byte[] cardDeployAcceptanceSignature) { + final Function function = new Function( + FUNC_DEPLOYPAYMENTACCOUNT, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner), + new org.web3j.abi.datatypes.Address(160, cardAddress), + cardParams, + new org.web3j.abi.datatypes.generated.Uint256(authLimitMargin_), + new org.web3j.abi.datatypes.DynamicBytes(ownerDeployAcceptanceSignature), + new org.web3j.abi.datatypes.DynamicBytes(cardDeployAcceptanceSignature)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); } public RemoteFunctionCall getRoleAdmin(byte[] role) { final Function function = new Function(FUNC_GETROLEADMIN, - List.of(new Bytes32(role)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall getRoleMember(byte[] role, BigInteger index) { final Function function = new Function(FUNC_GETROLEMEMBER, - Arrays.asList(new Bytes32(role), - new Uint256(index)), - List.of(new TypeReference
() { - })); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role), + new org.web3j.abi.datatypes.generated.Uint256(index)), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall getRoleMemberCount(byte[] role) { final Function function = new Function(FUNC_GETROLEMEMBERCOUNT, - List.of(new Bytes32(role)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall grantRole(byte[] role, String account) { final Function function = new Function( FUNC_GRANTROLE, - Arrays.asList(new Bytes32(role), - new Address(160, account)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role), + new org.web3j.abi.datatypes.Address(160, account)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall hasRole(byte[] role, String account) { final Function function = new Function(FUNC_HASROLE, - Arrays.asList(new Bytes32(role), - new Address(160, account)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role), + new org.web3j.abi.datatypes.Address(160, account)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } - public RemoteFunctionCall increaseVerifiedBalanceFor(String paymentAccount, BigInteger increase) { + public RemoteFunctionCall increaseVerifiedBalanceFor(String paymentAccount, + BigInteger increase) { final Function function = new Function( FUNC_INCREASEVERIFIEDBALANCEFOR, - Arrays.asList(new Address(160, paymentAccount), - new Uint256(increase)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.generated.Uint256(increase)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } + public RemoteFunctionCall isCardConfirmer(String account) { + final Function function = new Function(FUNC_ISCARDCONFIRMER, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, account)), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, Boolean.class); + } + public RemoteFunctionCall pause() { final Function function = new Function( FUNC_PAUSE, - List.of(), - Collections.emptyList()); + Arrays.asList(), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall paused() { final Function function = new Function(FUNC_PAUSED, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall paymentAccountFactory() { final Function function = new Function(FUNC_PAYMENTACCOUNTFACTORY, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall paymentReceiver() { final Function function = new Function(FUNC_PAYMENTRECEIVER, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall paymentToken() { final Function function = new Function(FUNC_PAYMENTTOKEN, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall processAuthorization(String card, BigInteger transactionId, BigInteger amount, byte[] otp, BigInteger otpCounter, Boolean forced) { - final Function function = new Function( - FUNC_PROCESSAUTHORIZATION, - Arrays.asList(new Address(160, card), - new Uint256(transactionId), - new Uint256(amount), - new org.web3j.abi.datatypes.generated.Bytes16(otp), - new org.web3j.abi.datatypes.generated.Uint16(otpCounter), - new Bool(forced)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall processAuthorizationChange(String card, BigInteger transactionId, BigInteger amount) { + public RemoteFunctionCall processAuthorizationChange(String paymentAccount, + String card, BigInteger transactionId, BigInteger amount) { final Function function = new Function( FUNC_PROCESSAUTHORIZATIONCHANGE, - Arrays.asList(new Address(160, card), - new Uint256(transactionId), - new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processAuthorizationNoOtp(String card, BigInteger transactionId, BigInteger amount, Boolean forced) { + public RemoteFunctionCall processDebt(String paymentAccount, String card, + BigInteger amount) { final Function function = new Function( - FUNC_PROCESSAUTHORIZATIONNOOTP, - Arrays.asList(new Address(160, card), - new Uint256(transactionId), - new Uint256(amount), - new Bool(forced)), - Collections.emptyList()); + FUNC_PROCESSDEBT, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processPendingRefund(String card, BigInteger transactionId) { + public RemoteFunctionCall processNoConfirmationAuthorization( + String paymentAccount, String card, BigInteger transactionId, BigInteger amount, + Boolean forced) { final Function function = new Function( - FUNC_PROCESSPENDINGREFUND, - Arrays.asList(new Address(160, card), - new Uint256(transactionId)), - Collections.emptyList()); + FUNC_PROCESSNOCONFIRMATIONAUTHORIZATION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount), + new org.web3j.abi.datatypes.Bool(forced)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processRefund(String card, BigInteger transactionId, BigInteger refundAmount) { + public RemoteFunctionCall processOtpAuthorization(String paymentAccount, + String card, BigInteger transactionId, BigInteger amount, byte[] otp, + BigInteger otpCounter, Boolean forced) { + final Function function = new Function( + FUNC_PROCESSOTPAUTHORIZATION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount), + new org.web3j.abi.datatypes.generated.Bytes16(otp), + new org.web3j.abi.datatypes.generated.Uint16(otpCounter), + new org.web3j.abi.datatypes.Bool(forced)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processRefund(String paymentAccount, String card, + BigInteger transactionId, BigInteger refundAmount) { final Function function = new Function( FUNC_PROCESSREFUND, - Arrays.asList(new Address(160, card), - new Uint256(transactionId), - new Uint256(refundAmount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(refundAmount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall processRefundCallback() { final Function function = new Function( FUNC_PROCESSREFUNDCALLBACK, - List.of(), - Collections.emptyList()); + Arrays.asList(), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processSettlement(String card, BigInteger transactionId, BigInteger amount) { + public RemoteFunctionCall processSettlement(String paymentAccount, + String card, BigInteger transactionId, BigInteger amount) { final Function function = new Function( FUNC_PROCESSSETTLEMENT, - Arrays.asList(new Address(160, card), - new Uint256(transactionId), - new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processSignatureAuthorization( + String paymentAccount, String card, BigInteger transactionId, BigInteger amount, + byte[] signature, Boolean forced) { + final Function function = new Function( + FUNC_PROCESSSIGNATUREAUTHORIZATION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount), + new org.web3j.abi.datatypes.DynamicBytes(signature), + new org.web3j.abi.datatypes.Bool(forced)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processUnsettledTransaction(String paymentAccount, + String card, BigInteger transactionId) { + final Function function = new Function( + FUNC_PROCESSUNSETTLEDTRANSACTION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processWithdrawal(String paymentAccount) { + final Function function = new Function( + FUNC_PROCESSWITHDRAWAL, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall refundAccount() { final Function function = new Function(FUNC_REFUNDACCOUNT, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall renounceRole(byte[] role, String callerConfirmation) { + public RemoteFunctionCall renounceRole(byte[] role, + String callerConfirmation) { final Function function = new Function( FUNC_RENOUNCEROLE, - Arrays.asList(new Bytes32(role), - new Address(160, callerConfirmation)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role), + new org.web3j.abi.datatypes.Address(160, callerConfirmation)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall revokeRole(byte[] role, String account) { final Function function = new Function( FUNC_REVOKEROLE, - Arrays.asList(new Bytes32(role), - new Address(160, account)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall savePendingRefund(String card, BigInteger transactionId, BigInteger amount) { - final Function function = new Function( - FUNC_SAVEPENDINGREFUND, - Arrays.asList(new Address(160, card), - new Uint256(transactionId), - new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(role), + new org.web3j.abi.datatypes.Address(160, account)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall securityDelay() { final Function function = new Function(FUNC_SECURITYDELAY, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } - public RemoteFunctionCall setFixedFee(BigInteger fixedFee_) { + public RemoteFunctionCall setAuthLimitMarginFor(String paymentAccount, + BigInteger authLimitMargin) { final Function function = new Function( - FUNC_SETFIXEDFEE, - List.of(new Uint256(fixedFee_)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall setPaymentAccount(String card, String paymentAccount) { - final Function function = new Function( - FUNC_SETPAYMENTACCOUNT, - Arrays.asList(new Address(160, card), - new Address(160, paymentAccount)), - Collections.emptyList()); + FUNC_SETAUTHLIMITMARGINFOR, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.generated.Uint256(authLimitMargin)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall setPaymentReceiver(String paymentReceiver_) { final Function function = new Function( FUNC_SETPAYMENTRECEIVER, - List.of(new Address(160, paymentReceiver_)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentReceiver_)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall setRefundAccount(String refundAccount_) { final Function function = new Function( FUNC_SETREFUNDACCOUNT, - List.of(new Address(160, refundAccount_)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, refundAccount_)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall setSecurityDelay(BigInteger securityDelay_) { final Function function = new Function( FUNC_SETSECURITYDELAY, - List.of(new Uint256(securityDelay_)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(securityDelay_)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall setSettlementPeriod(BigInteger settlementPeriod_) { - final Function function = new Function( - FUNC_SETSETTLEMENTPERIOD, - List.of(new Uint256(settlementPeriod_)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall setVerifiedBalanceFor(String paymentAccount, BigInteger verifiedBalance) { + public RemoteFunctionCall setVerifiedBalanceFor(String paymentAccount, + BigInteger verifiedBalance) { final Function function = new Function( FUNC_SETVERIFIEDBALANCEFOR, - Arrays.asList(new Address(160, paymentAccount), - new Uint256(verifiedBalance)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.generated.Uint256(verifiedBalance)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall settlementPeriod() { - final Function function = new Function(FUNC_SETTLEMENTPERIOD, - List.of(), - List.of(new TypeReference() { - })); - return executeRemoteCallSingleValueReturn(function, BigInteger.class); - } - public RemoteFunctionCall supportsInterface(byte[] interfaceId) { final Function function = new Function(FUNC_SUPPORTSINTERFACE, - List.of(new Bytes4(interfaceId)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes4(interfaceId)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall unpause() { final Function function = new Function( FUNC_UNPAUSE, - List.of(), - Collections.emptyList()); + Arrays.asList(), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall writeOffDebt(String card, BigInteger amount) { + public RemoteFunctionCall writeOffDebt(String paymentAccount, String card, + BigInteger amount) { final Function function = new Function( FUNC_WRITEOFFDEBT, - Arrays.asList(new Address(160, card), - new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentAccount), + new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } + @Deprecated + public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, + Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + return new TangemBridgeProcessor(contractAddress, web3j, credentials, gasPrice, gasLimit); + } + + @Deprecated + public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + return new TangemBridgeProcessor(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + } + + public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, + Credentials credentials, ContractGasProvider contractGasProvider) { + return new TangemBridgeProcessor(contractAddress, web3j, credentials, contractGasProvider); + } + + public static TangemBridgeProcessor load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + return new TangemBridgeProcessor(contractAddress, web3j, transactionManager, contractGasProvider); + } + + public static RemoteCall deploy(Web3j web3j, Credentials credentials, + ContractGasProvider contractGasProvider, String paymentReceiver_, String refundAccount_, + String paymentAccountFactory_, String paymentToken_, BigInteger securityDelay_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentReceiver_), + new org.web3j.abi.datatypes.Address(160, refundAccount_), + new org.web3j.abi.datatypes.Address(160, paymentAccountFactory_), + new org.web3j.abi.datatypes.Address(160, paymentToken_), + new org.web3j.abi.datatypes.generated.Uint256(securityDelay_))); + return deployRemoteCall(TangemBridgeProcessor.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), encodedConstructor); + } + + public static RemoteCall deploy(Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider, + String paymentReceiver_, String refundAccount_, String paymentAccountFactory_, + String paymentToken_, BigInteger securityDelay_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentReceiver_), + new org.web3j.abi.datatypes.Address(160, refundAccount_), + new org.web3j.abi.datatypes.Address(160, paymentAccountFactory_), + new org.web3j.abi.datatypes.Address(160, paymentToken_), + new org.web3j.abi.datatypes.generated.Uint256(securityDelay_))); + return deployRemoteCall(TangemBridgeProcessor.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), encodedConstructor); + } + + @Deprecated + public static RemoteCall deploy(Web3j web3j, Credentials credentials, + BigInteger gasPrice, BigInteger gasLimit, String paymentReceiver_, + String refundAccount_, String paymentAccountFactory_, String paymentToken_, + BigInteger securityDelay_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentReceiver_), + new org.web3j.abi.datatypes.Address(160, refundAccount_), + new org.web3j.abi.datatypes.Address(160, paymentAccountFactory_), + new org.web3j.abi.datatypes.Address(160, paymentToken_), + new org.web3j.abi.datatypes.generated.Uint256(securityDelay_))); + return deployRemoteCall(TangemBridgeProcessor.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor); + } + + @Deprecated + public static RemoteCall deploy(Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, + String paymentReceiver_, String refundAccount_, String paymentAccountFactory_, + String paymentToken_, BigInteger securityDelay_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, paymentReceiver_), + new org.web3j.abi.datatypes.Address(160, refundAccount_), + new org.web3j.abi.datatypes.Address(160, paymentAccountFactory_), + new org.web3j.abi.datatypes.Address(160, paymentToken_), + new org.web3j.abi.datatypes.generated.Uint256(securityDelay_))); + return deployRemoteCall(TangemBridgeProcessor.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor); + } + + public static void linkLibraries(List references) { + librariesLinkedBinary = linkBinaryWithReferences(BINARY, references); + } + + private static String getDeploymentBinary() { + if (librariesLinkedBinary != null) { + return librariesLinkedBinary; + } else { + return BINARY; + } + } + + public static class OtpState extends StaticStruct { + public byte[] otp; + + public BigInteger counter; + + public OtpState(byte[] otp, BigInteger counter) { + super(new org.web3j.abi.datatypes.generated.Bytes16(otp), + new org.web3j.abi.datatypes.generated.Uint16(counter)); + this.otp = otp; + this.counter = counter; + } + + public OtpState(Bytes16 otp, Uint16 counter) { + super(otp, counter); + this.otp = otp.getValue(); + this.counter = counter.getValue(); + } + } + + public static class LimitsParams extends StaticStruct { + public BigInteger singleTransactionLimit; + + public BigInteger spendLimit; + + public BigInteger noConfirmationSpendLimit; + + public BigInteger spendLimitsPeriod; + + public LimitsParams(BigInteger singleTransactionLimit, BigInteger spendLimit, + BigInteger noConfirmationSpendLimit, BigInteger spendLimitsPeriod) { + super(new org.web3j.abi.datatypes.generated.Uint256(singleTransactionLimit), + new org.web3j.abi.datatypes.generated.Uint256(spendLimit), + new org.web3j.abi.datatypes.generated.Uint256(noConfirmationSpendLimit), + new org.web3j.abi.datatypes.generated.Uint256(spendLimitsPeriod)); + this.singleTransactionLimit = singleTransactionLimit; + this.spendLimit = spendLimit; + this.noConfirmationSpendLimit = noConfirmationSpendLimit; + this.spendLimitsPeriod = spendLimitsPeriod; + } + + public LimitsParams(Uint256 singleTransactionLimit, Uint256 spendLimit, + Uint256 noConfirmationSpendLimit, Uint256 spendLimitsPeriod) { + super(singleTransactionLimit, spendLimit, noConfirmationSpendLimit, spendLimitsPeriod); + this.singleTransactionLimit = singleTransactionLimit.getValue(); + this.spendLimit = spendLimit.getValue(); + this.noConfirmationSpendLimit = noConfirmationSpendLimit.getValue(); + this.spendLimitsPeriod = spendLimitsPeriod.getValue(); + } + } + + public static class CardParams extends StaticStruct { + public Boolean isOwner; + + public OtpState otpState; + + public LimitsParams limitsParams; + + public CardParams(Boolean isOwner, OtpState otpState, LimitsParams limitsParams) { + super(new org.web3j.abi.datatypes.Bool(isOwner), + otpState, + limitsParams); + this.isOwner = isOwner; + this.otpState = otpState; + this.limitsParams = limitsParams; + } + + public CardParams(Bool isOwner, OtpState otpState, LimitsParams limitsParams) { + super(isOwner, otpState, limitsParams); + this.isOwner = isOwner.getValue(); + this.otpState = otpState; + this.limitsParams = limitsParams; + } + } + + public static class AuthLimitMarginSetForEventResponse extends BaseEventResponse { + public String paymentAccount; + + public BigInteger authLimitMargin; + } + public static class AuthorizationChangeProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + public String card; public BigInteger transactionId; public BigInteger amount; - - public BigInteger fee; } public static class AuthorizationProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + public String card; public BigInteger transactionId; public BigInteger amount; - - public BigInteger fee; } - public static class DebtWriteOffProcessedEventResponse extends BaseEventResponse { + public static class DebtProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + public String card; public BigInteger amount; } - public static class FixedFeeSetEventResponse extends BaseEventResponse { - public BigInteger fixedFee; + public static class DebtWriteOffProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + + public String card; + + public BigInteger amount; } public static class PausedEventResponse extends BaseEventResponse { public String account; } - public static class PaymentAccountSetEventResponse extends BaseEventResponse { - public String card; + public static class PaymentAccountDeployedEventResponse extends BaseEventResponse { + public String owner; + + public String cardAddress; public String paymentAccount; } @@ -1400,19 +1621,13 @@ class TangemBridgeProcessor extends Contract { public String paymentReceiver; } - public static class PendingRefundProcessedEventResponse extends BaseEventResponse { - public String card; - - public BigInteger transactionId; - - public BigInteger amount; - } - public static class RefundAccountSetEventResponse extends BaseEventResponse { public String refundAccount; } public static class RefundProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + public String card; public BigInteger transactionId; @@ -1444,14 +1659,6 @@ class TangemBridgeProcessor extends Contract { public String sender; } - public static class SaveRefundProcessedEventResponse extends BaseEventResponse { - public String card; - - public BigInteger transactionId; - - public BigInteger amount; - } - public static class SecurityDelaySetEventResponse extends BaseEventResponse { public BigInteger securityDelay; } @@ -1461,19 +1668,27 @@ class TangemBridgeProcessor extends Contract { } public static class SettlementProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + public String card; public BigInteger transactionId; public BigInteger amount; - - public BigInteger fee; } public static class UnpausedEventResponse extends BaseEventResponse { public String account; } + public static class UnsettledTransactionProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + + public String card; + + public BigInteger transactionId; + } + public static class VerifiedBalanceIncreasedForEventResponse extends BaseEventResponse { public String paymentAccount; @@ -1485,4 +1700,8 @@ class TangemBridgeProcessor extends Contract { public BigInteger verifiedBalance; } -} + + public static class WithdrawalProcessedEventResponse extends BaseEventResponse { + public String paymentAccount; + } +} \ No newline at end of file diff --git a/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccount.java b/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccount.java index 834d85f3c2..df19c6cee9 100644 --- a/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccount.java +++ b/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccount.java @@ -1,10 +1,30 @@ package com.tangem.lib.visa; +import io.reactivex.Flowable; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.Callable; import org.web3j.abi.EventEncoder; import org.web3j.abi.FunctionEncoder; import org.web3j.abi.TypeReference; -import org.web3j.abi.datatypes.*; -import org.web3j.abi.datatypes.generated.*; +import org.web3j.abi.datatypes.Address; +import org.web3j.abi.datatypes.Bool; +import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.DynamicBytes; +import org.web3j.abi.datatypes.Event; +import org.web3j.abi.datatypes.Function; +import org.web3j.abi.datatypes.StaticStruct; +import org.web3j.abi.datatypes.Type; +import org.web3j.abi.datatypes.Utf8String; +import org.web3j.abi.datatypes.generated.Bytes1; +import org.web3j.abi.datatypes.generated.Bytes16; +import org.web3j.abi.datatypes.generated.Bytes32; +import org.web3j.abi.datatypes.generated.Uint16; +import org.web3j.abi.datatypes.generated.Uint256; +import org.web3j.abi.datatypes.generated.Uint64; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.DefaultBlockParameter; @@ -14,36 +34,36 @@ import org.web3j.protocol.core.methods.request.EthFilter; import org.web3j.protocol.core.methods.response.BaseEventResponse; import org.web3j.protocol.core.methods.response.Log; import org.web3j.protocol.core.methods.response.TransactionReceipt; -import org.web3j.tuples.generated.Tuple3; +import org.web3j.tuples.generated.Tuple4; +import org.web3j.tuples.generated.Tuple5; import org.web3j.tuples.generated.Tuple7; import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; import org.web3j.tx.gas.ContractGasProvider; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.Callable; - -import io.reactivex.Flowable; - /** *

Auto generated code. *

Do not modify! *

Please use the web3j command line tools, - * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the + * codegen module to update. * - *

Generated with web3j version 1.5.2. + *

Generated with web3j version 1.6.1. */ @SuppressWarnings("rawtypes") -class TangemPaymentAccount extends Contract { - public static final String BINARY = "60c06040523060a0523480156200001557600080fd5b5060405162005aa938038062005aa983398101604081905262000038916200010a565b6001600160a01b0381166080526200004f62000056565b506200013c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000a75760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620001075780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156200011d57600080fd5b81516001600160a01b03811681146200013557600080fd5b9392505050565b60805160a05161592b6200017e600039600081816132fe0152818161332701526135880152600081816104d301528181610578015261290d015261592b6000f3fe6080604052600436106102c85760003560e01c806386489ba911610175578063c470d703116100dc578063df7727b411610095578063e3dbffd51161006f578063e3dbffd514610a40578063e4d7ddb914610a60578063e6e268f414610a80578063f89db45714610a9557600080fd5b8063df7727b4146102f5578063e1a8eafd146109b2578063e37b8154146109d257600080fd5b8063c470d703146108da578063c81656c81461090e578063ce1b1d431461093b578063d47ae89c1461095b578063dbed8faa14610970578063dcab7e501461099057600080fd5b8063a789457d1161012e578063a789457d1461077b578063ad3cb1cc14610827578063b4d02d0d14610865578063b9603bdf14610885578063be69191d146108a5578063c45a0155146108ba57600080fd5b806386489ba9146106c657806386f15d09146106e65780638bbe11af146106fb5780638c3b2a9b1461071b5780638da5cb5b1461073b578063a075b7c71461075b57600080fd5b80633c1a5012116102345780636b2a3830116101ed5780637da0a877116101c75780637da0a87714610569578063806679e41461059c57806384b0196e146105bc578063860aefcf146105e457600080fd5b80636b2a3830146105135780636b4943a7146105335780637b1039991461054957600080fd5b80633c1a501214610439578063456575e51461045957806346236eb9146104795780634f1ef2861461048e57806352d1902d146104a1578063572b6c05146104b657600080fd5b806322611280116102865780632261128014610377578063229865d11461038c5780633013ce29146103ac578063309433ba146103e457806334284dfb1461040457806335ba9af81461042457600080fd5b806274f356146102cd57806301e948ff146102f55780630381b4dd1461030a5780630f1071be1461032c57806319cdeb6f146103415780631f852f4b14610357575b600080fd5b3480156102d957600080fd5b506102e2610ab5565b6040519081526020015b60405180910390f35b34801561030157600080fd5b506102e2610acf565b34801561031657600080fd5b5061032a610325366004614b0d565b610ae0565b005b34801561033857600080fd5b506102e2610dde565b34801561034d57600080fd5b506102e260065481565b34801561036357600080fd5b5061032a610372366004614b8d565b610e63565b34801561038357600080fd5b5061032a610fa7565b34801561039857600080fd5b5061032a6103a7366004614be2565b611034565b3480156103b857600080fd5b506000546103cc906001600160a01b031681565b6040516001600160a01b0390911681526020016102ec565b3480156103f057600080fd5b5061032a6103ff366004614c2a565b6110cb565b34801561041057600080fd5b5061032a61041f366004614cb0565b611337565b34801561043057600080fd5b506102e26113fd565b34801561044557600080fd5b5061032a610454366004614d0b565b611490565b34801561046557600080fd5b5061032a610474366004614b0d565b61151c565b34801561048557600080fd5b50601c546102e2565b61032a61049c366004614d3e565b6115bc565b3480156104ad57600080fd5b506102e26115db565b3480156104c257600080fd5b506105036104d1366004614d0b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b60405190151581526020016102ec565b34801561051f57600080fd5b5061032a61052e366004614be2565b6115f8565b34801561053f57600080fd5b506102e260075481565b34801561055557600080fd5b506002546103cc906001600160a01b031681565b34801561057557600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cc565b3480156105a857600080fd5b5061032a6105b7366004614e02565b611749565b3480156105c857600080fd5b506105d16117ed565b6040516102ec9796959493929190614e8b565b3480156105f057600080fd5b506040805160a08082018352600d54825282518084018452600e548152600f546020828101919091528084019190915283518085018552601054815260115481830152838501528351808201855260125481526060808501919091526013546080808601919091528551938401865260145484528551808701875260155481526016548185015284840152855180870187526017548152601854818501528487015285519283019095526019548252820152601a5492810192909252601b546106b7929083565b6040516102ec93929190614f6c565b3480156106d257600080fd5b5061032a6106e1366004614f97565b611899565b3480156106f257600080fd5b50610503611a66565b34801561070757600080fd5b5061032a610716366004614be2565b611a90565b34801561072757600080fd5b5061032a610736366004614ff0565b611ba9565b34801561074757600080fd5b506004546103cc906001600160a01b031681565b34801561076757600080fd5b5061032a610776366004615023565b611cf8565b34801561078757600080fd5b506040805180820182526008546001600160a01b039081168252825180840184526009546001600160801b0319608082811b8216845261ffff600160801b9384900481166020868101919091528088019590955287518089018952600a5490961686528751808901909852600b549182901b9092168752919091041684820152810192909252600c54610818929083565b6040516102ec93929190615086565b34801561083357600080fd5b50610858604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516102ec91906150af565b34801561087157600080fd5b5061032a610880366004614be2565b611de0565b34801561089157600080fd5b5061032a6108a0366004614be2565b611ee3565b3480156108b157600080fd5b5061050361201c565b3480156108c657600080fd5b506001546103cc906001600160a01b031681565b3480156108e657600080fd5b507f3fc394ec90f88dd7e18c46ffeef55f1b6719a2027f4ae9fbc4ab118271891200546102e2565b34801561091a57600080fd5b506102e2610929366004614be2565b6000908152601d602052604090205490565b34801561094757600080fd5b506003546103cc906001600160a01b031681565b34801561096757600080fd5b506102e2612044565b34801561097c57600080fd5b5061032a61098b366004614be2565b6120c8565b34801561099c57600080fd5b506000805160206154fc833981519152546102e2565b3480156109be57600080fd5b5061032a6109cd366004614d0b565b612127565b3480156109de57600080fd5b50610a1b6109ed366004614be2565b600560205260009081526040902080546001909101546001600160801b03811690600160801b900460ff1683565b604080519384526001600160801b0390921660208401521515908201526060016102ec565b348015610a4c57600080fd5b5061032a610a5b366004614be2565b6122c6565b348015610a6c57600080fd5b5061032a610a7b366004614b0d565b6124ac565b348015610a8c57600080fd5b506102e261265c565b348015610aa157600080fd5b5061032a610ab0366004614be2565b612673565b6000806000805160206154dc8339815191525b5492915050565b6000610adb600061284d565b905090565b6003546001600160a01b0316610af4612909565b6001600160a01b0316146040518060600160405280603381526020016153166033913990610b3e5760405162461bcd60e51b8152600401610b3591906150af565b60405180910390fd5b50610b488161295b565b60008281526005602052604081205490818311610b7b575081808203828214610b7557610b75858261299b565b50610bff565b50806000610b89600d6129e0565b8054909150600081851015610bbf57610bae858303610ba98560006129ff565b612a6b565b9050610bbc81610ba9610acf565b90505b8015610be7576000610bd382878903612a6b565b948501949050610be584826000612a83565b505b838603868514610bfa57610bfa81612aaa565b505050505b8160075410156040518060600160405280602981526020016158226029913990610c3c5760405162461bcd60e51b8152600401610b3591906150af565b50600780548390039055600084815260056020908152604080832092835560019290920180546001600160881b0319169055600354825163659bf9d960e11b81529251610cdf936001600160a01b039092169263cb37f3b292600480820193918290030181865afa158015610cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd991906150c2565b82612b0b565b604080518481526020810183905285917fa06caae8c696e5deb33f685024044b74125cb932e11521aef47de748321657c4910160405180910390a26000546040516370a0823160e01b81523060048201527f273f30c859762d267fd40559825ed2fa0f467908c92843dfd0184b9d577dc082916001600160a01b0316906370a0823190602401602060405180830381865afa158015610d82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da691906150df565b600754610db1610ab5565b601c546040805194855260208501939093529183015260608201526080015b60405180910390a150505050565b6000610adb600360009054906101000a90046001600160a01b03166001600160a01b0316630f1071be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5a91906150df565b6283d600612a6b565b6004546001600160a01b0316610e77612909565b6001600160a01b03161480610eae5750610e916008612c1b565b546001600160a01b0316610ea3612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f913990610ee55760405162461bcd60e51b8152600401610b3591906150af565b50610ef1838383612c36565b600480546001600160a01b038581166001600160a01b0319831681178455600254604051635cd2673760e01b815293831694840185905260248401919091521690635cd2673790604401600060405180830381600087803b158015610f5557600080fd5b505af1158015610f69573d6000803e3d6000fd5b50506040516001600160a01b03871681527f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe292506020019050610dd0565b6004546001600160a01b0316610fbb612909565b6001600160a01b03161480610ff25750610fd56008612c1b565b546001600160a01b0316610fe7612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f9139906110295760405162461bcd60e51b8152600401610b3591906150af565b50611032612d2a565b565b6004546001600160a01b0316611048612909565b6001600160a01b0316148061107f57506110626008612c1b565b546001600160a01b0316611074612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f9139906110b65760405162461bcd60e51b8152600401610b3591906150af565b506110c8816110c3612044565b612d7b565b50565b6004546001600160a01b03166110df612909565b6001600160a01b0316148061111657506110f96008612c1b565b546001600160a01b031661110b612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f91399061114d5760405162461bcd60e51b8152600401610b3591906150af565b50611159858383612c36565b600c541561122857600a546040805180820182526001600160a01b03888116825282518084019093526001600160801b03198816835261ffff87166020848101919091528201929092529116906111bb906111b2612044565b60089190612e79565b600254604051630747fc3760e41b81526001600160a01b03838116600483015288811660248301529091169063747fc37090604401600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b50505050506112db565b61127b6040518060400160405280876001600160a01b031681526020016040518060400160405280886001600160801b03191681526020018761ffff16815250815250600861302090919063ffffffff16565b60025460405163346b888d60e11b81526001600160a01b038781166004830152909116906368d7111a90602401600060405180830381600087803b1580156112c257600080fd5b505af11580156112d6573d6000803e3d6000fd5b505050505b604080516001600160a01b03871681526001600160801b03198616602082015261ffff85168183015290517fae81d31085749debb22edb9a09f263e50cf6047cfc57ec741c07ce62b1121b9a9181900360600190a15050505050565b6003546001600160a01b031661134b612909565b6001600160a01b031614604051806060016040528060338152602001615316603391399061138c5760405162461bcd60e51b8152600401610b3591906150af565b50600161139a8484846130c1565b6113a68686848461311d565b604080518681526001600160801b03198616602082015261ffff851681830152905187917faab1db26b8ce0ed14d67fd3d8eab92617f4caf4134148122ad6f2a4e20068df7919081900360600190a2505050505050565b600080546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa158015611446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146a91906150df565b905060075481101561147d57600061148a565b60075461148a908261510e565b91505090565b6004546001600160a01b03166114a4612909565b6001600160a01b031614806114db57506114be6008612c1b565b546001600160a01b03166114d0612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f9139906115125760405162461bcd60e51b8152600401610b3591906150af565b506110c881613186565b6003546001600160a01b0316611530612909565b6001600160a01b03161460405180606001604052806033815260200161531660339139906115715760405162461bcd60e51b8152600401610b3591906150af565b5061157e601c8383613274565b817fea92e836c1b642a333bb58b44d5f13c5a066c5b0f35b8d6da5032af605c9e031826040516115b091815260200190565b60405180910390a25050565b6115c46132f3565b6115cd82613398565b6115d782826134c0565b5050565b60006115e561357d565b506000805160206155cf83398151915290565b6003546001600160a01b031661160c612909565b6001600160a01b031614604051806060016040528060338152602001615316603391399061164d5760405162461bcd60e51b8152600401610b3591906150af565b5060008160065461165e9190615121565b6000546040516370a0823160e01b81523060048201529192506001600160a01b0316906370a0823190602401602060405180830381865afa1580156116a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cb91906150df565b8111156040518060600160405280603781526020016153c760379139906117055760405162461bcd60e51b8152600401610b3591906150af565b50600681905560408051838152602081018390527fd6004694c2f543b69302481de26731f63c1d41062795b5366d8ca20fd3e3d6d391015b60405180910390a15050565b6003546001600160a01b031661175d612909565b6001600160a01b031614604051806060016040528060338152602001615316603391399061179e5760405162461bcd60e51b8152600401610b3591906150af565b5060006117ad8484848461311d565b837f5e1266400272ee17509f7d7edb190c0fa83572f90677ee6a3bbfac22bf1f679d846040516117df91815260200190565b60405180910390a250505050565b60006060808280808381600080516020615541833981519152805490915015801561181a57506001810154155b61185e5760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610b35565b6118666135c6565b61186e613689565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156118df5750825b905060008267ffffffffffffffff1660011480156118fc5750303b155b90508115801561190a575080155b156119285760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561195257845460ff60401b1916600160401b1785555b61195a6136c8565b6119626136c8565b6119b16040518060400160405280601481526020017315185b99d95b54185e5b595b9d1058d8dbdd5b9d60621b815250604051806040016040528060018152602001603160f81b8152506136d0565b6119b96136c8565b6119c1612909565b600180546001600160a01b03199081166001600160a01b03938416179091556004805482168e841617905560028054909116918c16919091179055611a13611a0b8a8a8a8a6136e2565b600d90613780565b8315611a5957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b6000805160206154fc8339815191525460009060008051602061549c83398151915290151561148a565b6000818152600560205260409020600181015490546001600160801b0390911690611ab9610dde565b611ac39083615121565b42116040518060600160405280602b8152602001615349602b913990611afc5760405162461bcd60e51b8152600401610b3591906150af565b508060075410156040518060600160405280602981526020016158226029913990611b3a5760405162461bcd60e51b8152600401610b3591906150af565b5060078054829003905560008381526005602052604080822091825560019190910180546001600160881b03191690555183907f056bed1bad5d90aa1df671c8d28b1bbb82ff67fd545f804e63cd261140b11f7b90611b9c9084815260200190565b60405180910390a2505050565b6004546001600160a01b0316611bbd612909565b6001600160a01b03161480611bf45750611bd76008612c1b565b546001600160a01b0316611be9612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f913990611c2b5760405162461bcd60e51b8152600401610b3591906150af565b50600c5415156040518060600160405280603181526020016157c66031913990611c685760405162461bcd60e51b8152600401610b3591906150af565b50604080518082018252600a546001600160a01b0316815281518083019092526001600160801b03198416825261ffff8316602083810191909152810191909152611cb5906111b2612044565b604080516001600160801b03198416815261ffff831660208201527fc50d2cc66f62a75104edeabfbcedb2a37ebd1cb8ce0b873ec3afa504e8bb1480910161173d565b6004546001600160a01b0316611d0c612909565b6001600160a01b03161480611d435750611d266008612c1b565b546001600160a01b0316611d38612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f913990611d7a5760405162461bcd60e51b8152600401610b3591906150af565b50611d9b611d8a858585856136e2565b611d92612044565b600d919061380c565b6040805185815260208101859052908101839052606081018290527ffc3ccf3ca5a38fad8786ed39386de19cb574b06205422992c583e4753aa6268f90608001610dd0565b6004546001600160a01b0316611df4612909565b6001600160a01b03161480611e2b5750611e0e6008612c1b565b546001600160a01b0316611e20612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f913990611e625760405162461bcd60e51b8152600401610b3591906150af565b506110c881600360009054906101000a90046001600160a01b03166001600160a01b031663cb37f3b26040518163ffffffff1660e01b8152600401602060405180830381865afa158015611eba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ede91906150c2565b6138fa565b6003546001600160a01b0316611ef7612909565b6001600160a01b0316146040518060600160405280603381526020016153166033913990611f385760405162461bcd60e51b8152600401610b3591906150af565b506000546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa591906150df565b8111156040518060600160405280603781526020016153c76037913990611fdf5760405162461bcd60e51b8152600401610b3591906150af565b5060068190556040518181527f321b800465e47508430424e6c089344256e17f9a5b0b43c751dffbdfd3930263906020015b60405180910390a150565b600060008051602061549c83398151915261148a6000805160206154fc833981519152613a4c565b6000610adb600360009054906101000a90046001600160a01b03166001600160a01b031663d47ae89c6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561209c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c091906150df565b610e10612a6b565b6003546001600160a01b03166120dc612909565b6001600160a01b031614604051806060016040528060338152602001615316603391399061211d5760405162461bcd60e51b8152600401610b3591906150af565b506110c881613ab4565b6004546001600160a01b031661213b612909565b6001600160a01b0316148061217257506121556008612c1b565b546001600160a01b0316612167612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f9139906121a95760405162461bcd60e51b8152600401610b3591906150af565b50600354604080516060810190915260238082526001600160a01b0390921615916153fe6020830139906121f05760405162461bcd60e51b8152600401610b3591906150af565b50600380546001600160a01b0319166001600160a01b03831690811790915560408051633013ce2960e01b81529051633013ce29916004808201926020929091908290030181865afa15801561224a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226e91906150c2565b600080546001600160a01b0319166001600160a01b0392831690811790915560408051928416835260208301919091527fb84a8bf26086331c9421c7ce6650da3b0ef748bd335c3f00ada56f481e4321939101612011565b6003546001600160a01b03166122da612909565b6001600160a01b031614604051806060016040528060338152602001615316603391399061231b5760405162461bcd60e51b8152600401610b3591906150af565b50600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015612365573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238991906150df565b9050600360009054906101000a90046001600160a01b03166001600160a01b0316632cc326416040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156123db57600080fd5b505af11580156123ef573d6000803e3d6000fd5b5050600080546040516370a0823160e01b81523060048201529193508492506001600160a01b0316906370a0823190602401602060405180830381865afa15801561243e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246291906150df565b61246c919061510e565b905061247a601c8483613b81565b827f2c6a6ee02f179bb5f13a4b7fdc9ccd1dd37e524b48ff0957a931348cc9ad75c082604051611b9c91815260200190565b6003546001600160a01b03166124c0612909565b6001600160a01b03161460405180606001604052806033815260200161531660339139906125015760405162461bcd60e51b8152600401610b3591906150af565b506000600560008481526020019081526020016000206000015490506000811160405180606001604052806023815260200161547960239139906125585760405162461bcd60e51b8152600401610b3591906150af565b508082106040518060600160405280603b81526020016156d7603b9139906125935760405162461bcd60e51b8152600401610b3591906150af565b508181036125a1848261299b565b80600754101560405180606001604052806029815260200161582260299139906125de5760405162461bcd60e51b8152600401610b3591906150af565b50600780548290039055600083900361261857600084815260056020526040812090815560010180546001600160881b031916905561262a565b60008481526005602052604090208390555b837f8274e5392b3ab6bba68ee0567f4ede55e361239b8d0122fa5d3b5dc36497b91d846040516117df91815260200190565b60008060008051602061549c833981519152610ac8565b6003546001600160a01b0316612687612909565b6001600160a01b03161460405180606001604052806033815260200161531660339139906126c85760405162461bcd60e51b8152600401610b3591906150af565b50600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015612712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273691906150df565b9050600360009054906101000a90046001600160a01b03166001600160a01b0316632cc326416040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561278857600080fd5b505af115801561279c573d6000803e3d6000fd5b5050600080546040516370a0823160e01b81523060048201529193508492506001600160a01b0316906370a0823190602401602060405180830381865afa1580156127eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061280f91906150df565b612819919061510e565b9050827f2c6a6ee02f179bb5f13a4b7fdc9ccd1dd37e524b48ff0957a931348cc9ad75c082604051611b9c91815260200190565b600080546040516370a0823160e01b815230600482015282916128c8916001600160a01b03909116906370a0823190602401602060405180830381865afa15801561289c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c091906150df565b600654612a6b565b600754909150836128e8576128db61265c565b6128e59082615121565b90505b808210156128f7576000612901565b612901818361510e565b949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633148015612944575060143610155b15612956575060131936013560601c90565b503390565b60408051808201909152601b81526000805160206154218339815191526020820152816115d75760405162461bcd60e51b8152600401610b3591906150af565b6000828152600560205260409020600101546001600160801b03811690600160801b900460ff166129da8383836129d2600d6129e0565b929190613c6c565b50505050565b60004282600e015411156129f457816129f9565b816007015b92915050565b6000612a0d83600501613a4c565b15612a3e578115612a23575060018201546129f9565b60018301546003840154612a379190612a6b565b90506129f9565b8115612a5057612a3783600101613c9a565b612a37612a5f84600101613c9a565b610ba985600301613c9a565b6000818310612a7a5781612a7c565b825b9392505050565b612a8c83613cbc565b612a968383613cee565b80612aa557612aa58383613cfb565b505050565b6000805160206154dc833981519152805482908290600090612acd908490615121565b909155505080546040805184815260208101929092527ff3a2c404b3362c4238317c3dad1020c2e9e984ba8df38a4a1ff18d57e92a242a910161173d565b600080546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015612b54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7891906150df565b905080600654146040518060600160405280603381526020016157656033913990612bb65760405162461bcd60e51b8152600401610b3591906150af565b5060408051808201909152601f81526000805160206154bc833981519152602082015282821015612bfa5760405162461bcd60e51b8152600401610b3591906150af565b50600680548390039055600054612aa5906001600160a01b03168484613d08565b60004282600401541115612c2f57816129f9565b5060020190565b60408051602081019091527f3fc394ec90f88dd7e18c46ffeef55f1b6719a2027f4ae9fbc4ab1182718912008054825290600090612c7c90612c7790613d5a565b613db2565b90506000612cc08286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613ddf92505050565b9050856001600160a01b0316816001600160a01b0316146040518060600160405280602b81526020016157f7602b913990612d0e5760405162461bcd60e51b8152600401610b3591906150af565b508254836000612d1d83615134565b9190505550505050505050565b600060008051602061549c8339815191528181556000805160206154fc83398151915282905560405190917f8892a543ee6d561b73cc067b2cde5a76c251a4e0b978d92390f1301db5d125ab91a150565b60408051808201909152601b8152600080516020615421833981519152602082015282612dbb5760405162461bcd60e51b8152600401610b3591906150af565b50612dc46113fd565b8211156040518060400160405280601f81526020016000805160206154bc83398151915281525090612e095760405162461bcd60e51b8152600401610b3591906150af565b5060008051602061549c833981519152828155612e346000805160206154fc83398151915283613e09565b60018101546040805185815260208101929092527ffa4870dc2e2f95d11863e7e765a98e12fe92c3d1d2a703b4cf983f9c4b1052e691015b60405180910390a1505050565b602082015151600384015460801b6001600160801b03199081169116141580612ebc575060208083015101516003840154600160801b900461ffff908116911614155b80612ed95750815160028401546001600160a01b03908116911614155b60405180606001604052806027815260200161568e6027913990612f105760405162461bcd60e51b8152600401610b3591906150af565b506004830154421015612f895781516002840180546001600160a01b039092166001600160a01b03199092169190911790556020808301518051600386018054929093015161ffff16600160801b026001600160901b031990921660809190911c17179055612f7f8142615121565b6004840155505050565b60028301805484546001600160a01b03199081166001600160a01b0380841691909117875560038701805460018901805461ffff600160801b808504821681026001600160901b03199384166001600160801b03871617179093558a51909516959096169490941790955560208088015180519101519092169092029290931660809390931c92909217179055612f7f8142615121565b60048201541515156040518060600160405280602f81526020016152e7602f91399061305f5760405162461bcd60e51b8152600401610b3591906150af565b5080516002830180546001600160a01b039092166001600160a01b03199092169190911790556020908101518051600384018054929093015161ffff16600160801b026001600160901b031990921660809190911c1717905542600490910155565b600c54421015806130cf5750805b60405180606001604052806035815260200161565960359139906131065760405162461bcd60e51b8152600401610b3591906150af565b50612aa583836131166008612c1b565b9190613e6c565b600560008581526020019081526020016000206000015460001460405180606001604052806029815260200161573c602991399061316e5760405162461bcd60e51b8152600401610b3591906150af565b5061317a838383613e87565b6129da84848484613ec8565b60008051602061549c833981519152805461319f6113fd565b8111156040518060400160405280601f81526020016000805160206154bc833981519152815250906131e45760405162461bcd60e51b8152600401610b3591906150af565b506131ed61201c565b60405180606001604052806038815260200161544160389139906132245760405162461bcd60e51b8152600401610b3591906150af565b50600080835560018301556132398382614067565b826001600160a01b03167fa578b4c05763eb039caef37b2d7b949c22914c3838384c9c73cefb78c4a8ed0a82604051611b9c91815260200190565b826001016000838152602001908152602001600020546000146040518060600160405280602a8152602001615374602a9139906132c45760405162461bcd60e51b8152600401610b3591906150af565b50600082815260018401602052604081208290558354829185916132e9908490615121565b9091555050505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061337a57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661336e6000805160206155cf833981519152546001600160a01b031690565b6001600160a01b031614155b156110325760405163703e46dd60e11b815260040160405180910390fd5b6004546001600160a01b03166133ac612909565b6001600160a01b031614806133e357506133c66008612c1b565b546001600160a01b03166133d8612909565b6001600160a01b0316145b6040518060600160405280602f815260200161589e602f91399061341a5760405162461bcd60e51b8152600401610b3591906150af565b506001546040516316da1fb760e11b81526001600160a01b03838116600483015290911690632db43f6e90602401602060405180830381865afa158015613465573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613489919061514d565b6040518060600160405280602981526020016158cd60299139906115d75760405162461bcd60e51b8152600401610b3591906150af565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561351a575060408051601f3d908101601f19168201909252613517918101906150df565b60015b61354257604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610b35565b6000805160206155cf833981519152811461357357604051632a87526960e21b815260048101829052602401610b35565b612aa583836140a0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110325760405163703e46dd60e11b815260040160405180910390fd5b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1028054606091600080516020615541833981519152916136059061516a565b80601f01602080910402602001604051908101604052809291908181526020018280546136319061516a565b801561367e5780601f106136535761010080835404028352916020019161367e565b820191906000526020600020905b81548152906001019060200180831161366157829003601f168201915b505050505091505090565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1038054606091600080516020615541833981519152916136059061516a565b6110326140f6565b6136d86140f6565b6115d7828261413f565b6136ea614a94565b600082116040518060600160405280602e815260200161584b602e9139906137255760405162461bcd60e51b8152600401610b3591906150af565b50506040805160a0810182529485528051808201825293845260006020858101829052808701959095528151808301835293845283850152848101929092528151928301909152600182526060830191909152608082015290565b600e8201541515156040518060600160405280602f81526020016152e7602f9139906137bf5760405162461bcd60e51b8152600401610b3591906150af565b508051600783015560208082015180516008850155810151600984015560408201518051600a8501550151600b830155606081015151600c83015560800151600d82015542600e90910155565b600e830154421015613870578151600784015560208083015180516008860155810151600985015560408301518051600a8601550151600b840155606082015151600c8401556080820151600d8401556138668142615121565b600e840155505050565b600783018054845560088401805460018601556009850180546002870155600a860180546003880155600b870180546004890155600c8801805460058a0155600d8901805460068b01558851909655602080890151805190965594850151909355604087015180519092559201519091556060840151519055608083015190556138668142615121565b6000805160206154dc8339815191526000613913610acf565b825460408051808201909152601b8152600080516020615421833981519152602082015291925090856139595760405162461bcd60e51b8152600401610b3591906150af565b5060408051808201909152601d81527f353430327c446562743a206e6f2066756e647320617661696c61626c650000006020820152826139ac5760405162461bcd60e51b8152600401610b3591906150af565b508085111560405180606001604052806025815260200161556160259139906139e85760405162461bcd60e51b8152600401610b3591906150af565b5060006139f58387612a6b565b845481900385559050613a088582614151565b83546040805183815260208101929092527f75aec94f6ad949cfd9728eb818639f1b0b882089b480409ab73245c06469eef4910160405180910390a1505050505050565b6000613a588254151590565b6040518060400160405280601d81526020017f353534317c54696d6572733a2074696d6572206e6f742061637469766500000081525090613aac5760405162461bcd60e51b8152600401610b3591906150af565b505054421190565b6000805160206154dc833981519152805460408051808201909152601b8152600080516020615421833981519152602082015283613b055760405162461bcd60e51b8152600401610b3591906150af565b50808311156040518060600160405280602581526020016155616025913990613b415760405162461bcd60e51b8152600401610b3591906150af565b5081548390038083556040805185815260208101929092527fb940258db5193d85cafbc591d0c29fad88d804ff8b9ab71c8f9545af2bb2c07c9101612e6c565b60008360010160008481526020019081526020016000205490506000811160405180606001604052806025815260200161551c6025913990613bd65760405162461bcd60e51b8152600401610b3591906150af565b508082146040518060600160405280602581526020016158796025913990613c115760405162461bcd60e51b8152600401610b3591906150af565b5083600001548111156040518060600160405280602a8152602001615712602a913990613c515760405162461bcd60e51b8152600401610b3591906150af565b50835403835550600090815260019091016020526040812055565b613c76848361415b565b156129da57613c886001850184614199565b806129da576129da6003850184614199565b805460018201546000919080821015613cb4576000612901565b900392915050565b613cc881600501613a4c565b156110c857600060028201556000600482015560068101546110c8906005830190613e09565b6115d760018301826141e8565b6115d760038301826141e8565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612aa5908490614205565b60006040518060600160405280602281526020016156b56022913980516020918201208351604051613d959301918252602082015260400190565b604051602081830303815290604052805190602001209050919050565b60006129f9613dbf614268565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080613def8686614272565b925092509250613dff82826142bf565b5090949350505050565b60408051808201909152601781527f353534307c54696d6572733a207a65726f2064656c6179000000000000000000602082015281613e5b5760405162461bcd60e51b8152600401610b3591906150af565b50613e668142615121565b90915550565b8254612aa59060018501906001600160a01b03168484614378565b601b5442101580613e955750815b15613eb057612aa58382613ea9600d6129e0565b9190614500565b613ebc600d8483614500565b612aa560148483614500565b613ed18361295b565b60008215613f3c576000613ee5600161284d565b9050848110613ef657849150613f36565b809150857f83067e3478aa8b638f7e34eeecb23875cc3671e615445e892cc22dcd4c8b8df3828703604051613f2d91815260200190565b60405180910390a25b50613f8e565b613f44610acf565b8411156040518060400160405280601f81526020016000805160206154bc83398151915281525090613f895760405162461bcd60e51b8152600401610b3591906150af565b508390505b60408051808201909152601f81527f353331337c4163636f756e743a206e6f2066756e647320746f20626c6f636b00602082015281613fe05760405162461bcd60e51b8152600401610b3591906150af565b50604080516060810182528281526001600160801b03428116602080840191825286151584860190815260008b815260059092529481209351845590516001909301805494511515600160801b026001600160881b03199095169390921692909217929092179091556007805483929061405b908490615121565b90915550505050505050565b806006541015614078576000614086565b80600654614086919061510e565b6006556000546115d7906001600160a01b03168383613d08565b6140a982614562565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156140ee57612aa582826145c7565b6115d761463d565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661103257604051631afcd79f60e31b815260040160405180910390fd5b6141476140f6565b6115d7828261465c565b6115d78282612b0b565b60006005830161416a81613a4c565b156141795760009150506129f9565b6006840154815460009161418c9161510e565b84101592506129f9915050565b80826001015410156040518060600160405280602e8152602001615798602e9139906141d85760405162461bcd60e51b8152600401610b3591906150af565b5060019091018054919091039055565b808260010160008282546141fc9190615121565b90915550505050565b600061421a6001600160a01b038416836146bd565b9050805160001415801561423f57508080602001905181019061423d919061514d565b155b15612aa557604051635274afe760e01b81526001600160a01b0384166004820152602401610b35565b6000610adb6146cb565b600080600083516041036142ac5760208401516040850151606086015160001a61429e8882858561473f565b9550955095505050506142b8565b50508151600091506002905b9250925092565b60008260038111156142d3576142d36151a4565b036142dc575050565b60018260038111156142f0576142f06151a4565b0361430e5760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115614322576143226151a4565b036143435760405163fce698f760e01b815260048101829052602401610b35565b6003826003811115614357576143576151a4565b036115d7576040516335e2f38360e21b815260048101829052602401610b35565b83546040805160608101909152602980825261ffff600160801b90930483169284168311919061539e6020830139906143c45760405162461bcd60e51b8152600401610b3591906150af565b5082825b8261ffff168161ffff161015614482576040516bffffffffffffffffffffffff19606088901b1660208201526001600160f01b031960f083901b1660348201526001600160801b03198316603682015260029060460160408051601f1981840301815290829052614438916151ba565b602060405180830381855afa158015614455573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061447891906150df565b91506001016143c8565b5085546040805160608101909152602180825260809290921b6001600160801b031990811690841614916155ae6020830139906144d25760405162461bcd60e51b8152600401610b3591906150af565b5050845461ffff909216600160801b026001600160901b031990921660809390931c92909217179092555050565b82600001548211156040518060600160405280603b815260200161561e603b91399061453f5760405162461bcd60e51b8152600401610b3591906150af565b5061454983613cbc565b614553838361480e565b80612aa557612aa5838361485d565b806001600160a01b03163b60000361459857604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610b35565b6000805160206155cf83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516145e491906151ba565b600060405180830381855af49150503d806000811461461f576040519150601f19603f3d011682016040523d82523d6000602084013e614624565b606091505b50915091506146348583836148af565b95945050505050565b34156110325760405163b398979f60e01b815260040160405180910390fd5b6146646140f6565b6000805160206155418339815191527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10261469e8482615226565b50600381016146ad8382615226565b5060008082556001909101555050565b6060612a7c8383600061490b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6146f66149a8565b6146fe614a12565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561477a5750600091506003905082614804565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156147ce573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166147fa57506000925060019150829050614804565b9250600091508190505b9450945094915050565b61481b6001830182614a56565b60405180606001604052806028815260200161558660289139906148525760405162461bcd60e51b8152600401610b3591906150af565b506115d78282613cee565b61486a6003830182614a56565b6040518060600160405280602f81526020016155ef602f9139906148a15760405162461bcd60e51b8152600401610b3591906150af565b506115d760038301826141e8565b6060826148c4576148bf82614a6b565b612a7c565b81511580156148db57506001600160a01b0384163b155b1561490457604051639996b31560e01b81526001600160a01b0385166004820152602401610b35565b5092915050565b6060814710156149305760405163cd78605960e01b8152306004820152602401610b35565b600080856001600160a01b0316848660405161494c91906151ba565b60006040518083038185875af1925050503d8060008114614989576040519150601f19603f3d011682016040523d82523d6000602084013e61498e565b606091505b509150915061499e8683836148af565b9695505050505050565b6000600080516020615541833981519152816149c26135c6565b8051909150156149da57805160209091012092915050565b815480156149e9579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600060008051602061554183398151915281614a2c613689565b805190915015614a4457805160209091012092915050565b600182015480156149e9579392505050565b6000614a6183613c9a565b9091111592915050565b805115614a7b5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a0016040528060008152602001614ac3604051806040016040528060008152602001600081525090565b8152602001614ae5604051806040016040528060008152602001600081525090565b8152602001614b006040518060200160405280600081525090565b8152602001600081525090565b60008060408385031215614b2057600080fd5b50508035926020909101359150565b6001600160a01b03811681146110c857600080fd5b60008083601f840112614b5657600080fd5b50813567ffffffffffffffff811115614b6e57600080fd5b602083019150836020828501011115614b8657600080fd5b9250929050565b600080600060408486031215614ba257600080fd5b8335614bad81614b2f565b9250602084013567ffffffffffffffff811115614bc957600080fd5b614bd586828701614b44565b9497909650939450505050565b600060208284031215614bf457600080fd5b5035919050565b80356001600160801b031981168114614c1357600080fd5b919050565b803561ffff81168114614c1357600080fd5b600080600080600060808688031215614c4257600080fd5b8535614c4d81614b2f565b9450614c5b60208701614bfb565b9350614c6960408701614c18565b9250606086013567ffffffffffffffff811115614c8557600080fd5b614c9188828901614b44565b969995985093965092949392505050565b80151581146110c857600080fd5b600080600080600060a08688031215614cc857600080fd5b8535945060208601359350614cdf60408701614bfb565b9250614ced60608701614c18565b91506080860135614cfd81614ca2565b809150509295509295909350565b600060208284031215614d1d57600080fd5b8135612a7c81614b2f565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215614d5157600080fd5b8235614d5c81614b2f565b9150602083013567ffffffffffffffff80821115614d7957600080fd5b818501915085601f830112614d8d57600080fd5b813581811115614d9f57614d9f614d28565b604051601f8201601f19908116603f01168101908382118183101715614dc757614dc7614d28565b81604052828152886020848701011115614de057600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600080600060608486031215614e1757600080fd5b83359250602084013591506040840135614e3081614ca2565b809150509250925092565b60005b83811015614e56578181015183820152602001614e3e565b50506000910152565b60008151808452614e77816020860160208601614e3b565b601f01601f19169290920160200192915050565b60ff60f81b881681526000602060e06020840152614eac60e084018a614e5f565b8381036040850152614ebe818a614e5f565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b81811015614f1257835183529284019291840191600101614ef6565b50909c9b505050505050505050505050565b8051825260208082015180518285015290810151604084015250604081015180516060840152602081015160808401525060608101515160a08301526080015160c090910152565b6101e08101614f7b8286614f24565b614f8860e0830185614f24565b826101c0830152949350505050565b60008060008060008060c08789031215614fb057600080fd5b8635614fbb81614b2f565b95506020870135614fcb81614b2f565b95989597505050506040840135936060810135936080820135935060a0909101359150565b6000806040838503121561500357600080fd5b61500c83614bfb565b915061501a60208401614c18565b90509250929050565b6000806000806080858703121561503957600080fd5b5050823594602084013594506040840135936060013592509050565b80516001600160a01b0316825260209081015180516001600160801b03191682840152015161ffff16604090910152565b60e081016150948286615055565b6150a16060830185615055565b8260c0830152949350505050565b602081526000612a7c6020830184614e5f565b6000602082840312156150d457600080fd5b8151612a7c81614b2f565b6000602082840312156150f157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156129f9576129f96150f8565b808201808211156129f9576129f96150f8565b600060018201615146576151466150f8565b5060010190565b60006020828403121561515f57600080fd5b8151612a7c81614ca2565b600181811c9082168061517e57607f821691505b60208210810361519e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fd5b600082516151cc818460208701614e3b565b9190910192915050565b601f821115612aa5576000816000526020600020601f850160051c810160208610156151ff5750805b601f850160051c820191505b8181101561521e5782815560010161520b565b505050505050565b815167ffffffffffffffff81111561524057615240614d28565b6152548161524e845461516a565b846151d6565b602080601f83116001811461528957600084156152715750858301515b600019600386901b1c1916600185901b17855561521e565b600085815260208120601f198616915b828110156152b857888601518255948401946001909101908401615299565b50858210156152d65787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe353530307c44656c6179656453657474696e67733a2076616c756520616c726561647920696e697469616c697a6564353330327c4163636f756e743a206f6e6c792070726f636573736f722063616e2063616c6c20746869732066756e6374696f6e353334307c4163636f756e743a20736574746c656d656e7420706572696f64206973206e6f74206f766572353432307c526566756e64733a20726566756e64207265636f726420616c726561647920657869737473353531307c4f6e6554696d6550617373776f72643a20696e76616c6964204f545020636f756e746572353335307c4163636f756e743a20726573756c74696e672076657269666965642062616c616e636520657863656564732061637475616c353335317c4163636f756e743a2070726f636573736f7220616c726561647920736574353130307c436f6d6d6f6e3a20616d6f756e74206973207a65726f0000000000353431307c44656c617965645769746864726177616c733a207769746864726177616c2074696d656c6f636b206e6f742065787072696564353332307c4163636f756e743a207472616e73616374696f6e206e6f7420666f756e6476d8021c4b979e99674b80f4e0cc10154af0e5f32df05eb51b29a464e2435500353130317c436f6d6d6f6e3a20696e73756666696369656e742066756e6473003486e95df892f06bd37fd38c44e2fee4c4efb6660a66e6eb20ed6d8a167eae0076d8021c4b979e99674b80f4e0cc10154af0e5f32df05eb51b29a464e2435501353432317c526566756e64733a20726566756e64207265636f7264206e6f7420666f756e64a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100353430337c446562743a20616d6f756e7420697320686967686572207468616e2064656274353532317c4163636f756e744c696d6974733a207370656e64206c696d6974206578636565646564353531317c4f6e6554696d6550617373776f72643a20696e76616c6964204f5450360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc353532337c4163636f756e744c696d6974733a206e6f206f7470207370656e64206c696d6974206578636565646564353532307c4163636f756e744c696d6974733a20616d6f756e7420657863656564732073696e676c65207472616e73616374696f6e206c696d6974353331327c4163636f756e743a2063617264206f72204f5450207374617465206368616e676520697320696e2070726f6772657373353530317c44656c6179656453657474696e67733a2076616c756520616c7265616479207365744f776e657273686970416363657074616e63652875696e74323536206e6f6e636529353332317c4163636f756e743a206e657720616d6f756e7420697320657175616c206f7220686967686572207468616e20617574686f72697a6564353432337c526566756e64733a2070656e64696e6720616d6f756e74206578636565647320746f74616c353331307c4163636f756e743a207472616e73616374696f6e20494420616c72656164792075736564353333307c4163636f756e743a2076657269666965642062616c616e6365206e6f7420657175616c20746f2062616c616e6365353533317c5370656e644c696d6974733a20696e73756666696369656e74207370656e7420746f2063616e63656c353335327c4163636f756e743a20636172642077697468206f7470207374617465206e6f7420696e697469616c697a6564353535307c4f776e657273686970416363657074616e63653a20696e76616c6964207369676e6174757265353330347c4163636f756e743a20696e73756666696369656e7420626c6f636b656420616d6f756e74353532347c4163636f756e744c696d6974733a207370656e64206c696d697420706572696f64206973207a65726f353432327c526566756e64733a20696e76616c696420616d6f756e74207265636569766564353330317c4163636f756e743a206f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f6e353337307c4163636f756e743a20756e617574686f72697a656420696d706c656d656e746174696f6ea26469706673582212201bf402f34a1057d0d739b2911423245677cc744b072d4af8e7f665bc51781a7f64736f6c63430008160033"; +public class TangemPaymentAccount extends Contract { + public static final String BINARY = "60c06040523462000050576200001e62000018620000f3565b62000116565b604051616e73620002b28239608051818181610fea0152612efb015260a0518181816149490152614b830152616e7390f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176200008d57604052565b62000055565b90620000aa620000a260405190565b92836200006b565b565b6001600160a01b031690565b90565b6001600160a01b038116036200005057565b90505190620000aa82620000bb565b906020828203126200005057620000b891620000cd565b620000b862007125803803806200010a8162000093565b928339810190620000dc565b620001219062000157565b620000aa620001fa565b620000b890620000ac906001600160a01b031682565b620000b8906200012b565b620000b89062000141565b60805262000168620000aa80808080565b62000173306200014c565b60a052565b620000b89060401c60ff1690565b620000b8905462000178565b620000b8905b6001600160401b031690565b620000b8905462000192565b620000b89062000198906001600160401b031682565b90620001da620000b8620001f692620001b0565b82546001600160401b0319166001600160401b03919091161790565b9055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00620002268162000186565b6200029f576200023681620001a4565b6001600160401b03919082908116036200024e575050565b81620002807fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2936200029a93620001c6565b604051918291826001600160401b03909116815260200190565b0390a1565b60405163f92ee8a960e01b8152600490fdfe6080604052600436101561001257600080fd5b60003560e01c806274f3561461037c57806301e948ff1461029657806312a168311461037757806316fc32971461037257806319cdeb6f1461036d5780631d6ae778146103685780631f852f4b14610363578063226112801461035e578063246f8b96146103595780632ea63823146103545780633013ce291461034f57806334d6ee4a1461034a578063357a03331461034557806335ba9af81461034057806337a1d4151461033b5780633e0fc2ff1461033657806340345137146103315780634e6d8a731461032c5780634f1ef2861461032757806352d1902d14610322578063563b9b0f1461031d578063572b6c05146103185780636b2a3830146103135780636b4943a71461030e5780636fb7e9c11461030957806370908f21146103045780637917cf6f146102ff5780637b103999146102fa5780637da0a877146102f557806384b0196e146102f057806386f15d09146102eb5780638da5cb5b146102e65780638ef008b8146102e1578063997584a4146102dc5780639cadd226146102d7578063aa37ff1b146102d2578063ad3cb1cc146102cd578063b9603bdf146102c8578063bc77d495146102c3578063be69191d146102be578063c45a0155146102b9578063c470d703146102b4578063c9a557fa146102af578063ce1b1d43146102aa578063d47ae89c146102a5578063dbed8faa146102a0578063dcab7e501461029b578063df7727b414610296578063e2b7202514610291578063e37b81541461028c578063e6e268f414610287578063e96ede8e14610282578063eec4f8121461027d578063f2bcd022146102785763f93184c10361038c57611620565b611605565b6115ed565b6115d4565b6115b9565b611588565b611496565b6103c7565b61147b565b611463565b611448565b61142d565b611406565b6113eb565b6113d0565b6113a9565b611390565b611378565b611351565b6112e3565b6112c4565b611247565b61120c565b611191565b61116a565b611136565b610fd5565b610fba565b610f93565b610f56565b610bb9565b610b17565b610af3565b610ac6565b610a93565b610a11565b6109fd565b61093d565b6108f5565b610879565b610861565b610846565b61082d565b6107e3565b610748565b6106c6565b6105e1565b6105c9565b6105b0565b61052c565b6104c0565b610486565b610441565b610397565b600091031261038c57565b600080fd5b9052565b565b3461038c576103a7366004610381565b6103c36103b261163c565b6040515b9182918290815260200190565b0390f35b3461038c576103d7366004610381565b6103c36103b2611655565b6001600160a01b031690565b90565b6001600160a01b0381165b0361038c57565b90503590610395826103f1565b9081604091031261038c5790565b919060608382031261038c576103ee90602061043a8286610403565b9401610410565b3461038c5761045a61045436600461041e565b90611869565b604051005b806103fc565b905035906103958261045f565b9060208282031261038c576103ee91610465565b3461038c5761045a610499366004610472565b611938565b6103ee916008021c81565b906103ee915461049e565b6103ee600060076104a9565b3461038c576104d0366004610381565b6103c36103b26104b4565b8015156103fc565b90503590610395826104db565b60808183031261038c576105048282610403565b926103ee6105158460208501610465565b9360606105258260408701610465565b94016104e3565b3461038c5761045a61053f3660046104f0565b92919091611a30565b909182601f8301121561038c578135916001600160401b03831161038c57602001926001830284011161038c57565b91909160408184031261038c5761058e8382610403565b9260208201356001600160401b03811161038c576105ac9201610548565b9091565b3461038c5761045a6105c3366004610577565b91611c61565b3461038c576105d9366004610381565b61045a611c82565b3461038c576105f1366004610381565b61045a611cda565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b0382111761063057604052565b6105f9565b9061039561064260405190565b928361060f565b919060808382031261038c5761069c9060606106656080610635565b946106708382610465565b865261067f8360208301610465565b60208701526106918360408301610465565b604087015201610465565b6060830152565b919060a08382031261038c576103ee9060206106bf8286610403565b9401610649565b3461038c5761045a6106d93660046106a3565b90611d9b565b6103ee916008021c6001600160a01b031690565b906103ee91546106df565b6103ee6000806106f3565b6103ee906103e2906001600160a01b031682565b6103ee90610709565b6103ee9061071d565b61039190610726565b602081019291610395919061072f565b3461038c57610758366004610381565b6103c36107636106fe565b60405191829182610738565b0190565b9061079361078c610782845190565b8084529260200190565b9260200190565b9060005b8181106107a45750505090565b9091926107ca6107c360019286516001600160a01b0316815260200190565b9460200190565b929101610797565b60208082526103ee92910190610773565b3461038c576107f3366004610381565b6103c36107fe611da5565b604051918291826107d2565b919060408382031261038c576103ee9060206108268286610403565b9401610465565b3461038c5761045a61084036600461080a565b90611dd1565b3461038c57610856366004610381565b6103c36103b2611e24565b3461038c57610871366004610381565b61045a611fd5565b3461038c5761045a61088c36600461080a565b906122fe565b908160e091031261038c5790565b90916101808284031261038c576108b78383610403565b926108c58160208501610403565b926108d38260408301610403565b926103ee6108e48460608501610403565b936101606108268260808701610892565b3461038c5761045a6109083660046108a0565b9493909392919261286e565b909160608284031261038c576103ee61092d8484610403565b9360406108268260208701610465565b3461038c5761045a610950366004610914565b91612c73565b6001600160401b03811161063057602090601f01601f19160190565b90826000939282370152565b9092919261099361098e82610956565b610635565b938185528183011161038c57610395916020850190610972565b9080601f8301121561038c578160206103ee9335910161097e565b91909160408184031261038c576109df8382610403565b9260208201356001600160401b03811161038c576103ee92016109ad565b61045a610a0b3660046109c8565b90612c9e565b3461038c57610a21366004610381565b6103c36103b2612ceb565b91906101408382031261038c57610a438184610403565b92610a518260208301610892565b926101008201356001600160401b03811161038c5783610a72918401610548565b9290936101208201356001600160401b03811161038c576105ac9201610548565b3461038c5761045a610aa6366004610a2c565b94939093929192612ee5565b9060208282031261038c576103ee91610403565b3461038c576103c3610ae1610adc366004610ab2565b612ef3565b60405191829182901515815260200190565b3461038c5761045a610b06366004610472565b613063565b6103ee600060086104a9565b3461038c57610b27366004610381565b6103c36103b2610b0b565b6001600160801b031981166103fc565b9050359061039582610b32565b61ffff81166103fc565b9050359061039582610b4f565b909160c08284031261038c57610b7c8383610403565b92610b8a8160208501610465565b92610b988260408301610465565b926103ee610ba98460608501610b42565b9360a06105258260808701610b59565b3461038c5761045a610bcc366004610b66565b94939093929192613103565b90610be290610726565b600052602052604060002090565b6103ee905b60ff1690565b6103ee9054610bf0565b6103ee9060081c610bf5565b6103ee9054610c05565b6103ee9060101c5b6001600160401b031690565b6103ee9054610c1b565b6103ee9060801c5b61ffff1690565b6103ee9054610c39565b6103ee6040610635565b90610395610c946000610c6d610c52565b94610c8e610c7e8383015460801b90565b6001600160801b03191687840152565b01610c48565b61ffff166020840152565b6103ee9081565b6103ee9054610c9f565b6103ee6060610635565b90610395610cf86002610ccb610cb0565b94610cdc610cd882610c5c565b8752565b610cf2610ceb60018301610c5c565b6020880152565b01610ca6565b6040840152565b90610395610d1d6001610d10610c52565b94610cf2610cd882610ca6565b6020840152565b6103ee6020610635565b90610395610d466000610d3f610d24565b9401610ca6565b8352565b6103ee60a0610635565b90610395610dad6006610d65610d4a565b94610d72610cd882610ca6565b610d81610ceb60018301610cff565b610d97610d9060038301610cff565b6040880152565b610cf2610da660058301610d2e565b6060880152565b6080840152565b90610395610cf8600e610dc5610cb0565b94610dd2610cd882610d54565b610cf2610ceb60078301610d54565b610dec906005610bd8565b610df581610bfb565b91610dff82610c11565b91610e0981610c2f565b916103ee6004610e1b60018501610cba565b9301610db4565b805180516001600160801b031916835260209081015161ffff16908301526103959190608090604090610e7460208201518386019080516001600160801b031916825260209081015161ffff16910152565b0151910152565b8051825261039591906020908190610e74565b516103959152565b80518252610395919060c090608090610eb760208201516020860190610e7b565b610ec960408201516060860190610e7b565b610e74606082015160a0860190610e8e565b906101c0604061039593610ef760008201516000860190610e96565b610e74602082015160e0860190610e96565b90151581526102e08101959461039594909361010093610f4f9291610f4591610f359015156020870152565b6001600160401b03166040850152565b6060830190610e22565b0190610edb565b3461038c576103c3610f71610f6c366004610ab2565b610de1565b91610f7e95939560405190565b95869586610f09565b6103ee600060096104a9565b3461038c57610fa3366004610381565b6103c36103b2610f87565b6103ee600060026106f3565b3461038c57610fca366004610381565b6103c3610763610fae565b3461038c57610fe5366004610381565b6103c37f00000000000000000000000000000000000000000000000000000000000000005b6040515b918291826001600160a01b03909116815260200190565b60005b8381106110385750506000910152565b8181015183820152602001611028565b61106961107260209361076f9361105d815190565b80835293849260200190565b95869101611025565b601f01601f191690565b9061108b61078c610782845190565b9060005b81811061109c5750505090565b9091926110b26107c36001928651815260200190565b92910161108f565b9395919461111261110a611129956110fc611122956103ee9c9a6110ef60e08c019260008d01906001600160f81b0319169052565b8a820360208c0152611048565b9088820360408a0152611048565b976060870152565b6001600160a01b03166080850152565b60a0830152565b60c081840391015261107c565b3461038c57611146366004610381565b6103c36111516131a1565b9361116197959793919360405190565b978897886110ba565b3461038c5761117a366004610381565b6103c3610ae161323f565b6103ee600060046106f3565b3461038c576111a1366004610381565b6103c361100a611185565b9160a08383031261038c576111c18284610403565b926111cf8360208301610465565b926111dd8160408401610465565b9260608301356001600160401b03811161038c57826112036080946103ee938701610548565b949095016104e3565b3461038c5761045a61121f3660046111ac565b9493909392919261330a565b919060408382031261038c576103ee9060206105258286610403565b3461038c5761045a61125a36600461122b565b906134ab565b919060808382031261038c576112768184610403565b9261128482602083016104e3565b9260408201356001600160401b03811161038c57836112a4918401610548565b92909360608201356001600160401b03811161038c576105ac9201610548565b3461038c5761045a6112d7366004611260565b949390939291926135ea565b3461038c5761045a6112f6366004610ab2565b6136c8565b9061130861098e83610956565b918252565b61131760056112fb565b640352e302e360dc1b602082015290565b6103ee61130d565b6103ee611328565b6103ee611330565b60208082526103ee92910190611048565b3461038c57611361366004610381565b6103c361136c611338565b60405191829182611340565b3461038c5761045a61138b366004610472565b613745565b3461038c5761045a6113a336600461080a565b906138cf565b3461038c576113b9366004610381565b6103c3610ae16138d9565b6103ee600060016106f3565b3461038c576113e0366004610381565b6103c36107636113c4565b3461038c576113fb366004610381565b6103c36103b2613902565b3461038c57611416366004610381565b6103c36103b261392d565b6103ee600060036106f3565b3461038c5761143d366004610381565b6103c3610763611421565b3461038c57611458366004610381565b6103c36103b2613963565b3461038c5761045a611476366004610472565b6139e1565b3461038c5761148b366004610381565b6103c36103b26139ea565b3461038c576114a6366004610381565b6103c36103b2613a13565b6103ee6103ee6103ee9290565b90610be2906114b1565b6103ee906103e2565b6103ee90546114c8565b6103ee9060a01c610c23565b6103ee90546114db565b6103ee9060e01c610bf5565b6103ee90546114f1565b6115129060066114be565b9061151c82610ca6565b91611529600182016114d1565b916103ee600161153a8185016114e7565b93016114fd565b61158061039594611570606094989795611560608086019a6000870152565b6001600160a01b03166020850152565b6001600160401b03166040830152565b019015159052565b3461038c576103c36115a361159e366004610472565b611507565b906115b094929460405190565b94859485611541565b3461038c576115c9366004610381565b6103c36103b2613a3e565b3461038c5761045a6115e7366004610914565b91613c48565b3461038c5761045a611600366004610472565b613c92565b3461038c57611615366004610381565b6103c361100a613c9b565b3461038c576103c36103b261163636600461080a565b90613d3b565b6103ee6000600080516020616dfe833981519152610cf2565b6103ee6000613d47565b611669602f6112fb565b7f353330317c4163636f756e743a206f6e6c79206f776e65722063616e2063616c60208201526e36103a3434b990333ab731ba34b7b760891b604082015290565b6103ee61165f565b6103ee6116aa565b156116c25750565b6116e4906116cf60405190565b62461bcd60e51b815291829160048301611340565b0390fd5b90610395916117276116f8613de3565b6117056103e260046114d1565b6001600160a01b0382161490811561172c575b506117216116b2565b906116ba565b611803565b61174491506103ee61173f916005610bd8565b613e1c565b38611718565b919060408382031261038c576117799060206117666040610635565b946117718382610b42565b865201610b59565b6020830152565b6103ee90369061174a565b506103ee906020810190610b42565b506103ee906020810190610b59565b9060206117da610395936117d16117c3600083018361178b565b6001600160801b0319168552565b8281019061179a565b61ffff16910152565b6001600160a01b03909116815260608101929161039591602001906117a9565b907fec402263d6c2da14e65d81be89696eecf02dad51b4edf01a00f7f001fdae65839161184f6118376103ee836005610bd8565b61183f613963565b9061184985611780565b90613e88565b61186461185b60405190565b928392836117e3565b0390a1565b90610395916116e8565b610395906118826116f8613de3565b6118b4565b90505190610395826103f1565b9060208282031261038c576103ee91611887565b6040513d6000823e3d90fd5b6118c66118c160036114d1565b610726565b9060206118d260405190565b63659bf9d960e11b815292839060049082905afa908115611933576118ff92600092611902575b50613f43565b50565b61192591925060203d60201161192c575b61191d818361060f565b810190611894565b90386118f9565b503d611913565b6118a8565b61039590611873565b61194b60336112fb565b7f353330327c4163636f756e743a206f6e6c792070726f636573736f722063616e6020820152721031b0b636103a3434b990333ab731ba34b7b760691b604082015290565b6103ee611941565b6103ee611990565b906103959392916119db6119b2613de3565b6119d26119c56103e26118c160036114d1565b916001600160a01b031690565b14611721611998565b9192611a21611a1b7f6f9b3fed74d79ecbab600aa9408ec793100801e0e811317a78db1cd7f56c589893611a166000611a2b9589848a614050565b6114b1565b93610726565b936103b660405190565b0390a3565b906103959392916119a0565b906103959291611a4d6116f8613de3565b611ac2565b6103e26103ee6103ee9290565b6103ee90611a52565b906001600160a01b03905b9181191691161790565b90611a8d6103ee611a9492610726565b8254611a68565b9055565b6001600160a01b039091168152604081019291610395916020905b01906001600160a01b03169052565b91611ad691611ad084614135565b836141c4565b611ae060046114d1565b600090611aef6103e283611a5f565b6001600160a01b03821603611bb75750611b0a826004611a7d565b611b176118c160026114d1565b91823b1561038c5781611b2960405190565b630d00929760e01b81526001600160a01b0383166004820152938490602490829084905af1918215611933577f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe29361186493611b8a575b505060405161100e565b81611ba992903d10611bb0575b611ba1818361060f565b810190610381565b3880611b80565b503d611b97565b91611bc3816004611a7d565b611bd06118c160026114d1565b803b1561038c57818391611c079583611be860405190565b809881958294611bfc63f00d4b5d60e01b90565b845260048401611a98565b03925af1918215611933577f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe29361186493611c44575b505061100a565b81611c5a92903d10611bb057611ba1818361060f565b3880611c3d565b906103959291611a3c565b611c776116f8613de3565b610395610395614254565b610395611c6c565b611c956116f8613de3565b6103957f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da611864611cc660046114d1565b61100a611cd36000611a5f565b6004611a7d565b610395611c8a565b9061039591611cf26116f8613de3565b611d43565b8051825261039591906060908190611d1460208201516020860152565b610e7460408201516040860152565b6001600160a01b03909116815260a0810192916103959160200190611cf7565b907f92daafee7b0d3ce63f680acb8054b3dc8e73ffb341502efa1b45a15b1687752991611d86611d776103ee836005610bd8565b83611d80613963565b916142de565b611864611d9260405190565b92839283611d23565b9061039591611ce2565b6103ee600a614307565b9061039591611dbf6116f8613de3565b61039591611dcb613963565b91614360565b9061039591611daf565b905051906103958261045f565b9060208282031261038c576103ee91611ddb565b634e487b7160e01b600052601160045260246000fd5b91908203918211611e1f57565b611dfc565b611e706020611e366118c160006114d1565b611e3f30610726565b90611e4960405190565b938492839182916370a0823160e01b5b83526001600160a01b031660048301526024820190565b03915afa90811561193357600091611eb6575b50611e916103ee6008610ca6565b8110611eab576103ee90611ea56008610ca6565b90611e12565b506103ee60006114b1565b611ed8915060203d602011611ede575b611ed0818361060f565b810190611de8565b38611e83565b503d611ec6565b611eef603c6112fb565b7f353330337c4163636f756e743a206f6e6c792070726f636573736f72206f722060208201527f6f776e65722063616e2063616c6c20746869732066756e6374696f6e00000000604082015290565b6103ee611ee5565b6103ee611f3e565b611f8c611f59613de3565b611f696103e26118c160036114d1565b6001600160a01b03821614908115611fad575b8115611f94575b50611721611f46565b610395611fcd565b611fa791506103ee61173f916005610bd8565b38611f83565b9050611fbc6103e260046114d1565b6001600160a01b0382161490611f7c565b61039561445f565b610395611f4e565b9061039591611fed6119b2613de3565b6121f4565b81810292918115918404141715611e1f57565b6103ee6127106114b1565b634e487b7160e01b600052601260045260246000fd5b90612030565b9190565b90811561203b570490565b612010565b61204a60236112fb565b7f353334317c4163636f756e743a207472616e73616374696f6e206e6f7420666f6020820152621d5b9960ea1b604082015290565b6103ee612040565b6103ee61207f565b612099603e6112fb565b7f353338327c4163636f756e743a207472616e73616374696f6e2077617320617560208201527f74686f72697a65642077697468206120646966666572656e7420636172640000604082015290565b6103ee61208f565b6103ee6120e8565b61210260296112fb565b7f353330347c4163636f756e743a20696e73756666696369656e7420626c6f636b602082015268195908185b5bdd5b9d60ba1b604082015290565b6103ee6120f8565b6103ee61213d565b9060001990611a73565b906121676103ee611a94926114b1565b825461214d565b91908201809211611e1f57565b9160001960089290920291821b911b611a73565b91906121a06103ee611a94936114b1565b90835461217b565b6103959160009161218f565b6000906001906121c483826121a8565b0155565b634e487b7160e01b600052600060045260246000fd5b906000036121ef57610395906121b4565b6121c8565b7fec2d267131598e18b6231352c72c82d77f6236d7da371ad09865737055a23180611a2b611a21611a1b6001956122e96122e26122356103ee8460066114be565b6122a661228b61224483610ca6565b9b8c9361228561226e61226061225a6009610ca6565b88611ff2565b612268612005565b90612026565b9561227c61202c60006114b1565b11611721612087565b016114d1565b61229d6001600160a01b038c166119c5565b146117216120f0565b6122c06122b36008610ca6565b8b905b1015611721612145565b6122dc6122d58b6122d16008610ca6565b0390565b6008612157565b8961216e565b87836144e9565b611a1660006122f98360066114be565b6121de565b9061039591611fdd565b6103ee9060401c610bf5565b6103ee9054612308565b6103ee90610c23565b6103ee905461231e565b610c236103ee6103ee9290565b906001600160401b0390611a73565b610c236103ee6103ee926001600160401b031690565b906123736103ee611a949261234d565b825461233e565b9068ff00000000000000009060401b611a73565b9061239e6103ee611a9492151590565b825461237a565b61039190612331565b60208101929161039591906123a5565b9093949291926123eb7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0090565b9586936124076124016123fd87612314565b1590565b95612327565b9560009761241489612331565b6001600160401b038916148061250c575b6001986124416124348b612331565b916001600160401b031690565b1490816124e8575b155b90816124df575b506124cd5761247b95876124728b6124698c612331565b9d019c8d612363565b6124be576126b7565b61248457505050565b6124b2611864927fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29461238e565b604051918291826123ae565b6124c8898c61238e565b6126b7565b60405163f92ee8a960e01b8152600490fd5b15905038612452565b905061244b6124f630610726565b3b61250361202c8d6114b1565b14919050612449565b5086612425565b61251d60146112fb565b7315185b99d95b54185e5b595b9d1058d8dbdd5b9d60621b602082015290565b6103ee612513565b61254f60016112fb565b603160f81b602082015290565b6103ee612545565b919060e08382031261038c576125a490606061257f81610635565b9461258a83826104e3565b8652612599836020830161174a565b602087015201610649565b6040830152565b6103ee903690612564565b6103fc816114c8565b90505190610395826125b6565b9060208282031261038c576103ee916125bf565b506103ee9060208101906104e3565b506103ee906020810190610465565b9060606126536103959361261c61261860008301836125ef565b8552565b61263361262c60208301836125ef565b6020860152565b61264a61264360408301836125ef565b6040860152565b828101906125ef565b910152565b90606061268e6103959361267861267260008301836125e0565b15158552565b6126896020820160208601906117a9565b820190565b9101906125fe565b6001600160a01b039091168152610100810192916103959160200190612658565b90612752612759936118c161274b611cd3946126d287614135565b6126db81614135565b6126e484614135565b6126ed89614135565b6126f5614547565b6126fd614547565b61271661270861253d565b61271061255c565b90614566565b61271e614547565b612726614547565b61272e614547565b612736614547565b6118c16127446118c1613de3565b6001611a7d565b6003611a7d565b6002611a7d565b61277961276a6103ee836005610bd8565b612773846125ab565b9061460c565b61278481600a614696565b506127926118c160036114d1565b92602061279e60405190565b633013ce2960e01b815294859060049082905afa908115611933576127f26127f9927f778238c396424814c7113c41823459473262293bc693b847480fcbc85a6d94bd9660009161283f575b506000611a7d565b6009612157565b7f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe261282761100a60046114d1565b0390a161186461283660405190565b92839283612696565b612861915060203d602011612867575b612859818361060f565b8101906125cc565b386127ea565b503d61284f565b9061039595949392916123be565b90610395929161288d6119b2613de3565b612907565b61289c60206112fb565b7f353338307c4163636f756e743a2063617264206973206e6f7420616374697665602082015290565b6103ee612892565b6103ee6128c5565b9081526040810192916103959160200152565b0152565b9081526060810193926103959290916040916128e890611779565b9190916129186103ee8460066114be565b9161292281614706565b61296f6001840193612933856114d1565b9060009586926129486119c56103e286611a5f565b03612c505750610cf26129676129626103ee886005610bd8565b614720565b6117216128cd565b926129866122606129806009610ca6565b86611ff2565b93600094818411612b2b576129dd916129ad6122d5928698506129a887840390565b61216e565b6129b6856114b1565b8111612b1a575b505b6129d36129cc6008610ca6565b82906122b6565b6122d16008610ca6565b6129ec816122f98760066114be565b6129f96118c160036114d1565b916020612a0560405190565b63659bf9d960e11b815293849060049082905afa938415611933577fabb0c23c76702883b6d5427581380669e510735331d9dc6a0eb99a1312dd5d5a86612a68611a1b612a869a611a1660209b611e369b6118c19b600091612afc575b506148a6565b93612a7e612a7560405190565b928392836128d5565b0390a36114d1565b03915afa8015611933577fc638d270f17f849b0216682c6cf6ee6fd9af6cac195b4647eb3b4857bbc10dc791600091612add575b50612ac56008610ca6565b90611864612ad161163c565b604051938493846128ec565b612af6915060203d602011611ede57611ed0818361060f565b38612aba565b612b1491508e3d60201161192c5761191d818361060f565b38612a62565b612b2590878a6144e9565b386129bd565b948195612b46612b41600461076f896005610bd8565b614741565b90612b52858301610ca6565b848491612b5c8190565b8210612c28575b5050612b6e866114b1565b8111612baf575b5050506129dd916122d59150612b8a87860390565b612b93856114b1565b8111612ba0575b506129bf565b612ba9906147fd565b38612b9a565b6129dd9492985090612bce6122d59492612bc8858a0390565b906147c7565b868482019a83831015612bf9575050612bea90612bf192611e12565b888b6144e9565b918193612b75565b9091838111612c0c575b50505050612bf1565b612c1f93612c1991611e12565b906147d4565b38858180612c03565b612c499250612c41919003612bc88461076f8a88614759565b612bc8611655565b8438612b63565b612c5c612c6e916114d1565b61229d6001600160a01b0388166119c5565b610cf2565b90610395929161287c565b9061039591612c8b61493e565b9061039591612c9981614a86565b614a8f565b9061039591612c7e565b6103ee90612cb4614b6d565b612ce2565b6103ee7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6114b1565b506103ee612cb9565b6103ee6000612ca8565b906103959594939291612d096116f8613de3565b612d89565b356103ee816104db565b90505190610395826104db565b9060208282031261038c576103ee91612d18565b612d4360246112fb565b7f353335337c4163636f756e743a20696e76616c6964206361726420636f6e667260208201526334b6b2b960e11b604082015290565b6103ee612d39565b6103ee612d79565b94612db79194612da8612ddb95602095612da28a614135565b896141c4565b612db186612d0e565b87614baf565b612dc46118c160036114d1565b604051938492839182916399fef6bb60e01b611e59565b03915afa801561193357612dfa91600091612eb6575b50611721612d81565b612e14612e0b6103ee846005610bd8565b612773836125ab565b612e1f82600a614696565b50612e2d6118c160026114d1565b91823b1561038c576000612e4060405190565b631ee284a960e11b81526001600160a01b0383166004820152938490602490829084905af1928315611933577f778238c396424814c7113c41823459473262293bc693b847480fcbc85a6d94bd93612ea0575b5061186461283660405190565b612eb0906000611ba1818361060f565b38612e93565b612ed8915060203d602011612ede575b612ed0818361060f565b810190612d25565b38612df1565b503d612ec6565b906103959594939291612cf5565b612f1f6119c57f00000000000000000000000000000000000000000000000000000000000000006103e2565b1490565b61039590612f326119b2613de3565b612fa0565b612f4160376112fb565b7f353335307c4163636f756e743a20726573756c74696e6720766572696669656460208201527f2062616c616e636520657863656564732061637475616c000000000000000000604082015290565b6103ee612f37565b6103ee612f90565b612fe990612fb2816129a86007610ca6565b906020612fc26118c160006114d1565b612fcb30610726565b90612fd560405190565b958692839182916370a0823160e01b611e59565b03915afa801561193357613027613033917fd6004694c2f543b69302481de26731f63c1d41062795b5366d8ca20fd3e3d6d39560009161304a575090565b835b1115611721612f98565b61303e826007612157565b611864612a7560405190565b6103ee915060203d602011611ede57611ed0818361060f565b61039590612f23565b9061039595949392916130806119b2613de3565b93946130cf6130c9859493611a166001856130c1611a2b978d7f30ac254a4e36e31e8baa2471788b94b8879347196809fce466f5c214c7d71e639c8e614c91565b87848c614050565b95610726565b956130d960405190565b938493849081526001600160801b031991909116602082015261ffff909116604082015260600190565b90610395959493929161306c565b1561311857565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b6001600160401b0381116106305760208091020190565b9061130861098e83613155565b369037565b9061039561319461318e8461316c565b93613155565b601f190160208401613179565b600080516020616e1e8339815191526131da6131bc82610ca6565b916000926131cc61202c856114b1565b14908161321f575b50613111565b6131e2614dd3565b916131eb614dee565b916131f530610726565b9061321061320b613205836114b1565b926114b1565b61317e565b600f60f81b9594934693929190565b61322c9150600101610ca6565b61323861202c846114b1565b14386131d4565b6103ee7f76d8021c4b979e99674b80f4e0cc10154af0e5f32df05eb51b29a464e2435502614e07565b90610395959493929161327c6119b2613de3565b6132b7565b9190611072816132988161076f9560209181520190565b8095610972565b9081526040602082018190526103ee93910191613281565b93946132f76130c97f8b7b934d191c6093eafb9a1fc61ef68d088dc5a0438697fe2ceac68b79574a52959493611a166001611a2b956130c18c8a8d614e89565b9561330160405190565b9384938461329f565b906103959594939291613268565b90610395916133286116f8613de3565b613406565b6103ee6103ee6103ee926001600160401b031690565b61334d60266112fb565b7f353338317c4163636f756e743a20636172642064697361626c6520696e2070726020820152656f677265737360d01b604082015290565b6103ee613343565b6103ee613385565b61339f60216112fb565b7f353335347c4163636f756e743a2069734f776e657220616c72656164792073656020820152601d60fa1b604082015290565b6103ee613395565b6103ee6133d2565b9061ff009060081b611a73565b906133ff6103ee611a9492151590565b82546133e2565b6118649061100a7f6a5e3421b4ba058a580be88d10e1c5940843a54923898f281b2fdf1ae733aef893600061343f6103ee856005610bd8565b61344b61296782614720565b0161347e61345882610c2f565b61347561346f6103ee613469613963565b4261216e565b9161332d565b1161172161338d565b6134a66134976000613491876005610bd8565b01610c11565b151583151514156117216133da565b6133ef565b9061039591613318565b9061039595949392916134c96116f8613de3565b6134ed565b6001600160a01b03909116815260408101929161039591602090611580565b94612db7919461350361350a95602095896141c4565b8587614baf565b03915afa80156119335761352891600091612eb65750611721612d81565b61353f8161353a6103ee856005610bd8565b614f34565b61354a82600a614696565b506135586118c160026114d1565b91823b1561038c57600061356b60405190565b631ee284a960e11b81526001600160a01b0383166004820152938490602490829084905af1928315611933577f1526aa7b69cd2d8a922030e75d5e009a330a1e46b715fd6f0e438df811d8ce8b936135d4575b506118646135cb60405190565b928392836134ce565b6135e4906000611ba1818361060f565b386135be565b9061039595949392916134b5565b610395906136076116f8613de3565b6136266136186103ee836005610bd8565b613620613963565b90614fba565b61363181600a615005565b5061363f6118c160026114d1565b90813b1561038c57600061365260405190565b634149177b60e01b81526001600160a01b0383166004820152928390602490829084905af1908115611933577f6a5e3421b4ba058a580be88d10e1c5940843a54923898f281b2fdf1ae733aef892611864926136b2575b5060405161100e565b6136c2906000611ba1818361060f565b386136a9565b610395906135f8565b610395906136e06119b2613de3565b6136f26020611e366118c160006114d1565b03915afa9182156119335761373a6137347f321b800465e47508430424e6c089344256e17f9a5b0b43c751dffbdfd3930263946118649460009161304a575090565b82613029565b6103b2816007612157565b610395906136d1565b906103959161375e6119b2613de3565b61376b6118c160006114d1565b6370a0823161377930610726565b90602061378560405190565b80946137918460e01b90565b82526001600160a01b038516600483015260249082905afa928315611933576000936138ae575b506137c66118c160036114d1565b91823b1561038c5760006137d960405190565b632cc3264160e01b8152938490600490829084905af19182156119335761382a93602093613898575b50611e596138136118c160006114d1565b9161381d60405190565b9586948593849360e01b90565b03915afa91821561193357611a1b613873611a21927faef62a4e4bd58df7ff5d05f9b40355fadfa67884312a36b7f64c53fd699d4f5695611a2b95600091613879575b50611e12565b956114b1565b613892915060203d602011611ede57611ed0818361060f565b3861386d565b6138a8906000611ba1818361060f565b38613802565b6138c891935060203d602011611ede57611ed0818361060f565b91386137b8565b906103959161374e565b6103ee7f76d8021c4b979e99674b80f4e0cc10154af0e5f32df05eb51b29a464e2435502615068565b6103ee60007f3fc394ec90f88dd7e18c46ffeef55f1b6719a2027f4ae9fbc4ab118271891200610cf2565b6103ee60007f5066de352c02692985a663f298a4534cb506e7947f703135018b6c3e10f82e00610cf2565b6103ee610e106114b1565b6139706118c160036114d1565b602061397b60405190565b63351eba2760e21b815291829060049082905afa8015611933576103ee916000916139aa575b50612bc8613958565b6139c3915060203d602011611ede57611ed0818361060f565b386139a1565b610395906139d86119b2613de3565b61039590615093565b610395906139c9565b6103ee7f76d8021c4b979e99674b80f4e0cc10154af0e5f32df05eb51b29a464e2435502610ca6565b6103ee60007fa715e0242b72e6c41603cf400167fb9f6392ccc61630d77addc87403bc041800610cf2565b6103ee6001600080516020616dde833981519152610cf2565b906103959291613a686119b2613de3565b613b25565b613a7760236112fb565b7f353332307c4163636f756e743a207472616e73616374696f6e206e6f7420666f6020820152621d5b9960ea1b604082015290565b6103ee613a6d565b6103ee613aac565b613ac6603b6112fb565b7f353332317c4163636f756e743a206e657720616d6f756e74206973206571756160208201527f6c206f7220686967686572207468616e20617574686f72697a65640000000000604082015290565b6103ee613abc565b6103ee613b15565b90611a2b611a21611a1b7f69cb00da9d035cbf84d93e5abc808a960d34e0da15bbddbda1e24f1b38bab89993613b5f6103ee8260066114be565b613c1c6122d56129bf8a613b7285610ca6565b613b89613b7f60006114b1565b8211611721613ab4565b613bac8c61229d6119c5613b9f60018b016114d1565b926001600160a01b031690565b613bba818310611721613b1d565b6122d1613c15613bd3613bcd6009610ca6565b84611ff2565b611ea5613c0e613c07613bee613be7612005565b8095612026565b93613c02613bfc6009610ca6565b8a611ff2565b612026565b928661216e565b918661216e565b8d896144e9565b87613c2760006114b1565b8103613c3f575050611a1660006122f98360066114be565b611a1691612157565b906103959291613a57565b61039590613c626119b2613de3565b6118647f7c8919e8b0586f5fc7dfabcfce8ecf5465b6ac9f6aaa0bcba610c55e30dad8c3916103b2816009612157565b61039590613c53565b6103ee6000600080516020616dde833981519152612285565b906103ee9291613cc56119b2613de3565b92919250613cec613ce1612b41600461076f6000956005610bd8565b93612bc88386614759565b90613cfa6118c160036114d1565b6020613d0560405190565b63659bf9d960e11b815291829060049082905afa80156119335761039593613d34926000926119025750613f43565b80946147d4565b6103ee91906000613cb4565b613d596020611e366118c160006114d1565b03915afa801561193357613d7a91600091613dc4575b50612bc86007610ca6565b90613d856008610ca6565b90819015613dab575b50808210613d9f576103ee91611e12565b50506103ee60006114b1565b613dbe9150613db8613a3e565b9061216e565b38613d8e565b613ddd915060203d602011611ede57611ed0818361060f565b38613d6f565b613dec33612ef3565b80613e06575b15613e0257601436033560601c90565b3390565b5036613e1561202c60146114b1565b1015613df2565b613e2581610c11565b9081613e2f575090565b6103ee9150614720565b613e4360236112fb565b7f353536317c43617264733a2063617264206973206e6f7420696e697469616c696020820152621e995960ea1b604082015290565b6103ee613e39565b6103ee613e78565b90613eaa6001610395949361076f613ea260008301610bfb565b611721613e80565b615241565b613eb9601d6112fb565b7f353430327c446562743a206e6f2066756e647320617661696c61626c65000000602082015290565b6103ee613eaf565b6103ee613ee2565b613efc60256112fb565b7f353430337c446562743a20616d6f756e7420697320686967686572207468616e602082015264081919589d60da1b604082015290565b6103ee613ef2565b6103ee613f33565b91907f75aec94f6ad949cfd9728eb818639f1b0b882089b480409ab73245c06469eef490613fee613fc5600080516020616dfe83398151915295613f85611655565b613fc0613fb4613f948a610ca6565b613f9d85614706565b6103ee613faa60006114b1565b8511611721613eea565b835b1115611721613f3b565b6147c7565b948592613fe9908490613fe4613fde836122d187610ca6565b85612157565b615305565b610ca6565b90611864612a7560405190565b61400560296112fb565b7f353331307c4163636f756e743a207472616e73616374696f6e20494420616c726020820152681958591e481d5cd95960ba1b604082015290565b6103ee613ffb565b6103ee614040565b906103959493929161406183614706565b61408a6140746000610cf28560066114be565b61408161202c60006114b1565b14611721614048565b61409e6129676129626103ee846005610bd8565b83156140d4575b6140cf85856140c96140c36122606140bd6009610ca6565b89611ff2565b8761216e565b8461530f565b615477565b6140ed61345860006140e7846005610bd8565b01610c2f565b6140a5565b6140fc601c6112fb565b7f353130327c436f6d6d6f6e3a2061646472657373206973207a65726f00000000602082015290565b6103ee6140f2565b6103ee614125565b610395906141496119c56103e26000611a5f565b141561172161412d565b6103ee91369161097e565b614168602b6112fb565b7f353535307c4f776e657273686970416363657074616e63653a20696e76616c6960208201526a64207369676e617475726560a81b604082015290565b6103ee61415e565b6103ee6141a5565b6000198114611e1f5760010190565b61423d906142346119c5613b9f610395969561422e60006142027f3fc394ec90f88dd7e18c46ffeef55f1b6719a2027f4ae9fbc4ab11827189120090565b01976142286142236142138b610ca6565b61421e611308610d24565b6155ff565b615646565b92614153565b9061566f565b146117216141ad565b61424e61424982610ca6565b6141b5565b90612157565b600080516020616dde8339815191527fc04d7db2ae23be2ba46893b43d7c4af2fc045905461f3df891e1d6c4d0683ef66142d96142cf614293846114d1565b6118c16142ca6002600188019761076f6142ac8a610ca6565b996142c06142ba6000611a5f565b84611a7d565b61424e60006114b1565b615685565b926103b660405190565b0390a2565b906143016142fb6004610395959461076f613ea260008301610bfb565b91615768565b906159b6565b60609061431890615a83565b930190565b905090565b614327601f6112fb565b7f353130317c436f6d6d6f6e3a20696e73756666696369656e742066756e647300602082015290565b6103ee61431d565b6103ee614350565b6143e96143e360007f31f69201fab7912e3ec9850e3ab705964bf46d9d4276bdcbb6d05e965e5f5401949561439487614706565b6143ae6143a26103ee611e24565b885b1115611721614358565b610cf26002600080516020616dde8339815191526143ce88868301611a7d565b6143db8a60018301612157565b019182615adb565b91610726565b926142d9612a7560405190565b61440060386112fb565b7f353431307c44656c617965645769746864726177616c733a207769746864726160208201527f77616c2074696d656c6f636b206e6f7420657870726965640000000000000000604082015290565b6103ee6143f6565b6103ee61444f565b600080516020616dde8339815191527fa578b4c05763eb039caef37b2d7b949c22914c3838384c9c73cefb78c4a8ed0a6142d96142cf61449e846114d1565b6144df6142ca6002600188019761076f6144b78a610ca6565b996144cc6144c66103ee611e24565b8c6143a4565b6142c06144d76138d9565b611721614457565b6118c18582615afa565b6144fd600461076f61039595946005610bd8565b9161453a614534600161452e6145266145218361451b8960066114be565b016114e7565b61332d565b9560066114be565b016114fd565b93614741565b615b37565b610395615b72565b61039561453f565b906103959161455c615b72565b9061039591615d4c565b906103959161454f565b61457a60246112fb565b7f353536307c43617264733a206361726420616c726561647920696e697469616c6020820152631a5e995960e21b604082015290565b6103ee614570565b6103ee6145b0565b9060ff90611a73565b906145d96103ee611a9492151590565b82546145c0565b9069ffffffffffffffff00009060101b611a73565b906146056103ee611a949261234d565b82546145e0565b9061467e60406146766004610395956146646001600160401b03600083016146416146396123fd83610bfb565b6117216145b8565b61464c6001826145c9565b61465f6146598a51151590565b826133ef565b6145f5565b61076f60018201602088015190615db3565b920151615768565b90615de4565b6103ee9081906001600160a01b031681565b906146be61202c611a166146b960006103ee966146b1600090565b50019461071d565b614684565b615e8e565b6146cd601b6112fb565b7f353130307c436f6d6d6f6e3a20616d6f756e74206973207a65726f0000000000602082015290565b6103ee6146c3565b6103ee6146f6565b6103959061471761202c60006114b1565b116117216146fe565b61472981610bfb565b9081614733575090565b6103ee91506123fd90615ed4565b61474d600e8201610ca6565b42106103ee5760070190565b9061476660058301615068565b1561479b571561477c576103ee90600101610ca6565b6103ee90612bc86000600361479360018501610ca6565b930101610ca6565b156147b1576103ee90600101615ef7565b615ef7565b6103ee90612bc86147ac60036143136001850183565b9080821015614318575090565b916147ec906147e284615f18565b6123fd8385615f5a565b6147f4575050565b61039591615f6c565b7ff3a2c404b3362c4238317c3dad1020c2e9e984ba8df38a4a1ff18d57e92a242a90613fee600080516020616dfe833981519152613fe9614841846129a884610ca6565b82612157565b61485160336112fb565b7f353333307c4163636f756e743a2076657269666965642062616c616e6365206e6020820152726f7420657175616c20746f2062616c616e636560681b604082015290565b6103ee614847565b6103ee614896565b906148ba916020612fc26118c160006114d1565b03915afa92831561193357610395936148f89160009161491f575b506148ed6148e36007610ca6565b821461172161489e565b831115611721614358565b614910614909836122d16007610ca6565b6007612157565b61491a60006114d1565b615fbc565b614938915060203d602011611ede57611ed0818361060f565b386148d5565b61494730610726565b7f00000000000000000000000000000000000000000000000000000000000000009061497b6001600160a01b0383166119c5565b1490811561499d575b5061498b57565b60405163703e46dd60e11b8152600490fd5b90506149ad6119c5613b9f616004565b141538614984565b610395906149c46116f8613de3565b614a1e565b6149d360296112fb565b7f353337307c4163636f756e743a20756e617574686f72697a656420696d706c6560208201526836b2b73a30ba34b7b760b91b604082015290565b6103ee6149c9565b6103ee614a0e565b6020614a4891614a316118c160016114d1565b604051938492839182916316da1fb760e11b611e59565b03915afa80156119335761039591600091614a67575b50611721614a16565b614a80915060203d602011612ede57612ed0818361060f565b38614a5e565b610395906149b5565b90614a9c6118c183610726565b906020614aa860405190565b6352d1902d60e01b815292839060049082905afa60009281614b4c575b50614b065750506001614ad55750565b6116e490614ae260405190565b634c9c8ce360e01b8152918291600483016001600160a01b03909116815260200190565b909291614b146103ee612cb9565b8403614b2557610395929350616014565b6116e484614b3260405190565b632a87526960e21b81529182916004830190815260200190565b614b6691935060203d602011611ede57611ed0818361060f565b9138614ac5565b614b7630610726565b614ba86001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166119c5565b0361498b57565b9261422e9192614c33614c266142236103ee97614bca600090565b507f5066de352c02692985a663f298a4534cb506e7947f703135018b6c3e10f82e0097614c21906125a4614bfd8b610ca6565b91614c18614c09610cb0565b6001600160a01b039096168652565b15156020850152565b61610e565b9461424e61424982610ca6565b614153565b614c42602d6112fb565b7f353331327c4163636f756e743a204f5450207374617465206368616e6765206960208201526c7320696e2070726f677265737360981b604082015290565b6103ee614c38565b6103ee614c81565b614cce61039594614cc9614cab600161076f866005610bd8565b91614cb86123fd84616151565b908115614cd3575b50611721614c89565b616164565b6162a9565b905038614cc0565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015614d11575b6020831014614d0c57565b614cdb565b91607f1691614d01565b80546000939291614d38614d2e83614cf1565b8085529360200190565b9160018116908115614d8a5750600114614d5157505050565b614d649192939450600052602060002090565b916000925b818410614d765750500190565b805484840152602090930192600101614d69565b92949550505060ff1916825215156020020190565b906103ee91614d1b565b90610395614dc392614dba60405190565b93848092614d9f565b038361060f565b6103ee90614da9565b6103ee6002600080516020616e1e8339815191525b01614dca565b6103ee6003600080516020616e1e833981519152614de8565b6000614e1c91614e15600090565b5001610ca6565b614e2961202c60006114b1565b141590565b614e38602f6112fb565b7f353535317c5472616e73616374696f6e436f6e6669726d6174696f6e3a20696e60208201526e76616c6964207369676e617475726560881b604082015290565b6103ee614e2e565b6103ee614e79565b61423d90614ee86119c5613b9f610395969561422e6000614ec77fa715e0242b72e6c41603cf400167fb9f6392ccc61630d77addc87403bc04180090565b0197614228614223614ed88b610ca6565b614ee3611308610d24565b6163ce565b14611721614e81565b614efb60206112fb565b7f353536327c43617264733a2063617264206973206e6f742064697361626c6564602082015290565b6103ee614ef1565b6103ee614f24565b6103959190614f59614f5182614f4c613ea282610bfb565b615ed4565b611721614f2c565b6134a66001600160401b03826145f5565b614f7460246112fb565b7f353536327c43617264733a206361726420697320616c72656164792064697361602082015263189b195960e21b604082015290565b6103ee614f6a565b6103ee614faa565b60008091614fff61039594614ff9614ff485850192613469614fdb85610c2f565b614feb6001600160401b03612434565b14611721614fb2565b612331565b906145f5565b016133ef565b9061502061202c611a166146b960006103ee966146b1600090565b616435565b61502f601d6112fb565b7f353534317c54696d6572733a2074696d6572206e6f7420616374697665000000602082015290565b6103ee615025565b6103ee615058565b6103ee600061508e92615079600090565b50610cf261508682614e07565b611721615060565b421190565b7fb940258db5193d85cafbc591d0c29fad88d804ff8b9ab71c8f9545af2bb2c07c90613fee600080516020616dfe8339815191526150e56150df6150d683610ca6565b6103ee86614706565b84613fb6565b613fe9614841846122d184610ca6565b6150ff60276112fb565b7f353530317c44656c6179656453657474696e67733a2076616c756520616c726560208201526618591e481cd95d60ca1b604082015290565b6103ee6150f5565b6103ee615138565b906fffffffffffffffffffffffffffffffff90611a73565b6001600160801b03191690565b9061518b615185611a94926001600160801b03191690565b60801c90565b8254615148565b9061ffff60801b9060801b611a73565b610c416103ee6103ee9261ffff1690565b906151c36103ee611a94926151a2565b8254615192565b908082036151d6575050565b61039591906151f8906151f36151ed825460801b90565b8461516d565b610c48565b906151b3565b90610395916151ca565b610395916151f89060209061522e61522882516001600160801b03191690565b8561516d565b015161ffff1690565b9061039591615208565b906001820161528e81615255815460801b90565b61527b61526d61516087516001600160801b03191690565b916001600160801b03191690565b14159081156152d6575b50611721615140565b61529783616151565b156152b657610395936134696002936152af93615237565b9101612157565b61039593613469600293836152d16152af95600089016151fe565b615237565b6152e09150610c48565b6152fd6152f5610c41602087015161ffff1690565b9161ffff1690565b141538615285565b90610395916148a6565b600461076f615322929594956005610bd8565b9261532f6123fd856164f5565b908115615362575b501561534e5761534961039593614741565b61656c565b610395926153499060079061076f85858386565b905038615337565b615374601f6112fb565b7f353331337c4163636f756e743a206e6f2066756e647320746f20626c6f636b00602082015290565b6103ee61536a565b6103ee61539d565b6103ee6080610635565b9067ffffffffffffffff60a01b9060a01b611a73565b906153dd6103ee611a949261234d565b82546153b7565b9060ff60e01b9060e01b611a73565b906154036103ee611a9492151590565b82546153e4565b906154676060600161039594615424614841600087015190565b019261544361543d60208301516001600160a01b031690565b85611a7d565b61546061545a60408301516001600160401b031690565b856153cd565b0151151590565b906153f3565b906103959161540a565b61039594916122d594615488600090565b5015615575576154986001613d47565b84811061552257506155139061550c615518945b6154c36154b960006114b1565b88116117216153a5565b6155036154cf42612331565b6154f36154da6153ad565b976154e38b8a52565b6001600160a01b03166020890152565b6001600160401b03166040870152565b15156060850152565b60066114be565b61546d565b6129a86008610ca6565b9061550c615518946155378461551395980390565b615540846114b1565b7f398a399795162d7b100f484c496bd46d45b5d80499256c51a0a1c0322b32986361556d611a2189610726565b0390a36154ac565b6155139061550c615518949561559561558f6103ee611655565b826143a4565b956154ac565b6155a560226112fb565b7f4f776e657273686970416363657074616e63652875696e74323536206e6f6e63602082015261652960f01b604082015290565b6103ee61559b565b6155e96155d9565b6155fb6155f4825190565b9160200190565b2090565b6155e961563a9161560e600090565b50615622600061561c6155e1565b92015190565b9061562c60405190565b9384926020840192836128d5565b9081038252038261060f565b6103ee906156526165af565b6042916040519161190160f01b8352600283015260228201522090565b6103ee9161567c916165b7565b90929192616652565b6103959060006152af816114b1565b61569c610c52565b906000825260006020830152565b6103ee615694565b6156ba610d24565b9060008252565b6103ee6156b2565b6156d1610d4a565b906000825260208080808086016156e66156aa565b8152016156f16156aa565b8152016156fc6156c1565b8152016000905250565b6103ee6156c9565b615718602e6112fb565b7f353532347c4163636f756e744c696d6974733a207370656e64206c696d69742060208201526d706572696f64206973207a65726f60901b604082015290565b6103ee61570e565b6103ee615758565b615770615706565b506103ee6060820191615854615784845190565b936157a060009561579761202c886114b1565b11611721615760565b61584d6157ad8685015190565b936158466157bc602083015190565b6157ce6157c7610c52565b918a830152565b61580a6157f060406157df8c6114b1565b956157eb876020870152565b015190565b936158036157fc610c52565b958c870152565b6020850152565b61583f615830615818610d24565b9661582c61582660016114b1565b8d8a0152565b5190565b97615839610d4a565b9a8b0152565b6020890152565b6040870152565b6060850152565b6080830152565b818103615866575050565b60016152af8184610cf261587f60006103959801610ca6565b86612157565b906103959161585b565b81810361589a575050565b60006152af816103959401610ca6565b906103959161588f565b8181036158bf575050565b60066152af81846158d861587f60006103959801610ca6565b6158e86001820160018701615885565b6158f86003820160038701615885565b610cf260058201600587016158aa565b90610395916158b4565b60016152af6020610395946157eb61587f600083015190565b9061039591615912565b60006152af8161039594015190565b9061039591615935565b60066152af60806103959461596761587f600083015190565b61597e615975602083015190565b6001870161592b565b61599561598c604083015190565b6003870161592b565b6157eb6159a3606083015190565b60058701615944565b906103959161594e565b906159c0826164f5565b156159db576152af61039593613469600e93600786016159ac565b6152af61039593613469600e93600786016159f98160008901615908565b6159ac565b90615a19615a0d610782845490565b92600052602060002090565b9060005b818110615a2a5750505090565b909192615a4e615a47600192615a3f87610ca6565b815260200190565b9460010190565b929101615a1d565b906103ee916159fe565b90610395614dc392615a7160405190565b93848092615a56565b6103ee90615a60565b60006103ee91615a91606090565b5001615a7a565b615aa260176112fb565b7f353534307c54696d6572733a207a65726f2064656c6179000000000000000000602082015290565b6103ee615a98565b6103ee615acb565b60006152af61039593613469615af0846114b1565b8211611721615ad3565b9061039591615b096007610ca6565b8211615b255761491061490983615b206007610ca6565b611e12565b614910615b3260006114b1565b614909565b929091615b44908461671b565b615b4d57505050565b615b5e906123fd83600186016167b0565b615b66575050565b610395916003016167b0565b615b7d6123fd6167dc565b615b8357565b604051631afcd79f60e31b8152600490fd5b9061039591615ba2615b72565b615cfd565b818110615bb2575050565b80615bc060006001936121a8565b01615ba7565b9190601f8111615bd557505050565b615be761039593600052602060002090565b906020601f840181900483019310615c09575b6020601f909101040190615ba7565b9091508190615bfa565b90615c1c815190565b906001600160401b03821161063057615c3f82615c398554614cf1565b85615bc6565b602090601f8311600114615c7a57611a94929160009183615c6f575b5050600019600883021c1916906002021790565b015190503880615c5b565b601f19831691615c8f85600052602060002090565b9260005b818110615ccd57509160029391856001969410615cb4575b50505002019055565b01516000196008601f8516021c19169055388080615cab565b91936020600181928787015181550195019201615c93565b9061039591615c13565b906121676103ee611a949290565b615d2f61039592615d26615d1c600080516020616e1e83398151915290565b9360028501615ce5565b60038301615ce5565b6001615d3b60006114b1565b91615d468382615cef565b01615cef565b9061039591615b95565b615d6060316112fb565b7f353530307c44656c6179656453657474696e67733a2073657474696e6720616c6020820152701c9958591e481a5b9a5d1a585b1a5e9959607a1b604082015290565b6103ee615d56565b6103ee615da3565b615dda61039592615dd1615dc96123fd85616805565b611721615dab565b60018301615237565b6002429101612157565b615e0361039592615dfa615dc96123fd85616813565b600783016159ac565b600e429101612157565b634e487b7160e01b600052603260045260246000fd5b8054821015615e4657615e3d600191600052602060002090565b91020190600090565b615e0d565b91906121a06103ee611a949390565b90815491680100000000000000008310156106305782615e8291600161039595018155615e23565b90615e4b565b90610be2565b615e9b6123fd8383616821565b15615ecd57615ec891615ec3906001615ebc84615eb88482615e5a565b5490565b9301615e88565b612157565b600190565b5050600090565b6000615ee991615ee2600090565b5001610c2f565b615ef24261346f565b111590565b615f0c6001615f0583610ca6565b9201610ca6565b808210613d9f57900390565b60058101615f2581615068565b615f2d575050565b615f54600683615f48615f436001610395970190565b61683a565b610cf26003820161683a565b90615adb565b610395919060010161684a565b61684a565b610395919060030161684a565b615f92615f8c6103ee9263ffffffff1690565b60e01b90565b6001600160e01b03191690565b6001600160a01b0390911681526040810192916103959160200152565b615fff600492615ff061039595615fd663a9059cbb615f79565b92615fe060405190565b9687946020860190815201615f9f565b6020820181038252038361060f565b61685f565b6103ee60006122856103ee612cb9565b9061601e826168e7565b61602782610726565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b61605160405190565b600090a2805161606461202c60006114b1565b1115616073576118ff91616955565b5050610395616912565b61608760406112fb565b7f43617264436f6e6669726d6174696f6e2861646472657373206361726441646460208201527f726573732c626f6f6c2069734f776e65722c75696e74323536206e6f6e636529604082015290565b6103ee61607d565b6155e96160d6565b6128e861039594616105606094989795611560608086019a6000870152565b15156040830152565b6155e96161196160de565b82516001600160a01b03169061563a616140604061613a6020880151151590565b96015190565b6040519586946020860194856160e6565b600261615f91614e15600090565b421090565b61617060028201610ca6565b42106103ee5760010190565b61618660296112fb565b7f353531307c4f6e6554696d6550617373776f72643a20696e76616c6964204f54602082015268281031b7bab73a32b960b91b604082015290565b6103ee61617c565b6103ee6161c1565b60016103ee910161ffff1690565b610391906001600160a01b031660601b90565b6103919061ffff1660f01b90565b6010939261622160148361621960029561076f976161df565b0180926161f2565b0180926001600160801b0319169052565b61076f61624a92602092616244815190565b94859290565b93849101611025565b6103ee91616232565b61626660216112fb565b7f353531317c4f6e6554696d6550617373776f72643a20696e76616c6964204f546020820152600560fc1b604082015290565b6103ee61625c565b6103ee616299565b9391929091906162b885610c48565b946162cf61ffff871661ffff8416106117216161c9565b8482955b61ffff88165b61ffff8816101561634457600061631660209261630a8a8a61563a6162fd60405190565b9485938985019384616200565b60405191829182616253565b039060025afa15611933576162d961633c61633661516060005160001b90565b976161d1565b9690506162d3565b6163719192949750610395965061637793955061636861526d615160875460801b90565b146117216162a1565b8261516d565b6151b3565b61638660266112fb565b7f5472616e73616374696f6e436f6e6669726d6174696f6e2875696e74323536206020820152656e6f6e63652960d01b604082015290565b6103ee61637c565b6155e96163be565b6155e961563a916163dd600090565b50615622600061561c6163c6565b634e487b7160e01b600052603160045260246000fd5b61039591600091615e4b565b8054801561643057600019019061642d6164278383615e23565b90616401565b55565b6163eb565b90616446613fe98260018501615e88565b61645060006114b1565b81146164ed576164af6103ee926000926164a4956164a9600197889361647e616478866114b1565b82611e12565b8885019161649661648d845490565b611ea5896114b1565b8083036164b4575b50505090565b61640d565b01615e88565b6121a8565b615e826164dd6164e5946164d46164ce615ec39589615e23565b906104a9565b92839188615e23565b888801615e88565b38808061649e565b505050600090565b600e61615f91614e15600090565b61650d603b6112fb565b7f353532307c4163636f756e744c696d6974733a20616d6f756e7420657863656560208201527f64732073696e676c65207472616e73616374696f6e206c696d69740000000000604082015290565b6103ee616503565b6103ee61655c565b9161659e9061658b6165806103ee86610ca6565b841115611721616564565b61659484615f18565b6123fd83856169d0565b6165a6575050565b61039591616a4d565b6103ee616a9c565b906000916165c3825190565b6165d061202c60416114b1565b036165fa576165f392506020820151906060604084015193015160001a90616b19565b9192909190565b509050616612611a1661660d6000611a5f565b925190565b909160029190565b634e487b7160e01b600052602160045260246000fd5b6004111561663a57565b61661a565b9061039582616630565b6103ee906114b1565b61665c600061663f565b6166658261663f565b0361666e575050565b616678600161663f565b6166818261663f565b036166985760405163f645eedf60e01b8152600490fd5b6166a2600261663f565b6166ab8261663f565b036166d9576116e46166bc83616649565b60405163fce698f760e01b81529182916004830190815260200190565b6166ec6166e6600361663f565b9161663f565b146166f45750565b6116e49061670160405190565b6335e2f38360e21b81529182916004830190815260200190565b600581019061672982615068565b1561673657505050600090565b6103ee61202c91611ea56006615f0560006167519701610ca6565b101590565b616760602e6112fb565b7f353533317c5370656e644c696d6974733a20696e73756666696369656e74207360208201526d1c195b9d081d1bc818d85b98d95b60921b604082015290565b6103ee616756565b6103ee6167a0565b9061424e60016103959301916167d36167c884610ca6565b8211156117216167a8565b6122d183610ca6565b6103ee7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00612314565b6002614e1c91614e15600090565b600e614e1c91614e15600090565b614e1c916001613fe992616833600090565b5001615e88565b6103959060016152af60006114b1565b9061424e60016103959301916129a883610ca6565b61686b61687291610726565b9182616be0565b805161688161202c60006114b1565b141590816168c3575b506168925750565b6116e49061689f60405190565b635274afe760e01b8152918291600483016001600160a01b03909116815260200190565b6168e191508060206168d66123fd935190565b818301019101612d25565b3861688a565b803b6168f661202c60006114b1565b14614ad55761039590600061690c6103ee612cb9565b01611a7d565b61691c60006114b1565b341161692457565b60405163b398979f60e01b8152600490fd5b3d15616950576169453d6112fb565b903d6000602084013e565b606090565b6000806103ee93616964606090565b50602081519101845af4616976616936565b91616bf4565b61698660286112fb565b7f353532317c4163636f756e744c696d6974733a207370656e64206c696d697420602082015267195e18d95959195960c21b604082015290565b6103ee61697c565b6103ee6169c0565b61039591906169ed6169e58360018401616c64565b6117216169c8565b615f5a565b6169fc602f6112fb565b7f353532337c4163636f756e744c696d6974733a206e6f206f7470207370656e6460208201526e081b1a5b5a5d08195e18d959591959608a1b604082015290565b6103ee6169f2565b6103ee616a3d565b6103959190600301615f67616a628383616c64565b611721616a45565b909594926103959461069c611ab392616a95608096616a8e60a088019c6000890152565b6020870152565b6040850152565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6155e9616ac8616c7c565b616ad0616d00565b9061563a616add30610726565b6040519586946020860194469286616a6a565b6128e8610395946125a4606094989795616b0f608086019a6000870152565b60ff166020850152565b9091616b2484616649565b616b5061202c7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a06114b1565b11616bcc5790616b7260209460009493616b6960405190565b94859485616af0565b838052039060015afa1561193357600051600091616b8f83611a5f565b6001600160a01b0381166001600160a01b03841614616bb85750616bb2836114b1565b91929190565b915091616bc4906114b1565b909160019190565b505050616bd96000611a5f565b9160039190565b6103ee91616bee60006114b1565b91616d4f565b90616bff5750616dae565b8151616c0e61202c60006114b1565b1480616c4e575b616c1d575090565b6116e490616c2a60405190565b639996b31560e01b8152918291600483016001600160a01b03909116815260200190565b50803b616c5e61202c60006114b1565b14616c15565b61202c6103ee615ef292616c76600090565b50615ef7565b600080516020616e1e833981519152616c966103ee614dd3565b90616c9f825190565b616cac61202c60006114b1565b1115616cbe57506155fb6155f4825190565b616cc89150610ca6565b616cd260006114b1565b8114616cdb5790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b600080516020616e1e833981519152616d1a6103ee614dee565b90616d23825190565b616d3061202c60006114b1565b1115616d4257506155fb6155f4825190565b616cc89150600101610ca6565b91616d5930610726565b81813110616d7d5750600082819260206103ee969551920190855af1616976616936565b6116e490616d8a60405190565b63cd78605960e01b8152918291600483016001600160a01b03909116815260200190565b8051616dbd61202c60006114b1565b1115616dcb57805190602001fd5b604051630a12f52160e11b8152600490fdfe76d8021c4b979e99674b80f4e0cc10154af0e5f32df05eb51b29a464e24355003486e95df892f06bd37fd38c44e2fee4c4efb6660a66e6eb20ed6d8a167eae00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100a2646970667358221220299c9946e80716a606163fc8482c2e4aa42277a57c723d628ffa5e98c614887064736f6c63430008160033"; + + private static String librariesLinkedBinary; public static final String FUNC_UPGRADE_INTERFACE_VERSION = "UPGRADE_INTERFACE_VERSION"; + public static final String FUNC_ACTIVECARDADDRESSES = "activeCardAddresses"; + + public static final String FUNC_ADDCARD = "addCard"; + + public static final String FUNC_AUTHLIMITMARGIN = "authLimitMargin"; + public static final String FUNC_AUTHORIZEDTRANSACTIONS = "authorizedTransactions"; public static final String FUNC_AVAILABLEFORDEBTPAYMENT = "availableForDebtPayment"; @@ -56,12 +76,18 @@ class TangemPaymentAccount extends Contract { public static final String FUNC_CANCELWITHDRAWAL = "cancelWithdrawal"; - public static final String FUNC_CARDWITHOTP = "cardWithOtp"; + public static final String FUNC_CARDCONFIRMATIONNONCE = "cardConfirmationNonce"; + + public static final String FUNC_CARDS = "cards"; public static final String FUNC_DEBTAMOUNT = "debtAmount"; + public static final String FUNC_DISABLECARD = "disableCard"; + public static final String FUNC_EIP712DOMAIN = "eip712Domain"; + public static final String FUNC_ENABLECARD = "enableCard"; + public static final String FUNC_FACTORY = "factory"; public static final String FUNC_INCREASEVERIFIEDBALANCE = "increaseVerifiedBalance"; @@ -76,32 +102,30 @@ class TangemPaymentAccount extends Contract { public static final String FUNC_ISWITHDRAWALREADY = "isWithdrawalReady"; - public static final String FUNC_LIMITS = "limits"; - public static final String FUNC_OWNER = "owner"; public static final String FUNC_OWNERSHIPACCEPTANCENONCE = "ownershipAcceptanceNonce"; + public static final String FUNC_PAYDEBT = "payDebt"; + public static final String FUNC_PAYMENTTOKEN = "paymentToken"; - public static final String FUNC_PENDINGREFUNDAMOUNT = "pendingRefundAmount"; - - public static final String FUNC_PENDINGREFUNDTOTAL = "pendingRefundTotal"; - - public static final String FUNC_PROCESSAUTHORIZATION = "processAuthorization"; - public static final String FUNC_PROCESSAUTHORIZATIONCHANGE = "processAuthorizationChange"; - public static final String FUNC_PROCESSAUTHORIZATIONNOOTP = "processAuthorizationNoOtp"; - public static final String FUNC_PROCESSDEBT = "processDebt"; - public static final String FUNC_PROCESSPENDINGREFUNDPAYMENT = "processPendingRefundPayment"; + public static final String FUNC_PROCESSNOCONFIRMATIONAUTHORIZATION = "processNoConfirmationAuthorization"; + + public static final String FUNC_PROCESSOTPAUTHORIZATION = "processOtpAuthorization"; public static final String FUNC_PROCESSREFUNDPAYMENT = "processRefundPayment"; public static final String FUNC_PROCESSSETTLEMENT = "processSettlement"; + public static final String FUNC_PROCESSSIGNATUREAUTHORIZATION = "processSignatureAuthorization"; + + public static final String FUNC_PROCESSUNSETTLEDTRANSACTION = "processUnsettledTransaction"; + public static final String FUNC_PROCESSWITHDRAWAL = "processWithdrawal"; public static final String FUNC_PROCESSOR = "processor"; @@ -110,11 +134,13 @@ class TangemPaymentAccount extends Contract { public static final String FUNC_REGISTRY = "registry"; - public static final String FUNC_SAVEPENDINGREFUND = "savePendingRefund"; + public static final String FUNC_REMOVEOWNER = "removeOwner"; public static final String FUNC_SECURITYDELAY = "securityDelay"; - public static final String FUNC_SETCARD = "setCard"; + public static final String FUNC_SETAUTHLIMITMARGIN = "setAuthLimitMargin"; + + public static final String FUNC_SETCARDISOWNER = "setCardIsOwner"; public static final String FUNC_SETLIMITS = "setLimits"; @@ -122,20 +148,18 @@ class TangemPaymentAccount extends Contract { public static final String FUNC_SETOWNER = "setOwner"; - public static final String FUNC_SETPROCESSOR = "setProcessor"; - public static final String FUNC_SETVERIFIEDBALANCE = "setVerifiedBalance"; - public static final String FUNC_SETTLEMENTPERIOD = "settlementPeriod"; + public static final String FUNC_TRANSACTIONCONFIRMATIONNONCE = "transactionConfirmationNonce"; public static final String FUNC_TRUSTEDFORWARDER = "trustedForwarder"; - public static final String FUNC_UNBLOCKUNSETTLEDTRANSACTION = "unblockUnsettledTransaction"; - public static final String FUNC_UPGRADETOANDCALL = "upgradeToAndCall"; public static final String FUNC_VERIFIEDBALANCE = "verifiedBalance"; + public static final String FUNC_WITHDRAWALADDRESS = "withdrawalAddress"; + public static final String FUNC_WITHDRAWALAMOUNT = "withdrawalAmount"; public static final String FUNC_WITHDRAWALREADYTIMESTAMP = "withdrawalReadyTimestamp"; @@ -143,240 +167,319 @@ class TangemPaymentAccount extends Contract { public static final String FUNC_WRITEOFFDEBT = "writeOffDebt"; public static final Event ACCOUNTSTATEAFTERSETTLEMENT_EVENT = new Event("AccountStateAfterSettlement", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference() {}, new TypeReference() {}, new TypeReference() {})); + ; - public static final Event CARDSET_EVENT = new Event("CardSet", - Arrays.asList(new TypeReference

() { - }, new TypeReference() { - }, new TypeReference() { - })); + public static final Event AUTHLIMITMARGINSET_EVENT = new Event("AuthLimitMarginSet", + Arrays.>asList(new TypeReference() {})); + ; + + public static final Event CARDADDED_EVENT = new Event("CardAdded", + Arrays.>asList(new TypeReference
() {}, new TypeReference() {})); + ; + + public static final Event CARDDISABLED_EVENT = new Event("CardDisabled", + Arrays.>asList(new TypeReference
() {})); + ; + + public static final Event CARDENABLED_EVENT = new Event("CardEnabled", + Arrays.>asList(new TypeReference
() {}, new TypeReference() {})); + ; public static final Event DEBTINCREASED_EVENT = new Event("DebtIncreased", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference() {}, new TypeReference() {})); + ; public static final Event DEBTPAID_EVENT = new Event("DebtPaid", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference() {}, new TypeReference() {})); + ; public static final Event DEBTWRITTENOFF_EVENT = new Event("DebtWrittenOff", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference() {}, new TypeReference() {})); + ; public static final Event EIP712DOMAINCHANGED_EVENT = new Event("EIP712DomainChanged", - List.of()); + Arrays.>asList()); + ; public static final Event INITIALIZED_EVENT = new Event("Initialized", - List.of(new TypeReference() { - })); + Arrays.>asList(new TypeReference() {})); + ; public static final Event INSUFFICIENTFUNDSONFORCEDAUTH_EVENT = new Event("InsufficientFundsOnForcedAuth", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event LIMITSSET_EVENT = new Event("LimitsSet", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - })); - - public static final Event NOOTPTRANSACTIONAUTHORIZED_EVENT = new Event("NoOtpTransactionAuthorized", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
() {}, new TypeReference() {})); + ; public static final Event OTPSTATESET_EVENT = new Event("OtpStateSet", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
() {}, new TypeReference() {})); + ; + + public static final Event OWNERREMOVED_EVENT = new Event("OwnerRemoved", + Arrays.>asList(new TypeReference
() {})); + ; public static final Event OWNERSET_EVENT = new Event("OwnerSet", - List.of(new TypeReference
() { - })); - - public static final Event PENDINGREFUNDSAVED_EVENT = new Event("PendingRefundSaved", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
() {})); + ; public static final Event PROCESSORSET_EVENT = new Event("ProcessorSet", - Arrays.asList(new TypeReference
() { - }, new TypeReference
() { - })); + Arrays.>asList(new TypeReference
() {}, new TypeReference
() {})); + ; public static final Event REFUNDPAID_EVENT = new Event("RefundPaid", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event TRANSACTIONAMOUNTCHANGED_EVENT = new Event("TransactionAmountChanged", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; - public static final Event TRANSACTIONAUTHORIZED_EVENT = new Event("TransactionAuthorized", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - })); + public static final Event TRANSACTIONAUTHORIZEDNOCONFIRMATION_EVENT = new Event("TransactionAuthorizedNoConfirmation", + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; + + public static final Event TRANSACTIONAUTHORIZEDWITHOTP_EVENT = new Event("TransactionAuthorizedWithOtp", + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {})); + ; + + public static final Event TRANSACTIONAUTHORIZEDWITHSIGNATURE_EVENT = new Event("TransactionAuthorizedWithSignature", + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {}, new TypeReference() {})); + ; public static final Event TRANSACTIONSETTLED_EVENT = new Event("TransactionSettled", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {}, new TypeReference() {})); + ; public static final Event UNSETTLEDTRANSACTIONUNBLOCKED_EVENT = new Event("UnsettledTransactionUnblocked", - Arrays.asList(new TypeReference(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event UPGRADED_EVENT = new Event("Upgraded", - List.of(new TypeReference
(true) { - })); + Arrays.>asList(new TypeReference
(true) {})); + ; public static final Event VERIFIEDBALANCEINCREASED_EVENT = new Event("VerifiedBalanceIncreased", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference() {}, new TypeReference() {})); + ; public static final Event VERIFIEDBALANCESET_EVENT = new Event("VerifiedBalanceSet", - List.of(new TypeReference() { - })); + Arrays.>asList(new TypeReference() {})); + ; public static final Event WITHDRAWALCANCELED_EVENT = new Event("WithdrawalCanceled", - List.of()); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event WITHDRAWALCOMPLETE_EVENT = new Event("WithdrawalComplete", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference() {})); + ; public static final Event WITHDRAWALINITIATED_EVENT = new Event("WithdrawalInitiated", - Arrays.asList(new TypeReference() { - }, new TypeReference() { - })); + Arrays.>asList(new TypeReference
(true) {}, new TypeReference() {}, new TypeReference() {})); + ; @Deprecated - protected TangemPaymentAccount(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + protected TangemPaymentAccount(String contractAddress, Web3j web3j, Credentials credentials, + BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } - protected TangemPaymentAccount(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + protected TangemPaymentAccount(String contractAddress, Web3j web3j, Credentials credentials, + ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, credentials, contractGasProvider); } @Deprecated - protected TangemPaymentAccount(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + protected TangemPaymentAccount(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } - protected TangemPaymentAccount(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + protected TangemPaymentAccount(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); } - public static List getAccountStateAfterSettlementEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(ACCOUNTSTATEAFTERSETTLEMENT_EVENT, transactionReceipt); + public static List getAccountStateAfterSettlementEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(ACCOUNTSTATEAFTERSETTLEMENT_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { AccountStateAfterSettlementEventResponse typedResponse = new AccountStateAfterSettlementEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.balance = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.blockedAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); typedResponse.debtTotal = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); - typedResponse.pendingRefundTotal = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue(); responses.add(typedResponse); } return responses; } - public static AccountStateAfterSettlementEventResponse getAccountStateAfterSettlementEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ACCOUNTSTATEAFTERSETTLEMENT_EVENT, log); + public static AccountStateAfterSettlementEventResponse getAccountStateAfterSettlementEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ACCOUNTSTATEAFTERSETTLEMENT_EVENT, log); AccountStateAfterSettlementEventResponse typedResponse = new AccountStateAfterSettlementEventResponse(); typedResponse.log = log; typedResponse.balance = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.blockedAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); typedResponse.debtTotal = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); - typedResponse.pendingRefundTotal = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue(); return typedResponse; } - public static CardSetEventResponse getCardSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(CARDSET_EVENT, log); - CardSetEventResponse typedResponse = new CardSetEventResponse(); + public Flowable accountStateAfterSettlementEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getAccountStateAfterSettlementEventFromLog(log)); + } + + public Flowable accountStateAfterSettlementEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(ACCOUNTSTATEAFTERSETTLEMENT_EVENT)); + return accountStateAfterSettlementEventFlowable(filter); + } + + public static List getAuthLimitMarginSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(AUTHLIMITMARGINSET_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + AuthLimitMarginSetEventResponse typedResponse = new AuthLimitMarginSetEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.authLimitMargin = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static AuthLimitMarginSetEventResponse getAuthLimitMarginSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(AUTHLIMITMARGINSET_EVENT, log); + AuthLimitMarginSetEventResponse typedResponse = new AuthLimitMarginSetEventResponse(); typedResponse.log = log; - typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.otpRoot = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); + typedResponse.authLimitMargin = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - public static DebtIncreasedEventResponse getDebtIncreasedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTINCREASED_EVENT, log); - DebtIncreasedEventResponse typedResponse = new DebtIncreasedEventResponse(); + public Flowable authLimitMarginSetEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getAuthLimitMarginSetEventFromLog(log)); + } + + public Flowable authLimitMarginSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(AUTHLIMITMARGINSET_EVENT)); + return authLimitMarginSetEventFlowable(filter); + } + + public static List getCardAddedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(CARDADDED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + CardAddedEventResponse typedResponse = new CardAddedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.cardAddress = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.cardData = (CardParams) eventValues.getNonIndexedValues().get(1); + responses.add(typedResponse); + } + return responses; + } + + public static CardAddedEventResponse getCardAddedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(CARDADDED_EVENT, log); + CardAddedEventResponse typedResponse = new CardAddedEventResponse(); typedResponse.log = log; - typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.debtAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + typedResponse.cardAddress = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.cardData = (CardParams) eventValues.getNonIndexedValues().get(1); return typedResponse; } - public static List getCardSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(CARDSET_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - CardSetEventResponse typedResponse = new CardSetEventResponse(); + public Flowable cardAddedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getCardAddedEventFromLog(log)); + } + + public Flowable cardAddedEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(CARDADDED_EVENT)); + return cardAddedEventFlowable(filter); + } + + public static List getCardDisabledEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(CARDDISABLED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + CardDisabledEventResponse typedResponse = new CardDisabledEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.otpRoot = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); responses.add(typedResponse); } return responses; } - public static DebtPaidEventResponse getDebtPaidEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTPAID_EVENT, log); - DebtPaidEventResponse typedResponse = new DebtPaidEventResponse(); + public static CardDisabledEventResponse getCardDisabledEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(CARDDISABLED_EVENT, log); + CardDisabledEventResponse typedResponse = new CardDisabledEventResponse(); typedResponse.log = log; - typedResponse.paid = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.debtLeft = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - public static DebtWrittenOffEventResponse getDebtWrittenOffEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTWRITTENOFF_EVENT, log); - DebtWrittenOffEventResponse typedResponse = new DebtWrittenOffEventResponse(); - typedResponse.log = log; - typedResponse.writtenOff = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.debtLeft = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - return typedResponse; + public Flowable cardDisabledEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getCardDisabledEventFromLog(log)); } - public static List getEIP712DomainChangedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(EIP712DOMAINCHANGED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - EIP712DomainChangedEventResponse typedResponse = new EIP712DomainChangedEventResponse(); + public Flowable cardDisabledEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(CARDDISABLED_EVENT)); + return cardDisabledEventFlowable(filter); + } + + public static List getCardEnabledEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(CARDENABLED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + CardEnabledEventResponse typedResponse = new CardEnabledEventResponse(); typedResponse.log = eventValues.getLog(); + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.isOwner = (Boolean) eventValues.getNonIndexedValues().get(1).getValue(); responses.add(typedResponse); } return responses; } - public static List getDebtIncreasedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(DEBTINCREASED_EVENT, transactionReceipt); + public static CardEnabledEventResponse getCardEnabledEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(CARDENABLED_EVENT, log); + CardEnabledEventResponse typedResponse = new CardEnabledEventResponse(); + typedResponse.log = log; + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.isOwner = (Boolean) eventValues.getNonIndexedValues().get(1).getValue(); + return typedResponse; + } + + public Flowable cardEnabledEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getCardEnabledEventFromLog(log)); + } + + public Flowable cardEnabledEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(CARDENABLED_EVENT)); + return cardEnabledEventFlowable(filter); + } + + public static List getDebtIncreasedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(DEBTINCREASED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { DebtIncreasedEventResponse typedResponse = new DebtIncreasedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -386,34 +489,31 @@ class TangemPaymentAccount extends Contract { return responses; } - public static EIP712DomainChangedEventResponse getEIP712DomainChangedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EIP712DOMAINCHANGED_EVENT, log); - EIP712DomainChangedEventResponse typedResponse = new EIP712DomainChangedEventResponse(); + public static DebtIncreasedEventResponse getDebtIncreasedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTINCREASED_EVENT, log); + DebtIncreasedEventResponse typedResponse = new DebtIncreasedEventResponse(); typedResponse.log = log; + typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.debtAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); return typedResponse; } - public static InitializedEventResponse getInitializedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(INITIALIZED_EVENT, log); - InitializedEventResponse typedResponse = new InitializedEventResponse(); - typedResponse.log = log; - typedResponse.version = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable debtIncreasedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getDebtIncreasedEventFromLog(log)); } - public static InsufficientFundsOnForcedAuthEventResponse getInsufficientFundsOnForcedAuthEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(INSUFFICIENTFUNDSONFORCEDAUTH_EVENT, log); - InsufficientFundsOnForcedAuthEventResponse typedResponse = new InsufficientFundsOnForcedAuthEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.insufficientAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable debtIncreasedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(DEBTINCREASED_EVENT)); + return debtIncreasedEventFlowable(filter); } - public static List getDebtPaidEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(DEBTPAID_EVENT, transactionReceipt); + public static List getDebtPaidEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(DEBTPAID_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { DebtPaidEventResponse typedResponse = new DebtPaidEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.paid = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -423,39 +523,31 @@ class TangemPaymentAccount extends Contract { return responses; } - public static LimitsSetEventResponse getLimitsSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(LIMITSSET_EVENT, log); - LimitsSetEventResponse typedResponse = new LimitsSetEventResponse(); + public static DebtPaidEventResponse getDebtPaidEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTPAID_EVENT, log); + DebtPaidEventResponse typedResponse = new DebtPaidEventResponse(); typedResponse.log = log; - typedResponse.singleTransactionLimit = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.spendLimit = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.noOtpSpendLimit = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); - typedResponse.spendLimitsPeriod = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue(); + typedResponse.paid = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.debtLeft = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); return typedResponse; } - public static NoOtpTransactionAuthorizedEventResponse getNoOtpTransactionAuthorizedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NOOTPTRANSACTIONAUTHORIZED_EVENT, log); - NoOtpTransactionAuthorizedEventResponse typedResponse = new NoOtpTransactionAuthorizedEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable debtPaidEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getDebtPaidEventFromLog(log)); } - public static OtpStateSetEventResponse getOtpStateSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OTPSTATESET_EVENT, log); - OtpStateSetEventResponse typedResponse = new OtpStateSetEventResponse(); - typedResponse.log = log; - typedResponse.otpRoot = (byte[]) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - return typedResponse; + public Flowable debtPaidEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(DEBTPAID_EVENT)); + return debtPaidEventFlowable(filter); } - public static List getDebtWrittenOffEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(DEBTWRITTENOFF_EVENT, transactionReceipt); + public static List getDebtWrittenOffEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(DEBTWRITTENOFF_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { DebtWrittenOffEventResponse typedResponse = new DebtWrittenOffEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.writtenOff = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -465,10 +557,232 @@ class TangemPaymentAccount extends Contract { return responses; } - public static List getOwnerSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(OWNERSET_EVENT, transactionReceipt); + public static DebtWrittenOffEventResponse getDebtWrittenOffEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEBTWRITTENOFF_EVENT, log); + DebtWrittenOffEventResponse typedResponse = new DebtWrittenOffEventResponse(); + typedResponse.log = log; + typedResponse.writtenOff = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.debtLeft = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + return typedResponse; + } + + public Flowable debtWrittenOffEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getDebtWrittenOffEventFromLog(log)); + } + + public Flowable debtWrittenOffEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(DEBTWRITTENOFF_EVENT)); + return debtWrittenOffEventFlowable(filter); + } + + public static List getEIP712DomainChangedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(EIP712DOMAINCHANGED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + EIP712DomainChangedEventResponse typedResponse = new EIP712DomainChangedEventResponse(); + typedResponse.log = eventValues.getLog(); + responses.add(typedResponse); + } + return responses; + } + + public static EIP712DomainChangedEventResponse getEIP712DomainChangedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EIP712DOMAINCHANGED_EVENT, log); + EIP712DomainChangedEventResponse typedResponse = new EIP712DomainChangedEventResponse(); + typedResponse.log = log; + return typedResponse; + } + + public Flowable eIP712DomainChangedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getEIP712DomainChangedEventFromLog(log)); + } + + public Flowable eIP712DomainChangedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(EIP712DOMAINCHANGED_EVENT)); + return eIP712DomainChangedEventFlowable(filter); + } + + public static List getInitializedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(INITIALIZED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + InitializedEventResponse typedResponse = new InitializedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.version = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static InitializedEventResponse getInitializedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(INITIALIZED_EVENT, log); + InitializedEventResponse typedResponse = new InitializedEventResponse(); + typedResponse.log = log; + typedResponse.version = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable initializedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getInitializedEventFromLog(log)); + } + + public Flowable initializedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(INITIALIZED_EVENT)); + return initializedEventFlowable(filter); + } + + public static List getInsufficientFundsOnForcedAuthEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(INSUFFICIENTFUNDSONFORCEDAUTH_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + InsufficientFundsOnForcedAuthEventResponse typedResponse = new InsufficientFundsOnForcedAuthEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.insufficientAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static InsufficientFundsOnForcedAuthEventResponse getInsufficientFundsOnForcedAuthEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(INSUFFICIENTFUNDSONFORCEDAUTH_EVENT, log); + InsufficientFundsOnForcedAuthEventResponse typedResponse = new InsufficientFundsOnForcedAuthEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.insufficientAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable insufficientFundsOnForcedAuthEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getInsufficientFundsOnForcedAuthEventFromLog(log)); + } + + public Flowable insufficientFundsOnForcedAuthEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(INSUFFICIENTFUNDSONFORCEDAUTH_EVENT)); + return insufficientFundsOnForcedAuthEventFlowable(filter); + } + + public static List getLimitsSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(LIMITSSET_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + LimitsSetEventResponse typedResponse = new LimitsSetEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.limitsParams = (LimitsParams) eventValues.getNonIndexedValues().get(1); + responses.add(typedResponse); + } + return responses; + } + + public static LimitsSetEventResponse getLimitsSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(LIMITSSET_EVENT, log); + LimitsSetEventResponse typedResponse = new LimitsSetEventResponse(); + typedResponse.log = log; + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.limitsParams = (LimitsParams) eventValues.getNonIndexedValues().get(1); + return typedResponse; + } + + public Flowable limitsSetEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getLimitsSetEventFromLog(log)); + } + + public Flowable limitsSetEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(LIMITSSET_EVENT)); + return limitsSetEventFlowable(filter); + } + + public static List getOtpStateSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(OTPSTATESET_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + OtpStateSetEventResponse typedResponse = new OtpStateSetEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.otpState = (OtpState) eventValues.getNonIndexedValues().get(1); + responses.add(typedResponse); + } + return responses; + } + + public static OtpStateSetEventResponse getOtpStateSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OTPSTATESET_EVENT, log); + OtpStateSetEventResponse typedResponse = new OtpStateSetEventResponse(); + typedResponse.log = log; + typedResponse.card = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.otpState = (OtpState) eventValues.getNonIndexedValues().get(1); + return typedResponse; + } + + public Flowable otpStateSetEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getOtpStateSetEventFromLog(log)); + } + + public Flowable otpStateSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(OTPSTATESET_EVENT)); + return otpStateSetEventFlowable(filter); + } + + public static List getOwnerRemovedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(OWNERREMOVED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + OwnerRemovedEventResponse typedResponse = new OwnerRemovedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.previousOwner = (String) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static OwnerRemovedEventResponse getOwnerRemovedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERREMOVED_EVENT, log); + OwnerRemovedEventResponse typedResponse = new OwnerRemovedEventResponse(); + typedResponse.log = log; + typedResponse.previousOwner = (String) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable ownerRemovedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getOwnerRemovedEventFromLog(log)); + } + + public Flowable ownerRemovedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(OWNERREMOVED_EVENT)); + return ownerRemovedEventFlowable(filter); + } + + public static List getOwnerSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(OWNERSET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { OwnerSetEventResponse typedResponse = new OwnerSetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.owner = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -478,277 +792,29 @@ class TangemPaymentAccount extends Contract { } public static OwnerSetEventResponse getOwnerSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERSET_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERSET_EVENT, log); OwnerSetEventResponse typedResponse = new OwnerSetEventResponse(); typedResponse.log = log; typedResponse.owner = (String) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } - public static PendingRefundSavedEventResponse getPendingRefundSavedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PENDINGREFUNDSAVED_EVENT, log); - PendingRefundSavedEventResponse typedResponse = new PendingRefundSavedEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; + public Flowable ownerSetEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getOwnerSetEventFromLog(log)); } - public static ProcessorSetEventResponse getProcessorSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PROCESSORSET_EVENT, log); - ProcessorSetEventResponse typedResponse = new ProcessorSetEventResponse(); - typedResponse.log = log; - typedResponse.processor = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.paymentToken = (String) eventValues.getNonIndexedValues().get(1).getValue(); - return typedResponse; - } - - public static RefundPaidEventResponse getRefundPaidEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REFUNDPAID_EVENT, log); - RefundPaidEventResponse typedResponse = new RefundPaidEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static TransactionAmountChangedEventResponse getTransactionAmountChangedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONAMOUNTCHANGED_EVENT, log); - TransactionAmountChangedEventResponse typedResponse = new TransactionAmountChangedEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.newAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static TransactionAuthorizedEventResponse getTransactionAuthorizedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZED_EVENT, log); - TransactionAuthorizedEventResponse typedResponse = new TransactionAuthorizedEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.otp = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); - return typedResponse; - } - - public static List getInitializedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(INITIALIZED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - InitializedEventResponse typedResponse = new InitializedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.version = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static TransactionSettledEventResponse getTransactionSettledEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONSETTLED_EVENT, log); - TransactionSettledEventResponse typedResponse = new TransactionSettledEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.settlementAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.paymentAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - return typedResponse; - } - - public static UnsettledTransactionUnblockedEventResponse getUnsettledTransactionUnblockedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNSETTLEDTRANSACTIONUNBLOCKED_EVENT, log); - UnsettledTransactionUnblockedEventResponse typedResponse = new UnsettledTransactionUnblockedEventResponse(); - typedResponse.log = log; - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static UpgradedEventResponse getUpgradedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UPGRADED_EVENT, log); - UpgradedEventResponse typedResponse = new UpgradedEventResponse(); - typedResponse.log = log; - typedResponse.implementation = (String) eventValues.getIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static List getInsufficientFundsOnForcedAuthEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(INSUFFICIENTFUNDSONFORCEDAUTH_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - InsufficientFundsOnForcedAuthEventResponse typedResponse = new InsufficientFundsOnForcedAuthEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.insufficientAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static VerifiedBalanceIncreasedEventResponse getVerifiedBalanceIncreasedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASED_EVENT, log); - VerifiedBalanceIncreasedEventResponse typedResponse = new VerifiedBalanceIncreasedEventResponse(); - typedResponse.log = log; - typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.verifiedBalance = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - return typedResponse; - } - - public static VerifiedBalanceSetEventResponse getVerifiedBalanceSetEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCESET_EVENT, log); - VerifiedBalanceSetEventResponse typedResponse = new VerifiedBalanceSetEventResponse(); - typedResponse.log = log; - typedResponse.verifiedBalance = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public static WithdrawalCanceledEventResponse getWithdrawalCanceledEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALCANCELED_EVENT, log); - WithdrawalCanceledEventResponse typedResponse = new WithdrawalCanceledEventResponse(); - typedResponse.log = log; - return typedResponse; - } - - public static List getLimitsSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(LIMITSSET_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - LimitsSetEventResponse typedResponse = new LimitsSetEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.singleTransactionLimit = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.spendLimit = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.noOtpSpendLimit = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); - typedResponse.spendLimitsPeriod = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static WithdrawalCompleteEventResponse getWithdrawalCompleteEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALCOMPLETE_EVENT, log); - WithdrawalCompleteEventResponse typedResponse = new WithdrawalCompleteEventResponse(); - typedResponse.log = log; - typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - @Deprecated - public static TangemPaymentAccount load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { - return new TangemPaymentAccount(contractAddress, web3j, credentials, gasPrice, gasLimit); - } - - @Deprecated - public static TangemPaymentAccount load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { - return new TangemPaymentAccount(contractAddress, web3j, transactionManager, gasPrice, gasLimit); - } - - public static List getNoOtpTransactionAuthorizedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NOOTPTRANSACTIONAUTHORIZED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - NoOtpTransactionAuthorizedEventResponse typedResponse = new NoOtpTransactionAuthorizedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static TangemPaymentAccount load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { - return new TangemPaymentAccount(contractAddress, web3j, credentials, contractGasProvider); - } - - public static TangemPaymentAccount load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { - return new TangemPaymentAccount(contractAddress, web3j, transactionManager, contractGasProvider); - } - - public static RemoteCall deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String trustedForwarder) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, trustedForwarder))); - return deployRemoteCall(TangemPaymentAccount.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor); - } - - public static List getOtpStateSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(OTPSTATESET_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - OtpStateSetEventResponse typedResponse = new OtpStateSetEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.otpRoot = (byte[]) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String trustedForwarder) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, trustedForwarder))); - return deployRemoteCall(TangemPaymentAccount.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor); - } - - @Deprecated - public static RemoteCall deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String trustedForwarder) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, trustedForwarder))); - return deployRemoteCall(TangemPaymentAccount.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor); - } - - @Deprecated - public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String trustedForwarder) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, trustedForwarder))); - return deployRemoteCall(TangemPaymentAccount.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor); - } - - public Flowable accountStateAfterSettlementEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getAccountStateAfterSettlementEventFromLog(log)); - } - - public Flowable accountStateAfterSettlementEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable ownerSetEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(ACCOUNTSTATEAFTERSETTLEMENT_EVENT)); - return accountStateAfterSettlementEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(OWNERSET_EVENT)); + return ownerSetEventFlowable(filter); } - public Flowable cardSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getCardSetEventFromLog(log)); - } - - public Flowable cardSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(CARDSET_EVENT)); - return cardSetEventFlowable(filter); - } - - public static List getPendingRefundSavedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PENDINGREFUNDSAVED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PendingRefundSavedEventResponse typedResponse = new PendingRefundSavedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public Flowable debtIncreasedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getDebtIncreasedEventFromLog(log)); - } - - public Flowable debtIncreasedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(DEBTINCREASED_EVENT)); - return debtIncreasedEventFlowable(filter); - } - - public Flowable debtPaidEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getDebtPaidEventFromLog(log)); - } - - public static List getProcessorSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PROCESSORSET_EVENT, transactionReceipt); + public static List getProcessorSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(PROCESSORSET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { ProcessorSetEventResponse typedResponse = new ProcessorSetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.processor = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -758,85 +824,147 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable debtPaidEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static ProcessorSetEventResponse getProcessorSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PROCESSORSET_EVENT, log); + ProcessorSetEventResponse typedResponse = new ProcessorSetEventResponse(); + typedResponse.log = log; + typedResponse.processor = (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.paymentToken = (String) eventValues.getNonIndexedValues().get(1).getValue(); + return typedResponse; + } + + public Flowable processorSetEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getProcessorSetEventFromLog(log)); + } + + public Flowable processorSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(DEBTPAID_EVENT)); - return debtPaidEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(PROCESSORSET_EVENT)); + return processorSetEventFlowable(filter); } - public Flowable debtWrittenOffEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getDebtWrittenOffEventFromLog(log)); - } - - public Flowable debtWrittenOffEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(DEBTWRITTENOFF_EVENT)); - return debtWrittenOffEventFlowable(filter); - } - - public static List getRefundPaidEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(REFUNDPAID_EVENT, transactionReceipt); + public static List getRefundPaidEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(REFUNDPAID_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { RefundPaidEventResponse typedResponse = new RefundPaidEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } - public Flowable eIP712DomainChangedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getEIP712DomainChangedEventFromLog(log)); + public static RefundPaidEventResponse getRefundPaidEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REFUNDPAID_EVENT, log); + RefundPaidEventResponse typedResponse = new RefundPaidEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public Flowable eIP712DomainChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable refundPaidEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getRefundPaidEventFromLog(log)); + } + + public Flowable refundPaidEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(EIP712DOMAINCHANGED_EVENT)); - return eIP712DomainChangedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(REFUNDPAID_EVENT)); + return refundPaidEventFlowable(filter); } - public Flowable initializedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getInitializedEventFromLog(log)); - } - - public static List getTransactionAmountChangedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(TRANSACTIONAMOUNTCHANGED_EVENT, transactionReceipt); + public static List getTransactionAmountChangedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(TRANSACTIONAMOUNTCHANGED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { TransactionAmountChangedEventResponse typedResponse = new TransactionAmountChangedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); typedResponse.newAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } - public Flowable initializedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static TransactionAmountChangedEventResponse getTransactionAmountChangedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONAMOUNTCHANGED_EVENT, log); + TransactionAmountChangedEventResponse typedResponse = new TransactionAmountChangedEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.newAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable transactionAmountChangedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getTransactionAmountChangedEventFromLog(log)); + } + + public Flowable transactionAmountChangedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(INITIALIZED_EVENT)); - return initializedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(TRANSACTIONAMOUNTCHANGED_EVENT)); + return transactionAmountChangedEventFlowable(filter); } - public Flowable insufficientFundsOnForcedAuthEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getInsufficientFundsOnForcedAuthEventFromLog(log)); - } - - public Flowable insufficientFundsOnForcedAuthEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(INSUFFICIENTFUNDSONFORCEDAUTH_EVENT)); - return insufficientFundsOnForcedAuthEventFlowable(filter); - } - - public static List getTransactionAuthorizedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - TransactionAuthorizedEventResponse typedResponse = new TransactionAuthorizedEventResponse(); + public static List getTransactionAuthorizedNoConfirmationEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZEDNOCONFIRMATION_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + TransactionAuthorizedNoConfirmationEventResponse typedResponse = new TransactionAuthorizedNoConfirmationEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static TransactionAuthorizedNoConfirmationEventResponse getTransactionAuthorizedNoConfirmationEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZEDNOCONFIRMATION_EVENT, log); + TransactionAuthorizedNoConfirmationEventResponse typedResponse = new TransactionAuthorizedNoConfirmationEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable transactionAuthorizedNoConfirmationEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getTransactionAuthorizedNoConfirmationEventFromLog(log)); + } + + public Flowable transactionAuthorizedNoConfirmationEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(TRANSACTIONAUTHORIZEDNOCONFIRMATION_EVENT)); + return transactionAuthorizedNoConfirmationEventFlowable(filter); + } + + public static List getTransactionAuthorizedWithOtpEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZEDWITHOTP_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + TransactionAuthorizedWithOtpEventResponse typedResponse = new TransactionAuthorizedWithOtpEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.otp = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); @@ -845,27 +973,80 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable limitsSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getLimitsSetEventFromLog(log)); + public static TransactionAuthorizedWithOtpEventResponse getTransactionAuthorizedWithOtpEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZEDWITHOTP_EVENT, log); + TransactionAuthorizedWithOtpEventResponse typedResponse = new TransactionAuthorizedWithOtpEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.otp = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); + typedResponse.otpCounter = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); + return typedResponse; } - public Flowable limitsSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable transactionAuthorizedWithOtpEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getTransactionAuthorizedWithOtpEventFromLog(log)); + } + + public Flowable transactionAuthorizedWithOtpEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(LIMITSSET_EVENT)); - return limitsSetEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(TRANSACTIONAUTHORIZEDWITHOTP_EVENT)); + return transactionAuthorizedWithOtpEventFlowable(filter); } - public Flowable noOtpTransactionAuthorizedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getNoOtpTransactionAuthorizedEventFromLog(log)); + public static List getTransactionAuthorizedWithSignatureEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZEDWITHSIGNATURE_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + TransactionAuthorizedWithSignatureEventResponse typedResponse = new TransactionAuthorizedWithSignatureEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.signature = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); + responses.add(typedResponse); + } + return responses; } - public static List getTransactionSettledEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(TRANSACTIONSETTLED_EVENT, transactionReceipt); + public static TransactionAuthorizedWithSignatureEventResponse getTransactionAuthorizedWithSignatureEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONAUTHORIZEDWITHSIGNATURE_EVENT, log); + TransactionAuthorizedWithSignatureEventResponse typedResponse = new TransactionAuthorizedWithSignatureEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.signature = (byte[]) eventValues.getNonIndexedValues().get(1).getValue(); + return typedResponse; + } + + public Flowable transactionAuthorizedWithSignatureEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getTransactionAuthorizedWithSignatureEventFromLog(log)); + } + + public Flowable transactionAuthorizedWithSignatureEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(TRANSACTIONAUTHORIZEDWITHSIGNATURE_EVENT)); + return transactionAuthorizedWithSignatureEventFlowable(filter); + } + + public static List getTransactionSettledEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(TRANSACTIONSETTLED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { TransactionSettledEventResponse typedResponse = new TransactionSettledEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); typedResponse.settlementAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.paymentAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); responses.add(typedResponse); @@ -873,53 +1054,72 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable noOtpTransactionAuthorizedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static TransactionSettledEventResponse getTransactionSettledEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TRANSACTIONSETTLED_EVENT, log); + TransactionSettledEventResponse typedResponse = new TransactionSettledEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.settlementAmount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.paymentAmount = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + return typedResponse; + } + + public Flowable transactionSettledEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getTransactionSettledEventFromLog(log)); + } + + public Flowable transactionSettledEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(NOOTPTRANSACTIONAUTHORIZED_EVENT)); - return noOtpTransactionAuthorizedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(TRANSACTIONSETTLED_EVENT)); + return transactionSettledEventFlowable(filter); } - public Flowable otpStateSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getOtpStateSetEventFromLog(log)); - } - - public Flowable otpStateSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(OTPSTATESET_EVENT)); - return otpStateSetEventFlowable(filter); - } - - public static List getUnsettledTransactionUnblockedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(UNSETTLEDTRANSACTIONUNBLOCKED_EVENT, transactionReceipt); + public static List getUnsettledTransactionUnblockedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(UNSETTLEDTRANSACTIONUNBLOCKED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { UnsettledTransactionUnblockedEventResponse typedResponse = new UnsettledTransactionUnblockedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } - public Flowable ownerSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getOwnerSetEventFromLog(log)); + public static UnsettledTransactionUnblockedEventResponse getUnsettledTransactionUnblockedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNSETTLEDTRANSACTIONUNBLOCKED_EVENT, log); + UnsettledTransactionUnblockedEventResponse typedResponse = new UnsettledTransactionUnblockedEventResponse(); + typedResponse.log = log; + typedResponse.transactionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public Flowable ownerSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable unsettledTransactionUnblockedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getUnsettledTransactionUnblockedEventFromLog(log)); + } + + public Flowable unsettledTransactionUnblockedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(OWNERSET_EVENT)); - return ownerSetEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(UNSETTLEDTRANSACTIONUNBLOCKED_EVENT)); + return unsettledTransactionUnblockedEventFlowable(filter); } - public Flowable pendingRefundSavedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPendingRefundSavedEventFromLog(log)); - } - - public static List getUpgradedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(UPGRADED_EVENT, transactionReceipt); + public static List getUpgradedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(UPGRADED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { UpgradedEventResponse typedResponse = new UpgradedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.implementation = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -928,26 +1128,30 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable pendingRefundSavedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static UpgradedEventResponse getUpgradedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UPGRADED_EVENT, log); + UpgradedEventResponse typedResponse = new UpgradedEventResponse(); + typedResponse.log = log; + typedResponse.implementation = (String) eventValues.getIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable upgradedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getUpgradedEventFromLog(log)); + } + + public Flowable upgradedEventFlowable(DefaultBlockParameter startBlock, + DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PENDINGREFUNDSAVED_EVENT)); - return pendingRefundSavedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(UPGRADED_EVENT)); + return upgradedEventFlowable(filter); } - public Flowable processorSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getProcessorSetEventFromLog(log)); - } - - public Flowable processorSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PROCESSORSET_EVENT)); - return processorSetEventFlowable(filter); - } - - public static List getVerifiedBalanceIncreasedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASED_EVENT, transactionReceipt); + public static List getVerifiedBalanceIncreasedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { VerifiedBalanceIncreasedEventResponse typedResponse = new VerifiedBalanceIncreasedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -957,24 +1161,33 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable refundPaidEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getRefundPaidEventFromLog(log)); + public static VerifiedBalanceIncreasedEventResponse getVerifiedBalanceIncreasedEventFromLog( + Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCEINCREASED_EVENT, log); + VerifiedBalanceIncreasedEventResponse typedResponse = new VerifiedBalanceIncreasedEventResponse(); + typedResponse.log = log; + typedResponse.increase = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.verifiedBalance = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); + return typedResponse; } - public Flowable refundPaidEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable verifiedBalanceIncreasedEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceIncreasedEventFromLog(log)); + } + + public Flowable verifiedBalanceIncreasedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(REFUNDPAID_EVENT)); - return refundPaidEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCEINCREASED_EVENT)); + return verifiedBalanceIncreasedEventFlowable(filter); } - public Flowable transactionAmountChangedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getTransactionAmountChangedEventFromLog(log)); - } - - public static List getVerifiedBalanceSetEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCESET_EVENT, transactionReceipt); + public static List getVerifiedBalanceSetEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(VERIFIEDBALANCESET_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { VerifiedBalanceSetEventResponse typedResponse = new VerifiedBalanceSetEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.verifiedBalance = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -983,51 +1196,66 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable transactionAmountChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static VerifiedBalanceSetEventResponse getVerifiedBalanceSetEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VERIFIEDBALANCESET_EVENT, log); + VerifiedBalanceSetEventResponse typedResponse = new VerifiedBalanceSetEventResponse(); + typedResponse.log = log; + typedResponse.verifiedBalance = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable verifiedBalanceSetEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceSetEventFromLog(log)); + } + + public Flowable verifiedBalanceSetEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(TRANSACTIONAMOUNTCHANGED_EVENT)); - return transactionAmountChangedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCESET_EVENT)); + return verifiedBalanceSetEventFlowable(filter); } - public Flowable transactionAuthorizedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getTransactionAuthorizedEventFromLog(log)); - } - - public Flowable transactionAuthorizedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(TRANSACTIONAUTHORIZED_EVENT)); - return transactionAuthorizedEventFlowable(filter); - } - - public static List getWithdrawalCanceledEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(WITHDRAWALCANCELED_EVENT, transactionReceipt); + public static List getWithdrawalCanceledEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(WITHDRAWALCANCELED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { WithdrawalCanceledEventResponse typedResponse = new WithdrawalCanceledEventResponse(); typedResponse.log = eventValues.getLog(); + typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } - public Flowable transactionSettledEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getTransactionSettledEventFromLog(log)); + public static WithdrawalCanceledEventResponse getWithdrawalCanceledEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALCANCELED_EVENT, log); + WithdrawalCanceledEventResponse typedResponse = new WithdrawalCanceledEventResponse(); + typedResponse.log = log; + typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; } - public Flowable transactionSettledEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable withdrawalCanceledEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getWithdrawalCanceledEventFromLog(log)); + } + + public Flowable withdrawalCanceledEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(TRANSACTIONSETTLED_EVENT)); - return transactionSettledEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(WITHDRAWALCANCELED_EVENT)); + return withdrawalCanceledEventFlowable(filter); } - public Flowable unsettledTransactionUnblockedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getUnsettledTransactionUnblockedEventFromLog(log)); - } - - public static List getWithdrawalCompleteEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(WITHDRAWALCOMPLETE_EVENT, transactionReceipt); + public static List getWithdrawalCompleteEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(WITHDRAWALCOMPLETE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { WithdrawalCompleteEventResponse typedResponse = new WithdrawalCompleteEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -1037,28 +1265,35 @@ class TangemPaymentAccount extends Contract { return responses; } - public Flowable unsettledTransactionUnblockedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static WithdrawalCompleteEventResponse getWithdrawalCompleteEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALCOMPLETE_EVENT, log); + WithdrawalCompleteEventResponse typedResponse = new WithdrawalCompleteEventResponse(); + typedResponse.log = log; + typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable withdrawalCompleteEventFlowable( + EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getWithdrawalCompleteEventFromLog(log)); + } + + public Flowable withdrawalCompleteEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(UNSETTLEDTRANSACTIONUNBLOCKED_EVENT)); - return unsettledTransactionUnblockedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(WITHDRAWALCOMPLETE_EVENT)); + return withdrawalCompleteEventFlowable(filter); } - public Flowable upgradedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getUpgradedEventFromLog(log)); - } - - public Flowable upgradedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(UPGRADED_EVENT)); - return upgradedEventFlowable(filter); - } - - public static List getWithdrawalInitiatedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(WITHDRAWALINITIATED_EVENT, transactionReceipt); + public static List getWithdrawalInitiatedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(WITHDRAWALINITIATED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { WithdrawalInitiatedEventResponse typedResponse = new WithdrawalInitiatedEventResponse(); typedResponse.log = eventValues.getLog(); + typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.readyToWithdrawTimestamp = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); responses.add(typedResponse); @@ -1067,175 +1302,176 @@ class TangemPaymentAccount extends Contract { } public static WithdrawalInitiatedEventResponse getWithdrawalInitiatedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALINITIATED_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALINITIATED_EVENT, log); WithdrawalInitiatedEventResponse typedResponse = new WithdrawalInitiatedEventResponse(); typedResponse.log = log; + typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.readyToWithdrawTimestamp = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue(); return typedResponse; } - public Flowable withdrawalInitiatedEventFlowable(EthFilter filter) { + public Flowable withdrawalInitiatedEventFlowable( + EthFilter filter) { return web3j.ethLogFlowable(filter).map(log -> getWithdrawalInitiatedEventFromLog(log)); } - public Flowable withdrawalInitiatedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable withdrawalInitiatedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(WITHDRAWALINITIATED_EVENT)); return withdrawalInitiatedEventFlowable(filter); } - public Flowable verifiedBalanceIncreasedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceIncreasedEventFromLog(log)); - } - - public Flowable verifiedBalanceIncreasedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCEINCREASED_EVENT)); - return verifiedBalanceIncreasedEventFlowable(filter); - } - - public Flowable verifiedBalanceSetEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getVerifiedBalanceSetEventFromLog(log)); - } - - public Flowable verifiedBalanceSetEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(VERIFIEDBALANCESET_EVENT)); - return verifiedBalanceSetEventFlowable(filter); - } - - public Flowable withdrawalCanceledEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getWithdrawalCanceledEventFromLog(log)); - } - - public Flowable withdrawalCanceledEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(WITHDRAWALCANCELED_EVENT)); - return withdrawalCanceledEventFlowable(filter); - } - - public Flowable withdrawalCompleteEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getWithdrawalCompleteEventFromLog(log)); - } - - public Flowable withdrawalCompleteEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(WITHDRAWALCOMPLETE_EVENT)); - return withdrawalCompleteEventFlowable(filter); - } - public RemoteFunctionCall UPGRADE_INTERFACE_VERSION() { final Function function = new Function(FUNC_UPGRADE_INTERFACE_VERSION, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall> authorizedTransactions(BigInteger param0) { - final Function function = new Function(FUNC_AUTHORIZEDTRANSACTIONS, - List.of(new Uint256(param0)), - Arrays.asList(new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - })); - return new RemoteFunctionCall>(function, - new Callable>() { + public RemoteFunctionCall activeCardAddresses() { + final Function function = new Function(FUNC_ACTIVECARDADDRESSES, + Arrays.asList(), + Arrays.>asList(new TypeReference>() {})); + return new RemoteFunctionCall(function, + new Callable() { @Override - public Tuple3 call() throws Exception { + @SuppressWarnings("unchecked") + public List call() throws Exception { + List result = (List) executeCallSingleValueReturn(function, List.class); + return convertToNative(result); + } + }); + } + + public RemoteFunctionCall addCard(String cardAddress, CardParams cardParams, + byte[] ownershipAcceptanceSignature, byte[] cardConfirmationSignature) { + final Function function = new Function( + FUNC_ADDCARD, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, cardAddress), + cardParams, + new org.web3j.abi.datatypes.DynamicBytes(ownershipAcceptanceSignature), + new org.web3j.abi.datatypes.DynamicBytes(cardConfirmationSignature)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall authLimitMargin() { + final Function function = new Function(FUNC_AUTHLIMITMARGIN, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, BigInteger.class); + } + + public RemoteFunctionCall> authorizedTransactions( + BigInteger param0) { + final Function function = new Function(FUNC_AUTHORIZEDTRANSACTIONS, + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(param0)), + Arrays.>asList(new TypeReference() {}, new TypeReference
() {}, new TypeReference() {}, new TypeReference() {})); + return new RemoteFunctionCall>(function, + new Callable>() { + @Override + public Tuple4 call() throws Exception { List results = executeCallMultipleValueReturn(function); - return new Tuple3( + return new Tuple4( (BigInteger) results.get(0).getValue(), - (BigInteger) results.get(1).getValue(), - (Boolean) results.get(2).getValue()); + (String) results.get(1).getValue(), + (BigInteger) results.get(2).getValue(), + (Boolean) results.get(3).getValue()); } }); } public RemoteFunctionCall availableForDebtPayment() { final Function function = new Function(FUNC_AVAILABLEFORDEBTPAYMENT, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall availableForPayment() { final Function function = new Function(FUNC_AVAILABLEFORPAYMENT, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall availableForWithdrawal() { final Function function = new Function(FUNC_AVAILABLEFORWITHDRAWAL, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall blockedAmount() { final Function function = new Function(FUNC_BLOCKEDAMOUNT, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall cancelWithdrawal() { final Function function = new Function( FUNC_CANCELWITHDRAWAL, - List.of(), - Collections.emptyList()); + Arrays.asList(), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall> cardWithOtp() { - final Function function = new Function(FUNC_CARDWITHOTP, - List.of(), - Arrays.asList(new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - })); - return new RemoteFunctionCall>(function, - new Callable>() { + public RemoteFunctionCall cardConfirmationNonce() { + final Function function = new Function(FUNC_CARDCONFIRMATIONNONCE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeRemoteCallSingleValueReturn(function, BigInteger.class); + } + + public RemoteFunctionCall> cards( + String param0) { + final Function function = new Function(FUNC_CARDS, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, param0)), + Arrays.>asList(new TypeReference() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {})); + return new RemoteFunctionCall>(function, + new Callable>() { @Override - public Tuple3 call() throws Exception { + public Tuple5 call( + ) throws Exception { List results = executeCallMultipleValueReturn(function); - return new Tuple3( - (CardWithOtp) results.get(0), - (CardWithOtp) results.get(1), - (BigInteger) results.get(2).getValue()); + return new Tuple5( + (Boolean) results.get(0).getValue(), + (Boolean) results.get(1).getValue(), + (BigInteger) results.get(2).getValue(), + (OtpStateSetting) results.get(3), + (LimitsSetting) results.get(4)); } }); } public RemoteFunctionCall debtAmount() { final Function function = new Function(FUNC_DEBTAMOUNT, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } - public RemoteFunctionCall>> eip712Domain() { + public RemoteFunctionCall disableCard(String card) { + final Function function = new Function( + FUNC_DISABLECARD, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall>> eip712Domain( + ) { final Function function = new Function(FUNC_EIP712DOMAIN, - List.of(), - Arrays.asList(new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - }, new TypeReference
() { - }, new TypeReference() { - }, new TypeReference>() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference() {}, new TypeReference
() {}, new TypeReference() {}, new TypeReference>() {})); return new RemoteFunctionCall>>(function, new Callable>>() { @Override - public Tuple7> call() throws Exception { + public Tuple7> call( + ) throws Exception { List results = executeCallMultipleValueReturn(function); return new Tuple7>( (byte[]) results.get(0).getValue(), @@ -1249,369 +1485,427 @@ class TangemPaymentAccount extends Contract { }); } + public RemoteFunctionCall enableCard(String card, Boolean isOwner, + byte[] ownershipAcceptanceSignature, byte[] cardConfirmationSignature) { + final Function function = new Function( + FUNC_ENABLECARD, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.Bool(isOwner), + new org.web3j.abi.datatypes.DynamicBytes(ownershipAcceptanceSignature), + new org.web3j.abi.datatypes.DynamicBytes(cardConfirmationSignature)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + public RemoteFunctionCall factory() { final Function function = new Function(FUNC_FACTORY, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall increaseVerifiedBalance(BigInteger increase) { final Function function = new Function( FUNC_INCREASEVERIFIEDBALANCE, - List.of(new Uint256(increase)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(increase)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall initWithdrawal(BigInteger amount) { + public RemoteFunctionCall initWithdrawal(String to, BigInteger amount) { final Function function = new Function( FUNC_INITWITHDRAWAL, - List.of(new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, to), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall initialize(String owner_, String registry_, BigInteger singleTransactionLimit, BigInteger spendLimit, BigInteger noOtpSpendLimit, BigInteger spendLimitsPeriod) { + public RemoteFunctionCall initialize(String owner_, String processor_, + String registry_, String cardAddress, CardParams cardParams, + BigInteger authLimitMargin_) { final Function function = new Function( FUNC_INITIALIZE, - Arrays.asList(new Address(160, owner_), - new Address(160, registry_), - new Uint256(singleTransactionLimit), - new Uint256(spendLimit), - new Uint256(noOtpSpendLimit), - new Uint256(spendLimitsPeriod)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner_), + new org.web3j.abi.datatypes.Address(160, processor_), + new org.web3j.abi.datatypes.Address(160, registry_), + new org.web3j.abi.datatypes.Address(160, cardAddress), + cardParams, + new org.web3j.abi.datatypes.generated.Uint256(authLimitMargin_)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall isTrustedForwarder(String forwarder) { final Function function = new Function(FUNC_ISTRUSTEDFORWARDER, - List.of(new Address(160, forwarder)), - List.of(new TypeReference() { - })); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, forwarder)), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall isWithdrawalInProgress() { final Function function = new Function(FUNC_ISWITHDRAWALINPROGRESS, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall isWithdrawalReady() { final Function function = new Function(FUNC_ISWITHDRAWALREADY, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } - public RemoteFunctionCall> limits() { - final Function function = new Function(FUNC_LIMITS, - List.of(), - Arrays.asList(new TypeReference() { - }, new TypeReference() { - }, new TypeReference() { - })); - return new RemoteFunctionCall>(function, - new Callable>() { - @Override - public Tuple3 call() throws Exception { - List results = executeCallMultipleValueReturn(function); - return new Tuple3( - (Limits) results.get(0), - (Limits) results.get(1), - (BigInteger) results.get(2).getValue()); - } - }); - } - public RemoteFunctionCall owner() { final Function function = new Function(FUNC_OWNER, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall ownershipAcceptanceNonce() { final Function function = new Function(FUNC_OWNERSHIPACCEPTANCENONCE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } + public RemoteFunctionCall payDebt(BigInteger amount) { + final Function function = new Function( + FUNC_PAYDEBT, + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + public RemoteFunctionCall paymentToken() { final Function function = new Function(FUNC_PAYMENTTOKEN, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall pendingRefundAmount(BigInteger transactionId) { - final Function function = new Function(FUNC_PENDINGREFUNDAMOUNT, - List.of(new Uint256(transactionId)), - List.of(new TypeReference() { - })); - return executeRemoteCallSingleValueReturn(function, BigInteger.class); - } - - public RemoteFunctionCall pendingRefundTotal() { - final Function function = new Function(FUNC_PENDINGREFUNDTOTAL, - List.of(), - List.of(new TypeReference() { - })); - return executeRemoteCallSingleValueReturn(function, BigInteger.class); - } - - public RemoteFunctionCall processAuthorization(BigInteger transactionId, BigInteger amount, byte[] otp, BigInteger otpCounter, Boolean forced) { - final Function function = new Function( - FUNC_PROCESSAUTHORIZATION, - Arrays.asList(new Uint256(transactionId), - new Uint256(amount), - new Bytes16(otp), - new Uint16(otpCounter), - new Bool(forced)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall processAuthorizationChange(BigInteger transactionId, BigInteger newAmount) { + public RemoteFunctionCall processAuthorizationChange(String card, + BigInteger transactionId, BigInteger newAmount) { final Function function = new Function( FUNC_PROCESSAUTHORIZATIONCHANGE, - Arrays.asList(new Uint256(transactionId), - new Uint256(newAmount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(newAmount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processAuthorizationNoOtp(BigInteger transactionId, BigInteger amount, Boolean forced) { - final Function function = new Function( - FUNC_PROCESSAUTHORIZATIONNOOTP, - Arrays.asList(new Uint256(transactionId), - new Uint256(amount), - new Bool(forced)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall processDebt(BigInteger amount) { + public RemoteFunctionCall processDebt(String card, BigInteger amount) { final Function function = new Function( FUNC_PROCESSDEBT, - List.of(new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processPendingRefundPayment(BigInteger transactionId) { + public RemoteFunctionCall processNoConfirmationAuthorization(String card, + BigInteger transactionId, BigInteger amount, Boolean forced) { final Function function = new Function( - FUNC_PROCESSPENDINGREFUNDPAYMENT, - List.of(new Uint256(transactionId)), - Collections.emptyList()); + FUNC_PROCESSNOCONFIRMATIONAUTHORIZATION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount), + new org.web3j.abi.datatypes.Bool(forced)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processRefundPayment(BigInteger transactionId) { + public RemoteFunctionCall processOtpAuthorization(String card, + BigInteger transactionId, BigInteger amount, byte[] otp, BigInteger otpCounter, + Boolean forced) { + final Function function = new Function( + FUNC_PROCESSOTPAUTHORIZATION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount), + new org.web3j.abi.datatypes.generated.Bytes16(otp), + new org.web3j.abi.datatypes.generated.Uint16(otpCounter), + new org.web3j.abi.datatypes.Bool(forced)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processRefundPayment(String card, + BigInteger transactionId) { final Function function = new Function( FUNC_PROCESSREFUNDPAYMENT, - List.of(new Uint256(transactionId)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processSettlement(BigInteger transactionId, BigInteger amount) { + public RemoteFunctionCall processSettlement(String card, + BigInteger transactionId, BigInteger amount) { final Function function = new Function( FUNC_PROCESSSETTLEMENT, - Arrays.asList(new Uint256(transactionId), - new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall processWithdrawal(String to) { + public RemoteFunctionCall processSignatureAuthorization(String card, + BigInteger transactionId, BigInteger amount, byte[] transactionConfirmationSignature, + Boolean forced) { + final Function function = new Function( + FUNC_PROCESSSIGNATUREAUTHORIZATION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId), + new org.web3j.abi.datatypes.generated.Uint256(amount), + new org.web3j.abi.datatypes.DynamicBytes(transactionConfirmationSignature), + new org.web3j.abi.datatypes.Bool(forced)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processUnsettledTransaction(String card, + BigInteger transactionId) { + final Function function = new Function( + FUNC_PROCESSUNSETTLEDTRANSACTION, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.generated.Uint256(transactionId)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall processWithdrawal() { final Function function = new Function( FUNC_PROCESSWITHDRAWAL, - List.of(new Address(160, to)), - Collections.emptyList()); + Arrays.asList(), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall processor() { final Function function = new Function(FUNC_PROCESSOR, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall proxiableUUID() { final Function function = new Function(FUNC_PROXIABLEUUID, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall registry() { final Function function = new Function(FUNC_REGISTRY, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall savePendingRefund(BigInteger transactionId, BigInteger amount) { + public RemoteFunctionCall removeOwner() { final Function function = new Function( - FUNC_SAVEPENDINGREFUND, - Arrays.asList(new Uint256(transactionId), - new Uint256(amount)), - Collections.emptyList()); + FUNC_REMOVEOWNER, + Arrays.asList(), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall securityDelay() { final Function function = new Function(FUNC_SECURITYDELAY, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } - public RemoteFunctionCall setCard(String card, byte[] otpRoot, BigInteger otpCounter, byte[] ownershipAcceptanceSignature) { + public RemoteFunctionCall setAuthLimitMargin(BigInteger authLimitMargin_) { final Function function = new Function( - FUNC_SETCARD, - Arrays.asList(new Address(160, card), - new Bytes16(otpRoot), - new Uint16(otpCounter), - new org.web3j.abi.datatypes.DynamicBytes(ownershipAcceptanceSignature)), - Collections.emptyList()); + FUNC_SETAUTHLIMITMARGIN, + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(authLimitMargin_)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall setLimits(BigInteger singleTransactionLimit, BigInteger spendLimit, BigInteger noOtpSpendLimit, BigInteger spendLimitsPeriod) { + public RemoteFunctionCall setCardIsOwner(String card, Boolean isOwner) { + final Function function = new Function( + FUNC_SETCARDISOWNER, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.Bool(isOwner)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall setLimits(String card, + LimitsParams limitsParams) { final Function function = new Function( FUNC_SETLIMITS, - Arrays.asList(new Uint256(singleTransactionLimit), - new Uint256(spendLimit), - new Uint256(noOtpSpendLimit), - new Uint256(spendLimitsPeriod)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + limitsParams), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall setOtpState(byte[] otp, BigInteger counter) { + public RemoteFunctionCall setOtpState(String card, OtpState otpState) { final Function function = new Function( FUNC_SETOTPSTATE, - Arrays.asList(new Bytes16(otp), - new Uint16(counter)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + otpState), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall setOwner(String owner_, byte[] ownershipAcceptanceSignature) { + public RemoteFunctionCall setOwner(String owner_, + byte[] ownershipAcceptanceSignature) { final Function function = new Function( FUNC_SETOWNER, - Arrays.asList(new Address(160, owner_), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner_), new org.web3j.abi.datatypes.DynamicBytes(ownershipAcceptanceSignature)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall setProcessor(String processor_) { - final Function function = new Function( - FUNC_SETPROCESSOR, - List.of(new Address(160, processor_)), - Collections.emptyList()); + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall setVerifiedBalance(BigInteger verifiedBalance_) { final Function function = new Function( FUNC_SETVERIFIEDBALANCE, - List.of(new Uint256(verifiedBalance_)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(verifiedBalance_)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall settlementPeriod() { - final Function function = new Function(FUNC_SETTLEMENTPERIOD, - List.of(), - List.of(new TypeReference() { - })); + public RemoteFunctionCall transactionConfirmationNonce() { + final Function function = new Function(FUNC_TRANSACTIONCONFIRMATIONNONCE, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall trustedForwarder() { final Function function = new Function(FUNC_TRUSTEDFORWARDER, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall unblockUnsettledTransaction(BigInteger transactionId) { - final Function function = new Function( - FUNC_UNBLOCKUNSETTLEDTRANSACTION, - List.of(new Uint256(transactionId)), - Collections.emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall upgradeToAndCall(String newImplementation, byte[] data, BigInteger weiValue) { + public RemoteFunctionCall upgradeToAndCall(String newImplementation, + byte[] data, BigInteger weiValue) { final Function function = new Function( FUNC_UPGRADETOANDCALL, - Arrays.asList(new Address(160, newImplementation), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, newImplementation), new org.web3j.abi.datatypes.DynamicBytes(data)), - Collections.emptyList()); + Collections.>emptyList()); return executeRemoteCallTransaction(function, weiValue); } public RemoteFunctionCall verifiedBalance() { final Function function = new Function(FUNC_VERIFIEDBALANCE, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } + public RemoteFunctionCall withdrawalAddress() { + final Function function = new Function(FUNC_WITHDRAWALADDRESS, + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); + return executeRemoteCallSingleValueReturn(function, String.class); + } + public RemoteFunctionCall withdrawalAmount() { final Function function = new Function(FUNC_WITHDRAWALAMOUNT, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall withdrawalReadyTimestamp() { final Function function = new Function(FUNC_WITHDRAWALREADYTIMESTAMP, - List.of(), - List.of(new TypeReference() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } public RemoteFunctionCall writeOffDebt(BigInteger amount) { final Function function = new Function( FUNC_WRITEOFFDEBT, - List.of(new Uint256(amount)), - Collections.emptyList()); + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(amount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } + @Deprecated + public static TangemPaymentAccount load(String contractAddress, Web3j web3j, + Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + return new TangemPaymentAccount(contractAddress, web3j, credentials, gasPrice, gasLimit); + } + + @Deprecated + public static TangemPaymentAccount load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + return new TangemPaymentAccount(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + } + + public static TangemPaymentAccount load(String contractAddress, Web3j web3j, + Credentials credentials, ContractGasProvider contractGasProvider) { + return new TangemPaymentAccount(contractAddress, web3j, credentials, contractGasProvider); + } + + public static TangemPaymentAccount load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + return new TangemPaymentAccount(contractAddress, web3j, transactionManager, contractGasProvider); + } + + public static RemoteCall deploy(Web3j web3j, Credentials credentials, + ContractGasProvider contractGasProvider, String trustedForwarder) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, trustedForwarder))); + return deployRemoteCall(TangemPaymentAccount.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), encodedConstructor); + } + + public static RemoteCall deploy(Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider, + String trustedForwarder) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, trustedForwarder))); + return deployRemoteCall(TangemPaymentAccount.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), encodedConstructor); + } + + @Deprecated + public static RemoteCall deploy(Web3j web3j, Credentials credentials, + BigInteger gasPrice, BigInteger gasLimit, String trustedForwarder) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, trustedForwarder))); + return deployRemoteCall(TangemPaymentAccount.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor); + } + + @Deprecated + public static RemoteCall deploy(Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, + String trustedForwarder) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, trustedForwarder))); + return deployRemoteCall(TangemPaymentAccount.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor); + } + + public static void linkLibraries(List references) { + librariesLinkedBinary = linkBinaryWithReferences(BINARY, references); + } + + private static String getDeploymentBinary() { + if (librariesLinkedBinary != null) { + return librariesLinkedBinary; + } else { + return BINARY; + } + } + public static class OtpState extends StaticStruct { public byte[] otp; public BigInteger counter; public OtpState(byte[] otp, BigInteger counter) { - super(new Bytes16(otp), - new Uint16(counter)); + super(new org.web3j.abi.datatypes.generated.Bytes16(otp), + new org.web3j.abi.datatypes.generated.Uint16(counter)); this.otp = otp; this.counter = counter; } @@ -1623,22 +1917,53 @@ class TangemPaymentAccount extends Contract { } } - public static class Limit extends StaticStruct { - public BigInteger _00_limit; + public static class LimitsParams extends StaticStruct { + public BigInteger singleTransactionLimit; - public BigInteger _01_spent; + public BigInteger spendLimit; + + public BigInteger noConfirmationSpendLimit; + + public BigInteger spendLimitsPeriod; + + public LimitsParams(BigInteger singleTransactionLimit, BigInteger spendLimit, + BigInteger noConfirmationSpendLimit, BigInteger spendLimitsPeriod) { + super(new org.web3j.abi.datatypes.generated.Uint256(singleTransactionLimit), + new org.web3j.abi.datatypes.generated.Uint256(spendLimit), + new org.web3j.abi.datatypes.generated.Uint256(noConfirmationSpendLimit), + new org.web3j.abi.datatypes.generated.Uint256(spendLimitsPeriod)); + this.singleTransactionLimit = singleTransactionLimit; + this.spendLimit = spendLimit; + this.noConfirmationSpendLimit = noConfirmationSpendLimit; + this.spendLimitsPeriod = spendLimitsPeriod; + } + + public LimitsParams(Uint256 singleTransactionLimit, Uint256 spendLimit, + Uint256 noConfirmationSpendLimit, Uint256 spendLimitsPeriod) { + super(singleTransactionLimit, spendLimit, noConfirmationSpendLimit, spendLimitsPeriod); + this.singleTransactionLimit = singleTransactionLimit.getValue(); + this.spendLimit = spendLimit.getValue(); + this.noConfirmationSpendLimit = noConfirmationSpendLimit.getValue(); + this.spendLimitsPeriod = spendLimitsPeriod.getValue(); + } + } + + public static class Limit extends StaticStruct { + public BigInteger limit; + + public BigInteger spent; public Limit(BigInteger limit, BigInteger spent) { - super(new Uint256(limit), - new Uint256(spent)); - this._00_limit = limit; - this._01_spent = spent; + super(new org.web3j.abi.datatypes.generated.Uint256(limit), + new org.web3j.abi.datatypes.generated.Uint256(spent)); + this.limit = limit; + this.spent = spent; } public Limit(Uint256 limit, Uint256 spent) { super(limit, spent); - this._00_limit = limit.getValue(); - this._01_spent = spent.getValue(); + this.limit = limit.getValue(); + this.spent = spent.getValue(); } } @@ -1646,7 +1971,7 @@ class TangemPaymentAccount extends Contract { public BigInteger expireTimestamp; public Timer(BigInteger expireTimestamp) { - super(new Uint256(expireTimestamp)); + super(new org.web3j.abi.datatypes.generated.Uint256(expireTimestamp)); this.expireTimestamp = expireTimestamp; } @@ -1656,56 +1981,112 @@ class TangemPaymentAccount extends Contract { } } - public static class CardWithOtp extends StaticStruct { - public String card; + public static class CardParams extends StaticStruct { + public Boolean isOwner; public OtpState otpState; - public CardWithOtp(String card, OtpState otpState) { - super(new Address(160, card), - otpState); - this.card = card; + public LimitsParams limitsParams; + + public CardParams(Boolean isOwner, OtpState otpState, LimitsParams limitsParams) { + super(new org.web3j.abi.datatypes.Bool(isOwner), + otpState, + limitsParams); + this.isOwner = isOwner; this.otpState = otpState; + this.limitsParams = limitsParams; } - public CardWithOtp(Address card, OtpState otpState) { - super(card, otpState); - this.card = card.getValue(); + public CardParams(Bool isOwner, OtpState otpState, LimitsParams limitsParams) { + super(isOwner, otpState, limitsParams); + this.isOwner = isOwner.getValue(); this.otpState = otpState; + this.limitsParams = limitsParams; + } + } + + public static class OtpStateSetting extends StaticStruct { + public OtpState oldValue; + + public OtpState newValue; + + public BigInteger changeTimestamp; + + public OtpStateSetting(OtpState oldValue, OtpState newValue, BigInteger changeTimestamp) { + super(oldValue, + newValue, + new org.web3j.abi.datatypes.generated.Uint256(changeTimestamp)); + this.oldValue = oldValue; + this.newValue = newValue; + this.changeTimestamp = changeTimestamp; + } + + public OtpStateSetting(OtpState oldValue, OtpState newValue, Uint256 changeTimestamp) { + super(oldValue, newValue, changeTimestamp); + this.oldValue = oldValue; + this.newValue = newValue; + this.changeTimestamp = changeTimestamp.getValue(); } } public static class Limits extends StaticStruct { - public BigInteger _00_singleTransactionLimit; + public BigInteger singleTransactionLimit; - public Limit _01_spendLimit; + public Limit spendLimit; - public Limit _02_noOtpSpendLimit; + public Limit noConfirmationSpendLimit; - public Timer _03_spendLimitsTimer; + public Timer spendLimitsTimer; - public BigInteger _04_spendLimitsPeriod; + public BigInteger spendLimitsPeriod; - public Limits(BigInteger singleTransactionLimit, Limit spendLimit, Limit noOtpSpendLimit, Timer spendLimitsTimer, BigInteger spendLimitsPeriod) { - super(new Uint256(singleTransactionLimit), + public Limits(BigInteger singleTransactionLimit, Limit spendLimit, + Limit noConfirmationSpendLimit, Timer spendLimitsTimer, + BigInteger spendLimitsPeriod) { + super(new org.web3j.abi.datatypes.generated.Uint256(singleTransactionLimit), spendLimit, - noOtpSpendLimit, - spendLimitsTimer, - new Uint256(spendLimitsPeriod)); - this._00_singleTransactionLimit = singleTransactionLimit; - this._01_spendLimit = spendLimit; - this._02_noOtpSpendLimit = noOtpSpendLimit; - this._03_spendLimitsTimer = spendLimitsTimer; - this._04_spendLimitsPeriod = spendLimitsPeriod; + noConfirmationSpendLimit, + spendLimitsTimer, + new org.web3j.abi.datatypes.generated.Uint256(spendLimitsPeriod)); + this.singleTransactionLimit = singleTransactionLimit; + this.spendLimit = spendLimit; + this.noConfirmationSpendLimit = noConfirmationSpendLimit; + this.spendLimitsTimer = spendLimitsTimer; + this.spendLimitsPeriod = spendLimitsPeriod; } - public Limits(Uint256 singleTransactionLimit, Limit spendLimit, Limit noOtpSpendLimit, Timer spendLimitsTimer, Uint256 spendLimitsPeriod) { - super(singleTransactionLimit, spendLimit, noOtpSpendLimit, spendLimitsTimer, spendLimitsPeriod); - this._00_singleTransactionLimit = singleTransactionLimit.getValue(); - this._01_spendLimit = spendLimit; - this._02_noOtpSpendLimit = noOtpSpendLimit; - this._03_spendLimitsTimer = spendLimitsTimer; - this._04_spendLimitsPeriod = spendLimitsPeriod.getValue(); + public Limits(Uint256 singleTransactionLimit, Limit spendLimit, + Limit noConfirmationSpendLimit, Timer spendLimitsTimer, Uint256 spendLimitsPeriod) { + super(singleTransactionLimit, spendLimit, noConfirmationSpendLimit, spendLimitsTimer, spendLimitsPeriod); + this.singleTransactionLimit = singleTransactionLimit.getValue(); + this.spendLimit = spendLimit; + this.noConfirmationSpendLimit = noConfirmationSpendLimit; + this.spendLimitsTimer = spendLimitsTimer; + this.spendLimitsPeriod = spendLimitsPeriod.getValue(); + } + } + + public static class LimitsSetting extends StaticStruct { + public Limits oldValue; + + public Limits newValue; + + public BigInteger changeTimestamp; + + public LimitsSetting(Limits oldValue, Limits newValue, BigInteger changeTimestamp) { + super(oldValue, + newValue, + new org.web3j.abi.datatypes.generated.Uint256(changeTimestamp)); + this.oldValue = oldValue; + this.newValue = newValue; + this.changeTimestamp = changeTimestamp; + } + + public LimitsSetting(Limits oldValue, Limits newValue, Uint256 changeTimestamp) { + super(oldValue, newValue, changeTimestamp); + this.oldValue = oldValue; + this.newValue = newValue; + this.changeTimestamp = changeTimestamp.getValue(); } } @@ -1715,16 +2096,26 @@ class TangemPaymentAccount extends Contract { public BigInteger blockedAmount; public BigInteger debtTotal; - - public BigInteger pendingRefundTotal; } - public static class CardSetEventResponse extends BaseEventResponse { + public static class AuthLimitMarginSetEventResponse extends BaseEventResponse { + public BigInteger authLimitMargin; + } + + public static class CardAddedEventResponse extends BaseEventResponse { + public String cardAddress; + + public CardParams cardData; + } + + public static class CardDisabledEventResponse extends BaseEventResponse { + public String card; + } + + public static class CardEnabledEventResponse extends BaseEventResponse { public String card; - public byte[] otpRoot; - - public BigInteger otpCounter; + public Boolean isOwner; } public static class DebtIncreasedEventResponse extends BaseEventResponse { @@ -1755,41 +2146,31 @@ class TangemPaymentAccount extends Contract { public static class InsufficientFundsOnForcedAuthEventResponse extends BaseEventResponse { public BigInteger transactionId; + public String card; + public BigInteger insufficientAmount; } public static class LimitsSetEventResponse extends BaseEventResponse { - public BigInteger singleTransactionLimit; + public String card; - public BigInteger spendLimit; - - public BigInteger noOtpSpendLimit; - - public BigInteger spendLimitsPeriod; - } - - public static class NoOtpTransactionAuthorizedEventResponse extends BaseEventResponse { - public BigInteger transactionId; - - public BigInteger amount; + public LimitsParams limitsParams; } public static class OtpStateSetEventResponse extends BaseEventResponse { - public byte[] otpRoot; + public String card; - public BigInteger otpCounter; + public OtpState otpState; + } + + public static class OwnerRemovedEventResponse extends BaseEventResponse { + public String previousOwner; } public static class OwnerSetEventResponse extends BaseEventResponse { public String owner; } - public static class PendingRefundSavedEventResponse extends BaseEventResponse { - public BigInteger transactionId; - - public BigInteger amount; - } - public static class ProcessorSetEventResponse extends BaseEventResponse { public String processor; @@ -1799,18 +2180,32 @@ class TangemPaymentAccount extends Contract { public static class RefundPaidEventResponse extends BaseEventResponse { public BigInteger transactionId; + public String card; + public BigInteger amount; } public static class TransactionAmountChangedEventResponse extends BaseEventResponse { public BigInteger transactionId; + public String card; + public BigInteger newAmount; } - public static class TransactionAuthorizedEventResponse extends BaseEventResponse { + public static class TransactionAuthorizedNoConfirmationEventResponse extends BaseEventResponse { public BigInteger transactionId; + public String card; + + public BigInteger amount; + } + + public static class TransactionAuthorizedWithOtpEventResponse extends BaseEventResponse { + public BigInteger transactionId; + + public String card; + public BigInteger amount; public byte[] otp; @@ -1818,9 +2213,21 @@ class TangemPaymentAccount extends Contract { public BigInteger otpCounter; } + public static class TransactionAuthorizedWithSignatureEventResponse extends BaseEventResponse { + public BigInteger transactionId; + + public String card; + + public BigInteger amount; + + public byte[] signature; + } + public static class TransactionSettledEventResponse extends BaseEventResponse { public BigInteger transactionId; + public String card; + public BigInteger settlementAmount; public BigInteger paymentAmount; @@ -1829,6 +2236,8 @@ class TangemPaymentAccount extends Contract { public static class UnsettledTransactionUnblockedEventResponse extends BaseEventResponse { public BigInteger transactionId; + public String card; + public BigInteger amount; } @@ -1847,6 +2256,9 @@ class TangemPaymentAccount extends Contract { } public static class WithdrawalCanceledEventResponse extends BaseEventResponse { + public String to; + + public BigInteger amount; } public static class WithdrawalCompleteEventResponse extends BaseEventResponse { @@ -1856,8 +2268,10 @@ class TangemPaymentAccount extends Contract { } public static class WithdrawalInitiatedEventResponse extends BaseEventResponse { + public String to; + public BigInteger amount; public BigInteger readyToWithdrawTimestamp; } -} +} \ No newline at end of file diff --git a/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccountRegistry.java b/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccountRegistry.java index bcf93417f6..a5107bee89 100644 --- a/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccountRegistry.java +++ b/libs/visa/src/main/java/com/tangem/lib/visa/TangemPaymentAccountRegistry.java @@ -1,9 +1,20 @@ package com.tangem.lib.visa; +import io.reactivex.Flowable; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.Callable; import org.web3j.abi.EventEncoder; import org.web3j.abi.FunctionEncoder; import org.web3j.abi.TypeReference; -import org.web3j.abi.datatypes.*; +import org.web3j.abi.datatypes.Address; +import org.web3j.abi.datatypes.DynamicArray; +import org.web3j.abi.datatypes.Event; +import org.web3j.abi.datatypes.Function; +import org.web3j.abi.datatypes.Type; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.DefaultBlockParameter; @@ -17,111 +28,89 @@ import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; import org.web3j.tx.gas.ContractGasProvider; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.Callable; - -import io.reactivex.Flowable; - /** *

Auto generated code. *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * - *

Generated with web3j version 1.5.2. + *

Generated with web3j version 1.6.1. */ @SuppressWarnings("rawtypes") -class TangemPaymentAccountRegistry extends Contract { - public static final String BINARY = "608060405234801561001057600080fd5b50604051610c47380380610c4783398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610bb4806100936000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806368d7111a1161005b57806368d7111a146100f0578063747fc3701461010357806379da564f14610116578063c45a01551461013657600080fd5b80630cef7172146100825780633509c7c5146100c85780635cd26737146100dd575b600080fd5b6100ab6100903660046108fd565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100db6100d6366004610918565b610149565b005b6100db6100eb366004610918565b610201565b6100db6100fe3660046108fd565b6103b0565b6100db610111366004610918565b610506565b6101296101243660046108fd565b6106db565b6040516100bf919061094b565b6000546100ab906001600160a01b031681565b600054604080516080810190915260428082526001600160a01b03909216331491610a576020830139906101995760405162461bcd60e51b81526004016101909190610998565b60405180910390fd5b506001600160a01b03811660009081526001602052604090206101bc9083610705565b50806001600160a01b0316826001600160a01b03167f65b303fd420aefd0541d9300bb10190bb8e3320a0e7c2ce4dec6b6bfb953027f60405160405180910390a35050565b6000546040516385bb392360e01b81523360048201526001600160a01b03909116906385bb392390602401602060405180830381865afa158015610249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026d91906109e7565b6040518060600160405280603a8152602001610b45603a9139906102a45760405162461bcd60e51b81526004016101909190610998565b506001600160a01b038216600090815260016020526040902033906102c99082610721565b6040518060600160405280603b8152602001610ad0603b9139906103005760405162461bcd60e51b81526004016101909190610998565b506001600160a01b03821660009081526001602052604090206103239082610705565b6040518060600160405280603b8152602001610ad0603b91399061035a5760405162461bcd60e51b81526004016101909190610998565b50604080516001600160a01b03808416825280861660208301528416918101919091527ffba993cae385d1da628b11b1b150a27262bca00bb2674980516b45ad7d331eaa906060015b60405180910390a1505050565b6000546040516385bb392360e01b81523360048201526001600160a01b03909116906385bb392390602401602060405180830381865afa1580156103f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041c91906109e7565b6040518060600160405280603a8152602001610b45603a9139906104535760405162461bcd60e51b81526004016101909190610998565b506001600160a01b0381811660009081526002602090815260409182902054825160608101909352603a8084529316159290610b0b90830139906104aa5760405162461bcd60e51b81526004016101909190610998565b506001600160a01b03811660008181526002602052604080822080546001600160a01b03191633908117909155905190929183917f02e4debb2ab36299bfcc998345f66f73428adbbda9ef5efef399d75a67a4b78a9190a35050565b6000546040516385bb392360e01b81523360048201526001600160a01b03909116906385bb392390602401602060405180830381865afa15801561054e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057291906109e7565b6040518060600160405280603a8152602001610b45603a9139906105a95760405162461bcd60e51b81526004016101909190610998565b506001600160a01b0382811660009081526002602090815260409182902054825160608101909352603780845233949190911684149291610a9990830139906106055760405162461bcd60e51b81526004016101909190610998565b506001600160a01b0382811660009081526002602090815260409182902054825160608101909352603a8084529316159290610b0b908301399061065c5760405162461bcd60e51b81526004016101909190610998565b506001600160a01b03838116600081815260026020908152604080832080546001600160a01b03199081169091558786168085529382902080549091169587169586179055805194855290840192909252908201527f362e9cf018894fbf5dfe9c5cbfb25c3e3ac8c4d5beed564352f1af2e2712dfc8906060016103a3565b6001600160a01b03811660009081526001602052604090206060906106ff90610736565b92915050565b600061071a836001600160a01b038416610743565b9392505050565b600061071a836001600160a01b038416610792565b6060600061071a83610885565b600081815260018301602052604081205461078a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106ff565b5060006106ff565b6000818152600183016020526040812054801561087b5760006107b6600183610a09565b85549091506000906107ca90600190610a09565b905080821461082f5760008660000182815481106107ea576107ea610a2a565b906000526020600020015490508087600001848154811061080d5761080d610a2a565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061084057610840610a40565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106ff565b60009150506106ff565b6060816000018054806020026020016040519081016040528092919081815260200182805480156108d557602002820191906000526020600020905b8154815260200190600101908083116108c1575b50505050509050919050565b80356001600160a01b03811681146108f857600080fd5b919050565b60006020828403121561090f57600080fd5b61071a826108e1565b6000806040838503121561092b57600080fd5b610934836108e1565b9150610942602084016108e1565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561098c5783516001600160a01b031683529284019291840191600101610967565b50909695505050505050565b60006020808352835180602085015260005b818110156109c6578581018301518582016040015282016109aa565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156109f957600080fd5b8151801515811461071a57600080fd5b818103818111156106ff57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfe353630307c52656769737472793a206f6e6c79207061796d656e74206163636f756e7420666163746f72792063616e2063616c6c20746869732066756e6374696f6e353630347c52656769737472793a2070726576696f757320636172642773207061796d656e74206163636f756e74206d69736d61746368353630327c52656769737472793a207061796d656e74206163636f756e74206265696e672072656d6f766564206e6f7420696e2074686520736574353630347c52656769737472793a207061796d656e74206163636f756e7420697320616c72656164792073657420666f72207468652063617264353630317c52656769737472793a206f6e6c79207061796d656e74206163636f756e742063616e2063616c6c20746869732066756e6374696f6ea26469706673582212203c97923f6f14a45f904087dcdced3b09f33cd32821438cd9cbf0add5824acaf064736f6c63430008160033"; +public class TangemPaymentAccountRegistry extends Contract { + public static final String BINARY = "60806040523462000030576200001e62000018620000d3565b62000156565b6040516110ab6200016e82396110ab90f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176200006d57604052565b62000035565b906200008a6200008260405190565b92836200004b565b565b6001600160a01b031690565b90565b6001600160a01b038116036200003057565b905051906200008a826200009b565b9060208282031262000030576200009891620000ad565b620000986200121980380380620000ea8162000073565b928339810190620000bc565b62000098906200008c906001600160a01b031682565b6200009890620000f6565b62000098906200010c565b906200013662000098620001529262000117565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b620001656200008a9162000117565b60006200012256fe6080604052600436101561001257600080fd5b60003560e01c80630cef7172146100b25780630d009297146100ad578063173825d9146100a85780633dc50952146100a35780634149177b1461009e57806379da564f14610099578063a727bc9014610094578063c45a01551461008f578063f00d4b5d1461008a5763f72a1107036100d857610353565b61033a565b610313565b6102cb565b610281565b6101f5565b6101dd565b6101c5565b6101a8565b61016f565b6001600160a01b031690565b90565b6001600160a01b0381165b036100d857565b600080fd5b905035906100ea826100c6565b565b906020828203126100d8576100c3916100dd565b6100c3906100b7906001600160a01b031682565b6100c390610100565b6100c390610114565b906101309061011d565b600052602052604060002090565b6100c3916008021c6100b7565b906100c3915461013e565b60006101666100c3926002610126565b61014b565b9052565b346100d8576101a461018a6101853660046100ec565b610156565b604051918291826001600160a01b03909116815260200190565b0390f35b346100d8576101c06101bb3660046100ec565b6105da565b604051005b346100d8576101c06101d83660046100ec565b610709565b346100d8576101c06101f03660046100ec565b61076f565b346100d8576101c06102083660046100ec565b6108f0565b0190565b9061023161022a610220845190565b8084529260200190565b9260200190565b9060005b8181106102425750505090565b90919261026861026160019286516001600160a01b0316815260200190565b9460200190565b929101610235565b60208082526100c392910190610211565b346100d8576101a461029c6102973660046100ec565b6108f9565b60405191829182610270565b91906040838203126100d8576100c39060206102c482866100dd565b94016100dd565b346100d8576101c06102de3660046102a8565b906109b8565b60009103126100d857565b6100c360008061014b565b61016b9061011d565b6020810192916100ea91906102fa565b346100d8576103233660046102e4565b6101a461032e6102ef565b60405191829182610303565b346100d8576101c061034d3660046102a8565b90610b01565b346100d8576101c06103663660046102a8565b90610b2d565b6100c3906100b7565b6100c3905461036c565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176103b757604052565b61037f565b8015156100d1565b905051906100ea826103bc565b906020828203126100d8576100c3916103c4565b6040513d6000823e3d90fd5b906100ea6103fe60405190565b9283610395565b67ffffffffffffffff81116103b757602090601f01601f19160190565b9061043461042f83610405565b6103f1565b918252565b610443603a610422565b7f353630317c52656769737472793a206f6e6c79207061796d656e74206163636f60208201527f756e742063616e2063616c6c20746869732066756e6374696f6e000000000000604082015290565b6100c3610439565b6100c3610492565b60005b8381106104b55750506000910152565b81810151838201526020016104a5565b6104e66104ef60209361020d936104da815190565b80835293849260200190565b958691016104a2565b601f01601f191690565b60208082526100c3929101906104c5565b156105125750565b6105349061051f60405190565b62461bcd60e51b8152918291600483016104f9565b0390fd5b61054a6105456000610375565b61011d565b90602061055660405190565b6385bb392360e01b815233600482015292839060249082905afa9182156105ca576100ea926105969160009161059b575b5061059061049a565b9061050a565b6105cf565b6105bd915060203d6020116105c3575b6105b58183610395565b8101906103d1565b38610587565b503d6105ab565b6103e5565b6100ea903390610b37565b6100ea90610538565b6105f06105456000610375565b9060206105fc60405190565b6385bb392360e01b815233600482015292839060249082905afa9182156105ca576100ea926106359160009161059b575061059061049a565b6106a3565b610644603b610422565b7f353630327c52656769737472793a207061796d656e74206163636f756e74206260208201527f65696e672072656d6f766564206e6f7420696e20746865207365740000000000604082015290565b6100c361063a565b6100c3610693565b6106c66106be6106b76100c3846001610126565b3390610ba3565b61059061069b565b6106d86106d23361011d565b9161011d565b907fe594d081b4382713733fe631966432c9cea5199afb2db5c3c1931f9f9300367961070360405190565b600090a3565b6100ea906105e3565b61071f6105456000610375565b90602061072b60405190565b6385bb392360e01b815233600482015292839060249082905afa9182156105ca576100ea926107649160009161059b575061059061049a565b6100ea903390610c7e565b6100ea90610712565b6107856105456000610375565b90602061079160405190565b6385bb392360e01b815233600482015292839060249082905afa9182156105ca576100ea926107ca9160009161059b575061059061049a565b610873565b6107d96030610422565b7f353630357c52656769737472793a2063617264206265696e672072656d6f766560208201526f19081b9bdd081a5b881d1a19481cd95d60821b604082015290565b6100c36107cf565b6100c361081b565b916001600160a01b0360089290920291821b911b5b9181191691161790565b919061085b6100c36108639361011d565b90835461082b565b9055565b6100ea9160009161084a565b6108a4610889610884836002610126565b610375565b61089b335b916001600160a01b031690565b14610590610823565b6108b960006108b4836002610126565b610867565b6108c56106d23361011d565b907f5f8ec0a3d11bc25dab3cc6b87b3add8f1797a221531def932c4d242f561abf2561070360405190565b6100ea90610778565b6109136100c36100c39261090b606090565b506001610126565b610cef565b6109226042610422565b7f353630307c52656769737472793a206f6e6c79207061796d656e74206163636f60208201527f756e7420666163746f72792063616e2063616c6c20746869732066756e63746960408201526137b760f11b606082015290565b6100c3610918565b6100c361097c565b906100ea916109ae6109a46100b76105456000610375565b3314610590610984565b906100ea91610c7e565b906100ea9161098c565b906109d06105456000610375565b9160206109dc60405190565b6385bb392360e01b815233600482015293849060249082905afa9283156105ca576100ea93610a159160009161059b575061059061049a565b610a83565b610a246040610422565b7f353630337c52656769737472793a207061796d656e74206163636f756e74206260208201527f65696e6720616464656420697320616c726561647920696e2074686520736574604082015290565b6100c3610a1a565b6100c3610a73565b90610a986106be6106b76100c3856001610126565b610abb610ab3610aac6100c3846001610126565b3390610d00565b610590610a7b565b610ad06106d2610aca3361011d565b9361011d565b917f381c0d11398486654573703c51ee8210ce9461764d133f9f0e53b6a539705331610afb60405190565b600090a4565b906100ea916109c2565b906100ea91610b236109a46100b76105456000610375565b906100ea91610b37565b906100ea91610b0b565b906106d2610b5991610545610ab382610b546100c3886001610126565b610d00565b907fa5e1f8b4009110f5525798d04ae2125421a12d0590aa52c13682ff1bd3c492ca61070360405190565b6100c39081906001600160a01b031681565b6100c36100c36100c39290565b90610bd4610bd0610bcb610bc660006100c396610bbe600090565b500194610114565b610b84565b610b96565b9190565b610e66565b6100b76100c36100c39290565b6100c390610bd9565b610bf9603a610422565b7f353630347c52656769737472793a207061796d656e74206163636f756e74206960208201527f7320616c72656164792073657420666f72207468652063617264000000000000604082015290565b6100c3610bef565b6100c3610c48565b906001600160a01b0390610840565b90610c776100c36108639261011d565b8254610c58565b906106d2610cc491610cb0610c97610884866002610126565b610ca761088e6100b76000610be6565b14610590610c50565b61054581610cbf866002610126565b610c67565b907fc063fc300750e8c5649c6b3779f6c4b05e7b38b170ee5c4a4b222ede9a28808361070360405190565b606090610cfb90610fc8565b905090565b90610d1b610bd0610bcb610bc660006100c396610bbe600090565b611005565b90610130565b6100c39081565b6100c39054610d26565b634e487b7160e01b600052601160045260246000fd5b91908203918211610d5a57565b610d37565b634e487b7160e01b600052603260045260246000fd5b8054821015610d9857610d8f600191600052602060002090565b91020190600090565b610d5f565b6100c3916008021c81565b906100c39154610d9d565b9160001960089290920291821b911b610840565b9190610dd66100c36108639390565b908354610db3565b9060001990610840565b90610df86100c361086392610b96565b8254610dde565b634e487b7160e01b600052603160045260246000fd5b6100ea91600091610dc7565b80548015610e44576000190190610e41610e3b8383610d75565b90610e15565b55565b610dff565b9190610dd66100c361086393610b96565b6100ea91600091610e49565b90610e7c610e778260018501610d20565b610d2d565b610e866000610b96565b8114610f3457610eeb6100c392600092610ee095610ee56001978893610eb4610eae86610b96565b82610d4d565b88850191610ed2610ec3845490565b610ecc89610b96565b90610d4d565b808303610ef0575b50505090565b610e21565b01610d20565b610e5a565b610f19610f1f610f2c94610f10610f0a610f279589610d75565b90610da8565b92839188610d75565b90610dc7565b888801610d20565b610de8565b388080610eda565b505050600090565b90610f57610f4b610220845490565b92600052602060002090565b9060005b818110610f685750505090565b909192610f8c610f85600192610f7d87610d2d565b815260200190565b9460010190565b929101610f5b565b906100c391610f3c565b906100ea610fb892610faf60405190565b93848092610f94565b0383610395565b6100c390610f9e565b60006100c391610fd6606090565b5001610fbf565b90815491680100000000000000008310156103b75782610f199160016100ea95018155610d75565b611016611012838361104a565b1590565b156110435761103e91610f27906001611037846110338482610fdd565b5490565b9301610d20565b600190565b5050600090565b611063916001610e779261105c600090565b5001610d20565b611070610bd06000610b96565b14159056fea26469706673582212205e9abf37b9af5365c966f2cb4bdb949d15aac5e8ec856dbc6a6c8fc7e9de783764736f6c63430008160033"; - public static final String FUNC_CHANGEPAYMENTACCOUNTCARD = "changePaymentAccountCard"; + private static String librariesLinkedBinary; - public static final String FUNC_CHANGEPAYMENTACCOUNTOWNER = "changePaymentAccountOwner"; + public static final String FUNC_ADDCARD = "addCard"; + + public static final String FUNC_ADDCARDONDEPLOY = "addCardOnDeploy"; + + public static final String FUNC_CHANGEOWNER = "changeOwner"; public static final String FUNC_FACTORY = "factory"; - public static final String FUNC_INITPAYMENTACCOUNTCARD = "initPaymentAccountCard"; + public static final String FUNC_INITOWNER = "initOwner"; - public static final String FUNC_INITPAYMENTACCOUNTOWNER = "initPaymentAccountOwner"; + public static final String FUNC_INITOWNERONDEPLOY = "initOwnerOnDeploy"; public static final String FUNC_PAYMENTACCOUNTBYCARD = "paymentAccountByCard"; public static final String FUNC_PAYMENTACCOUNTSBYOWNER = "paymentAccountsByOwner"; - public static final Event PAYMENTACCOUNTCARDCHANGED_EVENT = new Event("PaymentAccountCardChanged", - Arrays.asList(new TypeReference

() { - }, new TypeReference
() { - }, new TypeReference
() { - })); + public static final String FUNC_REMOVECARD = "removeCard"; - public static final Event PAYMENTACCOUNTCARDREGISTERED_EVENT = new Event("PaymentAccountCardRegistered", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference
(true) { - })); + public static final String FUNC_REMOVEOWNER = "removeOwner"; - public static final Event PAYMENTACCOUNTOWNERCHANGED_EVENT = new Event("PaymentAccountOwnerChanged", - Arrays.asList(new TypeReference
() { - }, new TypeReference
() { - }, new TypeReference
() { - })); + public static final Event CARDREGISTERED_EVENT = new Event("CardRegistered", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {})); + ; - public static final Event PAYMENTACCOUNTOWNERREGISTERED_EVENT = new Event("PaymentAccountOwnerRegistered", - Arrays.asList(new TypeReference
(true) { - }, new TypeReference
(true) { - })); + public static final Event CARDREMOVED_EVENT = new Event("CardRemoved", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {})); + ; + + public static final Event OWNERCHANGED_EVENT = new Event("OwnerChanged", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference
(true) {})); + ; + + public static final Event OWNERREGISTERED_EVENT = new Event("OwnerRegistered", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {})); + ; + + public static final Event OWNERREMOVED_EVENT = new Event("OwnerRemoved", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {})); + ; @Deprecated - protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, + Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } - protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, + Credentials credentials, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, credentials, contractGasProvider); } @Deprecated - protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } - protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + protected TangemPaymentAccountRegistry(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); } - public static List getPaymentAccountCardChangedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAYMENTACCOUNTCARDCHANGED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PaymentAccountCardChangedEventResponse typedResponse = new PaymentAccountCardChangedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.previousCard = (String) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.newCard = (String) eventValues.getNonIndexedValues().get(2).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static PaymentAccountCardChangedEventResponse getPaymentAccountCardChangedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTACCOUNTCARDCHANGED_EVENT, log); - PaymentAccountCardChangedEventResponse typedResponse = new PaymentAccountCardChangedEventResponse(); - typedResponse.log = log; - typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.previousCard = (String) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.newCard = (String) eventValues.getNonIndexedValues().get(2).getValue(); - return typedResponse; - } - - public static List getPaymentAccountCardRegisteredEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAYMENTACCOUNTCARDREGISTERED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PaymentAccountCardRegisteredEventResponse typedResponse = new PaymentAccountCardRegisteredEventResponse(); + public static List getCardRegisteredEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(CARDREGISTERED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + CardRegisteredEventResponse typedResponse = new CardRegisteredEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); @@ -130,44 +119,102 @@ class TangemPaymentAccountRegistry extends Contract { return responses; } - public static PaymentAccountCardRegisteredEventResponse getPaymentAccountCardRegisteredEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTACCOUNTCARDREGISTERED_EVENT, log); - PaymentAccountCardRegisteredEventResponse typedResponse = new PaymentAccountCardRegisteredEventResponse(); + public static CardRegisteredEventResponse getCardRegisteredEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(CARDREGISTERED_EVENT, log); + CardRegisteredEventResponse typedResponse = new CardRegisteredEventResponse(); typedResponse.log = log; typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); return typedResponse; } - public static List getPaymentAccountOwnerChangedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAYMENTACCOUNTOWNERCHANGED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PaymentAccountOwnerChangedEventResponse typedResponse = new PaymentAccountOwnerChangedEventResponse(); + public Flowable cardRegisteredEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getCardRegisteredEventFromLog(log)); + } + + public Flowable cardRegisteredEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(CARDREGISTERED_EVENT)); + return cardRegisteredEventFlowable(filter); + } + + public static List getCardRemovedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(CARDREMOVED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + CardRemovedEventResponse typedResponse = new CardRemovedEventResponse(); typedResponse.log = eventValues.getLog(); - typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.previousOwner = (String) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.newOwner = (String) eventValues.getNonIndexedValues().get(2).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); responses.add(typedResponse); } return responses; } - public static PaymentAccountOwnerChangedEventResponse getPaymentAccountOwnerChangedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTACCOUNTOWNERCHANGED_EVENT, log); - PaymentAccountOwnerChangedEventResponse typedResponse = new PaymentAccountOwnerChangedEventResponse(); + public static CardRemovedEventResponse getCardRemovedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(CARDREMOVED_EVENT, log); + CardRemovedEventResponse typedResponse = new CardRemovedEventResponse(); typedResponse.log = log; - typedResponse.paymentAccount = (String) eventValues.getNonIndexedValues().get(0).getValue(); - typedResponse.previousOwner = (String) eventValues.getNonIndexedValues().get(1).getValue(); - typedResponse.newOwner = (String) eventValues.getNonIndexedValues().get(2).getValue(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.card = (String) eventValues.getIndexedValues().get(1).getValue(); return typedResponse; } - public static List getPaymentAccountOwnerRegisteredEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PAYMENTACCOUNTOWNERREGISTERED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - PaymentAccountOwnerRegisteredEventResponse typedResponse = new PaymentAccountOwnerRegisteredEventResponse(); + public Flowable cardRemovedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getCardRemovedEventFromLog(log)); + } + + public Flowable cardRemovedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(CARDREMOVED_EVENT)); + return cardRemovedEventFlowable(filter); + } + + public static List getOwnerChangedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(OWNERCHANGED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + OwnerChangedEventResponse typedResponse = new OwnerChangedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.newOwner = (String) eventValues.getIndexedValues().get(2).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static OwnerChangedEventResponse getOwnerChangedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERCHANGED_EVENT, log); + OwnerChangedEventResponse typedResponse = new OwnerChangedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.newOwner = (String) eventValues.getIndexedValues().get(2).getValue(); + return typedResponse; + } + + public Flowable ownerChangedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getOwnerChangedEventFromLog(log)); + } + + public Flowable ownerChangedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(OWNERCHANGED_EVENT)); + return ownerChangedEventFlowable(filter); + } + + public static List getOwnerRegisteredEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(OWNERREGISTERED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + OwnerRegisteredEventResponse typedResponse = new OwnerRegisteredEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.owner = (String) eventValues.getIndexedValues().get(1).getValue(); @@ -176,151 +223,124 @@ class TangemPaymentAccountRegistry extends Contract { return responses; } - public static PaymentAccountOwnerRegisteredEventResponse getPaymentAccountOwnerRegisteredEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAYMENTACCOUNTOWNERREGISTERED_EVENT, log); - PaymentAccountOwnerRegisteredEventResponse typedResponse = new PaymentAccountOwnerRegisteredEventResponse(); + public static OwnerRegisteredEventResponse getOwnerRegisteredEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERREGISTERED_EVENT, log); + OwnerRegisteredEventResponse typedResponse = new OwnerRegisteredEventResponse(); typedResponse.log = log; typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.owner = (String) eventValues.getIndexedValues().get(1).getValue(); return typedResponse; } - @Deprecated - public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { - return new TangemPaymentAccountRegistry(contractAddress, web3j, credentials, gasPrice, gasLimit); + public Flowable ownerRegisteredEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getOwnerRegisteredEventFromLog(log)); } - @Deprecated - public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { - return new TangemPaymentAccountRegistry(contractAddress, web3j, transactionManager, gasPrice, gasLimit); - } - - public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { - return new TangemPaymentAccountRegistry(contractAddress, web3j, credentials, contractGasProvider); - } - - public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { - return new TangemPaymentAccountRegistry(contractAddress, web3j, transactionManager, contractGasProvider); - } - - public static RemoteCall deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String factory_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, factory_))); - return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor); - } - - public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String factory_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, factory_))); - return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor); - } - - @Deprecated - public static RemoteCall deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String factory_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, factory_))); - return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor); - } - - @Deprecated - public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String factory_) { - String encodedConstructor = FunctionEncoder.encodeConstructor(List.of(new Address(160, factory_))); - return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor); - } - - public Flowable paymentAccountCardChangedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPaymentAccountCardChangedEventFromLog(log)); - } - - public Flowable paymentAccountCardChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public Flowable ownerRegisteredEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAYMENTACCOUNTCARDCHANGED_EVENT)); - return paymentAccountCardChangedEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(OWNERREGISTERED_EVENT)); + return ownerRegisteredEventFlowable(filter); } - public Flowable paymentAccountCardRegisteredEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPaymentAccountCardRegisteredEventFromLog(log)); + public static List getOwnerRemovedEvents( + TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(OWNERREMOVED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (Contract.EventValuesWithLog eventValues : valueList) { + OwnerRemovedEventResponse typedResponse = new OwnerRemovedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.owner = (String) eventValues.getIndexedValues().get(1).getValue(); + responses.add(typedResponse); + } + return responses; } - public Flowable paymentAccountCardRegisteredEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + public static OwnerRemovedEventResponse getOwnerRemovedEventFromLog(Log log) { + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERREMOVED_EVENT, log); + OwnerRemovedEventResponse typedResponse = new OwnerRemovedEventResponse(); + typedResponse.log = log; + typedResponse.paymentAccount = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.owner = (String) eventValues.getIndexedValues().get(1).getValue(); + return typedResponse; + } + + public Flowable ownerRemovedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getOwnerRemovedEventFromLog(log)); + } + + public Flowable ownerRemovedEventFlowable( + DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAYMENTACCOUNTCARDREGISTERED_EVENT)); - return paymentAccountCardRegisteredEventFlowable(filter); + filter.addSingleTopic(EventEncoder.encode(OWNERREMOVED_EVENT)); + return ownerRemovedEventFlowable(filter); } - public Flowable paymentAccountOwnerChangedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPaymentAccountOwnerChangedEventFromLog(log)); - } - - public Flowable paymentAccountOwnerChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAYMENTACCOUNTOWNERCHANGED_EVENT)); - return paymentAccountOwnerChangedEventFlowable(filter); - } - - public Flowable paymentAccountOwnerRegisteredEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getPaymentAccountOwnerRegisteredEventFromLog(log)); - } - - public Flowable paymentAccountOwnerRegisteredEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(PAYMENTACCOUNTOWNERREGISTERED_EVENT)); - return paymentAccountOwnerRegisteredEventFlowable(filter); - } - - public RemoteFunctionCall changePaymentAccountCard(String previousCard, String newCard) { + public RemoteFunctionCall addCard(String card) { final Function function = new Function( - FUNC_CHANGEPAYMENTACCOUNTCARD, - Arrays.asList(new Address(160, previousCard), - new Address(160, newCard)), - Collections.emptyList()); + FUNC_ADDCARD, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall changePaymentAccountOwner(String previousOwner, String newOwner) { + public RemoteFunctionCall addCardOnDeploy(String card, + String paymentAccount) { final Function function = new Function( - FUNC_CHANGEPAYMENTACCOUNTOWNER, - Arrays.asList(new Address(160, previousOwner), - new Address(160, newOwner)), - Collections.emptyList()); + FUNC_ADDCARDONDEPLOY, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card), + new org.web3j.abi.datatypes.Address(160, paymentAccount)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall changeOwner(String previousOwner, + String newOwner) { + final Function function = new Function( + FUNC_CHANGEOWNER, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, previousOwner), + new org.web3j.abi.datatypes.Address(160, newOwner)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall factory() { final Function function = new Function(FUNC_FACTORY, - List.of(), - List.of(new TypeReference
() { - })); + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } - public RemoteFunctionCall initPaymentAccountCard(String card) { + public RemoteFunctionCall initOwner(String owner) { final Function function = new Function( - FUNC_INITPAYMENTACCOUNTCARD, - List.of(new Address(160, card)), - Collections.emptyList()); + FUNC_INITOWNER, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } - public RemoteFunctionCall initPaymentAccountOwner(String paymentAccount, String owner) { + public RemoteFunctionCall initOwnerOnDeploy(String owner, + String paymentAccount) { final Function function = new Function( - FUNC_INITPAYMENTACCOUNTOWNER, - Arrays.asList(new Address(160, paymentAccount), - new Address(160, owner)), - Collections.emptyList()); + FUNC_INITOWNERONDEPLOY, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner), + new org.web3j.abi.datatypes.Address(160, paymentAccount)), + Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall paymentAccountByCard(String param0) { final Function function = new Function(FUNC_PAYMENTACCOUNTBYCARD, - List.of(new Address(160, param0)), - List.of(new TypeReference
() { - })); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, param0)), + Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } public RemoteFunctionCall paymentAccountsByOwner(String owner) { final Function function = new Function(FUNC_PAYMENTACCOUNTSBYOWNER, - List.of(new Address(160, owner)), - List.of(new TypeReference>() { - })); + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner)), + Arrays.>asList(new TypeReference>() {})); return new RemoteFunctionCall(function, new Callable() { @Override @@ -332,21 +352,97 @@ class TangemPaymentAccountRegistry extends Contract { }); } - public static class PaymentAccountCardChangedEventResponse extends BaseEventResponse { - public String paymentAccount; - - public String previousCard; - - public String newCard; + public RemoteFunctionCall removeCard(String card) { + final Function function = new Function( + FUNC_REMOVECARD, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, card)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); } - public static class PaymentAccountCardRegisteredEventResponse extends BaseEventResponse { + public RemoteFunctionCall removeOwner(String owner) { + final Function function = new Function( + FUNC_REMOVEOWNER, + Arrays.asList(new org.web3j.abi.datatypes.Address(160, owner)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + @Deprecated + public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, + Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + return new TangemPaymentAccountRegistry(contractAddress, web3j, credentials, gasPrice, gasLimit); + } + + @Deprecated + public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + return new TangemPaymentAccountRegistry(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + } + + public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, + Credentials credentials, ContractGasProvider contractGasProvider) { + return new TangemPaymentAccountRegistry(contractAddress, web3j, credentials, contractGasProvider); + } + + public static TangemPaymentAccountRegistry load(String contractAddress, Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + return new TangemPaymentAccountRegistry(contractAddress, web3j, transactionManager, contractGasProvider); + } + + public static RemoteCall deploy(Web3j web3j, + Credentials credentials, ContractGasProvider contractGasProvider, String factory_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, factory_))); + return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), encodedConstructor); + } + + public static RemoteCall deploy(Web3j web3j, + TransactionManager transactionManager, ContractGasProvider contractGasProvider, + String factory_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, factory_))); + return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), encodedConstructor); + } + + @Deprecated + public static RemoteCall deploy(Web3j web3j, + Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String factory_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, factory_))); + return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor); + } + + @Deprecated + public static RemoteCall deploy(Web3j web3j, + TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, + String factory_) { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(new org.web3j.abi.datatypes.Address(160, factory_))); + return deployRemoteCall(TangemPaymentAccountRegistry.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor); + } + + public static void linkLibraries(List references) { + librariesLinkedBinary = linkBinaryWithReferences(BINARY, references); + } + + private static String getDeploymentBinary() { + if (librariesLinkedBinary != null) { + return librariesLinkedBinary; + } else { + return BINARY; + } + } + + public static class CardRegisteredEventResponse extends BaseEventResponse { public String paymentAccount; public String card; } - public static class PaymentAccountOwnerChangedEventResponse extends BaseEventResponse { + public static class CardRemovedEventResponse extends BaseEventResponse { + public String paymentAccount; + + public String card; + } + + public static class OwnerChangedEventResponse extends BaseEventResponse { public String paymentAccount; public String previousOwner; @@ -354,9 +450,15 @@ class TangemPaymentAccountRegistry extends Contract { public String newOwner; } - public static class PaymentAccountOwnerRegisteredEventResponse extends BaseEventResponse { + public static class OwnerRegisteredEventResponse extends BaseEventResponse { public String paymentAccount; public String owner; } -} + + public static class OwnerRemovedEventResponse extends BaseEventResponse { + public String paymentAccount; + + public String owner; + } +} \ No newline at end of file diff --git a/libs/visa/src/main/kotlin/com/tangem/lib/visa/DefaultVisaContractInfoProvider.kt b/libs/visa/src/main/kotlin/com/tangem/lib/visa/DefaultVisaContractInfoProvider.kt index 312f708435..2265f6258f 100644 --- a/libs/visa/src/main/kotlin/com/tangem/lib/visa/DefaultVisaContractInfoProvider.kt +++ b/libs/visa/src/main/kotlin/com/tangem/lib/visa/DefaultVisaContractInfoProvider.kt @@ -102,8 +102,7 @@ internal class DefaultVisaContractInfoProvider( { paymentAccount.availableForDebtPayment().send() }, { paymentAccount.blockedAmount().send() }, { paymentAccount.debtAmount().send() }, - { paymentAccount.pendingRefundTotal().send() }, - ) { total, verified, payment, withdrawal, debtPayment, blocked, debt, refund -> + ) { total, verified, payment, withdrawal, debtPayment, blocked, debt -> val decimals = paymentToken.decimals Balances( @@ -116,40 +115,42 @@ internal class DefaultVisaContractInfoProvider( ), blocked = blocked.toBigDecimal(decimals), debt = debt.toBigDecimal(decimals), - pendingRefund = refund.toBigDecimal(decimals), ) } } + @Suppress("UnusedPrivateMember") private fun fetchLimits( paymentAccount: TangemPaymentAccount, paymentToken: PaymentTokenInfo, ): Triple { - val ( - oldLimit, - newLimit, - changeDateSeconds, - ) = paymentAccount.limits().send() - - return Triple( - first = getLimits(oldLimit, paymentToken), - second = getLimits(newLimit, paymentToken), - third = changeDateSeconds.toInstant(), - ) + TODO() // TODO: [REDACTED_TASK_KEY] + // val ( + // oldLimit, + // newLimit, + // changeDateSeconds, + // ) = paymentAccount.cards("").send().component5() + // + // return Triple( + // first = getLimits(oldLimit, paymentToken), + // second = getLimits(newLimit, paymentToken), + // third = changeDateSeconds.toInstant(), + // ) } + @Suppress("UnusedPrivateMember") private fun getLimits(limit: TangemPaymentAccount.Limits, paymentToken: PaymentTokenInfo): Limits = Limits( - spendLimit = limit._01_spendLimit.toLimit(paymentToken.decimals), - noOtpLimit = limit._02_noOtpSpendLimit.toLimit(paymentToken.decimals), - singleTransactionLimit = limit._00_singleTransactionLimit.toBigDecimal(paymentToken.decimals), - expirationDate = limit._03_spendLimitsTimer.expireTimestamp.toInstant(), - spendPeriodSeconds = limit._04_spendLimitsPeriod, + spendLimit = limit.spendLimit.toLimit(paymentToken.decimals), + noOtpLimit = limit.noConfirmationSpendLimit.toLimit(paymentToken.decimals), + singleTransactionLimit = limit.singleTransactionLimit.toBigDecimal(paymentToken.decimals), + expirationDate = limit.spendLimitsTimer.expireTimestamp.toInstant(), + spendPeriodSeconds = limit.spendLimitsPeriod, ) private fun TangemPaymentAccount.Limit.toLimit(decimals: Int): Limits.Limit { return Limits.Limit( - limit = _00_limit.toBigDecimal(decimals), - spent = _01_spent.toBigDecimal(decimals), + limit = limit.toBigDecimal(decimals), + spent = spent.toBigDecimal(decimals), ) } diff --git a/libs/visa/src/main/kotlin/com/tangem/lib/visa/model/VisaContractInfo.kt b/libs/visa/src/main/kotlin/com/tangem/lib/visa/model/VisaContractInfo.kt index e2e6f98d58..e50c6e3c89 100644 --- a/libs/visa/src/main/kotlin/com/tangem/lib/visa/model/VisaContractInfo.kt +++ b/libs/visa/src/main/kotlin/com/tangem/lib/visa/model/VisaContractInfo.kt @@ -25,7 +25,6 @@ data class VisaContractInfo( val available: Available, val blocked: BigDecimal, val debt: BigDecimal, - val pendingRefund: BigDecimal, ) { data class Available( diff --git a/settings.gradle.kts b/settings.gradle.kts index 1ad6153ba0..b89a9482f9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -106,6 +106,17 @@ dependencyResolutionManagement { includeGroupAndSubgroups("com.tangem.ic4j") } } + maven { + // setting any repository from tangem project allows maven search all packages in the project + url = uri("https://maven.pkg.github.com/tangem/web3j") + credentials { + username = properties.getProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") + password = properties.getProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") + } + content { + includeGroupAndSubgroups("org.web3j") + } + } maven("https://jitpack.io") }