|
2 | 2 |
|
3 | 3 | import org.apache.commons.lang3.tuple.Pair; |
4 | 4 |
|
| 5 | +import io.zksync.domain.auth.Toggle2FA; |
5 | 6 | import io.zksync.domain.contract.ContractAddress; |
6 | 7 | import io.zksync.domain.fee.TransactionFeeBatchRequest; |
7 | 8 | import io.zksync.domain.fee.TransactionFeeDetails; |
|
13 | 14 | import io.zksync.domain.transaction.TransactionDetails; |
14 | 15 | import io.zksync.domain.transaction.ZkSyncTransaction; |
15 | 16 | import io.zksync.signer.EthSignature; |
| 17 | +import io.zksync.transport.ZkSyncSuccess; |
16 | 18 | import io.zksync.transport.ZkSyncTransport; |
17 | 19 | import io.zksync.transport.response.ZksAccountState; |
18 | 20 | import io.zksync.transport.response.ZksContractAddress; |
19 | 21 | import io.zksync.transport.response.ZksEthOpInfo; |
20 | 22 | import io.zksync.transport.response.ZksGetConfirmationsForEthOpAmount; |
21 | 23 | import io.zksync.transport.response.ZksSentTransaction; |
22 | 24 | import io.zksync.transport.response.ZksSentTransactionBatch; |
| 25 | +import io.zksync.transport.response.ZksToggle2FA; |
23 | 26 | import io.zksync.transport.response.ZksTokenPrice; |
24 | 27 | import io.zksync.transport.response.ZksTokens; |
25 | 28 | import io.zksync.transport.response.ZksTransactionDetails; |
@@ -163,6 +166,13 @@ public CompletableFuture<String> getEthTransactionForWithdrawal(String zkSyncWit |
163 | 166 | return response; |
164 | 167 | } |
165 | 168 |
|
| 169 | + @Override |
| 170 | + public CompletableFuture<Boolean> toggle2FA(Toggle2FA toggle2fa) { |
| 171 | + final CompletableFuture<ZkSyncSuccess> result = transport.sendAsync("toggle_2fa", Collections.singletonList(toggle2fa), ZksToggle2FA.class); |
| 172 | + |
| 173 | + return result.thenApply(ZkSyncSuccess::getSuccess); |
| 174 | + } |
| 175 | + |
166 | 176 | @Override |
167 | 177 | public CompletableFuture<Tokens> updateTokenSet() { |
168 | 178 | final CompletableFuture<Tokens> response = transport.sendAsync("tokens", Collections.emptyList(), ZksTokens.class); |
|
0 commit comments