本文整理匯總了Java中de.petendi.ethereum.android.service.model.WrappedRequest.setParameters方法的典型用法代碼示例。如果您正苦於以下問題:Java WrappedRequest.setParameters方法的具體用法?Java WrappedRequest.setParameters怎麽用?Java WrappedRequest.setParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類de.petendi.ethereum.android.service.model.WrappedRequest
的用法示例。
在下文中一共展示了WrappedRequest.setParameters方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: request
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
private void request() {
accountInput.setError(null);
String accountAddress = accountInput.getText().toString();
boolean cancel = false;
View focusView = null;
if (TextUtils.isEmpty(accountAddress)) {
accountInput.setError(getString(R.string.error_field_required));
focusView = accountInput;
cancel = true;
}
if (cancel) {
focusView.requestFocus();
} else {
showProgress(true);
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(RpcCommand.eth_getBalance.toString());
wrappedRequest.setParameters(new String[]{accountAddress, "latest"});
ethereumAndroid.sendAsync(wrappedRequest);
}
}
示例2: requestSync
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
private void requestSync() {
accountInput.setError(null);
String accountAddress = accountInput.getText().toString();
boolean cancel = false;
View focusView = null;
if (TextUtils.isEmpty(accountAddress)) {
accountInput.setError(getString(R.string.error_field_required));
focusView = accountInput;
cancel = true;
}
if (cancel) {
focusView.requestFocus();
} else {
showProgress(true);
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(RpcCommand.eth_getBalance.toString());
wrappedRequest.setParameters(new String[]{accountAddress, "latest"});
new MyAsyncTask(wrappedRequest).execute();
}
}
示例3: encode
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
public String encode(String abi, String functionName, Object... args) {
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(ContractCommand.contract_encode.toString());
Object[] parameters;
if (args == null) {
parameters = new Object[2];
} else {
parameters = new Object[2 + args.length];
}
parameters[0] = abi;
parameters[1] = functionName;
if (args != null) {
System.arraycopy(args, 0, parameters, 2, args.length);
}
wrappedRequest.setParameters(parameters);
WrappedResponse response = ethereumAndroid.send(wrappedRequest);
if (response.isSuccess()) {
return (String) response.getResponse();
} else {
throw new ResponseNotOKException(response.getErrorMessage());
}
}
示例4: generateContractCreation
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
public String generateContractCreation(String contractBytecode, String contractAbi, Object... constructorParams) {
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(ContractCommand.contract_creation.toString());
Object[] parameters;
if (constructorParams == null) {
parameters = new Object[2];
} else {
parameters = new Object[2 + constructorParams.length];
}
parameters[0] = contractBytecode;
parameters[1] = contractAbi;
if (constructorParams != null) {
System.arraycopy(constructorParams, 0, parameters, 2, constructorParams.length);
}
wrappedRequest.setParameters(parameters);
WrappedResponse response = ethereumAndroid.send(wrappedRequest);
if (response.isSuccess()) {
return (String) response.getResponse();
} else {
throw new ResponseNotOKException(response.getErrorMessage());
}
}
示例5: generateContractInteraction
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
public String generateContractInteraction(String address, BigInteger value, String encoded) {
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(ContractCommand.contract_interaction.toString());
Object[] parameters = new Object[3];
parameters[0] = address;
parameters[1] = value;
parameters[2] = encoded;
wrappedRequest.setParameters(parameters);
WrappedResponse response = ethereumAndroid.send(wrappedRequest);
if (response.isSuccess()) {
return (String) response.getResponse();
} else {
throw new ResponseNotOKException(response.getErrorMessage());
}
}
示例6: decodeResult
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
public Object[] decodeResult(String abi, String functionName, String arg) {
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(ContractCommand.contract_decode.toString());
Object[] parameters = new Object[3];
parameters[0] = abi;
parameters[1] = functionName;
parameters[2] = arg;
wrappedRequest.setParameters(parameters);
WrappedResponse response = ethereumAndroid.send(wrappedRequest);
if (response.isSuccess()) {
return ((ArrayList) response.getResponse()).toArray();
} else {
throw new ResponseNotOKException(response.getErrorMessage());
}
}
示例7: call
import de.petendi.ethereum.android.service.model.WrappedRequest; //導入方法依賴的package包/類
public String call(String address, BigInteger wei, String encoded) {
WrappedRequest wrappedRequest = new WrappedRequest();
wrappedRequest.setCommand(ContractCommand.contract_call.toString());
Object[] parameters = new Object[3];
parameters[0] = address;
parameters[1] = wei;
parameters[2] = encoded;
wrappedRequest.setParameters(parameters);
WrappedResponse response = ethereumAndroid.send(wrappedRequest);
if (response.isSuccess()) {
return (String) response.getResponse();
} else {
throw new ResponseNotOKException(response.getErrorMessage());
}
}