Skip to content

Commit

Permalink
Merge pull request #11 from emre/general-overhaul
Browse files Browse the repository at this point in the history
General overhaul
  • Loading branch information
emre committed Feb 15, 2023
2 parents dbacef9 + 955922b commit 7514fe7
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 580 deletions.
46 changes: 15 additions & 31 deletions docs/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ from the blockchain. Once you initialized the Account instance, you have access
Getting account history
-----------------------------------

.. important :: With version `0.4.1`, we have started using ``account_history_api.account_history``,
instead of ``condenser_api.account_history``. When you pass operation name into filter and exclude parameters,
you need to add an `_operation` suffix to the operation name.
Example:
- Before: ``transfer``
- After: ``transfer_operation``
Beofre:

With this method, you can traverse entire history of a HIVE account.

.. function:: history(self, account=None, limit=1000, filter=None, exclude=None,
Expand All @@ -43,13 +54,15 @@ With this method, you can traverse entire history of a HIVE account.
account_history is an important call for the HIVE applications. A few use cases:

- Getting incoming delegations
- Filtering transfers on specific accounts
- Filtering transfers on spe`cific accounts
- Getting author, curation rewards

etc.

**Example: Get all incoming HIVE of binance account in the last 7 days**



.. code-block:: python
import datetime
Expand Down Expand Up @@ -256,33 +269,4 @@ EventListener class also has
- start_block
- end_block

params that you can limit the streaming process into specific blocks.


ResourceCredits Helper
=================================

ResourceCredits class has a simple helper function to get RC costs on specific
operations.

For example, if you want to learn about how much resource credit will be exhausted
for an **account_claim** operation:

.. code-block:: python
from lighthive.client import Client
from lighthive.datastructures import Operation
client = Client(keys=[<your_active_key>])
op = Operation(
'claim_account',
{
"creator": "emrebeyler",
"fee": "0.000 HIVE",
"extensions": [],
}
)
print(client.rc().get_cost(op))
params that you can limit the streaming process into specific blocks.
4 changes: 1 addition & 3 deletions lighthive/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .exceptions import RPCNodeException
from .broadcast.transaction_builder import TransactionBuilder
from .helpers.account import Account
from .helpers.rc import ResourceCredit
from .node_picker import sort_nodes_by_response_time


Expand All @@ -18,12 +17,11 @@
"https://hived.emre.sh",
"https://api.deathwing.me",
"https://rpc.ausbit.dev",
"https://api.pharesim.me",
"https://rpc.ecency.com",
"https://hive-api.arcange.eu",
"https://api.openhive.network",
"https://api.hive.blue",
"https://techcoderx.com",
"https://rpc.mahdiyari.info",
]


Expand Down
47 changes: 0 additions & 47 deletions lighthive/helpers/rc.py

This file was deleted.

Empty file removed lighthive/vendor/__init__.py
Empty file.

0 comments on commit 7514fe7

Please sign in to comment.