use of wannabit.io.cosmostaion.task.FetchTask.NodeInfoTask in project cosmostation-android by cosmostation.
the class BaseActivity method onFetchAccountInfo.
public void onFetchAccountInfo(FetchCallBack callback) {
if (mTaskCount > 0) {
callback.fetchBusy();
}
mFetchCallback = callback;
getBaseDao().mIbcPaths.clear();
getBaseDao().mIbcTokens.clear();
getBaseDao().mChainParam = null;
getBaseDao().mAssets.clear();
getBaseDao().mCw20Assets.clear();
getBaseDao().mSifLmIncentive = null;
getBaseDao().mNodeInfo = null;
getBaseDao().mAllValidators.clear();
getBaseDao().mMyValidators.clear();
getBaseDao().mTopValidators.clear();
getBaseDao().mOtherValidators.clear();
getBaseDao().mBalances.clear();
getBaseDao().mMyDelegations.clear();
getBaseDao().mMyUnbondings.clear();
getBaseDao().mMyRewards.clear();
// kava GRPC
getBaseDao().mIncentiveParam5 = null;
getBaseDao().mIncentiveRewards = null;
getBaseDao().mMyHardDeposits.clear();
getBaseDao().mMyHardBorrows.clear();
getBaseDao().mModuleCoins.clear();
getBaseDao().mReserveCoins.clear();
// binance
getBaseDao().mBnbTokens.clear();
getBaseDao().mBnbTickers.clear();
// gRPC
getBaseDao().mGRpcNodeInfo = null;
getBaseDao().mGRpcAccount = null;
getBaseDao().mGRpcTopValidators.clear();
getBaseDao().mGRpcOtherValidators.clear();
getBaseDao().mGRpcAllValidators.clear();
getBaseDao().mGRpcMyValidators.clear();
getBaseDao().mGrpcBalance.clear();
getBaseDao().mGrpcVesting.clear();
getBaseDao().mGrpcDelegations.clear();
getBaseDao().mGrpcUndelegations.clear();
getBaseDao().mGrpcRewards.clear();
getBaseDao().mGrpcStarNameFee = null;
getBaseDao().mGrpcStarNameConfig = null;
getBaseDao().mGrpcGravityPools.clear();
if (mBaseChain.equals(BNB_MAIN)) {
mTaskCount = 6;
new NodeInfoTask(getBaseApplication(), this, BaseChain.getChain(mAccount.baseChain)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AccountInfoTask(getBaseApplication(), this, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BnbTokenListTask(getBaseApplication(), this, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BnbMiniTokenListTask(getBaseApplication(), this, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BnbTickerTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BnbMiniTickerTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
// new BnbFeesTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else if (mBaseChain.equals(BaseChain.OKEX_MAIN)) {
mTaskCount = 8;
getBaseDao().mOkStaking = null;
getBaseDao().mOkUnbonding = null;
getBaseDao().mOkTokenList = null;
getBaseDao().mOkTickersList = null;
new NodeInfoTask(getBaseApplication(), this, BaseChain.getChain(mAccount.baseChain)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new ValidatorInfoAllTask(getBaseApplication(), this, BaseChain.getChain(mAccount.baseChain)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AccountInfoTask(getBaseApplication(), this, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new OkAccountBalanceTask(getBaseApplication(), this, mAccount, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new OkTokenListTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new OkDexTickerTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new OkStakingInfoTask(getBaseApplication(), this, mAccount, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new OkUnbondingInfoTask(getBaseApplication(), this, mAccount, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else // grpc
if (mBaseChain.equals(COSMOS_MAIN)) {
mTaskCount = 10;
new NodeInfoGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AuthGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondingValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BalanceGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new DelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnDelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AllRewardGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new GravityDexPoolGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else if (mBaseChain.equals(IOV_MAIN)) {
mTaskCount = 11;
new NodeInfoGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AuthGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondingValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BalanceGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new DelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnDelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AllRewardGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new StarNameGrpcFeeTask(getBaseApplication(), this, BaseChain.getChain(mAccount.baseChain)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new StarNameGrpcConfigTask(getBaseApplication(), this, BaseChain.getChain(mAccount.baseChain)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else if (mBaseChain.equals(OSMOSIS_MAIN)) {
mTaskCount = 10;
new NodeInfoGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AuthGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondingValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BalanceGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new DelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnDelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AllRewardGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new OsmosisPoolListGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else if (mBaseChain.equals(KAVA_MAIN)) {
mTaskCount = 12;
new NodeInfoGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AuthGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondingValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BalanceGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new DelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnDelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AllRewardGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new KavaMarketPriceGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new KavaIncentiveParamTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new KavaIncentiveRewardTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else if (isGRPC(mBaseChain)) {
mTaskCount = 9;
new NodeInfoGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AuthGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondedValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnBondingValidatorsGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new BalanceGrpcTask(getBaseApplication(), this, mBaseChain, mAccount.address).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new DelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new UnDelegationsGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new AllRewardGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
use of wannabit.io.cosmostaion.task.FetchTask.NodeInfoTask in project cosmostation-android by cosmostation.
the class AccountDetailActivity method onInitView.
private void onInitView() {
if (getIntent() == null || TextUtils.isEmpty(getIntent().getStringExtra("id"))) {
onBackPressed();
}
mAccount = getBaseDao().onSelectAccount(getIntent().getStringExtra("id"));
if (mAccount == null)
onBackPressed();
mBaseChain = BaseChain.getChain(mAccount.baseChain);
onUpdatePushStatusUI();
WDp.showChainDp(AccountDetailActivity.this, mBaseChain, mCardName, mCardAlarm, mCardBody, mCardRewardAddress);
WDp.getChainImg(AccountDetailActivity.this, mBaseChain, mChainImg);
if (isGRPC(mBaseChain)) {
new WithdrawAddressGrpcTask(getBaseApplication(), this, mBaseChain, mAccount).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new NodeInfoGrpcTask(getBaseApplication(), this, mBaseChain).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
new NodeInfoTask(getBaseApplication(), this, BaseChain.getChain(mAccount.baseChain)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
if (TextUtils.isEmpty(mAccount.nickName)) {
mAccountName.setText(getString(R.string.str_my_wallet) + mAccount.id);
} else {
mAccountName.setText(mAccount.nickName);
}
mAccountAddress.setText(mAccount.address);
mAccountGenTime.setText(WDp.getDpTime(getBaseContext(), mAccount.importTime));
if (mAccount.hasPrivateKey && mAccount.fromMnemonic) {
mAccountState.setText(getString(R.string.str_with_mnemonic));
mAccountPath.setText(WDp.getPath(BaseChain.getChain(mAccount.baseChain), Integer.parseInt(mAccount.path), mAccount.customPath));
mPathLayer.setVisibility(View.VISIBLE);
mImportMsg.setVisibility(View.GONE);
mBtnCheck.setVisibility(View.VISIBLE);
mBtnCheckKey.setVisibility(View.VISIBLE);
mBtnCheck.setText(getString(R.string.str_check_mnemonic));
mBtnCheckKey.setText(getString(R.string.str_check_private_key));
} else if (mAccount.hasPrivateKey && !mAccount.fromMnemonic) {
mAccountState.setText(getString(R.string.str_with_privatekey));
mPathLayer.setVisibility(View.GONE);
mImportMsg.setVisibility(View.GONE);
mBtnCheck.setVisibility(View.GONE);
mView.setVisibility(View.GONE);
mBtnCheckKey.setVisibility(View.VISIBLE);
mBtnCheckKey.setText(getString(R.string.str_check_private_key));
if (mBaseChain.equals(OKEX_MAIN)) {
mPathLayer.setVisibility(View.VISIBLE);
mAccountPathTitle.setText("Address Type");
if (mAccount.customPath > 0) {
mAccountPath.setText("Ethereum Type Address");
} else {
mAccountPath.setText("Legacy Tendermint Type Address");
}
mAccountPath.setTextColor(getResources().getColor(R.color.colorPhoton));
}
} else {
mAccountState.setText(getString(R.string.str_only_address));
mPathLayer.setVisibility(View.GONE);
mImportMsg.setVisibility(View.VISIBLE);
mImportMsg.setTextColor(WDp.getChainColor(getBaseContext(), mBaseChain));
mBtnCheck.setVisibility(View.VISIBLE);
mBtnCheckKey.setVisibility(View.VISIBLE);
mBtnCheck.setText(getString(R.string.str_import_mnemonic));
mBtnCheckKey.setText(getString(R.string.str_import_key));
}
}
Aggregations