added getVestShare method in ecency.ts

This commit is contained in:
Sadaqat Ali 2022-02-08 19:34:30 +05:00
parent 38651fd367
commit 160a7987c4
3 changed files with 30 additions and 3 deletions

View File

@ -335,7 +335,7 @@ PODS:
- React
- react-native-version-number (0.3.6):
- React
- react-native-webview (11.2.3):
- react-native-webview (11.17.1):
- React-Core
- React-RCTActionSheet (0.63.4):
- React-Core/RCTActionSheetHeaders (= 0.63.4)
@ -736,7 +736,7 @@ SPEC CHECKSUMS:
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
react-native-udp: ff9d13e523f2b58e6bc5d4d32321ac60671b5dc9
react-native-version-number: b415bbec6a13f2df62bf978e85bc0d699462f37f
react-native-webview: 6520e3e7b4933de76b95ef542c8d7115cf45b68e
react-native-webview: 162b6453d074e0b1c7025242bb7a939b6f72b9e7
React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0

View File

@ -733,3 +733,22 @@ export const signUp = async (username:string, email:string, referral?:string) =>
throw error;
}
};
/**
*
* details
* @param username of user
*/
export const getReceivedVestingShares = async (username:string) => {
try {
console.log('Fetching received vesting shares entries');
return ecencyApi.get(`/private-api/received-vesting/${username}`).then((resp) => {
return resp.data ? resp.data : null
});
} catch (error) {
console.warn("Failed to get received vesting shares" + error)
bugsnagInstance.notify(error);
return error;
}
};

View File

@ -31,6 +31,7 @@ import TransferFormItemView from '../../../components/transferFormItem/view/tran
// Styles
import styles from './transferStyles';
import { OptionsModal } from '../../../components/atoms';
import { getReceivedVestingShares } from '../../../providers/ecency/ecency';
class DelegateScreen extends Component {
_handleOnAmountChange = debounce(
@ -154,7 +155,9 @@ class DelegateScreen extends Component {
const username = item;
return (
<TouchableOpacity
onPress={() => {
onPress={async () => {
const receivedVS = await getReceivedVestingShares(username);
console.log('receivedVS : ', receivedVS);
this.setState({ destination: username, usersResult: [], step: 2 });
}}
style={styles.usersDropItemRow}
@ -313,6 +316,11 @@ class DelegateScreen extends Component {
this._renderInformationText(`${(totalHP - spCalculated).toFixed(3)} HP`)
}
/>
<TransferFormItem
rightComponent={() =>
this._renderInformationText(`${(totalHP - spCalculated).toFixed(3)} HP`)
}
/>
<Slider
style={styles.slider}
trackStyle={styles.track}