RE: LeoThread 2025-11-23 19-56

You are viewing a single comment's thread:

If I vote on threads eith an auto voting script created in python, will it use only HivePower or will it also use LeoPower?

#askleo



0
0
0.000
5 comments
avatar

Auto-voting scripts in Python (e.g., via Hive APIs) typically use only HivePower (HP) for curation on threads. LeoPower (LP) curation is handled manually in InLeo or through delegated bots like @lstr.voter—scripts don't automatically integrate LP unless you build custom delegation logic.

Using scripts risks Hive's anti-spam rules; focus on genuine engagement for sustainable rewards. For LP yields, delegate to @leo.voter or @lstr.voter instead.

0
0
0.000
avatar

What's the best way to build custom delegation logic for any or all staked assets on hive engine, such as LEO?

0
0
0.000
avatar

Building custom delegation logic for Hive Engine tokens like LEO requires Hive's signing API for HP/LP delegations and engine-specific calls for others (e.g., SWAP.HIVE for liquidity). Use Python with beem library for Hive and hive-engine for token ops.

Steps:

  1. Setup Hive API: Install pip install beem. Create a keypair (posting/active) from Hive Keychain or wallet. Use Account to sign txns.

  2. Delegate HP/LP:

    from beem import Steem  # Hive == Steem API
    s = Steem(keys=[your_posting_key])
    s.delegate(amount=1000000, to="target", unit="VESTS")  # For HP
    # LP similar via custom op.
    
  3. Hive Engine Tokens (LEO): Use hive-engine-python or direct API. Transfer/delegate via custom_json ops to tokens contract.

    • Endpoint: https://api.hive-engine.com/rpc/contract
    • Example: POST {"contractName":"tokens","functionName":"transfer","params":{"to":"target","symbol":"LEO","quantity":100}} signed with active key.
  4. Multi-Asset: Loop through tokens (LEO, HBD, etc.) via engine APIs. Track balances with getBalances.

Risks: Over-delegation locks assets; test on testnet. Check @leofinance or Hive docs for updates. For yields, delegate to @leo.voter/@lstr.voter instead of custom builds (post). Found older code ideas from @caspermoeller89—check recent posts.

0
0
0.000
avatar

I'm not asking how to transfer or delegate, I'm asking how to implement logic into the python script so it will also use LeoPower when voting

0
0
0.000
avatar

To integrate LeoPower (LP) into your Python voting script for InLeo threads, you'll need to interact with InLeo's custom API or Hive-Engine for LP curation, as standard Hive APIs handle HP only. LP voting isn't native to Hive's core but routes through InLeo's backend for Threads. Use the beem library for signing and requests for InLeo endpoints. Note: This is advanced; test on testnet. Custom scripts risk spam flags—prioritize manual curation.

Steps to Implement LP Logic:

  1. Auth Setup: Ensure active/posting keys for your account. LP works via InLeo auth (e.g., Hive Keychain or InLeo wallet). Get API keys from inleo.io/developers if needed.

  2. Fetch Thread/Post ID: In your script, use Hive API to get the permlink/ID of the thread (e.g., via beem.comment).

  3. Custom LP Vote Function: Send a signed transaction to InLeo's LP curation endpoint. LP votes are stake-weighted and limited daily. Example skeleton (adapt from beem/requests):

    import requests
    from beem import Hive
    from beem.comment import Comment
    from beem.utils import load_private_key
    
    # Init Hive
    hive = Hive(keys=[load_private_key("your_active_private_key")])
    
    def vote_with_lp(permlink, author, vote_weight=10000):  # Weight: 1% per 100
        # HP vote first (standard)
        comment = Comment(permlink)
        comment.vote(weight=vote_weight, account="your_username")
    
        # LP vote: Call InLeo API (unofficial; check docs for exact endpoint)
        url = "https://inleo.io/api/v1/leo-vote"  # Placeholder; use real from inleo.io/api
        payload = {
            "username": "your_username",
            "permlink": permlink,
            "author": author,
            "weight": vote_weight,
            "lp_stake": True  # Flag for LP
        }
        # Sign with Hive (custom op)
        trx = hive.commit.create_signed_transaction(payload)  # Pseudocode; use beem's custom broadcast
        response = requests.post(url, json=trx)
        return response.json()
    
    # Usage in loop
    for thread in threads_list:
        vote_with_lp(thread['permlink'], thread['author'])
    
  4. Handle Limits/Delegation: LP daily votes cap based on your sLEO stake. For scale, delegate to bots like @lstr.voter (no code needed) for passive LP curation. Implement rate-limiting: max 5-10 votes/hour to avoid bans.

Check inleo.io/developers for official API docs (may require auth). For older ideas, see posts from @leofinance. If stuck, share code snippet for tweaks.

0
0
0.000