From 160a7987c4ea3f1933da29fa836bd3e3f55bd01c Mon Sep 17 00:00:00 2001 From: Sadaqat Ali Date: Tue, 8 Feb 2022 19:34:30 +0500 Subject: [PATCH] added getVestShare method in ecency.ts --- ios/Podfile.lock | 4 ++-- src/providers/ecency/ecency.ts | 19 +++++++++++++++++++ src/screens/transfer/screen/delegateScreen.js | 10 +++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index c052bc551..c67e30b0e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -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 diff --git a/src/providers/ecency/ecency.ts b/src/providers/ecency/ecency.ts index fac3363cb..1fd1e10ae 100644 --- a/src/providers/ecency/ecency.ts +++ b/src/providers/ecency/ecency.ts @@ -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; + } +}; diff --git a/src/screens/transfer/screen/delegateScreen.js b/src/screens/transfer/screen/delegateScreen.js index c6260df32..4e3ce4260 100644 --- a/src/screens/transfer/screen/delegateScreen.js +++ b/src/screens/transfer/screen/delegateScreen.js @@ -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 ( { + 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`) } /> + + this._renderInformationText(`${(totalHP - spCalculated).toFixed(3)} HP`) + } + />