Search in sources :

Example 21 with Function

use of org.fisco.bcos.web3j.abi.datatypes.Function in project web3sdk by FISCO-BCOS.

the class ChainGovernance method unfreezeAccount.

public void unfreezeAccount(String account, TransactionSucCallback callback) {
    final Function function = new Function(FUNC_UNFREEZEACCOUNT, Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Address(account)), Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Address(org.fisco.bcos.web3j.abi.datatypes.Address)

Example 22 with Function

use of org.fisco.bcos.web3j.abi.datatypes.Function in project web3sdk by FISCO-BCOS.

the class ChainGovernance method getUpdateThresholdInput.

public Tuple1<BigInteger> getUpdateThresholdInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_UPDATETHRESHOLD, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple1<BigInteger>((BigInteger) results.get(0).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) Tuple1(org.fisco.bcos.web3j.tuples.generated.Tuple1) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Example 23 with Function

use of org.fisco.bcos.web3j.abi.datatypes.Function in project web3sdk by FISCO-BCOS.

the class ChainGovernance method updateThreshold.

public void updateThreshold(BigInteger threshold, TransactionSucCallback callback) {
    final Function function = new Function(FUNC_UPDATETHRESHOLD, Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.generated.Int256(threshold)), Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Int256(org.fisco.bcos.web3j.abi.datatypes.generated.Int256)

Example 24 with Function

use of org.fisco.bcos.web3j.abi.datatypes.Function in project web3sdk by FISCO-BCOS.

the class ChainGovernance method freezeAccount.

public void freezeAccount(String account, TransactionSucCallback callback) {
    final Function function = new Function(FUNC_FREEZEACCOUNT, Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Address(account)), Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Address(org.fisco.bcos.web3j.abi.datatypes.Address)

Example 25 with Function

use of org.fisco.bcos.web3j.abi.datatypes.Function in project web3sdk by FISCO-BCOS.

the class ChainGovernance method getGrantOperatorInput.

public Tuple1<String> getGrantOperatorInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_GRANTOPERATOR, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple1<String>((String) results.get(0).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) Tuple1(org.fisco.bcos.web3j.tuples.generated.Tuple1) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Aggregations

Function (org.fisco.bcos.web3j.abi.datatypes.Function)108 Utf8String (org.fisco.bcos.web3j.abi.datatypes.Utf8String)59 Type (org.fisco.bcos.web3j.abi.datatypes.Type)41 TypeReference (org.fisco.bcos.web3j.abi.TypeReference)38 Tuple1 (org.fisco.bcos.web3j.tuples.generated.Tuple1)26 Int256 (org.fisco.bcos.web3j.abi.datatypes.generated.Int256)22 Address (org.fisco.bcos.web3j.abi.datatypes.Address)19 Uint256 (org.fisco.bcos.web3j.abi.datatypes.generated.Uint256)16 Test (org.junit.Test)15 EncryptType (org.fisco.bcos.web3j.crypto.EncryptType)11 Bytes32 (org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32)8 NamedType (org.fisco.bcos.web3j.protocol.core.methods.response.AbiDefinition.NamedType)8 Bool (org.fisco.bcos.web3j.abi.datatypes.Bool)6 DynamicBytes (org.fisco.bcos.web3j.abi.datatypes.DynamicBytes)6 Tuple2 (org.fisco.bcos.web3j.tuples.generated.Tuple2)6 CollectionType (com.fasterxml.jackson.databind.type.CollectionType)2 ArrayList (java.util.ArrayList)2 AbiDefinition (org.fisco.bcos.web3j.protocol.core.methods.response.AbiDefinition)2 TransactionReceipt (org.fisco.bcos.web3j.protocol.core.methods.response.TransactionReceipt)2 DynamicArray (org.fisco.bcos.web3j.abi.datatypes.DynamicArray)1