[암호화폐] 그것이 알고 싶다!! 토큰 전송하기

in #sct5 years ago (edited)

토큰 claim이 끝나면 받은 토큰을 전송해야겠죠.

그동안 사용하였던 명령어들은 주로 posting 키를 이용하는 것이었습니다. 하지만 토큰 전송을 위해서는 active key가 필요합니다. 따라서 많은 부분이 변경되어 야합니다. 검색을 해보니 @holger이 만든 beem에 transfer 기능을 추가하였더군요[2].

그래서 beem을 최신 버전으로 update하였습니다[2].
관련 파이썬 코드입니다.

def token_transfer(steem, user, symbol, to, qty) :
    # qty : float
    json = {
        "contractName": "tokens",
        "contractAction":"transfer",
        "contractPayload":{
            "symbol":symbol,
            "to":to,
            "quantity":str(qty),
            "memo":"Test"
            }
         }
    ops = [
        operations.CustomJson(**{
            "from": user,
            "id": "ssc-mainnet1",
            "json": json,
            "required_auths": [user],
            "required_posting_auths": [],
        }),
    ]

    broadcast(steem, user, ops, "active")

전송이 잘 되는군요.

이것으로 claim 자동화를 위한 기본 기능은 완성이 되었습니다. 전송을 위해서는 active key가 필요하기 때문에 코드를 공유하더라도 사용하시는 분이 거의 없을 것 같군요.

웹 버전이 나오면 모두가 편하게 사용할 수 있을 것 같습니다.

@goodhello님 웹 버전 금방 나오는거죠?


[1] https://github.com/holgern/beem
[2] https://steemit.com/utopian-io/@holger80/update-for-beem-steem-engine-token-transfer-possible-and-customjson-added-as-beempy-command

Sort:  

파이썬 로직은 저렇군요 ㅎㅎ
저도 배우고 싶네요

Thank you for your continued support towards JJM. For each 1000 JJM you are holding, you can get an additional 1% of upvote. 10,000JJM would give you a 11% daily voting from the 700K SP virus707 account.

Hi @tradingideas!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.360 which ranks you at #2579 across all Steem accounts.
Your rank has improved 3109 places in the last three days (old rank 5688).

In our last Algorithmic Curation Round, consisting of 171 contributions, your post is ranked at #78.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers like your work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server

우와~ 이미 실행 검증도 마치셨네요~^^ 언능 뿅뿅 자동화가 나왔으면 좋겠습니다
!!

Coin Marketplace

STEEM 0.36
TRX 0.12
JST 0.039
BTC 70112.96
ETH 3549.99
USDT 1.00
SBD 4.71