本文整理汇总了Java中org.web3j.abi.datatypes.Function类的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Function类属于org.web3j.abi.datatypes包,在下文中一共展示了Function类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createTokenTransferData
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public static byte[] createTokenTransferData(String to, BigInteger tokenAmount) {
List<Type> params = Arrays.asList(new Address(to), new Uint256(tokenAmount));
List<TypeReference<?>> returnTypes = Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {
});
Function function = new Function("transfer", params, returnTypes);
String encodedFunction = FunctionEncoder.encode(function);
return Numeric.hexStringToByteArray(Numeric.cleanHexPrefix(encodedFunction));
}
开发者ID:TrustWallet,项目名称:trust-wallet-android,代码行数:11,代码来源:TokenRepository.java
示例2: executeCallMultipleValueReturnObservable
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
protected Observable<List<Type>> executeCallMultipleValueReturnObservable(Function function) {
return executeCall(function)
.flatMap(types -> {
if (types == null) {
return Observable.error(new GethException("value is null"));
}
return Observable.just(types);
});
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:10,代码来源:Contract.java
示例3: executeCallSingleValueReturnObservable
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
protected <T extends Type> Observable<T> executeCallSingleValueReturnObservable(Function function) {
return executeCall(function)
.flatMap(types -> {
if (types == null || types.isEmpty()) {
return Observable.error(new GethException("value is null"));
}
return Observable.just((T) types.get(0));
});
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:10,代码来源:Contract.java
示例4: mAvailable
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
/**
* variables
**/
public Observable<Bool> mAvailable() {
Function function = new Function("mAvailable",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Bool>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:11,代码来源:SlotMachine.java
示例5: owner
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Address> owner() {
Function function = new Function(
"owner",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Address>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例6: mDecider
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Uint16> mDecider() {
Function function = new Function(
"mDecider",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Uint16>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例7: mMinBet
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Uint256> mMinBet() {
Function function = new Function("mMinBet",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Uint256>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:8,代码来源:SlotMachine.java
示例8: mMaxBet
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Uint256> mMaxBet() {
Function function = new Function(
"mMaxBet",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Uint256>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例9: mMaxPrize
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Uint16> mMaxPrize() {
Function function = new Function(
"mMaxPrize",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Uint16>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例10: bankerBalance
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Uint256> bankerBalance() {
Function function = new Function(
"bankerBalance",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Uint256>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例11: initialPlayerSeedReady
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Bool> initialPlayerSeedReady() {
Function function = new Function(
"initialPlayerSeedReady",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Bool>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例12: previousPlayerSeed
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Bytes32> previousPlayerSeed(Uint256 idx) {
Function function = new Function(
"previousPlayerSeed",
Collections.singletonList(idx),
Collections.singletonList(new TypeReference<Bytes32>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例13: previousBankerSeed
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Bytes32> previousBankerSeed(Uint256 idx) {
Function function = new Function(
"previousBankerSeed",
Collections.singletonList(idx),
Collections.singletonList(new TypeReference<Bytes32>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例14: mUsedPlayerSeeds
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Bool> mUsedPlayerSeeds(Bytes32 param0) {
Function function = new Function(
"mUsedPlayerSeeds",
Collections.singletonList(param0),
Collections.singletonList(new TypeReference<Bool>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例15: mCurrentGameId
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Bytes32> mCurrentGameId() {
Function function = new Function(
"mCurrentGameId",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Bytes32>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachine.java
示例16: getStorageAddr
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Address> getStorageAddr() {
Function function = new Function(
"getStorageAddr",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Address>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachineManager.java
示例17: fixedReverse
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<StaticArray<Uint256>> fixedReverse(StaticArray<Uint256> input) {
Function function = new Function(
"fixedReverse",
Collections.singletonList(input),
Collections.singletonList(new TypeReference.StaticArrayTypeReference<StaticArray<Uint256>>(10) {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:Arrays.java
示例18: dynamicReverse
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<DynamicArray<Uint256>> dynamicReverse(DynamicArray<Uint256> input) {
Function function = new Function(
"dynamicReverse",
Collections.singletonList(input),
Collections.singletonList(new TypeReference<DynamicArray<Uint256>>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:Arrays.java
示例19: totalNumOfSlotMachine
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
public Observable<Uint256> totalNumOfSlotMachine() {
Function function = new Function(
"totalNumOfSlotMachine",
Collections.emptyList(),
Collections.singletonList(new TypeReference<Uint256>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:9,代码来源:SlotMachineStorage.java
示例20: isValidBanker
import org.web3j.abi.datatypes.Function; //导入依赖的package包/类
/**
* methods
**/
public Observable<Bool> isValidBanker(Address _banker) {
Function function = new Function(
"isValidBanker",
Collections.singletonList(_banker),
Collections.singletonList(new TypeReference<Bool>() {
}));
return executeCallSingleValueReturnObservable(function);
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:12,代码来源:SlotMachineStorage.java
注:本文中的org.web3j.abi.datatypes.Function类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论