renaming folder

This commit is contained in:
feruz 2020-12-03 13:16:41 +02:00
parent 6e0a46b4a3
commit f256c388a4
39 changed files with 82 additions and 77 deletions

View File

@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { withNavigation } from 'react-navigation';
// Services and Actions
import { getCommunityTitle } from '../../../../providers/steem/dsteem';
import { getCommunityTitle } from '../../../../providers/hive/dhive';
// Middleware
// Constants

View File

@ -2,7 +2,7 @@ import React, { useState, useCallback } from 'react';
import { View, FlatList, Text } from 'react-native';
import { useIntl } from 'react-intl';
import { lookupAccounts } from '../../providers/steem/dsteem';
import { lookupAccounts } from '../../providers/hive/dhive';
import { FormInput, MainButton, Tag } from '..';

View File

@ -9,7 +9,7 @@ import { parseActiveVotes } from '../../../utils/postParser';
// Constants
// Actions
import { getActiveVotes } from '../../../providers/steem/dsteem';
import { getActiveVotes } from '../../../providers/hive/dhive';
// Components
import { CommentBody, PostHeaderDescription } from '../../postElements';

View File

@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import get from 'lodash/get';
import { getComments, deleteComment } from '../../../providers/steem/dsteem';
import { getComments, deleteComment } from '../../../providers/hive/dhive';
// Services and Actions
import { writeToClipboard } from '../../../utils/clipboard';
import { toastNotification } from '../../../redux/actions/uiAction';

View File

@ -5,7 +5,7 @@ import get from 'lodash/get';
// Services
import { act } from 'react-test-renderer';
import { getPost, getActiveVotes } from '../../../providers/steem/dsteem';
import { getPost, getActiveVotes } from '../../../providers/hive/dhive';
import { getPostReblogs } from '../../../providers/esteem/esteem';
import { parseActiveVotes } from '../../../utils/postParser';

View File

@ -7,7 +7,7 @@ import { injectIntl } from 'react-intl';
import get from 'lodash/get';
// Services and Actions
import { reblog } from '../../../providers/steem/dsteem';
import { reblog } from '../../../providers/hive/dhive';
import { addBookmark, addReport } from '../../../providers/esteem/esteem';
import { toastNotification, setRcOffer } from '../../../redux/actions/uiAction';
import { openPinCodeModal } from '../../../redux/actions/applicationActions';

View File

@ -8,7 +8,7 @@ import get from 'lodash/get';
import { toastNotification } from '../../../redux/actions/uiAction';
// Dsteem
import { deleteComment, getActiveVotes } from '../../../providers/steem/dsteem';
import { deleteComment, getActiveVotes } from '../../../providers/hive/dhive';
import { getPostReblogs } from '../../../providers/esteem/esteem';
// Constants

View File

@ -5,7 +5,7 @@ import unionBy from 'lodash/unionBy';
import Matomo from 'react-native-matomo-sdk';
// HIVE
import { getAccountPosts, getPost, getRankedPosts } from '../../../providers/steem/dsteem';
import { getAccountPosts, getPost, getRankedPosts } from '../../../providers/hive/dhive';
import { getPromotePosts } from '../../../providers/esteem/esteem';
// Component

View File

@ -5,7 +5,7 @@ import get from 'lodash/get';
// Services and Actions
import { search } from '../../../providers/esteem/esteem';
import { lookupAccounts, getTrendingTags, getPurePost } from '../../../providers/steem/dsteem';
import { lookupAccounts, getTrendingTags, getPurePost } from '../../../providers/hive/dhive';
// Constants
import ROUTES from '../../../constants/routeNames';

View File

@ -3,7 +3,7 @@ import { connect } from 'react-redux';
// Actions
import { getUserDataWithUsername } from '../../../realm/realm';
import { switchAccount } from '../../../providers/steem/auth';
import { switchAccount } from '../../../providers/hive/auth';
import { updateCurrentAccount } from '../../../redux/actions/accountAction';
import { logout, isRenderRequired } from '../../../redux/actions/applicationActions';

View File

@ -20,7 +20,7 @@ import { FormattedCurrency } from '../../formatedElements';
import { setRcOffer } from '../../../redux/actions/uiAction';
// STEEM
import { vote } from '../../../providers/steem/dsteem';
import { vote } from '../../../providers/hive/dhive';
// Styles
import styles from './upvoteStyles';

View File

@ -8,7 +8,7 @@ import { withNavigation } from 'react-navigation';
// Services and Actions
import { getUser, getUserPoints, claim } from '../providers/esteem/ePoint';
import { openPinCodeModal } from '../redux/actions/applicationActions';
import { getAccount, boost } from '../providers/steem/dsteem';
import { getAccount, boost } from '../providers/hive/dhive';
import { getUserDataWithUsername } from '../realm/realm';
import { toastNotification } from '../redux/actions/uiAction';

View File

@ -15,10 +15,9 @@ import {
getFollows,
getRepliesByLastUpdate,
getUser,
getIsFollowing,
getIsMuted,
getRelationship,
getAccountPosts,
} from '../providers/steem/dsteem';
} from '../providers/hive/dhive';
// Ecency providers
import { getIsFavorite, addFavorite, removeFavorite } from '../providers/esteem/esteem';
@ -260,9 +259,10 @@ class ProfileContainer extends Component {
let follows;
if (!isOwnProfile) {
_isFollowing = await getIsFollowing(username, currentAccount.name);
const res = await getRelationship(currentAccount.name, username);
_isFollowing = res && res.follows;
_isMuted = _isFollowing ? false : await getIsMuted(username, currentAccount.name);
_isMuted = res && res.ignores;
getIsFavorite(username, currentAccount.name).then((isFav) => {
isFavorite = isFav;

View File

@ -8,7 +8,7 @@ import { withNavigation } from 'react-navigation';
import { uploadImage } from '../providers/esteem/esteem';
import { profileUpdate, signImage } from '../providers/steem/dsteem';
import { profileUpdate, signImage } from '../providers/hive/dhive';
import { updateCurrentAccount } from '../redux/actions/accountAction';
// import ROUTES from '../constants/routeNames';

View File

@ -5,7 +5,7 @@ import get from 'lodash/get';
import { injectIntl } from 'react-intl';
import { withNavigation } from 'react-navigation';
import { promote, boost, isPostAvailable } from '../providers/steem/dsteem';
import { promote, boost, isPostAvailable } from '../providers/hive/dhive';
import { toastNotification } from '../redux/actions/uiAction';
import { getUserDataWithUsername } from '../realm/realm';

View File

@ -6,7 +6,7 @@ import get from 'lodash/get';
import { toastNotification } from '../redux/actions/uiAction';
// Dsteem
import { getAccount, claimRewardBalance, getBtcAddress } from '../providers/steem/dsteem';
import { getAccount, claimRewardBalance, getBtcAddress } from '../providers/hive/dhive';
// Actions
import { openPinCodeModal } from '../redux/actions/applicationActions';

View File

@ -16,7 +16,7 @@ import {
withdrawVesting,
delegateVestingShares,
setWithdrawVestingRoute,
} from '../providers/steem/dsteem';
} from '../providers/hive/dhive';
import { toastNotification } from '../redux/actions/uiAction';
import { getUserDataWithUsername } from '../realm/realm';
import { getUser } from '../providers/esteem/ePoint';

View File

@ -3,7 +3,7 @@ import sha256 from 'crypto-js/sha256';
import Config from 'react-native-config';
import get from 'lodash/get';
import { getUser } from './dsteem';
import { getUser } from './dhive';
import {
setUserData,
setAuthStatus,

View File

@ -2,7 +2,7 @@
// import '../../../shim';
// import * as bitcoin from 'bitcoinjs-lib';
import { Client, cryptoUtils } from '@hiveio/dhive';
import { Client, cryptoUtils, makeBitMaskFilter, operationOrders } from '@hiveio/dhive';
import { PrivateKey } from '@esteemapp/dhive';
import hivesigner from 'hivesigner';
@ -31,7 +31,7 @@ global.Buffer = global.Buffer || require('buffer').Buffer;
const DEFAULT_SERVER = SERVER_LIST;
let client = new Client(DEFAULT_SERVER, {
timeout: 3000,
timeout: 4000,
failoverThreshold: 10,
consoleOnFailover: true,
});
@ -46,7 +46,7 @@ export const checkClient = async () => {
});
client = new Client(selectedServer, {
timeout: 3000,
timeout: 4000,
failoverThreshold: 10,
consoleOnFailover: true,
});
@ -124,8 +124,35 @@ export const getAccount = (user) =>
export const getAccountHistory = (user) =>
new Promise((resolve, reject) => {
const op = operationOrders;
let wallet_operations_bitmask = makeBitMaskFilter([
op.transfer,
op.transfer_to_vesting,
op.withdraw_vesting,
op.interest,
op.liquidity_reward,
op.transfer_to_savings,
op.transfer_from_savings,
op.escrow_transfer,
op.cancel_transfer_from_savings,
op.escrow_approve,
op.escrow_dispute,
op.escrow_release,
op.fill_convert_request,
op.fill_order,
op.claim_reward_balance,
op.sps_fund,
op.comment_benefactor_reward,
op.return_vesting_delegation,
]);
try {
const ah = client.call('condenser_api', 'get_account_history', [user, -1, 1000]);
const ah = client.call('condenser_api', 'get_account_history', [
user,
-1,
1000,
...wallet_operations_bitmask,
]);
console.log(ah);
resolve(ah);
} catch (error) {
reject(error);
@ -282,14 +309,14 @@ export const getFollowing = (follower, startFollowing, followType = 'blog', limi
export const getFollowers = (follower, startFollowing, followType = 'blog', limit = 100) =>
client.database.call('get_followers', [follower, startFollowing, followType, limit]);
export const getIsFollowing = (user, author) =>
export const getRelationship = (follower, following) =>
new Promise((resolve, reject) => {
if (author) {
client.database
.call('get_following', [author, user, 'blog', 1])
if (follower) {
client
.call('bridge', 'get_relationship_between_accounts', [follower, following])
.then((result) => {
if (result[0] && result[0].follower === author && result[0].following === user) {
resolve(true);
if (result) {
resolve(result);
} else {
resolve(false);
}
@ -322,24 +349,6 @@ export const getFollowSearch = (user, targetUser) =>
}
});
export const getIsMuted = async (targetUsername, username) => {
let resp;
try {
resp = await getFollowing(username, targetUsername, 'ignore', 1);
} catch (err) {
return false;
}
if (resp && resp.length > 0) {
if (resp[0].follower === username && resp[0].following === targetUsername) {
return true;
}
}
return false;
};
export const ignoreUser = async (currentAccount, pin, data) => {
const digitPinCode = getDigitPinCode(pin);
const key = getAnyPrivateKey(currentAccount.local, digitPinCode);

View File

@ -1,4 +1,4 @@
import { fetchGlobalProps } from '../../providers/steem/dsteem';
import { fetchGlobalProps } from '../../providers/hive/dhive';
import {
ADD_OTHER_ACCOUNT,
FETCH_ACCOUNT_FAIL,

View File

@ -41,8 +41,8 @@ import {
getVersionForWelcomeModal,
setVersionForWelcomeModal,
} from '../../../realm/realm';
import { getUser, getPost } from '../../../providers/steem/dsteem';
import { switchAccount } from '../../../providers/steem/auth';
import { getUser, getPost } from '../../../providers/hive/dhive';
import { switchAccount } from '../../../providers/hive/auth';
import { setPushToken, markActivityAsRead } from '../../../providers/esteem/esteem';
import { navigate } from '../../../navigation/service';

View File

@ -3,8 +3,8 @@ import { withNavigation } from 'react-navigation';
import get from 'lodash/get';
import { connect } from 'react-redux';
import { getCommunity, getSubscriptions } from '../../../providers/steem/steem';
import { subscribeCommunity } from '../../../providers/steem/dsteem';
import { getCommunity, getSubscriptions } from '../../../providers/hive/hive';
import { subscribeCommunity } from '../../../providers/hive/dhive';
import ROUTES from '../../../constants/routeNames';

View File

@ -15,7 +15,7 @@ import {
getPurePost,
grantPostingPermission,
signImage,
} from '../../../providers/steem/dsteem';
} from '../../../providers/hive/dhive';
import { setDraftPost, getDraftPost } from '../../../realm/realm';
// Constants

View File

@ -6,7 +6,7 @@ import get from 'lodash/get';
// Utilities
// Services and Actions
import { getFollowers, getFollowing, getFollowSearch } from '../../../providers/steem/dsteem';
import { getFollowers, getFollowing, getFollowSearch } from '../../../providers/hive/dhive';
// Component
import FollowsScreen from '../screen/followsScreen';

View File

@ -6,8 +6,8 @@ import Config from 'react-native-config';
import messaging from '@react-native-firebase/messaging';
// Services and Actions
import { login } from '../../../providers/steem/auth';
import { lookupAccounts } from '../../../providers/steem/dsteem';
import { login } from '../../../providers/hive/auth';
import { lookupAccounts } from '../../../providers/hive/dhive';
import { userActivity } from '../../../providers/esteem/ePoint';
import {
failedAccount,

View File

@ -7,11 +7,7 @@ import get from 'lodash/get';
// Actions & Services
import { navigate } from '../../../navigation/service';
import {
setUserDataWithPinCode,
verifyPinCode,
updatePinCode,
} from '../../../providers/steem/auth';
import { setUserDataWithPinCode, verifyPinCode, updatePinCode } from '../../../providers/hive/auth';
import {
closePinCodeModal,
login,
@ -27,7 +23,7 @@ import {
setAuthStatus,
} from '../../../realm/realm';
import { updateCurrentAccount, removeOtherAccount } from '../../../redux/actions/accountAction';
import { getUser } from '../../../providers/steem/dsteem';
import { getUser } from '../../../providers/hive/dhive';
// Utils
import { encryptKey, decryptKey } from '../../../utils/crypto';

View File

@ -5,7 +5,7 @@ import get from 'lodash/get';
// Services and Actions
import Matomo from 'react-native-matomo-sdk';
import { getPost } from '../../../providers/steem/dsteem';
import { getPost } from '../../../providers/hive/dhive';
// import { matomo } from '../../../providers/esteem/analytics';
// Component

View File

@ -5,7 +5,7 @@ import { useSelector } from 'react-redux';
import { withNavigation } from 'react-navigation';
import get from 'lodash/get';
import { lookupAccounts } from '../../providers/steem/dsteem';
import { lookupAccounts } from '../../providers/hive/dhive';
import { register } from '../../providers/esteem/esteem';
import ROUTES from '../../constants/routeNames';

View File

@ -5,8 +5,8 @@ import isEmpty from 'lodash/isEmpty';
import ROUTES from '../../../constants/routeNames';
import { getCommunities, getSubscriptions } from '../../../providers/steem/steem';
import { subscribeCommunity } from '../../../providers/steem/dsteem';
import { getCommunities, getSubscriptions } from '../../../providers/hive/hive';
import { subscribeCommunity } from '../../../providers/hive/dhive';
const CommunitiesContainer = ({
children,

View File

@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import ROUTES from '../../../constants/routeNames';
import { lookupAccounts, getTrendingTags } from '../../../providers/steem/dsteem';
import { lookupAccounts, getTrendingTags } from '../../../providers/hive/dhive';
import { getLeaderboard } from '../../../providers/esteem/esteem';
const OtherResultContainer = (props) => {

View File

@ -6,7 +6,7 @@ import { connect } from 'react-redux';
import ROUTES from '../../../constants/routeNames';
import { search, getPromotePosts } from '../../../providers/esteem/esteem';
import { getPost } from '../../../providers/steem/dsteem';
import { getPost } from '../../../providers/hive/dhive';
const PostResultContainer = ({ children, navigation, searchValue, currentAccountUsername }) => {
const [data, setData] = useState([]);

View File

@ -34,8 +34,8 @@ import {
} from '../../../redux/actions/applicationActions';
import { toastNotification } from '../../../redux/actions/uiAction';
import { setPushToken, getNodes } from '../../../providers/esteem/esteem';
import { checkClient } from '../../../providers/steem/dsteem';
import { updatePinCode } from '../../../providers/steem/auth';
import { checkClient } from '../../../providers/hive/dhive';
import { updatePinCode } from '../../../providers/hive/auth';
import { updateCurrentAccount } from '../../../redux/actions/accountAction';
// Middleware

View File

@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import { withNavigation } from 'react-navigation';
import { loginWithSC2 } from '../../providers/steem/auth';
import { loginWithSC2 } from '../../providers/hive/auth';
import { hsOptions } from '../../constants/hsOptions';
// Actions

View File

@ -6,7 +6,7 @@ import { injectIntl } from 'react-intl';
import Slider from '@esteemapp/react-native-slider';
import get from 'lodash/get';
import { getWithdrawRoutes } from '../../../providers/steem/dsteem';
import { getWithdrawRoutes } from '../../../providers/hive/dhive';
import AUTH_TYPE from '../../../constants/authType';
import {

View File

@ -10,7 +10,7 @@ import { BasicHeader, FilterBar, VotersDisplay } from '../../../components';
import AccountListContainer from '../../../containers/accountListContainer';
// Utils
import { getActiveVotes } from '../../../providers/steem/dsteem';
import { getActiveVotes } from '../../../providers/hive/dhive';
import { parseActiveVotes } from '../../../utils/postParser';
import { getResizedAvatar } from '../../../utils/image';

View File

@ -2,7 +2,7 @@ import get from 'lodash/get';
import parseDate from './parseDate';
import parseToken from './parseToken';
import { vestsToSp } from './conversions';
import { getFeedHistory, getAccount, getAccountHistory } from '../providers/steem/dsteem';
import { getFeedHistory, getAccount, getAccountHistory } from '../providers/hive/dhive';
import { getCurrencyTokenRate } from '../providers/esteem/esteem';
export const transferTypes = [