org.web3j.protocol.core.RemoteCall Java Examples

The following examples show how to use org.web3j.protocol.core.RemoteCall. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Contract.java    From web3j with Apache License 2.0 6 votes vote down vote up
public static <T extends Contract> RemoteCall<T> deployRemoteCall(
        Class<T> type,
        Web3j web3j,
        Credentials credentials,
        ContractGasProvider contractGasProvider,
        String binary,
        String encodedConstructor) {
    return new RemoteCall<>(
            () ->
                    deploy(
                            type,
                            web3j,
                            credentials,
                            contractGasProvider,
                            binary,
                            encodedConstructor,
                            BigInteger.ZERO));
}
 
Example #2
Source File: Contract.java    From web3j with Apache License 2.0 6 votes vote down vote up
public static <T extends Contract> RemoteCall<T> deployRemoteCall(
        Class<T> type,
        Web3j web3j,
        Credentials credentials,
        ContractGasProvider contractGasProvider,
        String binary,
        String encodedConstructor,
        BigInteger value) {
    return new RemoteCall<>(
            () ->
                    deploy(
                            type,
                            web3j,
                            credentials,
                            contractGasProvider,
                            binary,
                            encodedConstructor,
                            value));
}
 
Example #3
Source File: PublicResolver.java    From web3j with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple2<BigInteger, byte[]>> ABI(byte[] node, BigInteger contentTypes) {
    final Function function = new Function(FUNC_ABI, 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(node), 
            new org.web3j.abi.datatypes.generated.Uint256(contentTypes)), 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<DynamicBytes>() {}));
    return new RemoteCall<Tuple2<BigInteger, byte[]>>(
            new Callable<Tuple2<BigInteger, byte[]>>() {
                @Override
                public Tuple2<BigInteger, byte[]> call() throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple2<BigInteger, byte[]>(
                            (BigInteger) results.get(0).getValue(), 
                            (byte[]) results.get(1).getValue());
                }
            });
}
 
Example #4
Source File: OnChainPrivacyGroupManagementProxy.java    From besu with Apache License 2.0 6 votes vote down vote up
public static RemoteCall<OnChainPrivacyGroupManagementProxy> deploy(
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider,
    String _implementation) {
  String encodedConstructor =
      FunctionEncoder.encodeConstructor(
          Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, _implementation)));
  return deployRemoteCall(
      OnChainPrivacyGroupManagementProxy.class,
      web3j,
      credentials,
      contractGasProvider,
      BINARY,
      encodedConstructor);
}
 
Example #5
Source File: Ballot.java    From web3j with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple4<BigInteger, Boolean, String, BigInteger>> voters(String param0) {
    final Function function = new Function(FUNC_VOTERS,
            Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(param0)),
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Bool>() {}, new TypeReference<Address>() {}, new TypeReference<Uint256>() {}));
    return new RemoteCall<Tuple4<BigInteger, Boolean, String, BigInteger>>(
            new Callable<Tuple4<BigInteger, Boolean, String, BigInteger>>() {
                @Override
                public Tuple4<BigInteger, Boolean, String, BigInteger> call() throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple4<BigInteger, Boolean, String, BigInteger>(
                            (BigInteger) results.get(0).getValue(),
                            (Boolean) results.get(1).getValue(),
                            (String) results.get(2).getValue(),
                            (BigInteger) results.get(3).getValue());
                }
            });
}
 
Example #6
Source File: OnChainPrivacyGroupManagementInterface.java    From besu with Apache License 2.0 5 votes vote down vote up
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy(
    Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      OnChainPrivacyGroupManagementInterface.class,
      web3j,
      credentials,
      contractGasProvider,
      BINARY,
      "");
}
 
Example #7
Source File: DefaultOnChainPrivacyGroupManagementContract.java    From besu with Apache License 2.0 5 votes vote down vote up
@Deprecated
public static RemoteCall<DefaultOnChainPrivacyGroupManagementContract> deploy(
    Web3j web3j,
    TransactionManager transactionManager,
    BigInteger gasPrice,
    BigInteger gasLimit) {
  return deployRemoteCall(
      DefaultOnChainPrivacyGroupManagementContract.class,
      web3j,
      transactionManager,
      gasPrice,
      gasLimit,
      BINARY,
      "");
}
 
Example #8
Source File: Greeter.java    From etherscan-explorer with GNU General Public License v3.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> kill() {
    final Function function = new Function(
            "kill", 
            Arrays.<Type>asList(), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #9
Source File: Ballot.java    From web3j with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> delegate(String to) {
    final Function function = new Function(
            FUNC_DELEGATE, 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(to)),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #10
Source File: MetaCoin.java    From etherscan-explorer with GNU General Public License v3.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> sendCoin(String receiver, BigInteger amount) {
    final Function function = new Function(
            "sendCoin", 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(receiver), 
            new org.web3j.abi.datatypes.generated.Uint256(amount)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #11
Source File: ERC721.java    From web3j with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> transferFrom(String _from, String _to, BigInteger _tokenId, BigInteger weiValue) {
    final Function function = new Function(
            FUNC_TRANSFERFROM, 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(_from), 
            new org.web3j.abi.datatypes.Address(_to), 
            new org.web3j.abi.datatypes.generated.Uint256(_tokenId)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function, weiValue);
}
 
Example #12
Source File: RestrictingPlanContract.java    From client-sdk-java with Apache License 2.0 5 votes vote down vote up
/**
 * 获取锁仓信息
 *
 * @param account 锁仓释放到账账户
 * @return
 */
public RemoteCall<CallResponse<RestrictingItem>> getRestrictingInfo(String account) {
	Function function = new Function(
            FunctionType.GET_RESTRICTINGINFO_FUNC_TYPE,
            Arrays.asList(new BytesType(Numeric.hexStringToByteArray(account))));
    return executeRemoteCallObjectValueReturn(function, RestrictingItem.class);
}
 
Example #13
Source File: HumanStandardToken.java    From web3j-quorum with Apache License 2.0 5 votes vote down vote up
public RemoteCall<BigInteger> allowance(String _owner, String _spender) {
    final Function function = new Function(FUNC_ALLOWANCE,
            Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(_owner),
                    new org.web3j.abi.datatypes.Address(_spender)),
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
    return executeRemoteCallSingleValueReturn(function, BigInteger.class);
}
 
Example #14
Source File: Arrays.java    From etherscan-explorer with GNU General Public License v3.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> fixedReverse(List<BigInteger> input) {
    final Function function = new Function(
            "fixedReverse", 
            java.util.Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.StaticArray10<org.web3j.abi.datatypes.generated.Uint256>(
                    org.web3j.abi.Utils.typeMap(input, org.web3j.abi.datatypes.generated.Uint256.class))), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #15
Source File: ENS.java    From etherscan-explorer with GNU General Public License v3.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> setSubnodeOwner(byte[] node, byte[] label, String owner) {
    Function function = new Function(
            "setSubnodeOwner",
            Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(node),
            new org.web3j.abi.datatypes.generated.Bytes32(label),
            new org.web3j.abi.datatypes.Address(owner)),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #16
Source File: HumanStandardToken.java    From web3j-quorum with Apache License 2.0 5 votes vote down vote up
public static RemoteCall<HumanStandardToken> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, BigInteger _initialAmount, String _tokenName, BigInteger _decimalUnits, String _tokenSymbol) {
    String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(_initialAmount),
            new org.web3j.abi.datatypes.Utf8String(_tokenName),
            new org.web3j.abi.datatypes.generated.Uint8(_decimalUnits),
            new org.web3j.abi.datatypes.Utf8String(_tokenSymbol)));
    return deployRemoteCall(HumanStandardToken.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor);
}
 
Example #17
Source File: HumanStandardToken.java    From client-sdk-java with Apache License 2.0 5 votes vote down vote up
@Deprecated
public static RemoteCall<HumanStandardToken> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit,
		BigInteger _initialAmount, String _tokenName, BigInteger _decimalUnits, String _tokenSymbol) {
	String encodedConstructor = FunctionEncoder.encodeConstructor(
			Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(_initialAmount), new org.web3j.abi.datatypes.Utf8String(_tokenName),
					new org.web3j.abi.datatypes.generated.Uint8(_decimalUnits), new org.web3j.abi.datatypes.Utf8String(_tokenSymbol)));
	return deployRemoteCall(HumanStandardToken.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor);
}
 
Example #18
Source File: Contract.java    From client-sdk-java with Apache License 2.0 5 votes vote down vote up
public static <T extends Contract> RemoteCall<T> deployRemoteCall(
        Class<T> type,
        Web3j web3j, TransactionManager transactionManager,
        BigInteger gasPrice, BigInteger gasLimit,
        String binary, String encodedConstructor) {
    return deployRemoteCall(
            type, web3j, transactionManager, gasPrice, gasLimit, binary,
            encodedConstructor, BigInteger.ZERO);
}
 
Example #19
Source File: RevertReason.java    From besu with Apache License 2.0 5 votes vote down vote up
@Deprecated
public static RemoteCall<RevertReason> deploy(
    final Web3j web3j,
    final TransactionManager transactionManager,
    final BigInteger gasPrice,
    final BigInteger gasLimit) {
  return deployRemoteCall(
      RevertReason.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
}
 
Example #20
Source File: MetaCoin.java    From web3j with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> sendCoin(String receiver, BigInteger amount) {
    final Function function = new Function(
            FUNC_SENDCOIN, 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(receiver), 
            new org.web3j.abi.datatypes.generated.Uint256(amount)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #21
Source File: SimpleStorage.java    From besu with Apache License 2.0 5 votes vote down vote up
public RemoteCall<BigInteger> get() {
  final Function function =
      new Function(
          FUNC_GET,
          Arrays.<Type>asList(),
          Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
  return executeRemoteCallSingleValueReturn(function, BigInteger.class);
}
 
Example #22
Source File: SimpleStorage.java    From besu with Apache License 2.0 5 votes vote down vote up
public static RemoteCall<SimpleStorage> deploy(
    final Web3j web3j,
    final Credentials credentials,
    final ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      SimpleStorage.class, web3j, credentials, contractGasProvider, BINARY, "");
}
 
Example #23
Source File: Greeter.java    From jbpm-work-items with Apache License 2.0 5 votes vote down vote up
public RemoteCall<String> greet() {
    Function function = new Function("greet",
                                     Arrays.<Type>asList(),
                                     Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {
                                     }));
    return executeRemoteCallSingleValueReturn(function,
                                              String.class);
}
 
Example #24
Source File: SimpleStorage.java    From besu with Apache License 2.0 5 votes vote down vote up
public static RemoteCall<SimpleStorage> deploy(
    final Web3j web3j,
    final TransactionManager transactionManager,
    final ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      SimpleStorage.class, web3j, transactionManager, contractGasProvider, BINARY, "");
}
 
Example #25
Source File: Greeter.java    From web3j with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> kill() {
    final Function function = new Function(
            FUNC_KILL,
            Arrays.<Type>asList(),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #26
Source File: CrossContractReader.java    From besu with Apache License 2.0 5 votes vote down vote up
@Deprecated
public static RemoteCall<CrossContractReader> deploy(
    final Web3j web3j,
    final Credentials credentials,
    final BigInteger gasPrice,
    final BigInteger gasLimit) {
  return deployRemoteCall(
      CrossContractReader.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
}
 
Example #27
Source File: Fibonacci.java    From etherscan-explorer with GNU General Public License v3.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> fibonacciNotify(BigInteger number) {
    final Function function = new Function(
            "fibonacciNotify", 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(number)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #28
Source File: Greeter.java    From web3j-quorum with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> kill() {
    final Function function = new Function(
            FUNC_KILL,
            Arrays.<Type>asList(),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #29
Source File: Purchase.java    From web3j with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> abort() {
    final Function function = new Function(
            FUNC_ABORT, 
            Arrays.<Type>asList(),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #30
Source File: Greeter.java    From jbpm-work-items with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> kill() {
    Function function = new Function(
            "kill",
            Arrays.<Type>asList(),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}