create account

SteemVBS Update: Vests/Steem Conversion and Current Vote Worth by justyy

View this thread on: hive.blogpeakd.comecency.com
· @justyy ·
$42.08
SteemVBS Update: Vests/Steem Conversion and Current Vote Worth
![](https://helloacm.com/wp-content/uploads/2018/05/vbscript.png)

# Introducing to SteemVBS
[SteemVBS](https://helloacm.com/get-following-and-followers-details-via-steemvbs/)  is the first Steem Library written in VBScript. Yes, it is [VBScript](https://isvbscriptdead.com). ;)

# New Features
Adding the support for Vests/Steem Conversions and the functions to get the current vote worth. In particular, the following functions have been added to the library.

1. Steem_Per_MVests
2. Vests_To_Steem
3. GetRewardFund
4. GetRecentClaims
5. GetAccountVests
6. GetMedianPrice
7. GetAccount_UpvoteValue

# Examples
Vests and Steem:
```
Dim SteemIt
Set SteemIt = New Steem

WScript.Echo SteemIt.Steem_Per_MVests
WScript.Echo SteemIt.Vests_To_Steem(1)
WScript.Echo SteemIt.Steem_To_Vests(1)
```
Get Current Vote Worth:
```
' get account upvote value
Public Function GetAccount_UpvoteValue(id, vp, weight)
    Dim power
    power = (100 * vp * 100 * weight / 1e4 + 49) / 50
    Dim total_vests
    total_vests = GetAccountVests(id)
    Dim final_vests
    final_vests = total_vests * 1e6
    Dim rshares
    rshares = power * final_vests / 1e4
    Dim rewards
    rewards = GetRewardFund
    Dim sbd_median_price
    sbd_median_price = GetMedianPrice
    Dim estimate
    estimate = rshares / GetRecentClaims * rewards * sbd_median_price
    GetAccount_UpvoteValue = estimate
End Function
```

Fully Unit Tested:

```
Dim SteemIt
Set SteemIt = New Steem

Dim Util
Set Util = New Utility

Dim fund
fund = SteemIt.GetRewardFund
AssertTrue fund > 0, "Rewards Pool should be larger than zero"

Dim esp
esp = SteemIt.Vests_To_Steem(SteemIt.GetAccountVests("justyy"))
AssertTrue esp > 1000, "justyy's ESP should be at least 1000"

Dim price
price = SteemIt.GetMedianPrice
AssertTrue price > 0, "median price should be larger than 0"

Dim upvote_value
upvote_value = SteemIt.GetAccount_UpvoteValue("justyy", 100, 100)
AssertTrue upvote_value > 0.1, "full vote value should be at least $0.1"

Dim current_upvote_value
current_upvote_value = SteemIt.GetAccount_UpvoteValue("justyy", 50, 20)
AssertEqualFloat upvote_value * 0.5 * 0.2, current_upvote_value, 0.1, "current upvote value calculation error"

Set SteemIt = Nothing
Set Util = Nothing
```

![image.png](https://ipfs.busy.org/ipfs/QmbN52gNesLBi2tG4abwypGKoytmA3iFXExXaXL2cRaCbu)

# Github
https://github.com/DoctorLai/steemvbs

# Pull Requests
https://github.com/DoctorLai/steemvbs/pull/1

## Support me and my work as a witness - [witness thread](https://steemit.com/witness-category/@justyy/justyy-just-another-witness) by 
1. voting me [here](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=justyy), or
2. voting me as [a witness proxy](https://v2.steemconnect.com/sign/account-witness-proxy?proxy=justyy&approve=1) - let @justyy represent you.

Thank you! **Some of My Contributions: [SteemYY.com - SteemIt Tutorials, Robots, Tools and APIs](https://steemyy.com/)** and [VPS Search Tool](https://anothervps.com/vps-database/)
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 76 others
properties (23)
authorjustyy
permlinksteemvbs-update-vests-steem-conversion-and-current-vote-worth
categoryutopian-io
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["utopian-io","development","steemvbs","busy","programming"],"users":["justyy"],"links":["https://helloacm.com/get-following-and-followers-details-via-steemvbs/","https://isvbscriptdead.com","https://github.com/DoctorLai/steemvbs","https://github.com/DoctorLai/steemvbs/pull/1","https://steemit.com/witness-category/@justyy/justyy-just-another-witness","https://steemconnect.com/sign/account_witness_vote?approve=1&witness=justyy","https://v2.steemconnect.com/sign/account-witness-proxy?proxy=justyy&approve=1","/@justyy","https://steemyy.com/","https://anothervps.com/vps-database/"],"image":["https://helloacm.com/wp-content/uploads/2018/05/vbscript.png","https://ipfs.busy.org/ipfs/QmbN52gNesLBi2tG4abwypGKoytmA3iFXExXaXL2cRaCbu"]}
created2018-11-06 01:27:57
last_update2018-11-06 01:27:57
depth0
children5
last_payout2018-11-13 01:27:57
cashout_time1969-12-31 23:59:59
total_payout_value32.283 HBD
curator_payout_value9.796 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,994
author_reputation280,616,224,641,976
root_title"SteemVBS Update: Vests/Steem Conversion and Current Vote Worth"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,757,363
net_rshares39,152,441,409,836
author_curate_reward""
vote details (140)
@amosbastian ·
$8.12
Thanks for the contribution, @justyy! Sorry for the late review, it's probably because none of us use VBScript. It's cool to see you have added a couple of new functions. I was wondering if you use this library for something? Why should someone use this over e.g. one of Python/JavaScript's libraries?

---

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2331213).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , , , , , , , , ,
properties (23)
authoramosbastian
permlinkre-justyy-steemvbs-update-vests-steem-conversion-and-current-vote-worth-20181109t122756459z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["justyy"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2331213","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-11-09 12:27:57
last_update2018-11-09 12:27:57
depth1
children1
last_payout2018-11-16 12:27:57
cashout_time1969-12-31 23:59:59
total_payout_value6.138 HBD
curator_payout_value1.984 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length797
author_reputation174,473,586,900,705
root_title"SteemVBS Update: Vests/Steem Conversion and Current Vote Worth"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,973,518
net_rshares8,769,179,041,779
author_curate_reward""
vote details (10)
@utopian-io ·
Thank you for your review, @amosbastian! Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-justyy-steemvbs-update-vests-steem-conversion-and-current-vote-worth-20181109t122756459z-20181111t161226z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-11 16:12:27
last_update2018-11-11 16:12:27
depth2
children0
last_payout2018-11-18 16:12:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length63
author_reputation152,955,367,999,756
root_title"SteemVBS Update: Vests/Steem Conversion and Current Vote Worth"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,099,919
net_rshares0
@ilovecoding ·
Hello! Your post has been resteemed and upvoted by @ilovecoding because **we love coding**! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On! 
 ![](https://codingforspeed.com/images/i-love-coding.jpg) 
*Reply !stop to disable the comment. Thanks!*
πŸ‘  ,
properties (23)
authorilovecoding
permlink20181106t012808993z
categoryutopian-io
json_metadata{"tags":["ilovecoding"],"app":"ilovecoding"}
created2018-11-06 01:28:09
last_update2018-11-06 01:28:09
depth1
children0
last_payout2018-11-13 01:28:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length323
author_reputation40,845,997,808
root_title"SteemVBS Update: Vests/Steem Conversion and Current Vote Worth"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,757,369
net_rshares2,611,770,895
author_curate_reward""
vote details (2)
@steem-ua ·
#### Hi @justyy!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-steemvbs-update-vests-steem-conversion-and-current-vote-worth-20181109t125155z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-09 12:51:57
last_update2018-11-09 12:51:57
depth1
children0
last_payout2018-11-16 12:51:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length285
author_reputation23,214,230,978,060
root_title"SteemVBS Update: Vests/Steem Conversion and Current Vote Worth"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,974,516
net_rshares0
@utopian-io ·
Hey, @justyy!

**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Get higher incentives and support Utopian.io!**
 Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-steemvbs-update-vests-steem-conversion-and-current-vote-worth-20181109t190252z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-09 19:02:54
last_update2018-11-09 19:02:54
depth1
children0
last_payout2018-11-16 19:02:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length588
author_reputation152,955,367,999,756
root_title"SteemVBS Update: Vests/Steem Conversion and Current Vote Worth"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,992,505
net_rshares0