use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.
the class Signer method getKavaIncentiveAllMsg.
public static ArrayList<Any> getKavaIncentiveAllMsg(String sender, String multiplier_name, BaseData baseData) {
ArrayList<Any> msgAnys = new ArrayList<>();
IncentiveReward incentiveRewards = baseData.mIncentiveRewards;
if (incentiveRewards.getMintingRewardAmount().compareTo(BigDecimal.ZERO) > 0) {
msgAnys.add(getKavaIncentiveUSDXMinting(sender, multiplier_name));
}
if (incentiveRewards.getHardRewardDenoms().size() > 0) {
ArrayList<kava.incentive.v1beta1.Tx.Selection> denoms_to_claims = new ArrayList<>();
for (String denom : incentiveRewards.getHardRewardDenoms()) {
denoms_to_claims.add(kava.incentive.v1beta1.Tx.Selection.newBuilder().setDenom(denom).setMultiplierName(multiplier_name).build());
}
msgAnys.add(getKavaIncentiveHard(sender, denoms_to_claims));
}
if (incentiveRewards.getDelegatorRewardDenoms().size() > 0) {
ArrayList<kava.incentive.v1beta1.Tx.Selection> denoms_to_claims = new ArrayList<>();
for (String denom : incentiveRewards.getDelegatorRewardDenoms()) {
denoms_to_claims.add(kava.incentive.v1beta1.Tx.Selection.newBuilder().setDenom(denom).setMultiplierName(multiplier_name).build());
}
msgAnys.add(getKavaIncentiveDelegator(sender, denoms_to_claims));
}
if (incentiveRewards.getSwapRewardDenoms().size() > 0) {
ArrayList<kava.incentive.v1beta1.Tx.Selection> denoms_to_claims = new ArrayList<>();
for (String denom : incentiveRewards.getSwapRewardDenoms()) {
denoms_to_claims.add(kava.incentive.v1beta1.Tx.Selection.newBuilder().setDenom(denom).setMultiplierName(multiplier_name).build());
}
msgAnys.add(getKavaIncentiveSwap(sender, denoms_to_claims));
}
return msgAnys;
}
use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.
the class Signer method getGrpcSignerInfo.
public static TxOuterClass.SignerInfo getGrpcSignerInfo(QueryOuterClass.QueryAccountResponse auth, ECKey pKey) {
Any pubKey = WKey.generateGrpcPubKeyFromPriv(auth, pKey.getPrivateKeyAsHex());
TxOuterClass.ModeInfo.Single singleMode = TxOuterClass.ModeInfo.Single.newBuilder().setMode(SIGN_MODE_DIRECT).build();
TxOuterClass.ModeInfo modeInfo = TxOuterClass.ModeInfo.newBuilder().setSingle(singleMode).build();
return TxOuterClass.SignerInfo.newBuilder().setPublicKey(pubKey).setModeInfo(modeInfo).setSequence(onParseSequenceNumber(auth)).build();
}
use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.
the class Signer method getKavaIncentiveDelegator.
public static Any getKavaIncentiveDelegator(String sender, ArrayList<kava.incentive.v1beta1.Tx.Selection> denoms_to_claims) {
kava.incentive.v1beta1.Tx.MsgClaimDelegatorReward msgClaimDelegatorReward = kava.incentive.v1beta1.Tx.MsgClaimDelegatorReward.newBuilder().setSender(sender).addAllDenomsToClaim(denoms_to_claims).build();
Any msgKavaClaimDelegateAny = Any.newBuilder().setTypeUrl("/kava.incentive.v1beta1.MsgClaimDelegatorReward").setValue(msgClaimDelegatorReward.toByteString()).build();
return msgKavaClaimDelegateAny;
}
use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.
the class Signer method getBeginUnbondingMsg.
public static ArrayList<Any> getBeginUnbondingMsg(QueryOuterClass.QueryAccountResponse auth, ArrayList<Long> ids) {
ArrayList<Any> msgAnys = new ArrayList<>();
for (Long id : ids) {
osmosis.lockup.Tx.MsgBeginUnlocking msgBeginUnlocking = osmosis.lockup.Tx.MsgBeginUnlocking.newBuilder().setOwner(onParseAddress(auth)).setID(id).build();
Any msgBeginUnbondingAny = Any.newBuilder().setTypeUrl("/osmosis.lockup.MsgBeginUnlocking").setValue(msgBeginUnlocking.toByteString()).build();
msgAnys.add(msgBeginUnbondingAny);
}
return msgAnys;
}
use of com.google.protobuf2.Any in project cosmostation-android by cosmostation.
the class Signer method getReInvestMsg.
public static ArrayList<Any> getReInvestMsg(QueryOuterClass.QueryAccountResponse auth, String valAddress, Coin amounts) {
ArrayList<Any> msgsAny = new ArrayList<>();
cosmos.distribution.v1beta1.Tx.MsgWithdrawDelegatorReward msgClaimReward = cosmos.distribution.v1beta1.Tx.MsgWithdrawDelegatorReward.newBuilder().setDelegatorAddress(onParseAddress(auth)).setValidatorAddress(valAddress).build();
Any msgClaimRewardAny = Any.newBuilder().setTypeUrl("/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward").setValue(msgClaimReward.toByteString()).build();
msgsAny.add(msgClaimRewardAny);
CoinOuterClass.Coin toReinvsetCoin = CoinOuterClass.Coin.newBuilder().setAmount(amounts.amount).setDenom(amounts.denom).build();
cosmos.staking.v1beta1.Tx.MsgDelegate msgDelegate = cosmos.staking.v1beta1.Tx.MsgDelegate.newBuilder().setDelegatorAddress(onParseAddress(auth)).setValidatorAddress(valAddress).setAmount(toReinvsetCoin).build();
Any msgDelegateAny = Any.newBuilder().setTypeUrl("/cosmos.staking.v1beta1.MsgDelegate").setValue(msgDelegate.toByteString()).build();
msgsAny.add(msgDelegateAny);
return msgsAny;
}
Aggregations