NectarFlower and Ecency Points


I was attempting to work on some Ecency Points related projects, and I was curious if anyone had any input on an Ecency API?
Has anyone else done a project like this?
I have been working on this thing for awhile now, and thanks to @thecrazygm and @ecoinstant have aimed me in the correct direction. So now lets get the @Ecency points swap things working...
There's so many users accumulating without a way to actually get to unload those rewards in an effective way to actually get paid for their hard work.
import time
from nectar.hive import Hive
from nectar.account import Account
from nectar.transactionbuilder import TransactionBuilder
from nectarbase.operations import Custom_json
# Hive + Nectar Setup
HIVE_NODES = ["https://api.hive.blog", "https://anyx.io"]
hive = Hive(node=HIVE_NODES)
RECEIVING_ACCOUNT = "peakecoin" # Your Hive account receiving
Ecency Points gifts
PEK_TOKEN = "PEK" # Token symbol
SWAP_RATE = 0.001 # 1 Ecency Point = 0.001 PEK
def send_pek(to_account, points_amount):
"""Send PEK tokens based on Ecency Points received."""
pek_amount = points_amount * SWAP_RATE
payload = {
"contractName": "tokens",
"contractAction": "transfer",
"contractPayload": {
"symbol": PEK_TOKEN,
"to": to_account,
"quantity": str(round(pek_amount, 8)),
"memo": "Ecency Points Swap"
}
}
tx = TransactionBuilder(blockchain_instance=hive)
op = Custom_json(
required_auths=[RECEIVING_ACCOUNT],
required_posting_auths=[],
id="ssc-mainnet-hive",
json=payload
)
tx.appendOps(op)
tx.appendSigner(RECEIVING_ACCOUNT, "active")
tx.sign()
tx.broadcast()
print(f"✅ Sent {pek_amount} PEK to {to_account}")
if __name__ == "__main__":
username = input("👤 Enter Hive username: ").strip()
points = int(input("🎯 How many Ecency Points were gifted?: ").strip())
send_pek(username, points)
0
0
0.000
That's great! I'm personally glad to see more tools like this get built. As an aside, I looked at your dust.html script, and it's a great start. I think you need to add an upper limit check to the DUST threshold, that way for instance if you want it to sell everything > 0.001 but < 1 whole token (actual dust) as it stands it wants to sell EVERYTHING with a balance. Kudos btw.
I'll look into that at some point today. I'm looking for a real-life use case for PeakeCoin locally. Are you familiar with what it takes to create an Android App?
I've looked at it very briefly. It's a bit more than I would want to do. I'll stick to my backend and console scripts. 😂
I'm looking to do a simple wallet probably. Just not sure of what it takes
Well, there is a couple of ways to go about it. One, you could learn a native language that runs on android, which I believe are Dart, Flutter, and Java. Or Two, you could use a wrapper type thing: Such as https://www.electronjs.org/ if you wanted to do it in javascript, or something like https://beeware.org/project/briefcase/ if you wanted to try one that works with python. I'm sure there are others as well, those are just the two that jumped to my mind.
I'll check the python wrapper. I appreciate the input, Im generally lost. Do you have a job doing this? Are they hiring?... Or you a freelance coder? How does that work?
Freelance, mostly just as a hobby, but I take odd jobs when @ecoinstant points me at them (He's my PM, I don't generally even really talk to people.) I don't mind helping people out because I remember being in that very spot when I started as well. Everyone starts somewhere.
Do you earn a living off of Hive?
To be 100% transparent, I'm permanently disabled, so everything on Hive is a hobby. But, there are people that do live off what they do here.
If I get inured any further I'll be sharing the same issue. At least its not stopping you from adding to the community here. I hope it doesn't hinder your physical world. If it does, I hope you enjoy what you can do.