Commit 13a0caad authored by Jason Salyers's avatar Jason Salyers
Browse files

[JES] Found replacements for get_state. The get_state call is now removed from the wallet

parent 495eebc1
......@@ -41,7 +41,7 @@
"testURL": "http://localhost/"
},
"dependencies": {
"@hiveio/hive-js": "0.8.5",
"@hiveio/hive-js": "0.8.8",
"@steem/crypto-session": "git+https://github.com/steemit/crypto-session.git#83a90b319ce5bc6a70362d52a15a815de7e729bb",
"assert": "1.4.1",
"autoprefixer-loader": "3.2.0",
......
......@@ -32,6 +32,29 @@ async function getStateForWitnesses() {
return result;
}
async function getGenericState(user) {
let result = {};
result.accounts = {};
result.content = {};
result.props = await api.getDynamicGlobalPropertiesAsync();
let user_to_check = user;
//user should be an account
if (user.startsWith('/')) {
user_to_check = user.split('/')[1];
}
if (user_to_check.startsWith('@'))
user_to_check = user_to_check.split('@')[1];
let account_details = await api.getAccountsAsync([user_to_check]);
result.accounts[user_to_check] = account_details[0];
result.feed_price = {};
let feed_data = await api.getFeedHistoryAsync();
result.feed_price = feed_data.current_median_history;
return result;
}
export async function getStateAsync(url) {
// strip off query string
if (url === 'trending') {
......@@ -58,7 +81,7 @@ export async function getStateAsync(url) {
}
}
}
let raw = await api.getStateAsync(path);
let raw = await getGenericState(path);
if (fetch_transfers) {
let account_name = path.split('@')[1];
......
......@@ -132,10 +132,10 @@
lodash "^4.17.13"
to-fast-properties "^2.0.0"
"@hiveio/hive-js@0.8.5":
version "0.8.5"
resolved "https://registry.yarnpkg.com/@hiveio/hive-js/-/hive-js-0.8.5.tgz#271fa801e5489c8519ac0c3011ad059cdd928b13"
integrity sha512-rBBZ5njd2XAXkOgCFu5kVFQIZ5QTvNLuEdbCXgVV2LU8yv+AbbdpCpKp8+V1ygMpzq5ZyqLnn2sbSzSKXu6AgA==
"@hiveio/hive-js@0.8.8":
version "0.8.8"
resolved "https://registry.yarnpkg.com/@hiveio/hive-js/-/hive-js-0.8.8.tgz#4880ceabb9e1d7580d8f48a4ed2825076f79cda9"
integrity sha512-xFgSfrAhlrm/K9QMpQ47bOfSg21/tWJQzEVSZl8eWfgqnWtTsQolyMvBNZNzrbRa6118Ewsm2APDbwTfs6Q34g==
dependencies:
"@steemit/rpc-auth" "^1.1.1"
bigi "^1.4.2"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment