org.bcos.web3j.protocol.parity.JsonRpc2_0Parity Maven / Gradle / Ivy
package org.bcos.web3j.protocol.parity;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.bcos.web3j.crypto.WalletFile;
import org.bcos.web3j.protocol.Web3jService;
import org.bcos.web3j.protocol.core.JsonRpc2_0Web3j;
import org.bcos.web3j.protocol.core.Request;
import org.bcos.web3j.protocol.core.methods.request.Transaction;
import org.bcos.web3j.protocol.core.methods.response.EthSendTransaction;
import org.bcos.web3j.protocol.core.methods.response.VoidResponse;
import org.bcos.web3j.protocol.parity.methods.response.NewAccountIdentifier;
import org.bcos.web3j.protocol.parity.methods.response.PersonalAccountsInfo;
import org.bcos.web3j.protocol.parity.methods.response.PersonalEcRecover;
import org.bcos.web3j.protocol.parity.methods.response.PersonalListAccounts;
import org.bcos.web3j.protocol.parity.methods.response.PersonalRejectRequest;
import org.bcos.web3j.protocol.parity.methods.response.PersonalRequestsToConfirm;
import org.bcos.web3j.protocol.parity.methods.response.PersonalSign;
import org.bcos.web3j.protocol.parity.methods.response.PersonalSignerEnabled;
import org.bcos.web3j.protocol.parity.methods.response.PersonalUnlockAccount;
/**
* JSON-RPC 2.0 factory implementation for Parity.
*/
public class JsonRpc2_0Parity extends JsonRpc2_0Web3j implements Parity {
public JsonRpc2_0Parity(Web3jService web3jService) {
super(web3jService);
}
@Override
public Request, PersonalSignerEnabled> personalSignerEnabled() {
return new Request<>(
"personal_signerEnabled",
Collections.emptyList(),
ID,
web3jService,
PersonalSignerEnabled.class);
}
@Override
public Request, PersonalSign> personalSign(
String message, String accountId, String password) {
return new Request<>(
"personal_sign",
Arrays.asList(message,accountId,password),
ID,
web3jService,
PersonalSign.class);
}
@Override
public Request, PersonalEcRecover> personalEcRecover(
String hexMessage, String signedMessage) {
return new Request<>(
"personal_ecRecover",
Arrays.asList(hexMessage,signedMessage),
ID,
web3jService,
PersonalEcRecover.class);
}
@Override
public Request, PersonalListAccounts> personalListAccounts() {
return new Request<>(
"personal_listAccounts",
Collections.emptyList(),
ID,
web3jService,
PersonalListAccounts.class);
}
@Override
public Request, NewAccountIdentifier> personalNewAccount(String password) {
return new Request<>(
"personal_newAccount",
Arrays.asList(password),
ID,
web3jService,
NewAccountIdentifier.class);
}
@Override
public Request, NewAccountIdentifier> personalNewAccountFromPhrase(
String phrase, String password) {
return new Request<>(
"personal_newAccountFromPhrase",
Arrays.asList(phrase, password),
ID,
web3jService,
NewAccountIdentifier.class);
}
@Override
public Request, NewAccountIdentifier> personalNewAccountFromWallet(
WalletFile walletFile, String password) {
return new Request<>(
"personal_newAccountFromWallet",
Arrays.asList(walletFile, password),
ID,
web3jService,
NewAccountIdentifier.class);
}
@Override
public Request, PersonalUnlockAccount> personalUnlockAccount(
String accountId, String password, BigInteger duration) {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy