beem.rc

class beem.rc.RC(steem_instance=None)

Bases: object

account_create_dict(account_create_dict)

Calc RC costs for account create

account_update_dict(account_update_dict)

Calc RC costs for account update

claim_account(tx_size=300)

Claim account

comment(tx_size=1000, permlink_length=10, parent_permlink_length=10)

Calc RC for a comment

comment_dict(comment_dict)

Calc RC costs for a comment dict object

Example for calculating RC costs

from beem.rc import RC
comment_dict = {
                "permlink": "test", "author": "holger80",
                "body": "test", "parent_permlink": "",
                "parent_author": "", "title": "test",
                "json_metadata": {"foo": "bar"}
               }

rc = RC()
print(rc.comment_from_dict(comment_dict))
create_claimed_account_dict(create_claimed_account_dict)

Calc RC costs for claimed account create

custom_json(tx_size=444, follow_id=False)
custom_json_dict(custom_json_dict)

Calc RC costs for a custom_json

Example for calculating RC costs

from beem.rc import RC
from collections import OrderedDict
custom_json_dict = {
                     "json": [
                              "reblog", OrderedDict([("account", "xeroc"), ("author", "chainsquad"),
                                                     ("permlink", "streemian-com-to-open-its-doors-and-offer-a-20-discount")
                                                    ])
                             ],
                     "required_auths": [],
                     "required_posting_auths": ["xeroc"],
                     "id": "follow"
                    }

rc = RC()
print(rc.comment(custom_json_dict))
get_authority_byte_count(auth)
get_resource_count(tx_size, execution_time_count, state_bytes_count=0, new_account_op_count=0, market_op_count=0)

Creates the resource_count dictionary based on tx_size, state_bytes_count, new_account_op_count and market_op_count

get_tx_size(op)

Returns the tx size of an operation

transfer(tx_size=290, market_op_count=1)

Calc RC of a transfer

transfer_dict(transfer_dict)

Calc RC costs for a transfer dict object

Example for calculating RC costs

from beem.rc import RC
from beem.amount import Amount
transfer_dict = {
                 "from": "foo", "to": "baar",
                 "amount": Amount("111.110 STEEM"),
                 "memo": "Fooo"
                }

rc = RC()
print(rc.comment(transfer_dict))
vote(tx_size=210)

Calc RC for a vote

vote_dict(vote_dict)

Calc RC costs for a vote

Example for calculating RC costs

from beem.rc import RC
vote_dict = {
             "voter": "foobara", "author": "foobarc",
             "permlink": "foobard", "weight": 1000
            }

rc = RC()
print(rc.comment(vote_dict))